testapi.c revision cc047b3384b8c36e80f75704e565481f6f9aac35
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 <string.h>
18#include <libxml/xmlerror.h>
19#include <libxml/relaxng.h>
20
21#if defined(_WIN32) && !defined(__CYGWIN__)
22#define snprintf _snprintf
23#endif
24
25static int testlibxml2(void);
26static int test_module(const char *module);
27
28static int generic_errors = 0;
29static int call_tests = 0;
30static int function_tests = 0;
31
32static xmlChar chartab[1024];
33static int inttab[1024];
34static unsigned long longtab[1024];
35
36static xmlDocPtr api_doc = NULL;
37static xmlDtdPtr api_dtd = NULL;
38static xmlNodePtr api_root = NULL;
39static xmlAttrPtr api_attr = NULL;
40static xmlNsPtr api_ns = NULL;
41
42static void
43structured_errors(void *userData ATTRIBUTE_UNUSED,
44                  xmlErrorPtr error ATTRIBUTE_UNUSED) {
45    generic_errors++;
46}
47
48static void
49free_api_doc(void) {
50    xmlFreeDoc(api_doc);
51    api_doc = NULL;
52    api_dtd = NULL;
53    api_root = NULL;
54    api_attr = NULL;
55    api_ns = NULL;
56}
57
58static xmlDocPtr
59get_api_doc(void) {
60    if (api_doc == NULL) {
61        api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
62	api_root = NULL;
63	api_attr = NULL;
64    }
65    return(api_doc);
66}
67
68static xmlDtdPtr
69get_api_dtd(void) {
70    if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
71        get_api_doc();
72	if ((api_doc != NULL) && (api_doc->children != NULL) &&
73	    (api_doc->children->type == XML_DTD_NODE))
74	    api_dtd = (xmlDtdPtr) api_doc->children;
75    }
76    return(api_dtd);
77}
78
79static xmlNodePtr
80get_api_root(void) {
81    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
82        get_api_doc();
83	if ((api_doc != NULL) && (api_doc->children != NULL) &&
84	    (api_doc->children->next != NULL) &&
85	    (api_doc->children->next->type == XML_ELEMENT_NODE))
86	    api_root = api_doc->children->next;
87    }
88    return(api_root);
89}
90
91static xmlNsPtr
92get_api_ns(void) {
93    get_api_root();
94    if (api_root != NULL)
95        api_ns = api_root->nsDef;
96    return(api_ns);
97}
98
99static xmlAttrPtr
100get_api_attr(void) {
101#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
102    static int nr = 0;
103    xmlChar name[20];
104#endif
105
106    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
107        get_api_root();
108    }
109    if (api_root == NULL)
110        return(NULL);
111    if (api_root->properties != NULL) {
112        api_attr = api_root->properties;
113        return(api_root->properties);
114    }
115    api_attr = NULL;
116#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
117    snprintf((char *) name, 20, "foo%d", nr++);
118    api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
119#endif
120    return(api_attr);
121}
122
123static int quiet = 0;
124
125int main(int argc, char **argv) {
126    int ret;
127    int blocks, mem;
128
129    memset(chartab, 0, sizeof(chartab));
130    strncpy((char *) chartab, "  chartab\n", 20);
131    memset(inttab, 0, sizeof(inttab));
132    memset(longtab, 0, sizeof(longtab));
133
134    xmlInitParser();
135#ifdef LIBXML_SCHEMAS_ENABLED
136    xmlRelaxNGInitTypes();
137#endif
138
139    LIBXML_TEST_VERSION
140
141    xmlSetStructuredErrorFunc(NULL, structured_errors);
142
143    if (argc >= 2) {
144        if (!strcmp(argv[1], "-q")) {
145	    quiet = 1;
146	    if (argc >= 3)
147	        ret = test_module(argv[2]);
148	    else
149		ret = testlibxml2();
150        } else {
151	   ret = test_module(argv[1]);
152	}
153    } else
154	ret = testlibxml2();
155
156    xmlCleanupParser();
157    blocks = xmlMemBlocks();
158    mem = xmlMemUsed();
159    if ((blocks != 0) || (mem != 0)) {
160        printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
161    }
162    xmlMemoryDump();
163
164    return (ret != 0);
165}
166
167#include <libxml/HTMLparser.h>
168#include <libxml/HTMLtree.h>
169#include <libxml/catalog.h>
170#include <libxml/chvalid.h>
171#include <libxml/dict.h>
172#include <libxml/encoding.h>
173#include <libxml/entities.h>
174#include <libxml/hash.h>
175#include <libxml/list.h>
176#include <libxml/nanoftp.h>
177#include <libxml/nanohttp.h>
178#include <libxml/parser.h>
179#include <libxml/parserInternals.h>
180#include <libxml/pattern.h>
181#include <libxml/relaxng.h>
182#include <libxml/schemasInternals.h>
183#include <libxml/schematron.h>
184#include <libxml/tree.h>
185#include <libxml/uri.h>
186#include <libxml/valid.h>
187#include <libxml/xinclude.h>
188#include <libxml/xmlIO.h>
189#include <libxml/xmlerror.h>
190#include <libxml/xmlreader.h>
191#include <libxml/xmlsave.h>
192#include <libxml/xmlschemas.h>
193#include <libxml/xmlschemastypes.h>
194#include <libxml/xmlstring.h>
195#include <libxml/xmlwriter.h>
196#include <libxml/xpath.h>
197#include <libxml/xpointer.h>
198#include <libxml/debugXML.h>
199
200/*
201  We manually define xmlErrMemory because it's normal declaration
202  is "hidden" by #ifdef IN_LIBXML
203*/
204void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
205
206/*
207 We need some "remote" addresses, but want to avoid getting into
208 name resolution delays, so we use these
209*/
210#define	REMOTE1GOOD	"http://localhost/"
211#define	REMOTE1BAD	"http://missing. example.org/"
212#define	REMOTE2GOOD	"ftp://localhost/foo"
213
214#define gen_nb_void_ptr 2
215
216static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
217    return(NULL);
218}
219static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
220}
221
222#if 0
223#define gen_nb_const_void_ptr 2
224
225static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
226    if (no == 0) return((const void *) "immutable string");
227    return(NULL);
228}
229static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
230}
231#endif
232
233#define gen_nb_userdata 3
234
235static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
236    if (no == 0) return((void *) &call_tests);
237    if (no == 1) return((void *) -1);
238    return(NULL);
239}
240static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
241}
242
243
244#define gen_nb_int 4
245
246static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
247    if (no == 0) return(0);
248    if (no == 1) return(1);
249    if (no == 2) return(-1);
250    if (no == 3) return(122);
251    return(-1);
252}
253
254static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
255}
256
257#define gen_nb_parseroptions 5
258
259static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
260    if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
261    if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
262    if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
263    if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
264    return(XML_PARSE_SAX1);
265}
266
267static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
268}
269
270#if 0
271#define gen_nb_long 5
272
273static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
274    if (no == 0) return(0);
275    if (no == 1) return(1);
276    if (no == 2) return(-1);
277    if (no == 3) return(122);
278    return(-1);
279}
280
281static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
282}
283#endif
284
285#define gen_nb_xmlChar 4
286
287static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
288    if (no == 0) return('a');
289    if (no == 1) return(' ');
290    if (no == 2) return((xmlChar) '�');
291    return(0);
292}
293
294static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
295}
296
297#define gen_nb_unsigned_int 3
298
299static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
300    if (no == 0) return(0);
301    if (no == 1) return(1);
302    if (no == 2) return(122);
303    return((unsigned int) -1);
304}
305
306static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
307}
308
309#define gen_nb_unsigned_long 4
310
311static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
312    if (no == 0) return(0);
313    if (no == 1) return(1);
314    if (no == 2) return(122);
315    return((unsigned long) -1);
316}
317
318static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
319}
320
321#define gen_nb_double 4
322
323static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
324    if (no == 0) return(0);
325    if (no == 1) return(-1.1);
326#if defined(LIBXML_XPATH_ENABLED)
327    if (no == 2) return(xmlXPathNAN);
328#endif
329    return(-1);
330}
331
332static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
333}
334
335#define gen_nb_unsigned_long_ptr 2
336
337static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
338    if (no == 0) return(&longtab[nr]);
339    return(NULL);
340}
341
342static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
343}
344
345#define gen_nb_int_ptr 2
346
347static int *gen_int_ptr(int no, int nr) {
348    if (no == 0) return(&inttab[nr]);
349    return(NULL);
350}
351
352static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
353}
354
355#define gen_nb_const_char_ptr 4
356
357static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
358    if (no == 0) return((char *) "foo");
359    if (no == 1) return((char *) "<foo/>");
360    if (no == 2) return((char *) "test/ent2");
361    return(NULL);
362}
363static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
364}
365
366#define gen_nb_xmlChar_ptr 2
367
368static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
369    if (no == 0) return(&chartab[0]);
370    return(NULL);
371}
372static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
373}
374
375#define gen_nb_FILE_ptr 2
376
377static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
378    if (no == 0) return(fopen("test.out", "a+"));
379    return(NULL);
380}
381static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
382    if (val != NULL) fclose(val);
383}
384
385#define gen_nb_debug_FILE_ptr 2
386static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
387    return(fopen("test.out", "a+"));
388}
389static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
390    if (val != NULL) fclose(val);
391}
392
393#define gen_nb_const_xmlChar_ptr 5
394
395static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
396    if (no == 0) return((xmlChar *) "foo");
397    if (no == 1) return((xmlChar *) "<foo/>");
398    if (no == 2) return((xmlChar *) "n�ne");
399    if (no == 3) return((xmlChar *) " 2ab ");
400    return(NULL);
401}
402static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
403}
404
405#define gen_nb_filepath 8
406
407static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
408    if (no == 0) return("missing.xml");
409    if (no == 1) return("<foo/>");
410    if (no == 2) return("test/ent2");
411    if (no == 3) return("test/valid/REC-xml-19980210.xml");
412    if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
413    if (no == 5) return(REMOTE1GOOD);
414    if (no == 6) return(REMOTE1BAD);
415    return(NULL);
416}
417static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
418}
419
420#define gen_nb_eaten_name 2
421
422static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
423    if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
424    return(NULL);
425}
426static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
427}
428
429#define gen_nb_fileoutput 6
430
431static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
432    if (no == 0) return("/missing.xml");
433    if (no == 1) return("<foo/>");
434    if (no == 2) return(REMOTE2GOOD);
435    if (no == 3) return(REMOTE1GOOD);
436    if (no == 4) return(REMOTE1BAD);
437    return(NULL);
438}
439static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
440}
441
442#define gen_nb_xmlParserCtxtPtr 3
443static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
444    if (no == 0) return(xmlNewParserCtxt());
445    if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
446    return(NULL);
447}
448static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
449    if (val != NULL)
450        xmlFreeParserCtxt(val);
451}
452
453#define gen_nb_xmlSAXHandlerPtr 2
454static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
455#ifdef LIBXML_SAX1_ENABLED
456    if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
457#endif
458    return(NULL);
459}
460static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
461}
462
463#define gen_nb_xmlValidCtxtPtr 2
464static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
465#ifdef LIBXML_VALID_ENABLED
466    if (no == 0) return(xmlNewValidCtxt());
467#endif
468    return(NULL);
469}
470static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
471#ifdef LIBXML_VALID_ENABLED
472    if (val != NULL)
473        xmlFreeValidCtxt(val);
474#endif
475}
476
477#define gen_nb_xmlParserInputBufferPtr 8
478
479static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
480    if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
481    if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
482    if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
483    if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
484    if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
485    if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
486    if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
487    return(NULL);
488}
489static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
490    xmlFreeParserInputBuffer(val);
491}
492
493#define gen_nb_xmlDocPtr 3
494static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
495    if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
496    if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
497    return(NULL);
498}
499static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
500    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
501        xmlFreeDoc(val);
502}
503
504#define gen_nb_xmlAttrPtr 2
505static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
506    if (no == 0) return(get_api_attr());
507    return(NULL);
508}
509static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
510    if (no == 0) free_api_doc();
511}
512
513#define gen_nb_xmlDictPtr 2
514static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
515    if (no == 0) return(xmlDictCreate());
516    return(NULL);
517}
518static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
519    if (val != NULL)
520        xmlDictFree(val);
521}
522
523#define gen_nb_xmlNodePtr 3
524static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
525    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
526    if (no == 1) return(get_api_root());
527    return(NULL);
528/*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
529}
530static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
531    if (no == 1) {
532        free_api_doc();
533    } else if (val != NULL) {
534        xmlUnlinkNode(val);
535        xmlFreeNode(val);
536    }
537}
538
539#define gen_nb_xmlDtdPtr 3
540static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
541    if (no == 0)
542        return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
543    if (no == 1) return(get_api_dtd());
544    return(NULL);
545}
546static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
547    if (no == 1) free_api_doc();
548    else if (val != NULL) {
549        xmlUnlinkNode((xmlNodePtr) val);
550        xmlFreeNode((xmlNodePtr) val);
551    }
552}
553
554#define gen_nb_xmlNsPtr 2
555static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
556    if (no == 0) return(get_api_ns());
557    return(NULL);
558}
559static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
560    if (no == 0) free_api_doc();
561}
562
563#define gen_nb_xmlNodePtr_in 3
564static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
565    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
566    if (no == 0) return(xmlNewText(BAD_CAST "text"));
567    return(NULL);
568}
569static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
570}
571
572#ifdef LIBXML_WRITER_ENABLED
573#define gen_nb_xmlTextWriterPtr 2
574static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
575    if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
576    return(NULL);
577}
578static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
579    if (val != NULL) xmlFreeTextWriter(val);
580}
581#endif
582
583#ifdef LIBXML_READER_ENABLED
584#define gen_nb_xmlTextReaderPtr 4
585static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
586    if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
587    if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
588    if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
589    return(NULL);
590}
591static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
592    if (val != NULL) xmlFreeTextReader(val);
593}
594#endif
595
596#define gen_nb_xmlBufferPtr 3
597static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
598    if (no == 0) return(xmlBufferCreate());
599    if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
600    return(NULL);
601}
602static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
603    if (val != NULL) {
604        xmlBufferFree(val);
605    }
606}
607
608#define gen_nb_xmlListPtr 2
609static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
610    if (no == 0) return(xmlListCreate(NULL, NULL));
611    return(NULL);
612}
613static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
614    if (val != NULL) {
615        xmlListDelete(val);
616    }
617}
618
619#define gen_nb_xmlHashTablePtr 2
620static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
621    if (no == 0) return(xmlHashCreate(10));
622    return(NULL);
623}
624static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
625    if (val != NULL) {
626        xmlHashFree(val, NULL);
627    }
628}
629
630#include <libxml/xpathInternals.h>
631
632#ifdef LIBXML_XPATH_ENABLED
633#define gen_nb_xmlXPathObjectPtr 5
634static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
635    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
636    if (no == 1) return(xmlXPathNewFloat(1.1));
637    if (no == 2) return(xmlXPathNewBoolean(1));
638    if (no == 3) return(xmlXPathNewNodeSet(NULL));
639    return(NULL);
640}
641static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
642    if (val != NULL) {
643        xmlXPathFreeObject(val);
644    }
645}
646#endif
647
648#ifdef LIBXML_OUTPUT_ENABLED
649#define gen_nb_xmlOutputBufferPtr 2
650static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
651    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
652    return(NULL);
653}
654static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
655    if (val != NULL) {
656        xmlOutputBufferClose(val);
657    }
658}
659#endif
660
661#ifdef LIBXML_FTP_ENABLED
662#define gen_nb_xmlNanoFTPCtxtPtr 4
663static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
664    if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
665    if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
666    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
667    return(NULL);
668}
669static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
670    if (val != NULL) {
671        xmlNanoFTPFreeCtxt(val);
672    }
673}
674#endif
675
676#ifdef LIBXML_HTTP_ENABLED
677#define gen_nb_xmlNanoHTTPCtxtPtr 1
678static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
679    if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
680    if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
681    if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
682    return(NULL);
683}
684static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
685    if (val != NULL) {
686	xmlNanoHTTPClose(val);
687    }
688}
689#endif
690
691#define gen_nb_xmlCharEncoding 4
692static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
693    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
694    if (no == 1) return(XML_CHAR_ENCODING_NONE);
695    if (no == 2) return(XML_CHAR_ENCODING_8859_1);
696    return(XML_CHAR_ENCODING_ERROR);
697}
698static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
699}
700
701#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
702
703#define gen_nb_xmlExpCtxtPtr 1
704static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
705    return(NULL);
706}
707static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
708}
709
710#define gen_nb_xmlExpNodePtr 1
711static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
712    return(NULL);
713}
714static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
715}
716
717#endif
718
719#define gen_nb_xmlHashDeallocator 2
720static void
721test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
722}
723
724static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
725    if (no == 0) return(test_xmlHashDeallocator);
726    return(NULL);
727}
728static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
729}
730
731
732static void desret_int(int val ATTRIBUTE_UNUSED) {
733}
734static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
735}
736static void desret_long(long val ATTRIBUTE_UNUSED) {
737}
738static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
739}
740static void desret_double(double val ATTRIBUTE_UNUSED) {
741}
742static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
743}
744#if 0
745static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
746}
747#endif
748static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
749}
750static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
751}
752static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
753}
754static void desret_xmlChar_ptr(xmlChar *val) {
755    if (val != NULL)
756	xmlFree(val);
757}
758static void desret_xmlDocPtr(xmlDocPtr val) {
759    if (val != api_doc)
760	xmlFreeDoc(val);
761}
762static void desret_xmlDictPtr(xmlDictPtr val) {
763    xmlDictFree(val);
764}
765#ifdef LIBXML_OUTPUT_ENABLED
766static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
767    xmlOutputBufferClose(val);
768}
769#endif
770#ifdef LIBXML_READER_ENABLED
771static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
772    xmlFreeTextReader(val);
773}
774#endif
775static void desret_xmlNodePtr(xmlNodePtr val) {
776    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
777	xmlUnlinkNode(val);
778	xmlFreeNode(val);
779    }
780}
781static void desret_xmlAttrPtr(xmlAttrPtr val) {
782    if (val != NULL) {
783	xmlUnlinkNode((xmlNodePtr) val);
784	xmlFreeNode((xmlNodePtr) val);
785    }
786}
787static void desret_xmlEntityPtr(xmlEntityPtr val) {
788    if (val != NULL) {
789	xmlUnlinkNode((xmlNodePtr) val);
790	xmlFreeNode((xmlNodePtr) val);
791    }
792}
793static void desret_xmlElementPtr(xmlElementPtr val) {
794    if (val != NULL) {
795	xmlUnlinkNode((xmlNodePtr) val);
796    }
797}
798static void desret_xmlAttributePtr(xmlAttributePtr val) {
799    if (val != NULL) {
800	xmlUnlinkNode((xmlNodePtr) val);
801    }
802}
803static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
804}
805static void desret_xmlDtdPtr(xmlDtdPtr val) {
806    desret_xmlNodePtr((xmlNodePtr)val);
807}
808#ifdef LIBXML_XPATH_ENABLED
809static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
810    xmlXPathFreeObject(val);
811}
812static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
813    xmlXPathFreeNodeSet(val);
814}
815#endif
816static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
817    xmlFreeParserCtxt(val);
818}
819static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
820    xmlFreeParserInputBuffer(val);
821}
822static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
823    xmlFreeInputStream(val);
824}
825#ifdef LIBXML_WRITER_ENABLED
826static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
827    xmlFreeTextWriter(val);
828}
829#endif
830static void desret_xmlBufferPtr(xmlBufferPtr val) {
831    xmlBufferFree(val);
832}
833#ifdef LIBXML_SCHEMAS_ENABLED
834static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
835    xmlSchemaFreeParserCtxt(val);
836}
837static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
838}
839static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
840    xmlRelaxNGFreeParserCtxt(val);
841}
842#endif
843#ifdef LIBXML_HTML_ENABLED
844static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
845}
846#endif
847#ifdef LIBXML_HTTP_ENABLED
848static void desret_xmlNanoHTTPCtxtPtr(void *val) {
849    xmlNanoHTTPClose(val);
850}
851#endif
852#ifdef LIBXML_FTP_ENABLED
853static void desret_xmlNanoFTPCtxtPtr(void *val) {
854    xmlNanoFTPClose(val);
855}
856#endif
857/* cut and pasted from autogenerated to avoid troubles */
858#define gen_nb_const_xmlChar_ptr_ptr 1
859static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
860    return(NULL);
861}
862static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
863}
864
865#define gen_nb_unsigned_char_ptr 1
866static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
867    return(NULL);
868}
869static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
870}
871
872#define gen_nb_const_unsigned_char_ptr 1
873static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
874    return(NULL);
875}
876static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
877}
878
879#ifdef LIBXML_HTML_ENABLED
880#define gen_nb_const_htmlNodePtr 1
881static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
882    return(NULL);
883}
884static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
885}
886#endif
887
888#ifdef LIBXML_HTML_ENABLED
889#define gen_nb_htmlDocPtr 3
890static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
891    if (no == 0) return(htmlNewDoc(NULL, NULL));
892    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
893    return(NULL);
894}
895static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
896    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
897        xmlFreeDoc(val);
898}
899static void desret_htmlDocPtr(htmlDocPtr val) {
900    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
901        xmlFreeDoc(val);
902}
903#define gen_nb_htmlParserCtxtPtr 3
904static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
905    if (no == 0) return(xmlNewParserCtxt());
906    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
907    return(NULL);
908}
909static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
910    if (val != NULL)
911        htmlFreeParserCtxt(val);
912}
913static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
914    if (val != NULL)
915        htmlFreeParserCtxt(val);
916}
917#endif
918
919#ifdef LIBXML_XPATH_ENABLED
920#define gen_nb_xmlNodeSetPtr 1
921static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
922    return(NULL);
923}
924static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
925}
926#endif
927
928#ifdef LIBXML_DEBUG_ENABLED
929#ifdef LIBXML_XPATH_ENABLED
930#define gen_nb_xmlShellCtxtPtr 1
931static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
932    return(NULL);
933}
934static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
935}
936#endif
937#endif
938
939#ifdef LIBXML_PATTERN_ENABLED
940#define gen_nb_xmlPatternPtr 1
941static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
942    return(NULL);
943}
944static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
945}
946#endif
947
948#define gen_nb_xmlElementContentPtr 1
949static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
950    return(NULL);
951}
952static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
953    if (val != NULL)
954        xmlFreeElementContent(val);
955}
956static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
957    if (val != NULL)
958        xmlFreeElementContent(val);
959}
960
961#define gen_nb_xmlParserNodeInfoSeqPtr 1
962static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
963    return(NULL);
964}
965static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
966}
967
968static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
969}
970
971/************************************************************************
972 *									*
973 *   WARNING: end of the manually maintained part of the test code	*
974 *            do not remove or alter the CUT HERE line			*
975 *									*
976 ************************************************************************/
977
978/* CUT HERE: everything below that line is generated */
979#ifdef LIBXML_HTML_ENABLED
980static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
981}
982
983#endif
984
985#define gen_nb_xmlAttributeDefault 4
986static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
987    if (no == 1) return(XML_ATTRIBUTE_FIXED);
988    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
989    if (no == 3) return(XML_ATTRIBUTE_NONE);
990    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
991    return(0);
992}
993
994static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
995}
996
997#define gen_nb_xmlAttributeType 4
998static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
999    if (no == 1) return(XML_ATTRIBUTE_CDATA);
1000    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1001    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1002    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1003    return(0);
1004}
1005
1006static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1007}
1008
1009#define gen_nb_xmlBufferAllocationScheme 3
1010static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1011    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1012    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1013    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1014    return(0);
1015}
1016
1017static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1018}
1019
1020static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1021}
1022
1023#ifdef LIBXML_CATALOG_ENABLED
1024#define gen_nb_xmlCatalogAllow 4
1025static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1026    if (no == 1) return(XML_CATA_ALLOW_ALL);
1027    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1028    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1029    if (no == 4) return(XML_CATA_ALLOW_NONE);
1030    return(0);
1031}
1032
1033static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1034}
1035
1036static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1037}
1038
1039#endif
1040
1041#ifdef LIBXML_CATALOG_ENABLED
1042#define gen_nb_xmlCatalogPrefer 3
1043static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1044    if (no == 1) return(XML_CATA_PREFER_NONE);
1045    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1046    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1047    return(0);
1048}
1049
1050static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1051}
1052
1053static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1054}
1055
1056#endif
1057
1058#define gen_nb_xmlElementContentType 4
1059static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1060    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1061    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1062    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1063    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1064    return(0);
1065}
1066
1067static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1068}
1069
1070#define gen_nb_xmlElementTypeVal 4
1071static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1072    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1073    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1074    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1075    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1076    return(0);
1077}
1078
1079static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1080}
1081
1082#define gen_nb_xmlFeature 4
1083static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1084    if (no == 1) return(XML_WITH_AUTOMATA);
1085    if (no == 2) return(XML_WITH_C14N);
1086    if (no == 3) return(XML_WITH_CATALOG);
1087    if (no == 4) return(XML_WITH_DEBUG);
1088    return(0);
1089}
1090
1091static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1092}
1093
1094static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1095}
1096
1097#ifdef LIBXML_SCHEMAS_ENABLED
1098#define gen_nb_xmlSchemaValType 4
1099static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1100    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1101    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1102    if (no == 3) return(XML_SCHEMAS_ANYURI);
1103    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1104    return(0);
1105}
1106
1107static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1108}
1109
1110static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1111}
1112
1113#endif
1114
1115#ifdef LIBXML_SCHEMAS_ENABLED
1116#define gen_nb_xmlSchemaWhitespaceValueType 4
1117static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1118    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1119    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1120    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1121    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1122    return(0);
1123}
1124
1125static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1126}
1127
1128#endif
1129
1130#include <libxml/HTMLparser.h>
1131#include <libxml/HTMLtree.h>
1132#include <libxml/SAX2.h>
1133#include <libxml/c14n.h>
1134#include <libxml/catalog.h>
1135#include <libxml/chvalid.h>
1136#include <libxml/debugXML.h>
1137#include <libxml/dict.h>
1138#include <libxml/encoding.h>
1139#include <libxml/entities.h>
1140#include <libxml/hash.h>
1141#include <libxml/list.h>
1142#include <libxml/nanoftp.h>
1143#include <libxml/nanohttp.h>
1144#include <libxml/parser.h>
1145#include <libxml/parserInternals.h>
1146#include <libxml/pattern.h>
1147#include <libxml/relaxng.h>
1148#include <libxml/schemasInternals.h>
1149#include <libxml/schematron.h>
1150#include <libxml/tree.h>
1151#include <libxml/uri.h>
1152#include <libxml/valid.h>
1153#include <libxml/xinclude.h>
1154#include <libxml/xmlIO.h>
1155#include <libxml/xmlautomata.h>
1156#include <libxml/xmlerror.h>
1157#include <libxml/xmlmodule.h>
1158#include <libxml/xmlreader.h>
1159#include <libxml/xmlregexp.h>
1160#include <libxml/xmlsave.h>
1161#include <libxml/xmlschemas.h>
1162#include <libxml/xmlschemastypes.h>
1163#include <libxml/xmlstring.h>
1164#include <libxml/xmlunicode.h>
1165#include <libxml/xmlwriter.h>
1166#include <libxml/xpath.h>
1167#include <libxml/xpathInternals.h>
1168#include <libxml/xpointer.h>
1169static int test_HTMLparser(void);
1170static int test_HTMLtree(void);
1171static int test_SAX2(void);
1172static int test_c14n(void);
1173static int test_catalog(void);
1174static int test_chvalid(void);
1175static int test_debugXML(void);
1176static int test_dict(void);
1177static int test_encoding(void);
1178static int test_entities(void);
1179static int test_hash(void);
1180static int test_list(void);
1181static int test_nanoftp(void);
1182static int test_nanohttp(void);
1183static int test_parser(void);
1184static int test_parserInternals(void);
1185static int test_pattern(void);
1186static int test_relaxng(void);
1187static int test_schemasInternals(void);
1188static int test_schematron(void);
1189static int test_tree(void);
1190static int test_uri(void);
1191static int test_valid(void);
1192static int test_xinclude(void);
1193static int test_xmlIO(void);
1194static int test_xmlautomata(void);
1195static int test_xmlerror(void);
1196static int test_xmlmodule(void);
1197static int test_xmlreader(void);
1198static int test_xmlregexp(void);
1199static int test_xmlsave(void);
1200static int test_xmlschemas(void);
1201static int test_xmlschemastypes(void);
1202static int test_xmlstring(void);
1203static int test_xmlunicode(void);
1204static int test_xmlwriter(void);
1205static int test_xpath(void);
1206static int test_xpathInternals(void);
1207static int test_xpointer(void);
1208
1209/**
1210 * testlibxml2:
1211 *
1212 * Main entry point of the tester for the full libxml2 module,
1213 * it calls all the tester entry point for each module.
1214 *
1215 * Returns the number of error found
1216 */
1217static int
1218testlibxml2(void)
1219{
1220    int test_ret = 0;
1221
1222    test_ret += test_HTMLparser();
1223    test_ret += test_HTMLtree();
1224    test_ret += test_SAX2();
1225    test_ret += test_c14n();
1226    test_ret += test_catalog();
1227    test_ret += test_chvalid();
1228    test_ret += test_debugXML();
1229    test_ret += test_dict();
1230    test_ret += test_encoding();
1231    test_ret += test_entities();
1232    test_ret += test_hash();
1233    test_ret += test_list();
1234    test_ret += test_nanoftp();
1235    test_ret += test_nanohttp();
1236    test_ret += test_parser();
1237    test_ret += test_parserInternals();
1238    test_ret += test_pattern();
1239    test_ret += test_relaxng();
1240    test_ret += test_schemasInternals();
1241    test_ret += test_schematron();
1242    test_ret += test_tree();
1243    test_ret += test_uri();
1244    test_ret += test_valid();
1245    test_ret += test_xinclude();
1246    test_ret += test_xmlIO();
1247    test_ret += test_xmlautomata();
1248    test_ret += test_xmlerror();
1249    test_ret += test_xmlmodule();
1250    test_ret += test_xmlreader();
1251    test_ret += test_xmlregexp();
1252    test_ret += test_xmlsave();
1253    test_ret += test_xmlschemas();
1254    test_ret += test_xmlschemastypes();
1255    test_ret += test_xmlstring();
1256    test_ret += test_xmlunicode();
1257    test_ret += test_xmlwriter();
1258    test_ret += test_xpath();
1259    test_ret += test_xpathInternals();
1260    test_ret += test_xpointer();
1261
1262    printf("Total: %d functions, %d tests, %d errors\n",
1263           function_tests, call_tests, test_ret);
1264    return(test_ret);
1265}
1266
1267
1268static int
1269test_UTF8ToHtml(void) {
1270    int test_ret = 0;
1271
1272#if defined(LIBXML_HTML_ENABLED)
1273    int mem_base;
1274    int ret_val;
1275    unsigned char * out; /* a pointer to an array of bytes to store the result */
1276    int n_out;
1277    int * outlen; /* the length of @out */
1278    int n_outlen;
1279    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1280    int n_in;
1281    int * inlen; /* the length of @in */
1282    int n_inlen;
1283
1284    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1285    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1286    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1287    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1288        mem_base = xmlMemBlocks();
1289        out = gen_unsigned_char_ptr(n_out, 0);
1290        outlen = gen_int_ptr(n_outlen, 1);
1291        in = gen_const_unsigned_char_ptr(n_in, 2);
1292        inlen = gen_int_ptr(n_inlen, 3);
1293
1294        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1295        desret_int(ret_val);
1296        call_tests++;
1297        des_unsigned_char_ptr(n_out, out, 0);
1298        des_int_ptr(n_outlen, outlen, 1);
1299        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1300        des_int_ptr(n_inlen, inlen, 3);
1301        xmlResetLastError();
1302        if (mem_base != xmlMemBlocks()) {
1303            printf("Leak of %d blocks found in UTF8ToHtml",
1304	           xmlMemBlocks() - mem_base);
1305	    test_ret++;
1306            printf(" %d", n_out);
1307            printf(" %d", n_outlen);
1308            printf(" %d", n_in);
1309            printf(" %d", n_inlen);
1310            printf("\n");
1311        }
1312    }
1313    }
1314    }
1315    }
1316    function_tests++;
1317#endif
1318
1319    return(test_ret);
1320}
1321
1322#ifdef LIBXML_HTML_ENABLED
1323
1324#define gen_nb_const_htmlElemDesc_ptr 1
1325static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1326    return(NULL);
1327}
1328static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1329}
1330#endif
1331
1332
1333static int
1334test_htmlAttrAllowed(void) {
1335    int test_ret = 0;
1336
1337#if defined(LIBXML_HTML_ENABLED)
1338    int mem_base;
1339    htmlStatus ret_val;
1340    htmlElemDesc * elt; /* HTML element */
1341    int n_elt;
1342    xmlChar * attr; /* HTML attribute */
1343    int n_attr;
1344    int legacy; /* whether to allow deprecated attributes */
1345    int n_legacy;
1346
1347    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1348    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1349    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1350        mem_base = xmlMemBlocks();
1351        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1352        attr = gen_const_xmlChar_ptr(n_attr, 1);
1353        legacy = gen_int(n_legacy, 2);
1354
1355        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1356        desret_htmlStatus(ret_val);
1357        call_tests++;
1358        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1359        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1360        des_int(n_legacy, legacy, 2);
1361        xmlResetLastError();
1362        if (mem_base != xmlMemBlocks()) {
1363            printf("Leak of %d blocks found in htmlAttrAllowed",
1364	           xmlMemBlocks() - mem_base);
1365	    test_ret++;
1366            printf(" %d", n_elt);
1367            printf(" %d", n_attr);
1368            printf(" %d", n_legacy);
1369            printf("\n");
1370        }
1371    }
1372    }
1373    }
1374    function_tests++;
1375#endif
1376
1377    return(test_ret);
1378}
1379
1380#ifdef LIBXML_HTML_ENABLED
1381
1382#define gen_nb_htmlNodePtr 1
1383static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1384    return(NULL);
1385}
1386static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1387}
1388#endif
1389
1390
1391static int
1392test_htmlAutoCloseTag(void) {
1393    int test_ret = 0;
1394
1395#if defined(LIBXML_HTML_ENABLED)
1396    int mem_base;
1397    int ret_val;
1398    htmlDocPtr doc; /* the HTML document */
1399    int n_doc;
1400    xmlChar * name; /* The tag name */
1401    int n_name;
1402    htmlNodePtr elem; /* the HTML element */
1403    int n_elem;
1404
1405    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1406    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1407    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1408        mem_base = xmlMemBlocks();
1409        doc = gen_htmlDocPtr(n_doc, 0);
1410        name = gen_const_xmlChar_ptr(n_name, 1);
1411        elem = gen_htmlNodePtr(n_elem, 2);
1412
1413        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1414        desret_int(ret_val);
1415        call_tests++;
1416        des_htmlDocPtr(n_doc, doc, 0);
1417        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1418        des_htmlNodePtr(n_elem, elem, 2);
1419        xmlResetLastError();
1420        if (mem_base != xmlMemBlocks()) {
1421            printf("Leak of %d blocks found in htmlAutoCloseTag",
1422	           xmlMemBlocks() - mem_base);
1423	    test_ret++;
1424            printf(" %d", n_doc);
1425            printf(" %d", n_name);
1426            printf(" %d", n_elem);
1427            printf("\n");
1428        }
1429    }
1430    }
1431    }
1432    function_tests++;
1433#endif
1434
1435    return(test_ret);
1436}
1437
1438
1439static int
1440test_htmlCreateMemoryParserCtxt(void) {
1441    int test_ret = 0;
1442
1443#if defined(LIBXML_HTML_ENABLED)
1444    int mem_base;
1445    htmlParserCtxtPtr ret_val;
1446    char * buffer; /* a pointer to a char array */
1447    int n_buffer;
1448    int size; /* the size of the array */
1449    int n_size;
1450
1451    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1452    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1453        mem_base = xmlMemBlocks();
1454        buffer = gen_const_char_ptr(n_buffer, 0);
1455        size = gen_int(n_size, 1);
1456
1457        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1458        desret_htmlParserCtxtPtr(ret_val);
1459        call_tests++;
1460        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1461        des_int(n_size, size, 1);
1462        xmlResetLastError();
1463        if (mem_base != xmlMemBlocks()) {
1464            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1465	           xmlMemBlocks() - mem_base);
1466	    test_ret++;
1467            printf(" %d", n_buffer);
1468            printf(" %d", n_size);
1469            printf("\n");
1470        }
1471    }
1472    }
1473    function_tests++;
1474#endif
1475
1476    return(test_ret);
1477}
1478
1479#ifdef LIBXML_HTML_ENABLED
1480
1481#define gen_nb_htmlSAXHandlerPtr 1
1482static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1483    return(NULL);
1484}
1485static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1486}
1487#endif
1488
1489
1490static int
1491test_htmlCreatePushParserCtxt(void) {
1492    int test_ret = 0;
1493
1494#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1495    int mem_base;
1496    htmlParserCtxtPtr ret_val;
1497    htmlSAXHandlerPtr sax; /* a SAX handler */
1498    int n_sax;
1499    void * user_data; /* The user data returned on SAX callbacks */
1500    int n_user_data;
1501    char * chunk; /* a pointer to an array of chars */
1502    int n_chunk;
1503    int size; /* number of chars in the array */
1504    int n_size;
1505    const char * filename; /* an optional file name or URI */
1506    int n_filename;
1507    xmlCharEncoding enc; /* an optional encoding */
1508    int n_enc;
1509
1510    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1511    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1512    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1513    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1514    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1515    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1516        mem_base = xmlMemBlocks();
1517        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1518        user_data = gen_userdata(n_user_data, 1);
1519        chunk = gen_const_char_ptr(n_chunk, 2);
1520        size = gen_int(n_size, 3);
1521        filename = gen_fileoutput(n_filename, 4);
1522        enc = gen_xmlCharEncoding(n_enc, 5);
1523
1524        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1525        desret_htmlParserCtxtPtr(ret_val);
1526        call_tests++;
1527        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1528        des_userdata(n_user_data, user_data, 1);
1529        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1530        des_int(n_size, size, 3);
1531        des_fileoutput(n_filename, filename, 4);
1532        des_xmlCharEncoding(n_enc, enc, 5);
1533        xmlResetLastError();
1534        if (mem_base != xmlMemBlocks()) {
1535            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1536	           xmlMemBlocks() - mem_base);
1537	    test_ret++;
1538            printf(" %d", n_sax);
1539            printf(" %d", n_user_data);
1540            printf(" %d", n_chunk);
1541            printf(" %d", n_size);
1542            printf(" %d", n_filename);
1543            printf(" %d", n_enc);
1544            printf("\n");
1545        }
1546    }
1547    }
1548    }
1549    }
1550    }
1551    }
1552    function_tests++;
1553#endif
1554
1555    return(test_ret);
1556}
1557
1558
1559static int
1560test_htmlCtxtReadDoc(void) {
1561    int test_ret = 0;
1562
1563#if defined(LIBXML_HTML_ENABLED)
1564    int mem_base;
1565    htmlDocPtr ret_val;
1566    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1567    int n_ctxt;
1568    xmlChar * cur; /* a pointer to a zero terminated string */
1569    int n_cur;
1570    const char * URL; /* the base URL to use for the document */
1571    int n_URL;
1572    char * encoding; /* the document encoding, or NULL */
1573    int n_encoding;
1574    int options; /* a combination of htmlParserOption(s) */
1575    int n_options;
1576
1577    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1578    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1579    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1580    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1581    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1582        mem_base = xmlMemBlocks();
1583        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1584        cur = gen_const_xmlChar_ptr(n_cur, 1);
1585        URL = gen_filepath(n_URL, 2);
1586        encoding = gen_const_char_ptr(n_encoding, 3);
1587        options = gen_int(n_options, 4);
1588
1589        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1590        desret_htmlDocPtr(ret_val);
1591        call_tests++;
1592        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1593        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1594        des_filepath(n_URL, URL, 2);
1595        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1596        des_int(n_options, options, 4);
1597        xmlResetLastError();
1598        if (mem_base != xmlMemBlocks()) {
1599            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1600	           xmlMemBlocks() - mem_base);
1601	    test_ret++;
1602            printf(" %d", n_ctxt);
1603            printf(" %d", n_cur);
1604            printf(" %d", n_URL);
1605            printf(" %d", n_encoding);
1606            printf(" %d", n_options);
1607            printf("\n");
1608        }
1609    }
1610    }
1611    }
1612    }
1613    }
1614    function_tests++;
1615#endif
1616
1617    return(test_ret);
1618}
1619
1620
1621static int
1622test_htmlCtxtReadFile(void) {
1623    int test_ret = 0;
1624
1625#if defined(LIBXML_HTML_ENABLED)
1626    htmlDocPtr ret_val;
1627    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1628    int n_ctxt;
1629    const char * filename; /* a file or URL */
1630    int n_filename;
1631    char * encoding; /* the document encoding, or NULL */
1632    int n_encoding;
1633    int options; /* a combination of htmlParserOption(s) */
1634    int n_options;
1635
1636    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1637    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1638    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1639    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1640        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1641        filename = gen_filepath(n_filename, 1);
1642        encoding = gen_const_char_ptr(n_encoding, 2);
1643        options = gen_int(n_options, 3);
1644
1645        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1646        desret_htmlDocPtr(ret_val);
1647        call_tests++;
1648        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1649        des_filepath(n_filename, filename, 1);
1650        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1651        des_int(n_options, options, 3);
1652        xmlResetLastError();
1653    }
1654    }
1655    }
1656    }
1657    function_tests++;
1658#endif
1659
1660    return(test_ret);
1661}
1662
1663
1664static int
1665test_htmlCtxtReadMemory(void) {
1666    int test_ret = 0;
1667
1668#if defined(LIBXML_HTML_ENABLED)
1669    int mem_base;
1670    htmlDocPtr ret_val;
1671    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1672    int n_ctxt;
1673    char * buffer; /* a pointer to a char array */
1674    int n_buffer;
1675    int size; /* the size of the array */
1676    int n_size;
1677    const char * URL; /* the base URL to use for the document */
1678    int n_URL;
1679    char * encoding; /* the document encoding, or NULL */
1680    int n_encoding;
1681    int options; /* a combination of htmlParserOption(s) */
1682    int n_options;
1683
1684    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1685    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1686    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1687    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1688    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1689    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1690        mem_base = xmlMemBlocks();
1691        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1692        buffer = gen_const_char_ptr(n_buffer, 1);
1693        size = gen_int(n_size, 2);
1694        URL = gen_filepath(n_URL, 3);
1695        encoding = gen_const_char_ptr(n_encoding, 4);
1696        options = gen_int(n_options, 5);
1697
1698        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1699        desret_htmlDocPtr(ret_val);
1700        call_tests++;
1701        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1702        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1703        des_int(n_size, size, 2);
1704        des_filepath(n_URL, URL, 3);
1705        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1706        des_int(n_options, options, 5);
1707        xmlResetLastError();
1708        if (mem_base != xmlMemBlocks()) {
1709            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1710	           xmlMemBlocks() - mem_base);
1711	    test_ret++;
1712            printf(" %d", n_ctxt);
1713            printf(" %d", n_buffer);
1714            printf(" %d", n_size);
1715            printf(" %d", n_URL);
1716            printf(" %d", n_encoding);
1717            printf(" %d", n_options);
1718            printf("\n");
1719        }
1720    }
1721    }
1722    }
1723    }
1724    }
1725    }
1726    function_tests++;
1727#endif
1728
1729    return(test_ret);
1730}
1731
1732
1733static int
1734test_htmlCtxtReset(void) {
1735    int test_ret = 0;
1736
1737#if defined(LIBXML_HTML_ENABLED)
1738    int mem_base;
1739    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1740    int n_ctxt;
1741
1742    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1743        mem_base = xmlMemBlocks();
1744        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1745
1746        htmlCtxtReset(ctxt);
1747        call_tests++;
1748        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1749        xmlResetLastError();
1750        if (mem_base != xmlMemBlocks()) {
1751            printf("Leak of %d blocks found in htmlCtxtReset",
1752	           xmlMemBlocks() - mem_base);
1753	    test_ret++;
1754            printf(" %d", n_ctxt);
1755            printf("\n");
1756        }
1757    }
1758    function_tests++;
1759#endif
1760
1761    return(test_ret);
1762}
1763
1764
1765static int
1766test_htmlCtxtUseOptions(void) {
1767    int test_ret = 0;
1768
1769#if defined(LIBXML_HTML_ENABLED)
1770    int mem_base;
1771    int ret_val;
1772    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1773    int n_ctxt;
1774    int options; /* a combination of htmlParserOption(s) */
1775    int n_options;
1776
1777    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1778    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1779        mem_base = xmlMemBlocks();
1780        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1781        options = gen_int(n_options, 1);
1782
1783        ret_val = htmlCtxtUseOptions(ctxt, options);
1784        desret_int(ret_val);
1785        call_tests++;
1786        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1787        des_int(n_options, options, 1);
1788        xmlResetLastError();
1789        if (mem_base != xmlMemBlocks()) {
1790            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1791	           xmlMemBlocks() - mem_base);
1792	    test_ret++;
1793            printf(" %d", n_ctxt);
1794            printf(" %d", n_options);
1795            printf("\n");
1796        }
1797    }
1798    }
1799    function_tests++;
1800#endif
1801
1802    return(test_ret);
1803}
1804
1805
1806static int
1807test_htmlElementAllowedHere(void) {
1808    int test_ret = 0;
1809
1810#if defined(LIBXML_HTML_ENABLED)
1811    int mem_base;
1812    int ret_val;
1813    htmlElemDesc * parent; /* HTML parent element */
1814    int n_parent;
1815    xmlChar * elt; /* HTML element */
1816    int n_elt;
1817
1818    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1819    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1820        mem_base = xmlMemBlocks();
1821        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1822        elt = gen_const_xmlChar_ptr(n_elt, 1);
1823
1824        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1825        desret_int(ret_val);
1826        call_tests++;
1827        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1828        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1829        xmlResetLastError();
1830        if (mem_base != xmlMemBlocks()) {
1831            printf("Leak of %d blocks found in htmlElementAllowedHere",
1832	           xmlMemBlocks() - mem_base);
1833	    test_ret++;
1834            printf(" %d", n_parent);
1835            printf(" %d", n_elt);
1836            printf("\n");
1837        }
1838    }
1839    }
1840    function_tests++;
1841#endif
1842
1843    return(test_ret);
1844}
1845
1846
1847static int
1848test_htmlElementStatusHere(void) {
1849    int test_ret = 0;
1850
1851#if defined(LIBXML_HTML_ENABLED)
1852    int mem_base;
1853    htmlStatus ret_val;
1854    htmlElemDesc * parent; /* HTML parent element */
1855    int n_parent;
1856    htmlElemDesc * elt; /* HTML element */
1857    int n_elt;
1858
1859    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1860    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1861        mem_base = xmlMemBlocks();
1862        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1863        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1864
1865        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1866        desret_htmlStatus(ret_val);
1867        call_tests++;
1868        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1869        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1870        xmlResetLastError();
1871        if (mem_base != xmlMemBlocks()) {
1872            printf("Leak of %d blocks found in htmlElementStatusHere",
1873	           xmlMemBlocks() - mem_base);
1874	    test_ret++;
1875            printf(" %d", n_parent);
1876            printf(" %d", n_elt);
1877            printf("\n");
1878        }
1879    }
1880    }
1881    function_tests++;
1882#endif
1883
1884    return(test_ret);
1885}
1886
1887
1888static int
1889test_htmlEncodeEntities(void) {
1890    int test_ret = 0;
1891
1892#if defined(LIBXML_HTML_ENABLED)
1893    int mem_base;
1894    int ret_val;
1895    unsigned char * out; /* a pointer to an array of bytes to store the result */
1896    int n_out;
1897    int * outlen; /* the length of @out */
1898    int n_outlen;
1899    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1900    int n_in;
1901    int * inlen; /* the length of @in */
1902    int n_inlen;
1903    int quoteChar; /* the quote character to escape (' or ") or zero. */
1904    int n_quoteChar;
1905
1906    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1907    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1908    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1909    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1910    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1911        mem_base = xmlMemBlocks();
1912        out = gen_unsigned_char_ptr(n_out, 0);
1913        outlen = gen_int_ptr(n_outlen, 1);
1914        in = gen_const_unsigned_char_ptr(n_in, 2);
1915        inlen = gen_int_ptr(n_inlen, 3);
1916        quoteChar = gen_int(n_quoteChar, 4);
1917
1918        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1919        desret_int(ret_val);
1920        call_tests++;
1921        des_unsigned_char_ptr(n_out, out, 0);
1922        des_int_ptr(n_outlen, outlen, 1);
1923        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1924        des_int_ptr(n_inlen, inlen, 3);
1925        des_int(n_quoteChar, quoteChar, 4);
1926        xmlResetLastError();
1927        if (mem_base != xmlMemBlocks()) {
1928            printf("Leak of %d blocks found in htmlEncodeEntities",
1929	           xmlMemBlocks() - mem_base);
1930	    test_ret++;
1931            printf(" %d", n_out);
1932            printf(" %d", n_outlen);
1933            printf(" %d", n_in);
1934            printf(" %d", n_inlen);
1935            printf(" %d", n_quoteChar);
1936            printf("\n");
1937        }
1938    }
1939    }
1940    }
1941    }
1942    }
1943    function_tests++;
1944#endif
1945
1946    return(test_ret);
1947}
1948
1949
1950static int
1951test_htmlEntityLookup(void) {
1952    int test_ret = 0;
1953
1954#if defined(LIBXML_HTML_ENABLED)
1955    int mem_base;
1956    const htmlEntityDesc * ret_val;
1957    xmlChar * name; /* the entity name */
1958    int n_name;
1959
1960    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1961        mem_base = xmlMemBlocks();
1962        name = gen_const_xmlChar_ptr(n_name, 0);
1963
1964        ret_val = htmlEntityLookup((const xmlChar *)name);
1965        desret_const_htmlEntityDesc_ptr(ret_val);
1966        call_tests++;
1967        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1968        xmlResetLastError();
1969        if (mem_base != xmlMemBlocks()) {
1970            printf("Leak of %d blocks found in htmlEntityLookup",
1971	           xmlMemBlocks() - mem_base);
1972	    test_ret++;
1973            printf(" %d", n_name);
1974            printf("\n");
1975        }
1976    }
1977    function_tests++;
1978#endif
1979
1980    return(test_ret);
1981}
1982
1983
1984static int
1985test_htmlEntityValueLookup(void) {
1986    int test_ret = 0;
1987
1988#if defined(LIBXML_HTML_ENABLED)
1989    int mem_base;
1990    const htmlEntityDesc * ret_val;
1991    unsigned int value; /* the entity's unicode value */
1992    int n_value;
1993
1994    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
1995        mem_base = xmlMemBlocks();
1996        value = gen_unsigned_int(n_value, 0);
1997
1998        ret_val = htmlEntityValueLookup(value);
1999        desret_const_htmlEntityDesc_ptr(ret_val);
2000        call_tests++;
2001        des_unsigned_int(n_value, value, 0);
2002        xmlResetLastError();
2003        if (mem_base != xmlMemBlocks()) {
2004            printf("Leak of %d blocks found in htmlEntityValueLookup",
2005	           xmlMemBlocks() - mem_base);
2006	    test_ret++;
2007            printf(" %d", n_value);
2008            printf("\n");
2009        }
2010    }
2011    function_tests++;
2012#endif
2013
2014    return(test_ret);
2015}
2016
2017
2018static int
2019test_htmlHandleOmittedElem(void) {
2020    int test_ret = 0;
2021
2022#if defined(LIBXML_HTML_ENABLED)
2023    int mem_base;
2024    int ret_val;
2025    int val; /* int 0 or 1 */
2026    int n_val;
2027
2028    for (n_val = 0;n_val < gen_nb_int;n_val++) {
2029        mem_base = xmlMemBlocks();
2030        val = gen_int(n_val, 0);
2031
2032        ret_val = htmlHandleOmittedElem(val);
2033        desret_int(ret_val);
2034        call_tests++;
2035        des_int(n_val, val, 0);
2036        xmlResetLastError();
2037        if (mem_base != xmlMemBlocks()) {
2038            printf("Leak of %d blocks found in htmlHandleOmittedElem",
2039	           xmlMemBlocks() - mem_base);
2040	    test_ret++;
2041            printf(" %d", n_val);
2042            printf("\n");
2043        }
2044    }
2045    function_tests++;
2046#endif
2047
2048    return(test_ret);
2049}
2050
2051
2052static int
2053test_htmlIsAutoClosed(void) {
2054    int test_ret = 0;
2055
2056#if defined(LIBXML_HTML_ENABLED)
2057    int mem_base;
2058    int ret_val;
2059    htmlDocPtr doc; /* the HTML document */
2060    int n_doc;
2061    htmlNodePtr elem; /* the HTML element */
2062    int n_elem;
2063
2064    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2065    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2066        mem_base = xmlMemBlocks();
2067        doc = gen_htmlDocPtr(n_doc, 0);
2068        elem = gen_htmlNodePtr(n_elem, 1);
2069
2070        ret_val = htmlIsAutoClosed(doc, elem);
2071        desret_int(ret_val);
2072        call_tests++;
2073        des_htmlDocPtr(n_doc, doc, 0);
2074        des_htmlNodePtr(n_elem, elem, 1);
2075        xmlResetLastError();
2076        if (mem_base != xmlMemBlocks()) {
2077            printf("Leak of %d blocks found in htmlIsAutoClosed",
2078	           xmlMemBlocks() - mem_base);
2079	    test_ret++;
2080            printf(" %d", n_doc);
2081            printf(" %d", n_elem);
2082            printf("\n");
2083        }
2084    }
2085    }
2086    function_tests++;
2087#endif
2088
2089    return(test_ret);
2090}
2091
2092
2093static int
2094test_htmlIsScriptAttribute(void) {
2095    int test_ret = 0;
2096
2097#if defined(LIBXML_HTML_ENABLED)
2098    int mem_base;
2099    int ret_val;
2100    xmlChar * name; /* an attribute name */
2101    int n_name;
2102
2103    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2104        mem_base = xmlMemBlocks();
2105        name = gen_const_xmlChar_ptr(n_name, 0);
2106
2107        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2108        desret_int(ret_val);
2109        call_tests++;
2110        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2111        xmlResetLastError();
2112        if (mem_base != xmlMemBlocks()) {
2113            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2114	           xmlMemBlocks() - mem_base);
2115	    test_ret++;
2116            printf(" %d", n_name);
2117            printf("\n");
2118        }
2119    }
2120    function_tests++;
2121#endif
2122
2123    return(test_ret);
2124}
2125
2126
2127static int
2128test_htmlNodeStatus(void) {
2129    int test_ret = 0;
2130
2131#if defined(LIBXML_HTML_ENABLED)
2132    int mem_base;
2133    htmlStatus ret_val;
2134    htmlNodePtr node; /* an htmlNodePtr in a tree */
2135    int n_node;
2136    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2137    int n_legacy;
2138
2139    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2140    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2141        mem_base = xmlMemBlocks();
2142        node = gen_const_htmlNodePtr(n_node, 0);
2143        legacy = gen_int(n_legacy, 1);
2144
2145        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2146        desret_htmlStatus(ret_val);
2147        call_tests++;
2148        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2149        des_int(n_legacy, legacy, 1);
2150        xmlResetLastError();
2151        if (mem_base != xmlMemBlocks()) {
2152            printf("Leak of %d blocks found in htmlNodeStatus",
2153	           xmlMemBlocks() - mem_base);
2154	    test_ret++;
2155            printf(" %d", n_node);
2156            printf(" %d", n_legacy);
2157            printf("\n");
2158        }
2159    }
2160    }
2161    function_tests++;
2162#endif
2163
2164    return(test_ret);
2165}
2166
2167
2168static int
2169test_htmlParseCharRef(void) {
2170    int test_ret = 0;
2171
2172#if defined(LIBXML_HTML_ENABLED)
2173    int mem_base;
2174    int ret_val;
2175    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2176    int n_ctxt;
2177
2178    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2179        mem_base = xmlMemBlocks();
2180        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2181
2182        ret_val = htmlParseCharRef(ctxt);
2183        desret_int(ret_val);
2184        call_tests++;
2185        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2186        xmlResetLastError();
2187        if (mem_base != xmlMemBlocks()) {
2188            printf("Leak of %d blocks found in htmlParseCharRef",
2189	           xmlMemBlocks() - mem_base);
2190	    test_ret++;
2191            printf(" %d", n_ctxt);
2192            printf("\n");
2193        }
2194    }
2195    function_tests++;
2196#endif
2197
2198    return(test_ret);
2199}
2200
2201
2202static int
2203test_htmlParseChunk(void) {
2204    int test_ret = 0;
2205
2206#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2207    int mem_base;
2208    int ret_val;
2209    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2210    int n_ctxt;
2211    char * chunk; /* an char array */
2212    int n_chunk;
2213    int size; /* the size in byte of the chunk */
2214    int n_size;
2215    int terminate; /* last chunk indicator */
2216    int n_terminate;
2217
2218    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2219    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2220    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2221    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2222        mem_base = xmlMemBlocks();
2223        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2224        chunk = gen_const_char_ptr(n_chunk, 1);
2225        size = gen_int(n_size, 2);
2226        terminate = gen_int(n_terminate, 3);
2227
2228        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2229        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2230        desret_int(ret_val);
2231        call_tests++;
2232        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2233        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2234        des_int(n_size, size, 2);
2235        des_int(n_terminate, terminate, 3);
2236        xmlResetLastError();
2237        if (mem_base != xmlMemBlocks()) {
2238            printf("Leak of %d blocks found in htmlParseChunk",
2239	           xmlMemBlocks() - mem_base);
2240	    test_ret++;
2241            printf(" %d", n_ctxt);
2242            printf(" %d", n_chunk);
2243            printf(" %d", n_size);
2244            printf(" %d", n_terminate);
2245            printf("\n");
2246        }
2247    }
2248    }
2249    }
2250    }
2251    function_tests++;
2252#endif
2253
2254    return(test_ret);
2255}
2256
2257
2258static int
2259test_htmlParseDoc(void) {
2260    int test_ret = 0;
2261
2262#if defined(LIBXML_HTML_ENABLED)
2263    int mem_base;
2264    htmlDocPtr ret_val;
2265    xmlChar * cur; /* a pointer to an array of xmlChar */
2266    int n_cur;
2267    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2268    int n_encoding;
2269
2270    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2271    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2272        mem_base = xmlMemBlocks();
2273        cur = gen_xmlChar_ptr(n_cur, 0);
2274        encoding = gen_const_char_ptr(n_encoding, 1);
2275
2276        ret_val = htmlParseDoc(cur, (const char *)encoding);
2277        desret_htmlDocPtr(ret_val);
2278        call_tests++;
2279        des_xmlChar_ptr(n_cur, cur, 0);
2280        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2281        xmlResetLastError();
2282        if (mem_base != xmlMemBlocks()) {
2283            printf("Leak of %d blocks found in htmlParseDoc",
2284	           xmlMemBlocks() - mem_base);
2285	    test_ret++;
2286            printf(" %d", n_cur);
2287            printf(" %d", n_encoding);
2288            printf("\n");
2289        }
2290    }
2291    }
2292    function_tests++;
2293#endif
2294
2295    return(test_ret);
2296}
2297
2298
2299static int
2300test_htmlParseDocument(void) {
2301    int test_ret = 0;
2302
2303#if defined(LIBXML_HTML_ENABLED)
2304    int mem_base;
2305    int ret_val;
2306    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2307    int n_ctxt;
2308
2309    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2310        mem_base = xmlMemBlocks();
2311        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2312
2313        ret_val = htmlParseDocument(ctxt);
2314        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2315        desret_int(ret_val);
2316        call_tests++;
2317        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2318        xmlResetLastError();
2319        if (mem_base != xmlMemBlocks()) {
2320            printf("Leak of %d blocks found in htmlParseDocument",
2321	           xmlMemBlocks() - mem_base);
2322	    test_ret++;
2323            printf(" %d", n_ctxt);
2324            printf("\n");
2325        }
2326    }
2327    function_tests++;
2328#endif
2329
2330    return(test_ret);
2331}
2332
2333
2334static int
2335test_htmlParseElement(void) {
2336    int test_ret = 0;
2337
2338#if defined(LIBXML_HTML_ENABLED)
2339    int mem_base;
2340    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2341    int n_ctxt;
2342
2343    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2344        mem_base = xmlMemBlocks();
2345        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2346
2347        htmlParseElement(ctxt);
2348        call_tests++;
2349        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2350        xmlResetLastError();
2351        if (mem_base != xmlMemBlocks()) {
2352            printf("Leak of %d blocks found in htmlParseElement",
2353	           xmlMemBlocks() - mem_base);
2354	    test_ret++;
2355            printf(" %d", n_ctxt);
2356            printf("\n");
2357        }
2358    }
2359    function_tests++;
2360#endif
2361
2362    return(test_ret);
2363}
2364
2365
2366static int
2367test_htmlParseEntityRef(void) {
2368    int test_ret = 0;
2369
2370#if defined(LIBXML_HTML_ENABLED)
2371    int mem_base;
2372    const htmlEntityDesc * ret_val;
2373    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2374    int n_ctxt;
2375    xmlChar ** str; /* location to store the entity name */
2376    int n_str;
2377
2378    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2379    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2380        mem_base = xmlMemBlocks();
2381        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2382        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2383
2384        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2385        desret_const_htmlEntityDesc_ptr(ret_val);
2386        call_tests++;
2387        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2388        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2389        xmlResetLastError();
2390        if (mem_base != xmlMemBlocks()) {
2391            printf("Leak of %d blocks found in htmlParseEntityRef",
2392	           xmlMemBlocks() - mem_base);
2393	    test_ret++;
2394            printf(" %d", n_ctxt);
2395            printf(" %d", n_str);
2396            printf("\n");
2397        }
2398    }
2399    }
2400    function_tests++;
2401#endif
2402
2403    return(test_ret);
2404}
2405
2406
2407static int
2408test_htmlParseFile(void) {
2409    int test_ret = 0;
2410
2411#if defined(LIBXML_HTML_ENABLED)
2412    htmlDocPtr ret_val;
2413    const char * filename; /* the filename */
2414    int n_filename;
2415    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2416    int n_encoding;
2417
2418    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2419    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2420        filename = gen_filepath(n_filename, 0);
2421        encoding = gen_const_char_ptr(n_encoding, 1);
2422
2423        ret_val = htmlParseFile(filename, (const char *)encoding);
2424        desret_htmlDocPtr(ret_val);
2425        call_tests++;
2426        des_filepath(n_filename, filename, 0);
2427        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2428        xmlResetLastError();
2429    }
2430    }
2431    function_tests++;
2432#endif
2433
2434    return(test_ret);
2435}
2436
2437
2438static int
2439test_htmlReadDoc(void) {
2440    int test_ret = 0;
2441
2442#if defined(LIBXML_HTML_ENABLED)
2443    int mem_base;
2444    htmlDocPtr ret_val;
2445    xmlChar * cur; /* a pointer to a zero terminated string */
2446    int n_cur;
2447    const char * URL; /* the base URL to use for the document */
2448    int n_URL;
2449    char * encoding; /* the document encoding, or NULL */
2450    int n_encoding;
2451    int options; /* a combination of htmlParserOption(s) */
2452    int n_options;
2453
2454    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2455    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2456    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2457    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2458        mem_base = xmlMemBlocks();
2459        cur = gen_const_xmlChar_ptr(n_cur, 0);
2460        URL = gen_filepath(n_URL, 1);
2461        encoding = gen_const_char_ptr(n_encoding, 2);
2462        options = gen_int(n_options, 3);
2463
2464        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2465        desret_htmlDocPtr(ret_val);
2466        call_tests++;
2467        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2468        des_filepath(n_URL, URL, 1);
2469        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2470        des_int(n_options, options, 3);
2471        xmlResetLastError();
2472        if (mem_base != xmlMemBlocks()) {
2473            printf("Leak of %d blocks found in htmlReadDoc",
2474	           xmlMemBlocks() - mem_base);
2475	    test_ret++;
2476            printf(" %d", n_cur);
2477            printf(" %d", n_URL);
2478            printf(" %d", n_encoding);
2479            printf(" %d", n_options);
2480            printf("\n");
2481        }
2482    }
2483    }
2484    }
2485    }
2486    function_tests++;
2487#endif
2488
2489    return(test_ret);
2490}
2491
2492
2493static int
2494test_htmlReadFile(void) {
2495    int test_ret = 0;
2496
2497#if defined(LIBXML_HTML_ENABLED)
2498    int mem_base;
2499    htmlDocPtr ret_val;
2500    const char * filename; /* a file or URL */
2501    int n_filename;
2502    char * encoding; /* the document encoding, or NULL */
2503    int n_encoding;
2504    int options; /* a combination of htmlParserOption(s) */
2505    int n_options;
2506
2507    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2508    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2509    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2510        mem_base = xmlMemBlocks();
2511        filename = gen_filepath(n_filename, 0);
2512        encoding = gen_const_char_ptr(n_encoding, 1);
2513        options = gen_int(n_options, 2);
2514
2515        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2516        desret_htmlDocPtr(ret_val);
2517        call_tests++;
2518        des_filepath(n_filename, filename, 0);
2519        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2520        des_int(n_options, options, 2);
2521        xmlResetLastError();
2522        if (mem_base != xmlMemBlocks()) {
2523            printf("Leak of %d blocks found in htmlReadFile",
2524	           xmlMemBlocks() - mem_base);
2525	    test_ret++;
2526            printf(" %d", n_filename);
2527            printf(" %d", n_encoding);
2528            printf(" %d", n_options);
2529            printf("\n");
2530        }
2531    }
2532    }
2533    }
2534    function_tests++;
2535#endif
2536
2537    return(test_ret);
2538}
2539
2540
2541static int
2542test_htmlReadMemory(void) {
2543    int test_ret = 0;
2544
2545#if defined(LIBXML_HTML_ENABLED)
2546    int mem_base;
2547    htmlDocPtr ret_val;
2548    char * buffer; /* a pointer to a char array */
2549    int n_buffer;
2550    int size; /* the size of the array */
2551    int n_size;
2552    const char * URL; /* the base URL to use for the document */
2553    int n_URL;
2554    char * encoding; /* the document encoding, or NULL */
2555    int n_encoding;
2556    int options; /* a combination of htmlParserOption(s) */
2557    int n_options;
2558
2559    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2560    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2561    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2562    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2563    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2564        mem_base = xmlMemBlocks();
2565        buffer = gen_const_char_ptr(n_buffer, 0);
2566        size = gen_int(n_size, 1);
2567        URL = gen_filepath(n_URL, 2);
2568        encoding = gen_const_char_ptr(n_encoding, 3);
2569        options = gen_int(n_options, 4);
2570
2571        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2572        desret_htmlDocPtr(ret_val);
2573        call_tests++;
2574        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2575        des_int(n_size, size, 1);
2576        des_filepath(n_URL, URL, 2);
2577        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2578        des_int(n_options, options, 4);
2579        xmlResetLastError();
2580        if (mem_base != xmlMemBlocks()) {
2581            printf("Leak of %d blocks found in htmlReadMemory",
2582	           xmlMemBlocks() - mem_base);
2583	    test_ret++;
2584            printf(" %d", n_buffer);
2585            printf(" %d", n_size);
2586            printf(" %d", n_URL);
2587            printf(" %d", n_encoding);
2588            printf(" %d", n_options);
2589            printf("\n");
2590        }
2591    }
2592    }
2593    }
2594    }
2595    }
2596    function_tests++;
2597#endif
2598
2599    return(test_ret);
2600}
2601
2602
2603static int
2604test_htmlSAXParseDoc(void) {
2605    int test_ret = 0;
2606
2607#if defined(LIBXML_HTML_ENABLED)
2608    int mem_base;
2609    htmlDocPtr ret_val;
2610    xmlChar * cur; /* a pointer to an array of xmlChar */
2611    int n_cur;
2612    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2613    int n_encoding;
2614    htmlSAXHandlerPtr sax; /* the SAX handler block */
2615    int n_sax;
2616    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2617    int n_userData;
2618
2619    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2620    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2621    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2622    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2623        mem_base = xmlMemBlocks();
2624        cur = gen_xmlChar_ptr(n_cur, 0);
2625        encoding = gen_const_char_ptr(n_encoding, 1);
2626        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2627        userData = gen_userdata(n_userData, 3);
2628
2629        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2630        desret_htmlDocPtr(ret_val);
2631        call_tests++;
2632        des_xmlChar_ptr(n_cur, cur, 0);
2633        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2634        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2635        des_userdata(n_userData, userData, 3);
2636        xmlResetLastError();
2637        if (mem_base != xmlMemBlocks()) {
2638            printf("Leak of %d blocks found in htmlSAXParseDoc",
2639	           xmlMemBlocks() - mem_base);
2640	    test_ret++;
2641            printf(" %d", n_cur);
2642            printf(" %d", n_encoding);
2643            printf(" %d", n_sax);
2644            printf(" %d", n_userData);
2645            printf("\n");
2646        }
2647    }
2648    }
2649    }
2650    }
2651    function_tests++;
2652#endif
2653
2654    return(test_ret);
2655}
2656
2657
2658static int
2659test_htmlSAXParseFile(void) {
2660    int test_ret = 0;
2661
2662#if defined(LIBXML_HTML_ENABLED)
2663    int mem_base;
2664    htmlDocPtr ret_val;
2665    const char * filename; /* the filename */
2666    int n_filename;
2667    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2668    int n_encoding;
2669    htmlSAXHandlerPtr sax; /* the SAX handler block */
2670    int n_sax;
2671    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2672    int n_userData;
2673
2674    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2675    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2676    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2677    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2678        mem_base = xmlMemBlocks();
2679        filename = gen_filepath(n_filename, 0);
2680        encoding = gen_const_char_ptr(n_encoding, 1);
2681        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2682        userData = gen_userdata(n_userData, 3);
2683
2684        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2685        desret_htmlDocPtr(ret_val);
2686        call_tests++;
2687        des_filepath(n_filename, filename, 0);
2688        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2689        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2690        des_userdata(n_userData, userData, 3);
2691        xmlResetLastError();
2692        if (mem_base != xmlMemBlocks()) {
2693            printf("Leak of %d blocks found in htmlSAXParseFile",
2694	           xmlMemBlocks() - mem_base);
2695	    test_ret++;
2696            printf(" %d", n_filename);
2697            printf(" %d", n_encoding);
2698            printf(" %d", n_sax);
2699            printf(" %d", n_userData);
2700            printf("\n");
2701        }
2702    }
2703    }
2704    }
2705    }
2706    function_tests++;
2707#endif
2708
2709    return(test_ret);
2710}
2711
2712
2713static int
2714test_htmlTagLookup(void) {
2715    int test_ret = 0;
2716
2717
2718    /* missing type support */
2719    return(test_ret);
2720}
2721
2722static int
2723test_HTMLparser(void) {
2724    int test_ret = 0;
2725
2726    if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n");
2727    test_ret += test_UTF8ToHtml();
2728    test_ret += test_htmlAttrAllowed();
2729    test_ret += test_htmlAutoCloseTag();
2730    test_ret += test_htmlCreateMemoryParserCtxt();
2731    test_ret += test_htmlCreatePushParserCtxt();
2732    test_ret += test_htmlCtxtReadDoc();
2733    test_ret += test_htmlCtxtReadFile();
2734    test_ret += test_htmlCtxtReadMemory();
2735    test_ret += test_htmlCtxtReset();
2736    test_ret += test_htmlCtxtUseOptions();
2737    test_ret += test_htmlElementAllowedHere();
2738    test_ret += test_htmlElementStatusHere();
2739    test_ret += test_htmlEncodeEntities();
2740    test_ret += test_htmlEntityLookup();
2741    test_ret += test_htmlEntityValueLookup();
2742    test_ret += test_htmlHandleOmittedElem();
2743    test_ret += test_htmlIsAutoClosed();
2744    test_ret += test_htmlIsScriptAttribute();
2745    test_ret += test_htmlNodeStatus();
2746    test_ret += test_htmlParseCharRef();
2747    test_ret += test_htmlParseChunk();
2748    test_ret += test_htmlParseDoc();
2749    test_ret += test_htmlParseDocument();
2750    test_ret += test_htmlParseElement();
2751    test_ret += test_htmlParseEntityRef();
2752    test_ret += test_htmlParseFile();
2753    test_ret += test_htmlReadDoc();
2754    test_ret += test_htmlReadFile();
2755    test_ret += test_htmlReadMemory();
2756    test_ret += test_htmlSAXParseDoc();
2757    test_ret += test_htmlSAXParseFile();
2758    test_ret += test_htmlTagLookup();
2759
2760    if (test_ret != 0)
2761	printf("Module HTMLparser: %d errors\n", test_ret);
2762    return(test_ret);
2763}
2764
2765static int
2766test_htmlDocContentDumpFormatOutput(void) {
2767    int test_ret = 0;
2768
2769#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2770    int mem_base;
2771    xmlOutputBufferPtr buf; /* the HTML buffer output */
2772    int n_buf;
2773    xmlDocPtr cur; /* the document */
2774    int n_cur;
2775    char * encoding; /* the encoding string */
2776    int n_encoding;
2777    int format; /* should formatting spaces been added */
2778    int n_format;
2779
2780    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2781    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2782    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2783    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2784        mem_base = xmlMemBlocks();
2785        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2786        cur = gen_xmlDocPtr(n_cur, 1);
2787        encoding = gen_const_char_ptr(n_encoding, 2);
2788        format = gen_int(n_format, 3);
2789
2790        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2791        call_tests++;
2792        des_xmlOutputBufferPtr(n_buf, buf, 0);
2793        des_xmlDocPtr(n_cur, cur, 1);
2794        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2795        des_int(n_format, format, 3);
2796        xmlResetLastError();
2797        if (mem_base != xmlMemBlocks()) {
2798            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2799	           xmlMemBlocks() - mem_base);
2800	    test_ret++;
2801            printf(" %d", n_buf);
2802            printf(" %d", n_cur);
2803            printf(" %d", n_encoding);
2804            printf(" %d", n_format);
2805            printf("\n");
2806        }
2807    }
2808    }
2809    }
2810    }
2811    function_tests++;
2812#endif
2813
2814    return(test_ret);
2815}
2816
2817
2818static int
2819test_htmlDocContentDumpOutput(void) {
2820    int test_ret = 0;
2821
2822#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2823    int mem_base;
2824    xmlOutputBufferPtr buf; /* the HTML buffer output */
2825    int n_buf;
2826    xmlDocPtr cur; /* the document */
2827    int n_cur;
2828    char * encoding; /* the encoding string */
2829    int n_encoding;
2830
2831    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2832    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2833    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2834        mem_base = xmlMemBlocks();
2835        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2836        cur = gen_xmlDocPtr(n_cur, 1);
2837        encoding = gen_const_char_ptr(n_encoding, 2);
2838
2839        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2840        call_tests++;
2841        des_xmlOutputBufferPtr(n_buf, buf, 0);
2842        des_xmlDocPtr(n_cur, cur, 1);
2843        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2844        xmlResetLastError();
2845        if (mem_base != xmlMemBlocks()) {
2846            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2847	           xmlMemBlocks() - mem_base);
2848	    test_ret++;
2849            printf(" %d", n_buf);
2850            printf(" %d", n_cur);
2851            printf(" %d", n_encoding);
2852            printf("\n");
2853        }
2854    }
2855    }
2856    }
2857    function_tests++;
2858#endif
2859
2860    return(test_ret);
2861}
2862
2863
2864static int
2865test_htmlDocDump(void) {
2866    int test_ret = 0;
2867
2868#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2869    int mem_base;
2870    int ret_val;
2871    FILE * f; /* the FILE* */
2872    int n_f;
2873    xmlDocPtr cur; /* the document */
2874    int n_cur;
2875
2876    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2877    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2878        mem_base = xmlMemBlocks();
2879        f = gen_FILE_ptr(n_f, 0);
2880        cur = gen_xmlDocPtr(n_cur, 1);
2881
2882        ret_val = htmlDocDump(f, cur);
2883        desret_int(ret_val);
2884        call_tests++;
2885        des_FILE_ptr(n_f, f, 0);
2886        des_xmlDocPtr(n_cur, cur, 1);
2887        xmlResetLastError();
2888        if (mem_base != xmlMemBlocks()) {
2889            printf("Leak of %d blocks found in htmlDocDump",
2890	           xmlMemBlocks() - mem_base);
2891	    test_ret++;
2892            printf(" %d", n_f);
2893            printf(" %d", n_cur);
2894            printf("\n");
2895        }
2896    }
2897    }
2898    function_tests++;
2899#endif
2900
2901    return(test_ret);
2902}
2903
2904
2905#define gen_nb_xmlChar_ptr_ptr 1
2906static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2907    return(NULL);
2908}
2909static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2910}
2911
2912static int
2913test_htmlDocDumpMemory(void) {
2914    int test_ret = 0;
2915
2916#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2917    int mem_base;
2918    xmlDocPtr cur; /* the document */
2919    int n_cur;
2920    xmlChar ** mem; /* OUT: the memory pointer */
2921    int n_mem;
2922    int * size; /* OUT: the memory length */
2923    int n_size;
2924
2925    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2926    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2927    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2928        mem_base = xmlMemBlocks();
2929        cur = gen_xmlDocPtr(n_cur, 0);
2930        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2931        size = gen_int_ptr(n_size, 2);
2932
2933        htmlDocDumpMemory(cur, mem, size);
2934        call_tests++;
2935        des_xmlDocPtr(n_cur, cur, 0);
2936        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2937        des_int_ptr(n_size, size, 2);
2938        xmlResetLastError();
2939        if (mem_base != xmlMemBlocks()) {
2940            printf("Leak of %d blocks found in htmlDocDumpMemory",
2941	           xmlMemBlocks() - mem_base);
2942	    test_ret++;
2943            printf(" %d", n_cur);
2944            printf(" %d", n_mem);
2945            printf(" %d", n_size);
2946            printf("\n");
2947        }
2948    }
2949    }
2950    }
2951    function_tests++;
2952#endif
2953
2954    return(test_ret);
2955}
2956
2957
2958static int
2959test_htmlDocDumpMemoryFormat(void) {
2960    int test_ret = 0;
2961
2962#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2963    int mem_base;
2964    xmlDocPtr cur; /* the document */
2965    int n_cur;
2966    xmlChar ** mem; /* OUT: the memory pointer */
2967    int n_mem;
2968    int * size; /* OUT: the memory length */
2969    int n_size;
2970    int format; /* should formatting spaces been added */
2971    int n_format;
2972
2973    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2974    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2975    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2976    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2977        mem_base = xmlMemBlocks();
2978        cur = gen_xmlDocPtr(n_cur, 0);
2979        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2980        size = gen_int_ptr(n_size, 2);
2981        format = gen_int(n_format, 3);
2982
2983        htmlDocDumpMemoryFormat(cur, mem, size, format);
2984        call_tests++;
2985        des_xmlDocPtr(n_cur, cur, 0);
2986        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2987        des_int_ptr(n_size, size, 2);
2988        des_int(n_format, format, 3);
2989        xmlResetLastError();
2990        if (mem_base != xmlMemBlocks()) {
2991            printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
2992	           xmlMemBlocks() - mem_base);
2993	    test_ret++;
2994            printf(" %d", n_cur);
2995            printf(" %d", n_mem);
2996            printf(" %d", n_size);
2997            printf(" %d", n_format);
2998            printf("\n");
2999        }
3000    }
3001    }
3002    }
3003    }
3004    function_tests++;
3005#endif
3006
3007    return(test_ret);
3008}
3009
3010
3011static int
3012test_htmlGetMetaEncoding(void) {
3013    int test_ret = 0;
3014
3015#if defined(LIBXML_HTML_ENABLED)
3016    int mem_base;
3017    const xmlChar * ret_val;
3018    htmlDocPtr doc; /* the document */
3019    int n_doc;
3020
3021    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3022        mem_base = xmlMemBlocks();
3023        doc = gen_htmlDocPtr(n_doc, 0);
3024
3025        ret_val = htmlGetMetaEncoding(doc);
3026        desret_const_xmlChar_ptr(ret_val);
3027        call_tests++;
3028        des_htmlDocPtr(n_doc, doc, 0);
3029        xmlResetLastError();
3030        if (mem_base != xmlMemBlocks()) {
3031            printf("Leak of %d blocks found in htmlGetMetaEncoding",
3032	           xmlMemBlocks() - mem_base);
3033	    test_ret++;
3034            printf(" %d", n_doc);
3035            printf("\n");
3036        }
3037    }
3038    function_tests++;
3039#endif
3040
3041    return(test_ret);
3042}
3043
3044
3045static int
3046test_htmlIsBooleanAttr(void) {
3047    int test_ret = 0;
3048
3049#if defined(LIBXML_HTML_ENABLED)
3050    int mem_base;
3051    int ret_val;
3052    xmlChar * name; /* the name of the attribute to check */
3053    int n_name;
3054
3055    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3056        mem_base = xmlMemBlocks();
3057        name = gen_const_xmlChar_ptr(n_name, 0);
3058
3059        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3060        desret_int(ret_val);
3061        call_tests++;
3062        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3063        xmlResetLastError();
3064        if (mem_base != xmlMemBlocks()) {
3065            printf("Leak of %d blocks found in htmlIsBooleanAttr",
3066	           xmlMemBlocks() - mem_base);
3067	    test_ret++;
3068            printf(" %d", n_name);
3069            printf("\n");
3070        }
3071    }
3072    function_tests++;
3073#endif
3074
3075    return(test_ret);
3076}
3077
3078
3079static int
3080test_htmlNewDoc(void) {
3081    int test_ret = 0;
3082
3083#if defined(LIBXML_HTML_ENABLED)
3084    int mem_base;
3085    htmlDocPtr ret_val;
3086    xmlChar * URI; /* URI for the dtd, or NULL */
3087    int n_URI;
3088    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3089    int n_ExternalID;
3090
3091    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3092    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3093        mem_base = xmlMemBlocks();
3094        URI = gen_const_xmlChar_ptr(n_URI, 0);
3095        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3096
3097        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3098        desret_htmlDocPtr(ret_val);
3099        call_tests++;
3100        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3101        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3102        xmlResetLastError();
3103        if (mem_base != xmlMemBlocks()) {
3104            printf("Leak of %d blocks found in htmlNewDoc",
3105	           xmlMemBlocks() - mem_base);
3106	    test_ret++;
3107            printf(" %d", n_URI);
3108            printf(" %d", n_ExternalID);
3109            printf("\n");
3110        }
3111    }
3112    }
3113    function_tests++;
3114#endif
3115
3116    return(test_ret);
3117}
3118
3119
3120static int
3121test_htmlNewDocNoDtD(void) {
3122    int test_ret = 0;
3123
3124#if defined(LIBXML_HTML_ENABLED)
3125    int mem_base;
3126    htmlDocPtr ret_val;
3127    xmlChar * URI; /* URI for the dtd, or NULL */
3128    int n_URI;
3129    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3130    int n_ExternalID;
3131
3132    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3133    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3134        mem_base = xmlMemBlocks();
3135        URI = gen_const_xmlChar_ptr(n_URI, 0);
3136        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3137
3138        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3139        desret_htmlDocPtr(ret_val);
3140        call_tests++;
3141        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3142        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3143        xmlResetLastError();
3144        if (mem_base != xmlMemBlocks()) {
3145            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3146	           xmlMemBlocks() - mem_base);
3147	    test_ret++;
3148            printf(" %d", n_URI);
3149            printf(" %d", n_ExternalID);
3150            printf("\n");
3151        }
3152    }
3153    }
3154    function_tests++;
3155#endif
3156
3157    return(test_ret);
3158}
3159
3160
3161static int
3162test_htmlNodeDump(void) {
3163    int test_ret = 0;
3164
3165#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3166    int mem_base;
3167    int ret_val;
3168    xmlBufferPtr buf; /* the HTML buffer output */
3169    int n_buf;
3170    xmlDocPtr doc; /* the document */
3171    int n_doc;
3172    xmlNodePtr cur; /* the current node */
3173    int n_cur;
3174
3175    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3176    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3177    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3178        mem_base = xmlMemBlocks();
3179        buf = gen_xmlBufferPtr(n_buf, 0);
3180        doc = gen_xmlDocPtr(n_doc, 1);
3181        cur = gen_xmlNodePtr(n_cur, 2);
3182
3183        ret_val = htmlNodeDump(buf, doc, cur);
3184        desret_int(ret_val);
3185        call_tests++;
3186        des_xmlBufferPtr(n_buf, buf, 0);
3187        des_xmlDocPtr(n_doc, doc, 1);
3188        des_xmlNodePtr(n_cur, cur, 2);
3189        xmlResetLastError();
3190        if (mem_base != xmlMemBlocks()) {
3191            printf("Leak of %d blocks found in htmlNodeDump",
3192	           xmlMemBlocks() - mem_base);
3193	    test_ret++;
3194            printf(" %d", n_buf);
3195            printf(" %d", n_doc);
3196            printf(" %d", n_cur);
3197            printf("\n");
3198        }
3199    }
3200    }
3201    }
3202    function_tests++;
3203#endif
3204
3205    return(test_ret);
3206}
3207
3208
3209static int
3210test_htmlNodeDumpFile(void) {
3211    int test_ret = 0;
3212
3213#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3214    int mem_base;
3215    FILE * out; /* the FILE pointer */
3216    int n_out;
3217    xmlDocPtr doc; /* the document */
3218    int n_doc;
3219    xmlNodePtr cur; /* the current node */
3220    int n_cur;
3221
3222    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3223    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3224    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3225        mem_base = xmlMemBlocks();
3226        out = gen_FILE_ptr(n_out, 0);
3227        doc = gen_xmlDocPtr(n_doc, 1);
3228        cur = gen_xmlNodePtr(n_cur, 2);
3229
3230        htmlNodeDumpFile(out, doc, cur);
3231        call_tests++;
3232        des_FILE_ptr(n_out, out, 0);
3233        des_xmlDocPtr(n_doc, doc, 1);
3234        des_xmlNodePtr(n_cur, cur, 2);
3235        xmlResetLastError();
3236        if (mem_base != xmlMemBlocks()) {
3237            printf("Leak of %d blocks found in htmlNodeDumpFile",
3238	           xmlMemBlocks() - mem_base);
3239	    test_ret++;
3240            printf(" %d", n_out);
3241            printf(" %d", n_doc);
3242            printf(" %d", n_cur);
3243            printf("\n");
3244        }
3245    }
3246    }
3247    }
3248    function_tests++;
3249#endif
3250
3251    return(test_ret);
3252}
3253
3254
3255static int
3256test_htmlNodeDumpFileFormat(void) {
3257    int test_ret = 0;
3258
3259#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3260    int mem_base;
3261    int ret_val;
3262    FILE * out; /* the FILE pointer */
3263    int n_out;
3264    xmlDocPtr doc; /* the document */
3265    int n_doc;
3266    xmlNodePtr cur; /* the current node */
3267    int n_cur;
3268    char * encoding; /* the document encoding */
3269    int n_encoding;
3270    int format; /* should formatting spaces been added */
3271    int n_format;
3272
3273    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3274    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3275    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3276    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3277    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3278        mem_base = xmlMemBlocks();
3279        out = gen_FILE_ptr(n_out, 0);
3280        doc = gen_xmlDocPtr(n_doc, 1);
3281        cur = gen_xmlNodePtr(n_cur, 2);
3282        encoding = gen_const_char_ptr(n_encoding, 3);
3283        format = gen_int(n_format, 4);
3284
3285        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3286        desret_int(ret_val);
3287        call_tests++;
3288        des_FILE_ptr(n_out, out, 0);
3289        des_xmlDocPtr(n_doc, doc, 1);
3290        des_xmlNodePtr(n_cur, cur, 2);
3291        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3292        des_int(n_format, format, 4);
3293        xmlResetLastError();
3294        if (mem_base != xmlMemBlocks()) {
3295            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3296	           xmlMemBlocks() - mem_base);
3297	    test_ret++;
3298            printf(" %d", n_out);
3299            printf(" %d", n_doc);
3300            printf(" %d", n_cur);
3301            printf(" %d", n_encoding);
3302            printf(" %d", n_format);
3303            printf("\n");
3304        }
3305    }
3306    }
3307    }
3308    }
3309    }
3310    function_tests++;
3311#endif
3312
3313    return(test_ret);
3314}
3315
3316
3317static int
3318test_htmlNodeDumpFormatOutput(void) {
3319    int test_ret = 0;
3320
3321#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3322    int mem_base;
3323    xmlOutputBufferPtr buf; /* the HTML buffer output */
3324    int n_buf;
3325    xmlDocPtr doc; /* the document */
3326    int n_doc;
3327    xmlNodePtr cur; /* the current node */
3328    int n_cur;
3329    char * encoding; /* the encoding string */
3330    int n_encoding;
3331    int format; /* should formatting spaces been added */
3332    int n_format;
3333
3334    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3335    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3336    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3337    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3338    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3339        mem_base = xmlMemBlocks();
3340        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3341        doc = gen_xmlDocPtr(n_doc, 1);
3342        cur = gen_xmlNodePtr(n_cur, 2);
3343        encoding = gen_const_char_ptr(n_encoding, 3);
3344        format = gen_int(n_format, 4);
3345
3346        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3347        call_tests++;
3348        des_xmlOutputBufferPtr(n_buf, buf, 0);
3349        des_xmlDocPtr(n_doc, doc, 1);
3350        des_xmlNodePtr(n_cur, cur, 2);
3351        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3352        des_int(n_format, format, 4);
3353        xmlResetLastError();
3354        if (mem_base != xmlMemBlocks()) {
3355            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3356	           xmlMemBlocks() - mem_base);
3357	    test_ret++;
3358            printf(" %d", n_buf);
3359            printf(" %d", n_doc);
3360            printf(" %d", n_cur);
3361            printf(" %d", n_encoding);
3362            printf(" %d", n_format);
3363            printf("\n");
3364        }
3365    }
3366    }
3367    }
3368    }
3369    }
3370    function_tests++;
3371#endif
3372
3373    return(test_ret);
3374}
3375
3376
3377static int
3378test_htmlNodeDumpOutput(void) {
3379    int test_ret = 0;
3380
3381#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3382    int mem_base;
3383    xmlOutputBufferPtr buf; /* the HTML buffer output */
3384    int n_buf;
3385    xmlDocPtr doc; /* the document */
3386    int n_doc;
3387    xmlNodePtr cur; /* the current node */
3388    int n_cur;
3389    char * encoding; /* the encoding string */
3390    int n_encoding;
3391
3392    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3393    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3394    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3395    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3396        mem_base = xmlMemBlocks();
3397        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3398        doc = gen_xmlDocPtr(n_doc, 1);
3399        cur = gen_xmlNodePtr(n_cur, 2);
3400        encoding = gen_const_char_ptr(n_encoding, 3);
3401
3402        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3403        call_tests++;
3404        des_xmlOutputBufferPtr(n_buf, buf, 0);
3405        des_xmlDocPtr(n_doc, doc, 1);
3406        des_xmlNodePtr(n_cur, cur, 2);
3407        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3408        xmlResetLastError();
3409        if (mem_base != xmlMemBlocks()) {
3410            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3411	           xmlMemBlocks() - mem_base);
3412	    test_ret++;
3413            printf(" %d", n_buf);
3414            printf(" %d", n_doc);
3415            printf(" %d", n_cur);
3416            printf(" %d", n_encoding);
3417            printf("\n");
3418        }
3419    }
3420    }
3421    }
3422    }
3423    function_tests++;
3424#endif
3425
3426    return(test_ret);
3427}
3428
3429
3430static int
3431test_htmlSaveFile(void) {
3432    int test_ret = 0;
3433
3434#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3435    int mem_base;
3436    int ret_val;
3437    const char * filename; /* the filename (or URL) */
3438    int n_filename;
3439    xmlDocPtr cur; /* the document */
3440    int n_cur;
3441
3442    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3443    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3444        mem_base = xmlMemBlocks();
3445        filename = gen_fileoutput(n_filename, 0);
3446        cur = gen_xmlDocPtr(n_cur, 1);
3447
3448        ret_val = htmlSaveFile(filename, cur);
3449        desret_int(ret_val);
3450        call_tests++;
3451        des_fileoutput(n_filename, filename, 0);
3452        des_xmlDocPtr(n_cur, cur, 1);
3453        xmlResetLastError();
3454        if (mem_base != xmlMemBlocks()) {
3455            printf("Leak of %d blocks found in htmlSaveFile",
3456	           xmlMemBlocks() - mem_base);
3457	    test_ret++;
3458            printf(" %d", n_filename);
3459            printf(" %d", n_cur);
3460            printf("\n");
3461        }
3462    }
3463    }
3464    function_tests++;
3465#endif
3466
3467    return(test_ret);
3468}
3469
3470
3471static int
3472test_htmlSaveFileEnc(void) {
3473    int test_ret = 0;
3474
3475#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3476    int mem_base;
3477    int ret_val;
3478    const char * filename; /* the filename */
3479    int n_filename;
3480    xmlDocPtr cur; /* the document */
3481    int n_cur;
3482    char * encoding; /* the document encoding */
3483    int n_encoding;
3484
3485    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3486    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3487    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3488        mem_base = xmlMemBlocks();
3489        filename = gen_fileoutput(n_filename, 0);
3490        cur = gen_xmlDocPtr(n_cur, 1);
3491        encoding = gen_const_char_ptr(n_encoding, 2);
3492
3493        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3494        desret_int(ret_val);
3495        call_tests++;
3496        des_fileoutput(n_filename, filename, 0);
3497        des_xmlDocPtr(n_cur, cur, 1);
3498        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3499        xmlResetLastError();
3500        if (mem_base != xmlMemBlocks()) {
3501            printf("Leak of %d blocks found in htmlSaveFileEnc",
3502	           xmlMemBlocks() - mem_base);
3503	    test_ret++;
3504            printf(" %d", n_filename);
3505            printf(" %d", n_cur);
3506            printf(" %d", n_encoding);
3507            printf("\n");
3508        }
3509    }
3510    }
3511    }
3512    function_tests++;
3513#endif
3514
3515    return(test_ret);
3516}
3517
3518
3519static int
3520test_htmlSaveFileFormat(void) {
3521    int test_ret = 0;
3522
3523#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3524    int mem_base;
3525    int ret_val;
3526    const char * filename; /* the filename */
3527    int n_filename;
3528    xmlDocPtr cur; /* the document */
3529    int n_cur;
3530    char * encoding; /* the document encoding */
3531    int n_encoding;
3532    int format; /* should formatting spaces been added */
3533    int n_format;
3534
3535    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3536    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3537    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3538    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3539        mem_base = xmlMemBlocks();
3540        filename = gen_fileoutput(n_filename, 0);
3541        cur = gen_xmlDocPtr(n_cur, 1);
3542        encoding = gen_const_char_ptr(n_encoding, 2);
3543        format = gen_int(n_format, 3);
3544
3545        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
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        des_int(n_format, format, 3);
3552        xmlResetLastError();
3553        if (mem_base != xmlMemBlocks()) {
3554            printf("Leak of %d blocks found in htmlSaveFileFormat",
3555	           xmlMemBlocks() - mem_base);
3556	    test_ret++;
3557            printf(" %d", n_filename);
3558            printf(" %d", n_cur);
3559            printf(" %d", n_encoding);
3560            printf(" %d", n_format);
3561            printf("\n");
3562        }
3563    }
3564    }
3565    }
3566    }
3567    function_tests++;
3568#endif
3569
3570    return(test_ret);
3571}
3572
3573
3574static int
3575test_htmlSetMetaEncoding(void) {
3576    int test_ret = 0;
3577
3578#if defined(LIBXML_HTML_ENABLED)
3579    int mem_base;
3580    int ret_val;
3581    htmlDocPtr doc; /* the document */
3582    int n_doc;
3583    xmlChar * encoding; /* the encoding string */
3584    int n_encoding;
3585
3586    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3587    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3588        mem_base = xmlMemBlocks();
3589        doc = gen_htmlDocPtr(n_doc, 0);
3590        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3591
3592        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3593        desret_int(ret_val);
3594        call_tests++;
3595        des_htmlDocPtr(n_doc, doc, 0);
3596        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3597        xmlResetLastError();
3598        if (mem_base != xmlMemBlocks()) {
3599            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3600	           xmlMemBlocks() - mem_base);
3601	    test_ret++;
3602            printf(" %d", n_doc);
3603            printf(" %d", n_encoding);
3604            printf("\n");
3605        }
3606    }
3607    }
3608    function_tests++;
3609#endif
3610
3611    return(test_ret);
3612}
3613
3614static int
3615test_HTMLtree(void) {
3616    int test_ret = 0;
3617
3618    if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3619    test_ret += test_htmlDocContentDumpFormatOutput();
3620    test_ret += test_htmlDocContentDumpOutput();
3621    test_ret += test_htmlDocDump();
3622    test_ret += test_htmlDocDumpMemory();
3623    test_ret += test_htmlDocDumpMemoryFormat();
3624    test_ret += test_htmlGetMetaEncoding();
3625    test_ret += test_htmlIsBooleanAttr();
3626    test_ret += test_htmlNewDoc();
3627    test_ret += test_htmlNewDocNoDtD();
3628    test_ret += test_htmlNodeDump();
3629    test_ret += test_htmlNodeDumpFile();
3630    test_ret += test_htmlNodeDumpFileFormat();
3631    test_ret += test_htmlNodeDumpFormatOutput();
3632    test_ret += test_htmlNodeDumpOutput();
3633    test_ret += test_htmlSaveFile();
3634    test_ret += test_htmlSaveFileEnc();
3635    test_ret += test_htmlSaveFileFormat();
3636    test_ret += test_htmlSetMetaEncoding();
3637
3638    if (test_ret != 0)
3639	printf("Module HTMLtree: %d errors\n", test_ret);
3640    return(test_ret);
3641}
3642
3643static int
3644test_docbDefaultSAXHandlerInit(void) {
3645    int test_ret = 0;
3646
3647#if defined(LIBXML_DOCB_ENABLED)
3648#ifdef LIBXML_DOCB_ENABLED
3649    int mem_base;
3650
3651        mem_base = xmlMemBlocks();
3652
3653        docbDefaultSAXHandlerInit();
3654        call_tests++;
3655        xmlResetLastError();
3656        if (mem_base != xmlMemBlocks()) {
3657            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3658	           xmlMemBlocks() - mem_base);
3659	    test_ret++;
3660            printf("\n");
3661        }
3662    function_tests++;
3663#endif
3664#endif
3665
3666    return(test_ret);
3667}
3668
3669
3670static int
3671test_htmlDefaultSAXHandlerInit(void) {
3672    int test_ret = 0;
3673
3674#if defined(LIBXML_HTML_ENABLED)
3675#ifdef LIBXML_HTML_ENABLED
3676    int mem_base;
3677
3678        mem_base = xmlMemBlocks();
3679
3680        htmlDefaultSAXHandlerInit();
3681        call_tests++;
3682        xmlResetLastError();
3683        if (mem_base != xmlMemBlocks()) {
3684            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3685	           xmlMemBlocks() - mem_base);
3686	    test_ret++;
3687            printf("\n");
3688        }
3689    function_tests++;
3690#endif
3691#endif
3692
3693    return(test_ret);
3694}
3695
3696
3697static int
3698test_xmlDefaultSAXHandlerInit(void) {
3699    int test_ret = 0;
3700
3701    int mem_base;
3702
3703        mem_base = xmlMemBlocks();
3704
3705        xmlDefaultSAXHandlerInit();
3706        call_tests++;
3707        xmlResetLastError();
3708        if (mem_base != xmlMemBlocks()) {
3709            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3710	           xmlMemBlocks() - mem_base);
3711	    test_ret++;
3712            printf("\n");
3713        }
3714    function_tests++;
3715
3716    return(test_ret);
3717}
3718
3719
3720#define gen_nb_xmlEnumerationPtr 1
3721static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3722    return(NULL);
3723}
3724static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3725}
3726
3727static int
3728test_xmlSAX2AttributeDecl(void) {
3729    int test_ret = 0;
3730
3731    int mem_base;
3732    void * ctx; /* the user data (XML parser context) */
3733    int n_ctx;
3734    xmlChar * elem; /* the name of the element */
3735    int n_elem;
3736    xmlChar * fullname; /* the attribute name */
3737    int n_fullname;
3738    int type; /* the attribute type */
3739    int n_type;
3740    int def; /* the type of default value */
3741    int n_def;
3742    xmlChar * defaultValue; /* the attribute default value */
3743    int n_defaultValue;
3744    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3745    int n_tree;
3746
3747    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3748    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3749    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3750    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3751    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3752    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3753    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3754        mem_base = xmlMemBlocks();
3755        ctx = gen_void_ptr(n_ctx, 0);
3756        elem = gen_const_xmlChar_ptr(n_elem, 1);
3757        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3758        type = gen_int(n_type, 3);
3759        def = gen_int(n_def, 4);
3760        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3761        tree = gen_xmlEnumerationPtr(n_tree, 6);
3762
3763        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3764        call_tests++;
3765        des_void_ptr(n_ctx, ctx, 0);
3766        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3767        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3768        des_int(n_type, type, 3);
3769        des_int(n_def, def, 4);
3770        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3771        des_xmlEnumerationPtr(n_tree, tree, 6);
3772        xmlResetLastError();
3773        if (mem_base != xmlMemBlocks()) {
3774            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3775	           xmlMemBlocks() - mem_base);
3776	    test_ret++;
3777            printf(" %d", n_ctx);
3778            printf(" %d", n_elem);
3779            printf(" %d", n_fullname);
3780            printf(" %d", n_type);
3781            printf(" %d", n_def);
3782            printf(" %d", n_defaultValue);
3783            printf(" %d", n_tree);
3784            printf("\n");
3785        }
3786    }
3787    }
3788    }
3789    }
3790    }
3791    }
3792    }
3793    function_tests++;
3794
3795    return(test_ret);
3796}
3797
3798
3799static int
3800test_xmlSAX2CDataBlock(void) {
3801    int test_ret = 0;
3802
3803    int mem_base;
3804    void * ctx; /* the user data (XML parser context) */
3805    int n_ctx;
3806    xmlChar * value; /* The pcdata content */
3807    int n_value;
3808    int len; /* the block length */
3809    int n_len;
3810
3811    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3812    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3813    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3814        mem_base = xmlMemBlocks();
3815        ctx = gen_void_ptr(n_ctx, 0);
3816        value = gen_const_xmlChar_ptr(n_value, 1);
3817        len = gen_int(n_len, 2);
3818
3819        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3820        call_tests++;
3821        des_void_ptr(n_ctx, ctx, 0);
3822        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3823        des_int(n_len, len, 2);
3824        xmlResetLastError();
3825        if (mem_base != xmlMemBlocks()) {
3826            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3827	           xmlMemBlocks() - mem_base);
3828	    test_ret++;
3829            printf(" %d", n_ctx);
3830            printf(" %d", n_value);
3831            printf(" %d", n_len);
3832            printf("\n");
3833        }
3834    }
3835    }
3836    }
3837    function_tests++;
3838
3839    return(test_ret);
3840}
3841
3842
3843static int
3844test_xmlSAX2Characters(void) {
3845    int test_ret = 0;
3846
3847    int mem_base;
3848    void * ctx; /* the user data (XML parser context) */
3849    int n_ctx;
3850    xmlChar * ch; /* a xmlChar string */
3851    int n_ch;
3852    int len; /* the number of xmlChar */
3853    int n_len;
3854
3855    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3856    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3857    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3858        mem_base = xmlMemBlocks();
3859        ctx = gen_void_ptr(n_ctx, 0);
3860        ch = gen_const_xmlChar_ptr(n_ch, 1);
3861        len = gen_int(n_len, 2);
3862
3863        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3864        call_tests++;
3865        des_void_ptr(n_ctx, ctx, 0);
3866        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3867        des_int(n_len, len, 2);
3868        xmlResetLastError();
3869        if (mem_base != xmlMemBlocks()) {
3870            printf("Leak of %d blocks found in xmlSAX2Characters",
3871	           xmlMemBlocks() - mem_base);
3872	    test_ret++;
3873            printf(" %d", n_ctx);
3874            printf(" %d", n_ch);
3875            printf(" %d", n_len);
3876            printf("\n");
3877        }
3878    }
3879    }
3880    }
3881    function_tests++;
3882
3883    return(test_ret);
3884}
3885
3886
3887static int
3888test_xmlSAX2Comment(void) {
3889    int test_ret = 0;
3890
3891    int mem_base;
3892    void * ctx; /* the user data (XML parser context) */
3893    int n_ctx;
3894    xmlChar * value; /* the xmlSAX2Comment content */
3895    int n_value;
3896
3897    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3898    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3899        mem_base = xmlMemBlocks();
3900        ctx = gen_void_ptr(n_ctx, 0);
3901        value = gen_const_xmlChar_ptr(n_value, 1);
3902
3903        xmlSAX2Comment(ctx, (const xmlChar *)value);
3904        call_tests++;
3905        des_void_ptr(n_ctx, ctx, 0);
3906        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3907        xmlResetLastError();
3908        if (mem_base != xmlMemBlocks()) {
3909            printf("Leak of %d blocks found in xmlSAX2Comment",
3910	           xmlMemBlocks() - mem_base);
3911	    test_ret++;
3912            printf(" %d", n_ctx);
3913            printf(" %d", n_value);
3914            printf("\n");
3915        }
3916    }
3917    }
3918    function_tests++;
3919
3920    return(test_ret);
3921}
3922
3923
3924static int
3925test_xmlSAX2ElementDecl(void) {
3926    int test_ret = 0;
3927
3928    int mem_base;
3929    void * ctx; /* the user data (XML parser context) */
3930    int n_ctx;
3931    xmlChar * name; /* the element name */
3932    int n_name;
3933    int type; /* the element type */
3934    int n_type;
3935    xmlElementContentPtr content; /* the element value tree */
3936    int n_content;
3937
3938    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3939    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3940    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3941    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3942        mem_base = xmlMemBlocks();
3943        ctx = gen_void_ptr(n_ctx, 0);
3944        name = gen_const_xmlChar_ptr(n_name, 1);
3945        type = gen_int(n_type, 2);
3946        content = gen_xmlElementContentPtr(n_content, 3);
3947
3948        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3949        call_tests++;
3950        des_void_ptr(n_ctx, ctx, 0);
3951        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3952        des_int(n_type, type, 2);
3953        des_xmlElementContentPtr(n_content, content, 3);
3954        xmlResetLastError();
3955        if (mem_base != xmlMemBlocks()) {
3956            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
3957	           xmlMemBlocks() - mem_base);
3958	    test_ret++;
3959            printf(" %d", n_ctx);
3960            printf(" %d", n_name);
3961            printf(" %d", n_type);
3962            printf(" %d", n_content);
3963            printf("\n");
3964        }
3965    }
3966    }
3967    }
3968    }
3969    function_tests++;
3970
3971    return(test_ret);
3972}
3973
3974
3975static int
3976test_xmlSAX2EndDocument(void) {
3977    int test_ret = 0;
3978
3979    int mem_base;
3980    void * ctx; /* the user data (XML parser context) */
3981    int n_ctx;
3982
3983    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3984        mem_base = xmlMemBlocks();
3985        ctx = gen_void_ptr(n_ctx, 0);
3986
3987        xmlSAX2EndDocument(ctx);
3988        call_tests++;
3989        des_void_ptr(n_ctx, ctx, 0);
3990        xmlResetLastError();
3991        if (mem_base != xmlMemBlocks()) {
3992            printf("Leak of %d blocks found in xmlSAX2EndDocument",
3993	           xmlMemBlocks() - mem_base);
3994	    test_ret++;
3995            printf(" %d", n_ctx);
3996            printf("\n");
3997        }
3998    }
3999    function_tests++;
4000
4001    return(test_ret);
4002}
4003
4004
4005static int
4006test_xmlSAX2EndElement(void) {
4007    int test_ret = 0;
4008
4009#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4010#ifdef LIBXML_SAX1_ENABLED
4011    int mem_base;
4012    void * ctx; /* the user data (XML parser context) */
4013    int n_ctx;
4014    xmlChar * name; /* The element name */
4015    int n_name;
4016
4017    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4018    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4019        mem_base = xmlMemBlocks();
4020        ctx = gen_void_ptr(n_ctx, 0);
4021        name = gen_const_xmlChar_ptr(n_name, 1);
4022
4023        xmlSAX2EndElement(ctx, (const xmlChar *)name);
4024        call_tests++;
4025        des_void_ptr(n_ctx, ctx, 0);
4026        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4027        xmlResetLastError();
4028        if (mem_base != xmlMemBlocks()) {
4029            printf("Leak of %d blocks found in xmlSAX2EndElement",
4030	           xmlMemBlocks() - mem_base);
4031	    test_ret++;
4032            printf(" %d", n_ctx);
4033            printf(" %d", n_name);
4034            printf("\n");
4035        }
4036    }
4037    }
4038    function_tests++;
4039#endif
4040#endif
4041
4042    return(test_ret);
4043}
4044
4045
4046static int
4047test_xmlSAX2EndElementNs(void) {
4048    int test_ret = 0;
4049
4050    int mem_base;
4051    void * ctx; /* the user data (XML parser context) */
4052    int n_ctx;
4053    xmlChar * localname; /* the local name of the element */
4054    int n_localname;
4055    xmlChar * prefix; /* the element namespace prefix if available */
4056    int n_prefix;
4057    xmlChar * URI; /* the element namespace name if available */
4058    int n_URI;
4059
4060    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4061    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4062    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4063    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4064        mem_base = xmlMemBlocks();
4065        ctx = gen_void_ptr(n_ctx, 0);
4066        localname = gen_const_xmlChar_ptr(n_localname, 1);
4067        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4068        URI = gen_const_xmlChar_ptr(n_URI, 3);
4069
4070        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4071        call_tests++;
4072        des_void_ptr(n_ctx, ctx, 0);
4073        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4074        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4075        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4076        xmlResetLastError();
4077        if (mem_base != xmlMemBlocks()) {
4078            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4079	           xmlMemBlocks() - mem_base);
4080	    test_ret++;
4081            printf(" %d", n_ctx);
4082            printf(" %d", n_localname);
4083            printf(" %d", n_prefix);
4084            printf(" %d", n_URI);
4085            printf("\n");
4086        }
4087    }
4088    }
4089    }
4090    }
4091    function_tests++;
4092
4093    return(test_ret);
4094}
4095
4096
4097static int
4098test_xmlSAX2EntityDecl(void) {
4099    int test_ret = 0;
4100
4101    int mem_base;
4102    void * ctx; /* the user data (XML parser context) */
4103    int n_ctx;
4104    xmlChar * name; /* the entity name */
4105    int n_name;
4106    int type; /* the entity type */
4107    int n_type;
4108    xmlChar * publicId; /* The public ID of the entity */
4109    int n_publicId;
4110    xmlChar * systemId; /* The system ID of the entity */
4111    int n_systemId;
4112    xmlChar * content; /* the entity value (without processing). */
4113    int n_content;
4114
4115    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4116    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4117    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4118    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4119    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4120    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4121        mem_base = xmlMemBlocks();
4122        ctx = gen_void_ptr(n_ctx, 0);
4123        name = gen_const_xmlChar_ptr(n_name, 1);
4124        type = gen_int(n_type, 2);
4125        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4126        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4127        content = gen_xmlChar_ptr(n_content, 5);
4128
4129        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4130        call_tests++;
4131        des_void_ptr(n_ctx, ctx, 0);
4132        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4133        des_int(n_type, type, 2);
4134        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4135        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4136        des_xmlChar_ptr(n_content, content, 5);
4137        xmlResetLastError();
4138        if (mem_base != xmlMemBlocks()) {
4139            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4140	           xmlMemBlocks() - mem_base);
4141	    test_ret++;
4142            printf(" %d", n_ctx);
4143            printf(" %d", n_name);
4144            printf(" %d", n_type);
4145            printf(" %d", n_publicId);
4146            printf(" %d", n_systemId);
4147            printf(" %d", n_content);
4148            printf("\n");
4149        }
4150    }
4151    }
4152    }
4153    }
4154    }
4155    }
4156    function_tests++;
4157
4158    return(test_ret);
4159}
4160
4161
4162static int
4163test_xmlSAX2ExternalSubset(void) {
4164    int test_ret = 0;
4165
4166    int mem_base;
4167    void * ctx; /* the user data (XML parser context) */
4168    int n_ctx;
4169    xmlChar * name; /* the root element name */
4170    int n_name;
4171    xmlChar * ExternalID; /* the external ID */
4172    int n_ExternalID;
4173    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4174    int n_SystemID;
4175
4176    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4177    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4178    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4179    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4180        mem_base = xmlMemBlocks();
4181        ctx = gen_void_ptr(n_ctx, 0);
4182        name = gen_const_xmlChar_ptr(n_name, 1);
4183        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4184        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4185
4186        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4187        call_tests++;
4188        des_void_ptr(n_ctx, ctx, 0);
4189        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4190        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4191        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4192        xmlResetLastError();
4193        if (mem_base != xmlMemBlocks()) {
4194            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4195	           xmlMemBlocks() - mem_base);
4196	    test_ret++;
4197            printf(" %d", n_ctx);
4198            printf(" %d", n_name);
4199            printf(" %d", n_ExternalID);
4200            printf(" %d", n_SystemID);
4201            printf("\n");
4202        }
4203    }
4204    }
4205    }
4206    }
4207    function_tests++;
4208
4209    return(test_ret);
4210}
4211
4212
4213static int
4214test_xmlSAX2GetColumnNumber(void) {
4215    int test_ret = 0;
4216
4217    int mem_base;
4218    int ret_val;
4219    void * ctx; /* the user data (XML parser context) */
4220    int n_ctx;
4221
4222    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4223        mem_base = xmlMemBlocks();
4224        ctx = gen_void_ptr(n_ctx, 0);
4225
4226        ret_val = xmlSAX2GetColumnNumber(ctx);
4227        desret_int(ret_val);
4228        call_tests++;
4229        des_void_ptr(n_ctx, ctx, 0);
4230        xmlResetLastError();
4231        if (mem_base != xmlMemBlocks()) {
4232            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4233	           xmlMemBlocks() - mem_base);
4234	    test_ret++;
4235            printf(" %d", n_ctx);
4236            printf("\n");
4237        }
4238    }
4239    function_tests++;
4240
4241    return(test_ret);
4242}
4243
4244
4245static int
4246test_xmlSAX2GetEntity(void) {
4247    int test_ret = 0;
4248
4249    int mem_base;
4250    xmlEntityPtr ret_val;
4251    void * ctx; /* the user data (XML parser context) */
4252    int n_ctx;
4253    xmlChar * name; /* The entity name */
4254    int n_name;
4255
4256    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4257    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4258        mem_base = xmlMemBlocks();
4259        ctx = gen_void_ptr(n_ctx, 0);
4260        name = gen_const_xmlChar_ptr(n_name, 1);
4261
4262        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4263        desret_xmlEntityPtr(ret_val);
4264        call_tests++;
4265        des_void_ptr(n_ctx, ctx, 0);
4266        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4267        xmlResetLastError();
4268        if (mem_base != xmlMemBlocks()) {
4269            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4270	           xmlMemBlocks() - mem_base);
4271	    test_ret++;
4272            printf(" %d", n_ctx);
4273            printf(" %d", n_name);
4274            printf("\n");
4275        }
4276    }
4277    }
4278    function_tests++;
4279
4280    return(test_ret);
4281}
4282
4283
4284static int
4285test_xmlSAX2GetLineNumber(void) {
4286    int test_ret = 0;
4287
4288    int mem_base;
4289    int ret_val;
4290    void * ctx; /* the user data (XML parser context) */
4291    int n_ctx;
4292
4293    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4294        mem_base = xmlMemBlocks();
4295        ctx = gen_void_ptr(n_ctx, 0);
4296
4297        ret_val = xmlSAX2GetLineNumber(ctx);
4298        desret_int(ret_val);
4299        call_tests++;
4300        des_void_ptr(n_ctx, ctx, 0);
4301        xmlResetLastError();
4302        if (mem_base != xmlMemBlocks()) {
4303            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4304	           xmlMemBlocks() - mem_base);
4305	    test_ret++;
4306            printf(" %d", n_ctx);
4307            printf("\n");
4308        }
4309    }
4310    function_tests++;
4311
4312    return(test_ret);
4313}
4314
4315
4316static int
4317test_xmlSAX2GetParameterEntity(void) {
4318    int test_ret = 0;
4319
4320    int mem_base;
4321    xmlEntityPtr ret_val;
4322    void * ctx; /* the user data (XML parser context) */
4323    int n_ctx;
4324    xmlChar * name; /* The entity name */
4325    int n_name;
4326
4327    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4328    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4329        mem_base = xmlMemBlocks();
4330        ctx = gen_void_ptr(n_ctx, 0);
4331        name = gen_const_xmlChar_ptr(n_name, 1);
4332
4333        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4334        desret_xmlEntityPtr(ret_val);
4335        call_tests++;
4336        des_void_ptr(n_ctx, ctx, 0);
4337        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4338        xmlResetLastError();
4339        if (mem_base != xmlMemBlocks()) {
4340            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4341	           xmlMemBlocks() - mem_base);
4342	    test_ret++;
4343            printf(" %d", n_ctx);
4344            printf(" %d", n_name);
4345            printf("\n");
4346        }
4347    }
4348    }
4349    function_tests++;
4350
4351    return(test_ret);
4352}
4353
4354
4355static int
4356test_xmlSAX2GetPublicId(void) {
4357    int test_ret = 0;
4358
4359    int mem_base;
4360    const xmlChar * ret_val;
4361    void * ctx; /* the user data (XML parser context) */
4362    int n_ctx;
4363
4364    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4365        mem_base = xmlMemBlocks();
4366        ctx = gen_void_ptr(n_ctx, 0);
4367
4368        ret_val = xmlSAX2GetPublicId(ctx);
4369        desret_const_xmlChar_ptr(ret_val);
4370        call_tests++;
4371        des_void_ptr(n_ctx, ctx, 0);
4372        xmlResetLastError();
4373        if (mem_base != xmlMemBlocks()) {
4374            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4375	           xmlMemBlocks() - mem_base);
4376	    test_ret++;
4377            printf(" %d", n_ctx);
4378            printf("\n");
4379        }
4380    }
4381    function_tests++;
4382
4383    return(test_ret);
4384}
4385
4386
4387static int
4388test_xmlSAX2GetSystemId(void) {
4389    int test_ret = 0;
4390
4391    int mem_base;
4392    const xmlChar * ret_val;
4393    void * ctx; /* the user data (XML parser context) */
4394    int n_ctx;
4395
4396    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4397        mem_base = xmlMemBlocks();
4398        ctx = gen_void_ptr(n_ctx, 0);
4399
4400        ret_val = xmlSAX2GetSystemId(ctx);
4401        desret_const_xmlChar_ptr(ret_val);
4402        call_tests++;
4403        des_void_ptr(n_ctx, ctx, 0);
4404        xmlResetLastError();
4405        if (mem_base != xmlMemBlocks()) {
4406            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4407	           xmlMemBlocks() - mem_base);
4408	    test_ret++;
4409            printf(" %d", n_ctx);
4410            printf("\n");
4411        }
4412    }
4413    function_tests++;
4414
4415    return(test_ret);
4416}
4417
4418
4419static int
4420test_xmlSAX2HasExternalSubset(void) {
4421    int test_ret = 0;
4422
4423    int mem_base;
4424    int ret_val;
4425    void * ctx; /* the user data (XML parser context) */
4426    int n_ctx;
4427
4428    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4429        mem_base = xmlMemBlocks();
4430        ctx = gen_void_ptr(n_ctx, 0);
4431
4432        ret_val = xmlSAX2HasExternalSubset(ctx);
4433        desret_int(ret_val);
4434        call_tests++;
4435        des_void_ptr(n_ctx, ctx, 0);
4436        xmlResetLastError();
4437        if (mem_base != xmlMemBlocks()) {
4438            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4439	           xmlMemBlocks() - mem_base);
4440	    test_ret++;
4441            printf(" %d", n_ctx);
4442            printf("\n");
4443        }
4444    }
4445    function_tests++;
4446
4447    return(test_ret);
4448}
4449
4450
4451static int
4452test_xmlSAX2HasInternalSubset(void) {
4453    int test_ret = 0;
4454
4455    int mem_base;
4456    int ret_val;
4457    void * ctx; /* the user data (XML parser context) */
4458    int n_ctx;
4459
4460    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4461        mem_base = xmlMemBlocks();
4462        ctx = gen_void_ptr(n_ctx, 0);
4463
4464        ret_val = xmlSAX2HasInternalSubset(ctx);
4465        desret_int(ret_val);
4466        call_tests++;
4467        des_void_ptr(n_ctx, ctx, 0);
4468        xmlResetLastError();
4469        if (mem_base != xmlMemBlocks()) {
4470            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4471	           xmlMemBlocks() - mem_base);
4472	    test_ret++;
4473            printf(" %d", n_ctx);
4474            printf("\n");
4475        }
4476    }
4477    function_tests++;
4478
4479    return(test_ret);
4480}
4481
4482
4483static int
4484test_xmlSAX2IgnorableWhitespace(void) {
4485    int test_ret = 0;
4486
4487    int mem_base;
4488    void * ctx; /* the user data (XML parser context) */
4489    int n_ctx;
4490    xmlChar * ch; /* a xmlChar string */
4491    int n_ch;
4492    int len; /* the number of xmlChar */
4493    int n_len;
4494
4495    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4496    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4497    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4498        mem_base = xmlMemBlocks();
4499        ctx = gen_void_ptr(n_ctx, 0);
4500        ch = gen_const_xmlChar_ptr(n_ch, 1);
4501        len = gen_int(n_len, 2);
4502
4503        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4504        call_tests++;
4505        des_void_ptr(n_ctx, ctx, 0);
4506        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4507        des_int(n_len, len, 2);
4508        xmlResetLastError();
4509        if (mem_base != xmlMemBlocks()) {
4510            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4511	           xmlMemBlocks() - mem_base);
4512	    test_ret++;
4513            printf(" %d", n_ctx);
4514            printf(" %d", n_ch);
4515            printf(" %d", n_len);
4516            printf("\n");
4517        }
4518    }
4519    }
4520    }
4521    function_tests++;
4522
4523    return(test_ret);
4524}
4525
4526
4527#define gen_nb_xmlSAXHandler_ptr 1
4528static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4529    return(NULL);
4530}
4531static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4532}
4533
4534static int
4535test_xmlSAX2InitDefaultSAXHandler(void) {
4536    int test_ret = 0;
4537
4538    int mem_base;
4539    xmlSAXHandler * hdlr; /* the SAX handler */
4540    int n_hdlr;
4541    int warning; /* flag if non-zero sets the handler warning procedure */
4542    int n_warning;
4543
4544    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4545    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4546        mem_base = xmlMemBlocks();
4547        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4548        warning = gen_int(n_warning, 1);
4549
4550        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4551        call_tests++;
4552        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4553        des_int(n_warning, warning, 1);
4554        xmlResetLastError();
4555        if (mem_base != xmlMemBlocks()) {
4556            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4557	           xmlMemBlocks() - mem_base);
4558	    test_ret++;
4559            printf(" %d", n_hdlr);
4560            printf(" %d", n_warning);
4561            printf("\n");
4562        }
4563    }
4564    }
4565    function_tests++;
4566
4567    return(test_ret);
4568}
4569
4570
4571static int
4572test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4573    int test_ret = 0;
4574
4575#if defined(LIBXML_DOCB_ENABLED)
4576    int mem_base;
4577    xmlSAXHandler * hdlr; /* the SAX handler */
4578    int n_hdlr;
4579
4580    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4581        mem_base = xmlMemBlocks();
4582        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4583
4584        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4585        call_tests++;
4586        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4587        xmlResetLastError();
4588        if (mem_base != xmlMemBlocks()) {
4589            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4590	           xmlMemBlocks() - mem_base);
4591	    test_ret++;
4592            printf(" %d", n_hdlr);
4593            printf("\n");
4594        }
4595    }
4596    function_tests++;
4597#endif
4598
4599    return(test_ret);
4600}
4601
4602
4603static int
4604test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4605    int test_ret = 0;
4606
4607#if defined(LIBXML_HTML_ENABLED)
4608    int mem_base;
4609    xmlSAXHandler * hdlr; /* the SAX handler */
4610    int n_hdlr;
4611
4612    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4613        mem_base = xmlMemBlocks();
4614        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4615
4616        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4617        call_tests++;
4618        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4619        xmlResetLastError();
4620        if (mem_base != xmlMemBlocks()) {
4621            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4622	           xmlMemBlocks() - mem_base);
4623	    test_ret++;
4624            printf(" %d", n_hdlr);
4625            printf("\n");
4626        }
4627    }
4628    function_tests++;
4629#endif
4630
4631    return(test_ret);
4632}
4633
4634
4635static int
4636test_xmlSAX2InternalSubset(void) {
4637    int test_ret = 0;
4638
4639    int mem_base;
4640    void * ctx; /* the user data (XML parser context) */
4641    int n_ctx;
4642    xmlChar * name; /* the root element name */
4643    int n_name;
4644    xmlChar * ExternalID; /* the external ID */
4645    int n_ExternalID;
4646    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4647    int n_SystemID;
4648
4649    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4650    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4651    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4652    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4653        mem_base = xmlMemBlocks();
4654        ctx = gen_void_ptr(n_ctx, 0);
4655        name = gen_const_xmlChar_ptr(n_name, 1);
4656        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4657        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4658
4659        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4660        call_tests++;
4661        des_void_ptr(n_ctx, ctx, 0);
4662        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4663        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4664        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4665        xmlResetLastError();
4666        if (mem_base != xmlMemBlocks()) {
4667            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4668	           xmlMemBlocks() - mem_base);
4669	    test_ret++;
4670            printf(" %d", n_ctx);
4671            printf(" %d", n_name);
4672            printf(" %d", n_ExternalID);
4673            printf(" %d", n_SystemID);
4674            printf("\n");
4675        }
4676    }
4677    }
4678    }
4679    }
4680    function_tests++;
4681
4682    return(test_ret);
4683}
4684
4685
4686static int
4687test_xmlSAX2IsStandalone(void) {
4688    int test_ret = 0;
4689
4690    int mem_base;
4691    int ret_val;
4692    void * ctx; /* the user data (XML parser context) */
4693    int n_ctx;
4694
4695    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4696        mem_base = xmlMemBlocks();
4697        ctx = gen_void_ptr(n_ctx, 0);
4698
4699        ret_val = xmlSAX2IsStandalone(ctx);
4700        desret_int(ret_val);
4701        call_tests++;
4702        des_void_ptr(n_ctx, ctx, 0);
4703        xmlResetLastError();
4704        if (mem_base != xmlMemBlocks()) {
4705            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4706	           xmlMemBlocks() - mem_base);
4707	    test_ret++;
4708            printf(" %d", n_ctx);
4709            printf("\n");
4710        }
4711    }
4712    function_tests++;
4713
4714    return(test_ret);
4715}
4716
4717
4718static int
4719test_xmlSAX2NotationDecl(void) {
4720    int test_ret = 0;
4721
4722    int mem_base;
4723    void * ctx; /* the user data (XML parser context) */
4724    int n_ctx;
4725    xmlChar * name; /* The name of the notation */
4726    int n_name;
4727    xmlChar * publicId; /* The public ID of the entity */
4728    int n_publicId;
4729    xmlChar * systemId; /* The system ID of the entity */
4730    int n_systemId;
4731
4732    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4733    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4734    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4735    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4736        mem_base = xmlMemBlocks();
4737        ctx = gen_void_ptr(n_ctx, 0);
4738        name = gen_const_xmlChar_ptr(n_name, 1);
4739        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4740        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4741
4742        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4743        call_tests++;
4744        des_void_ptr(n_ctx, ctx, 0);
4745        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4746        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4747        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4748        xmlResetLastError();
4749        if (mem_base != xmlMemBlocks()) {
4750            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4751	           xmlMemBlocks() - mem_base);
4752	    test_ret++;
4753            printf(" %d", n_ctx);
4754            printf(" %d", n_name);
4755            printf(" %d", n_publicId);
4756            printf(" %d", n_systemId);
4757            printf("\n");
4758        }
4759    }
4760    }
4761    }
4762    }
4763    function_tests++;
4764
4765    return(test_ret);
4766}
4767
4768
4769static int
4770test_xmlSAX2ProcessingInstruction(void) {
4771    int test_ret = 0;
4772
4773    int mem_base;
4774    void * ctx; /* the user data (XML parser context) */
4775    int n_ctx;
4776    xmlChar * target; /* the target name */
4777    int n_target;
4778    xmlChar * data; /* the PI data's */
4779    int n_data;
4780
4781    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4782    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4783    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4784        mem_base = xmlMemBlocks();
4785        ctx = gen_void_ptr(n_ctx, 0);
4786        target = gen_const_xmlChar_ptr(n_target, 1);
4787        data = gen_const_xmlChar_ptr(n_data, 2);
4788
4789        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4790        call_tests++;
4791        des_void_ptr(n_ctx, ctx, 0);
4792        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4793        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4794        xmlResetLastError();
4795        if (mem_base != xmlMemBlocks()) {
4796            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4797	           xmlMemBlocks() - mem_base);
4798	    test_ret++;
4799            printf(" %d", n_ctx);
4800            printf(" %d", n_target);
4801            printf(" %d", n_data);
4802            printf("\n");
4803        }
4804    }
4805    }
4806    }
4807    function_tests++;
4808
4809    return(test_ret);
4810}
4811
4812
4813static int
4814test_xmlSAX2Reference(void) {
4815    int test_ret = 0;
4816
4817    int mem_base;
4818    void * ctx; /* the user data (XML parser context) */
4819    int n_ctx;
4820    xmlChar * name; /* The entity name */
4821    int n_name;
4822
4823    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4824    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4825        mem_base = xmlMemBlocks();
4826        ctx = gen_void_ptr(n_ctx, 0);
4827        name = gen_const_xmlChar_ptr(n_name, 1);
4828
4829        xmlSAX2Reference(ctx, (const xmlChar *)name);
4830        call_tests++;
4831        des_void_ptr(n_ctx, ctx, 0);
4832        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4833        xmlResetLastError();
4834        if (mem_base != xmlMemBlocks()) {
4835            printf("Leak of %d blocks found in xmlSAX2Reference",
4836	           xmlMemBlocks() - mem_base);
4837	    test_ret++;
4838            printf(" %d", n_ctx);
4839            printf(" %d", n_name);
4840            printf("\n");
4841        }
4842    }
4843    }
4844    function_tests++;
4845
4846    return(test_ret);
4847}
4848
4849
4850static int
4851test_xmlSAX2ResolveEntity(void) {
4852    int test_ret = 0;
4853
4854    int mem_base;
4855    xmlParserInputPtr ret_val;
4856    void * ctx; /* the user data (XML parser context) */
4857    int n_ctx;
4858    xmlChar * publicId; /* The public ID of the entity */
4859    int n_publicId;
4860    xmlChar * systemId; /* The system ID of the entity */
4861    int n_systemId;
4862
4863    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4864    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4865    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4866        mem_base = xmlMemBlocks();
4867        ctx = gen_void_ptr(n_ctx, 0);
4868        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4869        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4870
4871        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4872        desret_xmlParserInputPtr(ret_val);
4873        call_tests++;
4874        des_void_ptr(n_ctx, ctx, 0);
4875        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4876        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4877        xmlResetLastError();
4878        if (mem_base != xmlMemBlocks()) {
4879            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4880	           xmlMemBlocks() - mem_base);
4881	    test_ret++;
4882            printf(" %d", n_ctx);
4883            printf(" %d", n_publicId);
4884            printf(" %d", n_systemId);
4885            printf("\n");
4886        }
4887    }
4888    }
4889    }
4890    function_tests++;
4891
4892    return(test_ret);
4893}
4894
4895
4896#define gen_nb_xmlSAXLocatorPtr 1
4897static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4898    return(NULL);
4899}
4900static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4901}
4902
4903static int
4904test_xmlSAX2SetDocumentLocator(void) {
4905    int test_ret = 0;
4906
4907    int mem_base;
4908    void * ctx; /* the user data (XML parser context) */
4909    int n_ctx;
4910    xmlSAXLocatorPtr loc; /* A SAX Locator */
4911    int n_loc;
4912
4913    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4914    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4915        mem_base = xmlMemBlocks();
4916        ctx = gen_void_ptr(n_ctx, 0);
4917        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4918
4919        xmlSAX2SetDocumentLocator(ctx, loc);
4920        call_tests++;
4921        des_void_ptr(n_ctx, ctx, 0);
4922        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4923        xmlResetLastError();
4924        if (mem_base != xmlMemBlocks()) {
4925            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4926	           xmlMemBlocks() - mem_base);
4927	    test_ret++;
4928            printf(" %d", n_ctx);
4929            printf(" %d", n_loc);
4930            printf("\n");
4931        }
4932    }
4933    }
4934    function_tests++;
4935
4936    return(test_ret);
4937}
4938
4939
4940static int
4941test_xmlSAX2StartDocument(void) {
4942    int test_ret = 0;
4943
4944    int mem_base;
4945    void * ctx; /* the user data (XML parser context) */
4946    int n_ctx;
4947
4948    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4949        mem_base = xmlMemBlocks();
4950        ctx = gen_void_ptr(n_ctx, 0);
4951
4952        xmlSAX2StartDocument(ctx);
4953        call_tests++;
4954        des_void_ptr(n_ctx, ctx, 0);
4955        xmlResetLastError();
4956        if (mem_base != xmlMemBlocks()) {
4957            printf("Leak of %d blocks found in xmlSAX2StartDocument",
4958	           xmlMemBlocks() - mem_base);
4959	    test_ret++;
4960            printf(" %d", n_ctx);
4961            printf("\n");
4962        }
4963    }
4964    function_tests++;
4965
4966    return(test_ret);
4967}
4968
4969
4970static int
4971test_xmlSAX2StartElement(void) {
4972    int test_ret = 0;
4973
4974#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4975#ifdef LIBXML_SAX1_ENABLED
4976    int mem_base;
4977    void * ctx; /* the user data (XML parser context) */
4978    int n_ctx;
4979    xmlChar * fullname; /* The element name, including namespace prefix */
4980    int n_fullname;
4981    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
4982    int n_atts;
4983
4984    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4985    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
4986    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
4987        mem_base = xmlMemBlocks();
4988        ctx = gen_void_ptr(n_ctx, 0);
4989        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
4990        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
4991
4992        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
4993        call_tests++;
4994        des_void_ptr(n_ctx, ctx, 0);
4995        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
4996        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
4997        xmlResetLastError();
4998        if (mem_base != xmlMemBlocks()) {
4999            printf("Leak of %d blocks found in xmlSAX2StartElement",
5000	           xmlMemBlocks() - mem_base);
5001	    test_ret++;
5002            printf(" %d", n_ctx);
5003            printf(" %d", n_fullname);
5004            printf(" %d", n_atts);
5005            printf("\n");
5006        }
5007    }
5008    }
5009    }
5010    function_tests++;
5011#endif
5012#endif
5013
5014    return(test_ret);
5015}
5016
5017
5018static int
5019test_xmlSAX2StartElementNs(void) {
5020    int test_ret = 0;
5021
5022    int mem_base;
5023    void * ctx; /* the user data (XML parser context) */
5024    int n_ctx;
5025    xmlChar * localname; /* the local name of the element */
5026    int n_localname;
5027    xmlChar * prefix; /* the element namespace prefix if available */
5028    int n_prefix;
5029    xmlChar * URI; /* the element namespace name if available */
5030    int n_URI;
5031    int nb_namespaces; /* number of namespace definitions on that node */
5032    int n_nb_namespaces;
5033    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5034    int n_namespaces;
5035    int nb_attributes; /* the number of attributes on that node */
5036    int n_nb_attributes;
5037    int nb_defaulted; /* the number of defaulted attributes. */
5038    int n_nb_defaulted;
5039    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5040    int n_attributes;
5041
5042    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5043    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5044    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5045    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5046    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5047    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5048    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5049    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5050    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5051        mem_base = xmlMemBlocks();
5052        ctx = gen_void_ptr(n_ctx, 0);
5053        localname = gen_const_xmlChar_ptr(n_localname, 1);
5054        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5055        URI = gen_const_xmlChar_ptr(n_URI, 3);
5056        nb_namespaces = gen_int(n_nb_namespaces, 4);
5057        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5058        nb_attributes = gen_int(n_nb_attributes, 6);
5059        nb_defaulted = gen_int(n_nb_defaulted, 7);
5060        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5061
5062        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5063        call_tests++;
5064        des_void_ptr(n_ctx, ctx, 0);
5065        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5066        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5067        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5068        des_int(n_nb_namespaces, nb_namespaces, 4);
5069        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5070        des_int(n_nb_attributes, nb_attributes, 6);
5071        des_int(n_nb_defaulted, nb_defaulted, 7);
5072        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5073        xmlResetLastError();
5074        if (mem_base != xmlMemBlocks()) {
5075            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5076	           xmlMemBlocks() - mem_base);
5077	    test_ret++;
5078            printf(" %d", n_ctx);
5079            printf(" %d", n_localname);
5080            printf(" %d", n_prefix);
5081            printf(" %d", n_URI);
5082            printf(" %d", n_nb_namespaces);
5083            printf(" %d", n_namespaces);
5084            printf(" %d", n_nb_attributes);
5085            printf(" %d", n_nb_defaulted);
5086            printf(" %d", n_attributes);
5087            printf("\n");
5088        }
5089    }
5090    }
5091    }
5092    }
5093    }
5094    }
5095    }
5096    }
5097    }
5098    function_tests++;
5099
5100    return(test_ret);
5101}
5102
5103
5104static int
5105test_xmlSAX2UnparsedEntityDecl(void) {
5106    int test_ret = 0;
5107
5108    int mem_base;
5109    void * ctx; /* the user data (XML parser context) */
5110    int n_ctx;
5111    xmlChar * name; /* The name of the entity */
5112    int n_name;
5113    xmlChar * publicId; /* The public ID of the entity */
5114    int n_publicId;
5115    xmlChar * systemId; /* The system ID of the entity */
5116    int n_systemId;
5117    xmlChar * notationName; /* the name of the notation */
5118    int n_notationName;
5119
5120    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5121    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5122    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5123    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5124    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5125        mem_base = xmlMemBlocks();
5126        ctx = gen_void_ptr(n_ctx, 0);
5127        name = gen_const_xmlChar_ptr(n_name, 1);
5128        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5129        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5130        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5131
5132        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5133        call_tests++;
5134        des_void_ptr(n_ctx, ctx, 0);
5135        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5136        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5137        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5138        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5139        xmlResetLastError();
5140        if (mem_base != xmlMemBlocks()) {
5141            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5142	           xmlMemBlocks() - mem_base);
5143	    test_ret++;
5144            printf(" %d", n_ctx);
5145            printf(" %d", n_name);
5146            printf(" %d", n_publicId);
5147            printf(" %d", n_systemId);
5148            printf(" %d", n_notationName);
5149            printf("\n");
5150        }
5151    }
5152    }
5153    }
5154    }
5155    }
5156    function_tests++;
5157
5158    return(test_ret);
5159}
5160
5161
5162static int
5163test_xmlSAXDefaultVersion(void) {
5164    int test_ret = 0;
5165
5166#if defined(LIBXML_SAX1_ENABLED)
5167#ifdef LIBXML_SAX1_ENABLED
5168    int mem_base;
5169    int ret_val;
5170    int version; /* the version, 1 or 2 */
5171    int n_version;
5172
5173    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5174        mem_base = xmlMemBlocks();
5175        version = gen_int(n_version, 0);
5176
5177        ret_val = xmlSAXDefaultVersion(version);
5178        desret_int(ret_val);
5179        call_tests++;
5180        des_int(n_version, version, 0);
5181        xmlResetLastError();
5182        if (mem_base != xmlMemBlocks()) {
5183            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5184	           xmlMemBlocks() - mem_base);
5185	    test_ret++;
5186            printf(" %d", n_version);
5187            printf("\n");
5188        }
5189    }
5190    function_tests++;
5191#endif
5192#endif
5193
5194    return(test_ret);
5195}
5196
5197
5198static int
5199test_xmlSAXVersion(void) {
5200    int test_ret = 0;
5201
5202    int mem_base;
5203    int ret_val;
5204    xmlSAXHandler * hdlr; /* the SAX handler */
5205    int n_hdlr;
5206    int version; /* the version, 1 or 2 */
5207    int n_version;
5208
5209    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5210    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5211        mem_base = xmlMemBlocks();
5212        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5213        version = gen_int(n_version, 1);
5214
5215        ret_val = xmlSAXVersion(hdlr, version);
5216        desret_int(ret_val);
5217        call_tests++;
5218        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5219        des_int(n_version, version, 1);
5220        xmlResetLastError();
5221        if (mem_base != xmlMemBlocks()) {
5222            printf("Leak of %d blocks found in xmlSAXVersion",
5223	           xmlMemBlocks() - mem_base);
5224	    test_ret++;
5225            printf(" %d", n_hdlr);
5226            printf(" %d", n_version);
5227            printf("\n");
5228        }
5229    }
5230    }
5231    function_tests++;
5232
5233    return(test_ret);
5234}
5235
5236static int
5237test_SAX2(void) {
5238    int test_ret = 0;
5239
5240    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5241    test_ret += test_docbDefaultSAXHandlerInit();
5242    test_ret += test_htmlDefaultSAXHandlerInit();
5243    test_ret += test_xmlDefaultSAXHandlerInit();
5244    test_ret += test_xmlSAX2AttributeDecl();
5245    test_ret += test_xmlSAX2CDataBlock();
5246    test_ret += test_xmlSAX2Characters();
5247    test_ret += test_xmlSAX2Comment();
5248    test_ret += test_xmlSAX2ElementDecl();
5249    test_ret += test_xmlSAX2EndDocument();
5250    test_ret += test_xmlSAX2EndElement();
5251    test_ret += test_xmlSAX2EndElementNs();
5252    test_ret += test_xmlSAX2EntityDecl();
5253    test_ret += test_xmlSAX2ExternalSubset();
5254    test_ret += test_xmlSAX2GetColumnNumber();
5255    test_ret += test_xmlSAX2GetEntity();
5256    test_ret += test_xmlSAX2GetLineNumber();
5257    test_ret += test_xmlSAX2GetParameterEntity();
5258    test_ret += test_xmlSAX2GetPublicId();
5259    test_ret += test_xmlSAX2GetSystemId();
5260    test_ret += test_xmlSAX2HasExternalSubset();
5261    test_ret += test_xmlSAX2HasInternalSubset();
5262    test_ret += test_xmlSAX2IgnorableWhitespace();
5263    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5264    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5265    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5266    test_ret += test_xmlSAX2InternalSubset();
5267    test_ret += test_xmlSAX2IsStandalone();
5268    test_ret += test_xmlSAX2NotationDecl();
5269    test_ret += test_xmlSAX2ProcessingInstruction();
5270    test_ret += test_xmlSAX2Reference();
5271    test_ret += test_xmlSAX2ResolveEntity();
5272    test_ret += test_xmlSAX2SetDocumentLocator();
5273    test_ret += test_xmlSAX2StartDocument();
5274    test_ret += test_xmlSAX2StartElement();
5275    test_ret += test_xmlSAX2StartElementNs();
5276    test_ret += test_xmlSAX2UnparsedEntityDecl();
5277    test_ret += test_xmlSAXDefaultVersion();
5278    test_ret += test_xmlSAXVersion();
5279
5280    if (test_ret != 0)
5281	printf("Module SAX2: %d errors\n", test_ret);
5282    return(test_ret);
5283}
5284
5285static int
5286test_xmlC14NDocDumpMemory(void) {
5287    int test_ret = 0;
5288
5289#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5290    int mem_base;
5291    int ret_val;
5292    xmlDocPtr doc; /* the XML document for canonization */
5293    int n_doc;
5294    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5295    int n_nodes;
5296    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5297    int n_exclusive;
5298    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) */
5299    int n_inclusive_ns_prefixes;
5300    int with_comments; /* include comments in the result (!=0) or not (==0) */
5301    int n_with_comments;
5302    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 */
5303    int n_doc_txt_ptr;
5304
5305    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5306    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5307    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5308    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5309    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5310    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5311        mem_base = xmlMemBlocks();
5312        doc = gen_xmlDocPtr(n_doc, 0);
5313        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5314        exclusive = gen_int(n_exclusive, 2);
5315        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5316        with_comments = gen_int(n_with_comments, 4);
5317        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5318
5319        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5320        desret_int(ret_val);
5321        call_tests++;
5322        des_xmlDocPtr(n_doc, doc, 0);
5323        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5324        des_int(n_exclusive, exclusive, 2);
5325        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5326        des_int(n_with_comments, with_comments, 4);
5327        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5328        xmlResetLastError();
5329        if (mem_base != xmlMemBlocks()) {
5330            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5331	           xmlMemBlocks() - mem_base);
5332	    test_ret++;
5333            printf(" %d", n_doc);
5334            printf(" %d", n_nodes);
5335            printf(" %d", n_exclusive);
5336            printf(" %d", n_inclusive_ns_prefixes);
5337            printf(" %d", n_with_comments);
5338            printf(" %d", n_doc_txt_ptr);
5339            printf("\n");
5340        }
5341    }
5342    }
5343    }
5344    }
5345    }
5346    }
5347    function_tests++;
5348#endif
5349
5350    return(test_ret);
5351}
5352
5353
5354static int
5355test_xmlC14NDocSave(void) {
5356    int test_ret = 0;
5357
5358#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5359    int mem_base;
5360    int ret_val;
5361    xmlDocPtr doc; /* the XML document for canonization */
5362    int n_doc;
5363    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5364    int n_nodes;
5365    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5366    int n_exclusive;
5367    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) */
5368    int n_inclusive_ns_prefixes;
5369    int with_comments; /* include comments in the result (!=0) or not (==0) */
5370    int n_with_comments;
5371    const char * filename; /* the filename to store canonical XML image */
5372    int n_filename;
5373    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5374    int n_compression;
5375
5376    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5377    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5378    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5379    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5380    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5381    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5382    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5383        mem_base = xmlMemBlocks();
5384        doc = gen_xmlDocPtr(n_doc, 0);
5385        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5386        exclusive = gen_int(n_exclusive, 2);
5387        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5388        with_comments = gen_int(n_with_comments, 4);
5389        filename = gen_fileoutput(n_filename, 5);
5390        compression = gen_int(n_compression, 6);
5391
5392        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5393        desret_int(ret_val);
5394        call_tests++;
5395        des_xmlDocPtr(n_doc, doc, 0);
5396        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5397        des_int(n_exclusive, exclusive, 2);
5398        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5399        des_int(n_with_comments, with_comments, 4);
5400        des_fileoutput(n_filename, filename, 5);
5401        des_int(n_compression, compression, 6);
5402        xmlResetLastError();
5403        if (mem_base != xmlMemBlocks()) {
5404            printf("Leak of %d blocks found in xmlC14NDocSave",
5405	           xmlMemBlocks() - mem_base);
5406	    test_ret++;
5407            printf(" %d", n_doc);
5408            printf(" %d", n_nodes);
5409            printf(" %d", n_exclusive);
5410            printf(" %d", n_inclusive_ns_prefixes);
5411            printf(" %d", n_with_comments);
5412            printf(" %d", n_filename);
5413            printf(" %d", n_compression);
5414            printf("\n");
5415        }
5416    }
5417    }
5418    }
5419    }
5420    }
5421    }
5422    }
5423    function_tests++;
5424#endif
5425
5426    return(test_ret);
5427}
5428
5429
5430static int
5431test_xmlC14NDocSaveTo(void) {
5432    int test_ret = 0;
5433
5434#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5435    int mem_base;
5436    int ret_val;
5437    xmlDocPtr doc; /* the XML document for canonization */
5438    int n_doc;
5439    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5440    int n_nodes;
5441    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5442    int n_exclusive;
5443    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) */
5444    int n_inclusive_ns_prefixes;
5445    int with_comments; /* include comments in the result (!=0) or not (==0) */
5446    int n_with_comments;
5447    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5448    int n_buf;
5449
5450    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5451    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5452    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5453    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5454    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5455    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5456        mem_base = xmlMemBlocks();
5457        doc = gen_xmlDocPtr(n_doc, 0);
5458        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5459        exclusive = gen_int(n_exclusive, 2);
5460        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5461        with_comments = gen_int(n_with_comments, 4);
5462        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5463
5464        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5465        desret_int(ret_val);
5466        call_tests++;
5467        des_xmlDocPtr(n_doc, doc, 0);
5468        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5469        des_int(n_exclusive, exclusive, 2);
5470        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5471        des_int(n_with_comments, with_comments, 4);
5472        des_xmlOutputBufferPtr(n_buf, buf, 5);
5473        xmlResetLastError();
5474        if (mem_base != xmlMemBlocks()) {
5475            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5476	           xmlMemBlocks() - mem_base);
5477	    test_ret++;
5478            printf(" %d", n_doc);
5479            printf(" %d", n_nodes);
5480            printf(" %d", n_exclusive);
5481            printf(" %d", n_inclusive_ns_prefixes);
5482            printf(" %d", n_with_comments);
5483            printf(" %d", n_buf);
5484            printf("\n");
5485        }
5486    }
5487    }
5488    }
5489    }
5490    }
5491    }
5492    function_tests++;
5493#endif
5494
5495    return(test_ret);
5496}
5497
5498
5499static int
5500test_xmlC14NExecute(void) {
5501    int test_ret = 0;
5502
5503
5504    /* missing type support */
5505    return(test_ret);
5506}
5507
5508static int
5509test_c14n(void) {
5510    int test_ret = 0;
5511
5512    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5513    test_ret += test_xmlC14NDocDumpMemory();
5514    test_ret += test_xmlC14NDocSave();
5515    test_ret += test_xmlC14NDocSaveTo();
5516    test_ret += test_xmlC14NExecute();
5517
5518    if (test_ret != 0)
5519	printf("Module c14n: %d errors\n", test_ret);
5520    return(test_ret);
5521}
5522#ifdef LIBXML_CATALOG_ENABLED
5523
5524#define gen_nb_xmlCatalogPtr 1
5525static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5526    return(NULL);
5527}
5528static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5529}
5530#endif
5531
5532
5533static int
5534test_xmlACatalogAdd(void) {
5535    int test_ret = 0;
5536
5537#if defined(LIBXML_CATALOG_ENABLED)
5538    int mem_base;
5539    int ret_val;
5540    xmlCatalogPtr catal; /* a Catalog */
5541    int n_catal;
5542    xmlChar * type; /* the type of record to add to the catalog */
5543    int n_type;
5544    xmlChar * orig; /* the system, public or prefix to match */
5545    int n_orig;
5546    xmlChar * replace; /* the replacement value for the match */
5547    int n_replace;
5548
5549    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5550    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5551    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5552    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5553        mem_base = xmlMemBlocks();
5554        catal = gen_xmlCatalogPtr(n_catal, 0);
5555        type = gen_const_xmlChar_ptr(n_type, 1);
5556        orig = gen_const_xmlChar_ptr(n_orig, 2);
5557        replace = gen_const_xmlChar_ptr(n_replace, 3);
5558
5559        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5560        desret_int(ret_val);
5561        call_tests++;
5562        des_xmlCatalogPtr(n_catal, catal, 0);
5563        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5564        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5565        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5566        xmlResetLastError();
5567        if (mem_base != xmlMemBlocks()) {
5568            printf("Leak of %d blocks found in xmlACatalogAdd",
5569	           xmlMemBlocks() - mem_base);
5570	    test_ret++;
5571            printf(" %d", n_catal);
5572            printf(" %d", n_type);
5573            printf(" %d", n_orig);
5574            printf(" %d", n_replace);
5575            printf("\n");
5576        }
5577    }
5578    }
5579    }
5580    }
5581    function_tests++;
5582#endif
5583
5584    return(test_ret);
5585}
5586
5587
5588static int
5589test_xmlACatalogDump(void) {
5590    int test_ret = 0;
5591
5592#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5593    int mem_base;
5594    xmlCatalogPtr catal; /* a Catalog */
5595    int n_catal;
5596    FILE * out; /* the file. */
5597    int n_out;
5598
5599    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5600    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5601        mem_base = xmlMemBlocks();
5602        catal = gen_xmlCatalogPtr(n_catal, 0);
5603        out = gen_FILE_ptr(n_out, 1);
5604
5605        xmlACatalogDump(catal, out);
5606        call_tests++;
5607        des_xmlCatalogPtr(n_catal, catal, 0);
5608        des_FILE_ptr(n_out, out, 1);
5609        xmlResetLastError();
5610        if (mem_base != xmlMemBlocks()) {
5611            printf("Leak of %d blocks found in xmlACatalogDump",
5612	           xmlMemBlocks() - mem_base);
5613	    test_ret++;
5614            printf(" %d", n_catal);
5615            printf(" %d", n_out);
5616            printf("\n");
5617        }
5618    }
5619    }
5620    function_tests++;
5621#endif
5622
5623    return(test_ret);
5624}
5625
5626
5627static int
5628test_xmlACatalogRemove(void) {
5629    int test_ret = 0;
5630
5631#if defined(LIBXML_CATALOG_ENABLED)
5632    int mem_base;
5633    int ret_val;
5634    xmlCatalogPtr catal; /* a Catalog */
5635    int n_catal;
5636    xmlChar * value; /* the value to remove */
5637    int n_value;
5638
5639    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5640    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5641        mem_base = xmlMemBlocks();
5642        catal = gen_xmlCatalogPtr(n_catal, 0);
5643        value = gen_const_xmlChar_ptr(n_value, 1);
5644
5645        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5646        desret_int(ret_val);
5647        call_tests++;
5648        des_xmlCatalogPtr(n_catal, catal, 0);
5649        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5650        xmlResetLastError();
5651        if (mem_base != xmlMemBlocks()) {
5652            printf("Leak of %d blocks found in xmlACatalogRemove",
5653	           xmlMemBlocks() - mem_base);
5654	    test_ret++;
5655            printf(" %d", n_catal);
5656            printf(" %d", n_value);
5657            printf("\n");
5658        }
5659    }
5660    }
5661    function_tests++;
5662#endif
5663
5664    return(test_ret);
5665}
5666
5667
5668static int
5669test_xmlACatalogResolve(void) {
5670    int test_ret = 0;
5671
5672#if defined(LIBXML_CATALOG_ENABLED)
5673    int mem_base;
5674    xmlChar * ret_val;
5675    xmlCatalogPtr catal; /* a Catalog */
5676    int n_catal;
5677    xmlChar * pubID; /* the public ID string */
5678    int n_pubID;
5679    xmlChar * sysID; /* the system ID string */
5680    int n_sysID;
5681
5682    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5683    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5684    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5685        mem_base = xmlMemBlocks();
5686        catal = gen_xmlCatalogPtr(n_catal, 0);
5687        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5688        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5689
5690        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5691        desret_xmlChar_ptr(ret_val);
5692        call_tests++;
5693        des_xmlCatalogPtr(n_catal, catal, 0);
5694        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5695        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5696        xmlResetLastError();
5697        if (mem_base != xmlMemBlocks()) {
5698            printf("Leak of %d blocks found in xmlACatalogResolve",
5699	           xmlMemBlocks() - mem_base);
5700	    test_ret++;
5701            printf(" %d", n_catal);
5702            printf(" %d", n_pubID);
5703            printf(" %d", n_sysID);
5704            printf("\n");
5705        }
5706    }
5707    }
5708    }
5709    function_tests++;
5710#endif
5711
5712    return(test_ret);
5713}
5714
5715
5716static int
5717test_xmlACatalogResolvePublic(void) {
5718    int test_ret = 0;
5719
5720#if defined(LIBXML_CATALOG_ENABLED)
5721    int mem_base;
5722    xmlChar * ret_val;
5723    xmlCatalogPtr catal; /* a Catalog */
5724    int n_catal;
5725    xmlChar * pubID; /* the public ID string */
5726    int n_pubID;
5727
5728    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5729    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5730        mem_base = xmlMemBlocks();
5731        catal = gen_xmlCatalogPtr(n_catal, 0);
5732        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5733
5734        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5735        desret_xmlChar_ptr(ret_val);
5736        call_tests++;
5737        des_xmlCatalogPtr(n_catal, catal, 0);
5738        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5739        xmlResetLastError();
5740        if (mem_base != xmlMemBlocks()) {
5741            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5742	           xmlMemBlocks() - mem_base);
5743	    test_ret++;
5744            printf(" %d", n_catal);
5745            printf(" %d", n_pubID);
5746            printf("\n");
5747        }
5748    }
5749    }
5750    function_tests++;
5751#endif
5752
5753    return(test_ret);
5754}
5755
5756
5757static int
5758test_xmlACatalogResolveSystem(void) {
5759    int test_ret = 0;
5760
5761#if defined(LIBXML_CATALOG_ENABLED)
5762    int mem_base;
5763    xmlChar * ret_val;
5764    xmlCatalogPtr catal; /* a Catalog */
5765    int n_catal;
5766    xmlChar * sysID; /* the system ID string */
5767    int n_sysID;
5768
5769    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5770    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5771        mem_base = xmlMemBlocks();
5772        catal = gen_xmlCatalogPtr(n_catal, 0);
5773        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5774
5775        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5776        desret_xmlChar_ptr(ret_val);
5777        call_tests++;
5778        des_xmlCatalogPtr(n_catal, catal, 0);
5779        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5780        xmlResetLastError();
5781        if (mem_base != xmlMemBlocks()) {
5782            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5783	           xmlMemBlocks() - mem_base);
5784	    test_ret++;
5785            printf(" %d", n_catal);
5786            printf(" %d", n_sysID);
5787            printf("\n");
5788        }
5789    }
5790    }
5791    function_tests++;
5792#endif
5793
5794    return(test_ret);
5795}
5796
5797
5798static int
5799test_xmlACatalogResolveURI(void) {
5800    int test_ret = 0;
5801
5802#if defined(LIBXML_CATALOG_ENABLED)
5803    int mem_base;
5804    xmlChar * ret_val;
5805    xmlCatalogPtr catal; /* a Catalog */
5806    int n_catal;
5807    xmlChar * URI; /* the URI */
5808    int n_URI;
5809
5810    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5811    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5812        mem_base = xmlMemBlocks();
5813        catal = gen_xmlCatalogPtr(n_catal, 0);
5814        URI = gen_const_xmlChar_ptr(n_URI, 1);
5815
5816        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5817        desret_xmlChar_ptr(ret_val);
5818        call_tests++;
5819        des_xmlCatalogPtr(n_catal, catal, 0);
5820        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5821        xmlResetLastError();
5822        if (mem_base != xmlMemBlocks()) {
5823            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5824	           xmlMemBlocks() - mem_base);
5825	    test_ret++;
5826            printf(" %d", n_catal);
5827            printf(" %d", n_URI);
5828            printf("\n");
5829        }
5830    }
5831    }
5832    function_tests++;
5833#endif
5834
5835    return(test_ret);
5836}
5837
5838
5839static int
5840test_xmlCatalogAdd(void) {
5841    int test_ret = 0;
5842
5843#if defined(LIBXML_CATALOG_ENABLED)
5844    int mem_base;
5845    int ret_val;
5846    xmlChar * type; /* the type of record to add to the catalog */
5847    int n_type;
5848    xmlChar * orig; /* the system, public or prefix to match */
5849    int n_orig;
5850    xmlChar * replace; /* the replacement value for the match */
5851    int n_replace;
5852
5853    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5854    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5855    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5856        mem_base = xmlMemBlocks();
5857        type = gen_const_xmlChar_ptr(n_type, 0);
5858        orig = gen_const_xmlChar_ptr(n_orig, 1);
5859        replace = gen_const_xmlChar_ptr(n_replace, 2);
5860
5861        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5862        desret_int(ret_val);
5863        call_tests++;
5864        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5865        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5866        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5867        xmlResetLastError();
5868        if (mem_base != xmlMemBlocks()) {
5869            printf("Leak of %d blocks found in xmlCatalogAdd",
5870	           xmlMemBlocks() - mem_base);
5871	    test_ret++;
5872            printf(" %d", n_type);
5873            printf(" %d", n_orig);
5874            printf(" %d", n_replace);
5875            printf("\n");
5876        }
5877    }
5878    }
5879    }
5880    function_tests++;
5881#endif
5882
5883    return(test_ret);
5884}
5885
5886
5887static int
5888test_xmlCatalogCleanup(void) {
5889    int test_ret = 0;
5890
5891#if defined(LIBXML_CATALOG_ENABLED)
5892
5893
5894        xmlCatalogCleanup();
5895        call_tests++;
5896        xmlResetLastError();
5897    function_tests++;
5898#endif
5899
5900    return(test_ret);
5901}
5902
5903
5904static int
5905test_xmlCatalogConvert(void) {
5906    int test_ret = 0;
5907
5908#if defined(LIBXML_CATALOG_ENABLED)
5909    int ret_val;
5910
5911
5912        ret_val = xmlCatalogConvert();
5913        desret_int(ret_val);
5914        call_tests++;
5915        xmlResetLastError();
5916    function_tests++;
5917#endif
5918
5919    return(test_ret);
5920}
5921
5922
5923static int
5924test_xmlCatalogDump(void) {
5925    int test_ret = 0;
5926
5927#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5928    int mem_base;
5929    FILE * out; /* the file. */
5930    int n_out;
5931
5932    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5933        mem_base = xmlMemBlocks();
5934        out = gen_FILE_ptr(n_out, 0);
5935
5936        xmlCatalogDump(out);
5937        call_tests++;
5938        des_FILE_ptr(n_out, out, 0);
5939        xmlResetLastError();
5940        if (mem_base != xmlMemBlocks()) {
5941            printf("Leak of %d blocks found in xmlCatalogDump",
5942	           xmlMemBlocks() - mem_base);
5943	    test_ret++;
5944            printf(" %d", n_out);
5945            printf("\n");
5946        }
5947    }
5948    function_tests++;
5949#endif
5950
5951    return(test_ret);
5952}
5953
5954
5955static int
5956test_xmlCatalogGetDefaults(void) {
5957    int test_ret = 0;
5958
5959#if defined(LIBXML_CATALOG_ENABLED)
5960    int mem_base;
5961    xmlCatalogAllow ret_val;
5962
5963        mem_base = xmlMemBlocks();
5964
5965        ret_val = xmlCatalogGetDefaults();
5966        desret_xmlCatalogAllow(ret_val);
5967        call_tests++;
5968        xmlResetLastError();
5969        if (mem_base != xmlMemBlocks()) {
5970            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
5971	           xmlMemBlocks() - mem_base);
5972	    test_ret++;
5973            printf("\n");
5974        }
5975    function_tests++;
5976#endif
5977
5978    return(test_ret);
5979}
5980
5981
5982static int
5983test_xmlCatalogIsEmpty(void) {
5984    int test_ret = 0;
5985
5986#if defined(LIBXML_CATALOG_ENABLED)
5987    int mem_base;
5988    int ret_val;
5989    xmlCatalogPtr catal; /* should this create an SGML catalog */
5990    int n_catal;
5991
5992    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5993        mem_base = xmlMemBlocks();
5994        catal = gen_xmlCatalogPtr(n_catal, 0);
5995
5996        ret_val = xmlCatalogIsEmpty(catal);
5997        desret_int(ret_val);
5998        call_tests++;
5999        des_xmlCatalogPtr(n_catal, catal, 0);
6000        xmlResetLastError();
6001        if (mem_base != xmlMemBlocks()) {
6002            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6003	           xmlMemBlocks() - mem_base);
6004	    test_ret++;
6005            printf(" %d", n_catal);
6006            printf("\n");
6007        }
6008    }
6009    function_tests++;
6010#endif
6011
6012    return(test_ret);
6013}
6014
6015
6016static int
6017test_xmlCatalogLocalResolve(void) {
6018    int test_ret = 0;
6019
6020#if defined(LIBXML_CATALOG_ENABLED)
6021    int mem_base;
6022    xmlChar * ret_val;
6023    void * catalogs; /* a document's list of catalogs */
6024    int n_catalogs;
6025    xmlChar * pubID; /* the public ID string */
6026    int n_pubID;
6027    xmlChar * sysID; /* the system ID string */
6028    int n_sysID;
6029
6030    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6031    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6032    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6033        mem_base = xmlMemBlocks();
6034        catalogs = gen_void_ptr(n_catalogs, 0);
6035        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6036        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6037
6038        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6039        desret_xmlChar_ptr(ret_val);
6040        call_tests++;
6041        des_void_ptr(n_catalogs, catalogs, 0);
6042        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6043        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6044        xmlResetLastError();
6045        if (mem_base != xmlMemBlocks()) {
6046            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6047	           xmlMemBlocks() - mem_base);
6048	    test_ret++;
6049            printf(" %d", n_catalogs);
6050            printf(" %d", n_pubID);
6051            printf(" %d", n_sysID);
6052            printf("\n");
6053        }
6054    }
6055    }
6056    }
6057    function_tests++;
6058#endif
6059
6060    return(test_ret);
6061}
6062
6063
6064static int
6065test_xmlCatalogLocalResolveURI(void) {
6066    int test_ret = 0;
6067
6068#if defined(LIBXML_CATALOG_ENABLED)
6069    int mem_base;
6070    xmlChar * ret_val;
6071    void * catalogs; /* a document's list of catalogs */
6072    int n_catalogs;
6073    xmlChar * URI; /* the URI */
6074    int n_URI;
6075
6076    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6077    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6078        mem_base = xmlMemBlocks();
6079        catalogs = gen_void_ptr(n_catalogs, 0);
6080        URI = gen_const_xmlChar_ptr(n_URI, 1);
6081
6082        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6083        desret_xmlChar_ptr(ret_val);
6084        call_tests++;
6085        des_void_ptr(n_catalogs, catalogs, 0);
6086        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6087        xmlResetLastError();
6088        if (mem_base != xmlMemBlocks()) {
6089            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6090	           xmlMemBlocks() - mem_base);
6091	    test_ret++;
6092            printf(" %d", n_catalogs);
6093            printf(" %d", n_URI);
6094            printf("\n");
6095        }
6096    }
6097    }
6098    function_tests++;
6099#endif
6100
6101    return(test_ret);
6102}
6103
6104
6105static int
6106test_xmlCatalogRemove(void) {
6107    int test_ret = 0;
6108
6109#if defined(LIBXML_CATALOG_ENABLED)
6110    int ret_val;
6111    xmlChar * value; /* the value to remove */
6112    int n_value;
6113
6114    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6115        value = gen_const_xmlChar_ptr(n_value, 0);
6116
6117        ret_val = xmlCatalogRemove((const xmlChar *)value);
6118        desret_int(ret_val);
6119        call_tests++;
6120        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6121        xmlResetLastError();
6122    }
6123    function_tests++;
6124#endif
6125
6126    return(test_ret);
6127}
6128
6129
6130static int
6131test_xmlCatalogResolve(void) {
6132    int test_ret = 0;
6133
6134#if defined(LIBXML_CATALOG_ENABLED)
6135    int mem_base;
6136    xmlChar * ret_val;
6137    xmlChar * pubID; /* the public ID string */
6138    int n_pubID;
6139    xmlChar * sysID; /* the system ID string */
6140    int n_sysID;
6141
6142    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6143    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6144        mem_base = xmlMemBlocks();
6145        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6146        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6147
6148        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6149        desret_xmlChar_ptr(ret_val);
6150        call_tests++;
6151        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6152        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6153        xmlResetLastError();
6154        if (mem_base != xmlMemBlocks()) {
6155            printf("Leak of %d blocks found in xmlCatalogResolve",
6156	           xmlMemBlocks() - mem_base);
6157	    test_ret++;
6158            printf(" %d", n_pubID);
6159            printf(" %d", n_sysID);
6160            printf("\n");
6161        }
6162    }
6163    }
6164    function_tests++;
6165#endif
6166
6167    return(test_ret);
6168}
6169
6170
6171static int
6172test_xmlCatalogResolvePublic(void) {
6173    int test_ret = 0;
6174
6175#if defined(LIBXML_CATALOG_ENABLED)
6176    int mem_base;
6177    xmlChar * ret_val;
6178    xmlChar * pubID; /* the public ID string */
6179    int n_pubID;
6180
6181    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6182        mem_base = xmlMemBlocks();
6183        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6184
6185        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6186        desret_xmlChar_ptr(ret_val);
6187        call_tests++;
6188        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6189        xmlResetLastError();
6190        if (mem_base != xmlMemBlocks()) {
6191            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6192	           xmlMemBlocks() - mem_base);
6193	    test_ret++;
6194            printf(" %d", n_pubID);
6195            printf("\n");
6196        }
6197    }
6198    function_tests++;
6199#endif
6200
6201    return(test_ret);
6202}
6203
6204
6205static int
6206test_xmlCatalogResolveSystem(void) {
6207    int test_ret = 0;
6208
6209#if defined(LIBXML_CATALOG_ENABLED)
6210    int mem_base;
6211    xmlChar * ret_val;
6212    xmlChar * sysID; /* the system ID string */
6213    int n_sysID;
6214
6215    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6216        mem_base = xmlMemBlocks();
6217        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6218
6219        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6220        desret_xmlChar_ptr(ret_val);
6221        call_tests++;
6222        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6223        xmlResetLastError();
6224        if (mem_base != xmlMemBlocks()) {
6225            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6226	           xmlMemBlocks() - mem_base);
6227	    test_ret++;
6228            printf(" %d", n_sysID);
6229            printf("\n");
6230        }
6231    }
6232    function_tests++;
6233#endif
6234
6235    return(test_ret);
6236}
6237
6238
6239static int
6240test_xmlCatalogResolveURI(void) {
6241    int test_ret = 0;
6242
6243#if defined(LIBXML_CATALOG_ENABLED)
6244    int mem_base;
6245    xmlChar * ret_val;
6246    xmlChar * URI; /* the URI */
6247    int n_URI;
6248
6249    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6250        mem_base = xmlMemBlocks();
6251        URI = gen_const_xmlChar_ptr(n_URI, 0);
6252
6253        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6254        desret_xmlChar_ptr(ret_val);
6255        call_tests++;
6256        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6257        xmlResetLastError();
6258        if (mem_base != xmlMemBlocks()) {
6259            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6260	           xmlMemBlocks() - mem_base);
6261	    test_ret++;
6262            printf(" %d", n_URI);
6263            printf("\n");
6264        }
6265    }
6266    function_tests++;
6267#endif
6268
6269    return(test_ret);
6270}
6271
6272
6273static int
6274test_xmlCatalogSetDefaultPrefer(void) {
6275    int test_ret = 0;
6276
6277#if defined(LIBXML_CATALOG_ENABLED)
6278    int mem_base;
6279    xmlCatalogPrefer ret_val;
6280    xmlCatalogPrefer prefer; /* the default preference for delegation */
6281    int n_prefer;
6282
6283    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6284        mem_base = xmlMemBlocks();
6285        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6286
6287        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6288        desret_xmlCatalogPrefer(ret_val);
6289        call_tests++;
6290        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6291        xmlResetLastError();
6292        if (mem_base != xmlMemBlocks()) {
6293            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6294	           xmlMemBlocks() - mem_base);
6295	    test_ret++;
6296            printf(" %d", n_prefer);
6297            printf("\n");
6298        }
6299    }
6300    function_tests++;
6301#endif
6302
6303    return(test_ret);
6304}
6305
6306
6307static int
6308test_xmlCatalogSetDefaults(void) {
6309    int test_ret = 0;
6310
6311#if defined(LIBXML_CATALOG_ENABLED)
6312    int mem_base;
6313    xmlCatalogAllow allow; /* what catalogs should be accepted */
6314    int n_allow;
6315
6316    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6317        mem_base = xmlMemBlocks();
6318        allow = gen_xmlCatalogAllow(n_allow, 0);
6319
6320        xmlCatalogSetDefaults(allow);
6321        call_tests++;
6322        des_xmlCatalogAllow(n_allow, allow, 0);
6323        xmlResetLastError();
6324        if (mem_base != xmlMemBlocks()) {
6325            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6326	           xmlMemBlocks() - mem_base);
6327	    test_ret++;
6328            printf(" %d", n_allow);
6329            printf("\n");
6330        }
6331    }
6332    function_tests++;
6333#endif
6334
6335    return(test_ret);
6336}
6337
6338
6339static int
6340test_xmlConvertSGMLCatalog(void) {
6341    int test_ret = 0;
6342
6343#if defined(LIBXML_CATALOG_ENABLED)
6344    int mem_base;
6345    int ret_val;
6346    xmlCatalogPtr catal; /* the catalog */
6347    int n_catal;
6348
6349    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6350        mem_base = xmlMemBlocks();
6351        catal = gen_xmlCatalogPtr(n_catal, 0);
6352
6353        ret_val = xmlConvertSGMLCatalog(catal);
6354        desret_int(ret_val);
6355        call_tests++;
6356        des_xmlCatalogPtr(n_catal, catal, 0);
6357        xmlResetLastError();
6358        if (mem_base != xmlMemBlocks()) {
6359            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6360	           xmlMemBlocks() - mem_base);
6361	    test_ret++;
6362            printf(" %d", n_catal);
6363            printf("\n");
6364        }
6365    }
6366    function_tests++;
6367#endif
6368
6369    return(test_ret);
6370}
6371
6372
6373static int
6374test_xmlInitializeCatalog(void) {
6375    int test_ret = 0;
6376
6377#if defined(LIBXML_CATALOG_ENABLED)
6378    int mem_base;
6379
6380        mem_base = xmlMemBlocks();
6381
6382        xmlInitializeCatalog();
6383        call_tests++;
6384        xmlResetLastError();
6385        if (mem_base != xmlMemBlocks()) {
6386            printf("Leak of %d blocks found in xmlInitializeCatalog",
6387	           xmlMemBlocks() - mem_base);
6388	    test_ret++;
6389            printf("\n");
6390        }
6391    function_tests++;
6392#endif
6393
6394    return(test_ret);
6395}
6396
6397
6398static int
6399test_xmlLoadACatalog(void) {
6400    int test_ret = 0;
6401
6402
6403    /* missing type support */
6404    return(test_ret);
6405}
6406
6407
6408static int
6409test_xmlLoadCatalog(void) {
6410    int test_ret = 0;
6411
6412#if defined(LIBXML_CATALOG_ENABLED)
6413    int ret_val;
6414    const char * filename; /* a file path */
6415    int n_filename;
6416
6417    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6418        filename = gen_filepath(n_filename, 0);
6419
6420        ret_val = xmlLoadCatalog(filename);
6421        desret_int(ret_val);
6422        call_tests++;
6423        des_filepath(n_filename, filename, 0);
6424        xmlResetLastError();
6425    }
6426    function_tests++;
6427#endif
6428
6429    return(test_ret);
6430}
6431
6432
6433static int
6434test_xmlLoadCatalogs(void) {
6435    int test_ret = 0;
6436
6437#if defined(LIBXML_CATALOG_ENABLED)
6438    char * pathss; /* a list of directories separated by a colon or a space. */
6439    int n_pathss;
6440
6441    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6442        pathss = gen_const_char_ptr(n_pathss, 0);
6443
6444        xmlLoadCatalogs((const char *)pathss);
6445        call_tests++;
6446        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6447        xmlResetLastError();
6448    }
6449    function_tests++;
6450#endif
6451
6452    return(test_ret);
6453}
6454
6455
6456static int
6457test_xmlLoadSGMLSuperCatalog(void) {
6458    int test_ret = 0;
6459
6460
6461    /* missing type support */
6462    return(test_ret);
6463}
6464
6465
6466static int
6467test_xmlNewCatalog(void) {
6468    int test_ret = 0;
6469
6470
6471    /* missing type support */
6472    return(test_ret);
6473}
6474
6475
6476static int
6477test_xmlParseCatalogFile(void) {
6478    int test_ret = 0;
6479
6480#if defined(LIBXML_CATALOG_ENABLED)
6481    int mem_base;
6482    xmlDocPtr ret_val;
6483    const char * filename; /* the filename */
6484    int n_filename;
6485
6486    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6487        mem_base = xmlMemBlocks();
6488        filename = gen_filepath(n_filename, 0);
6489
6490        ret_val = xmlParseCatalogFile(filename);
6491        desret_xmlDocPtr(ret_val);
6492        call_tests++;
6493        des_filepath(n_filename, filename, 0);
6494        xmlResetLastError();
6495        if (mem_base != xmlMemBlocks()) {
6496            printf("Leak of %d blocks found in xmlParseCatalogFile",
6497	           xmlMemBlocks() - mem_base);
6498	    test_ret++;
6499            printf(" %d", n_filename);
6500            printf("\n");
6501        }
6502    }
6503    function_tests++;
6504#endif
6505
6506    return(test_ret);
6507}
6508
6509static int
6510test_catalog(void) {
6511    int test_ret = 0;
6512
6513    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6514    test_ret += test_xmlACatalogAdd();
6515    test_ret += test_xmlACatalogDump();
6516    test_ret += test_xmlACatalogRemove();
6517    test_ret += test_xmlACatalogResolve();
6518    test_ret += test_xmlACatalogResolvePublic();
6519    test_ret += test_xmlACatalogResolveSystem();
6520    test_ret += test_xmlACatalogResolveURI();
6521    test_ret += test_xmlCatalogAdd();
6522    test_ret += test_xmlCatalogCleanup();
6523    test_ret += test_xmlCatalogConvert();
6524    test_ret += test_xmlCatalogDump();
6525    test_ret += test_xmlCatalogGetDefaults();
6526    test_ret += test_xmlCatalogIsEmpty();
6527    test_ret += test_xmlCatalogLocalResolve();
6528    test_ret += test_xmlCatalogLocalResolveURI();
6529    test_ret += test_xmlCatalogRemove();
6530    test_ret += test_xmlCatalogResolve();
6531    test_ret += test_xmlCatalogResolvePublic();
6532    test_ret += test_xmlCatalogResolveSystem();
6533    test_ret += test_xmlCatalogResolveURI();
6534    test_ret += test_xmlCatalogSetDefaultPrefer();
6535    test_ret += test_xmlCatalogSetDefaults();
6536    test_ret += test_xmlConvertSGMLCatalog();
6537    test_ret += test_xmlInitializeCatalog();
6538    test_ret += test_xmlLoadACatalog();
6539    test_ret += test_xmlLoadCatalog();
6540    test_ret += test_xmlLoadCatalogs();
6541    test_ret += test_xmlLoadSGMLSuperCatalog();
6542    test_ret += test_xmlNewCatalog();
6543    test_ret += test_xmlParseCatalogFile();
6544
6545    if (test_ret != 0)
6546	printf("Module catalog: %d errors\n", test_ret);
6547    return(test_ret);
6548}
6549
6550#define gen_nb_const_xmlChRangeGroup_ptr 1
6551static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6552    return(NULL);
6553}
6554static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6555}
6556
6557static int
6558test_xmlCharInRange(void) {
6559    int test_ret = 0;
6560
6561    int mem_base;
6562    int ret_val;
6563    unsigned int val; /* character to be validated */
6564    int n_val;
6565    xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6566    int n_rptr;
6567
6568    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6569    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6570        mem_base = xmlMemBlocks();
6571        val = gen_unsigned_int(n_val, 0);
6572        rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6573
6574        ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6575        desret_int(ret_val);
6576        call_tests++;
6577        des_unsigned_int(n_val, val, 0);
6578        des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6579        xmlResetLastError();
6580        if (mem_base != xmlMemBlocks()) {
6581            printf("Leak of %d blocks found in xmlCharInRange",
6582	           xmlMemBlocks() - mem_base);
6583	    test_ret++;
6584            printf(" %d", n_val);
6585            printf(" %d", n_rptr);
6586            printf("\n");
6587        }
6588    }
6589    }
6590    function_tests++;
6591
6592    return(test_ret);
6593}
6594
6595
6596static int
6597test_xmlIsBaseChar(void) {
6598    int test_ret = 0;
6599
6600    int mem_base;
6601    int ret_val;
6602    unsigned int ch; /* character to validate */
6603    int n_ch;
6604
6605    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6606        mem_base = xmlMemBlocks();
6607        ch = gen_unsigned_int(n_ch, 0);
6608
6609        ret_val = xmlIsBaseChar(ch);
6610        desret_int(ret_val);
6611        call_tests++;
6612        des_unsigned_int(n_ch, ch, 0);
6613        xmlResetLastError();
6614        if (mem_base != xmlMemBlocks()) {
6615            printf("Leak of %d blocks found in xmlIsBaseChar",
6616	           xmlMemBlocks() - mem_base);
6617	    test_ret++;
6618            printf(" %d", n_ch);
6619            printf("\n");
6620        }
6621    }
6622    function_tests++;
6623
6624    return(test_ret);
6625}
6626
6627
6628static int
6629test_xmlIsBlank(void) {
6630    int test_ret = 0;
6631
6632    int mem_base;
6633    int ret_val;
6634    unsigned int ch; /* character to validate */
6635    int n_ch;
6636
6637    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6638        mem_base = xmlMemBlocks();
6639        ch = gen_unsigned_int(n_ch, 0);
6640
6641        ret_val = xmlIsBlank(ch);
6642        desret_int(ret_val);
6643        call_tests++;
6644        des_unsigned_int(n_ch, ch, 0);
6645        xmlResetLastError();
6646        if (mem_base != xmlMemBlocks()) {
6647            printf("Leak of %d blocks found in xmlIsBlank",
6648	           xmlMemBlocks() - mem_base);
6649	    test_ret++;
6650            printf(" %d", n_ch);
6651            printf("\n");
6652        }
6653    }
6654    function_tests++;
6655
6656    return(test_ret);
6657}
6658
6659
6660static int
6661test_xmlIsChar(void) {
6662    int test_ret = 0;
6663
6664    int mem_base;
6665    int ret_val;
6666    unsigned int ch; /* character to validate */
6667    int n_ch;
6668
6669    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6670        mem_base = xmlMemBlocks();
6671        ch = gen_unsigned_int(n_ch, 0);
6672
6673        ret_val = xmlIsChar(ch);
6674        desret_int(ret_val);
6675        call_tests++;
6676        des_unsigned_int(n_ch, ch, 0);
6677        xmlResetLastError();
6678        if (mem_base != xmlMemBlocks()) {
6679            printf("Leak of %d blocks found in xmlIsChar",
6680	           xmlMemBlocks() - mem_base);
6681	    test_ret++;
6682            printf(" %d", n_ch);
6683            printf("\n");
6684        }
6685    }
6686    function_tests++;
6687
6688    return(test_ret);
6689}
6690
6691
6692static int
6693test_xmlIsCombining(void) {
6694    int test_ret = 0;
6695
6696    int mem_base;
6697    int ret_val;
6698    unsigned int ch; /* character to validate */
6699    int n_ch;
6700
6701    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6702        mem_base = xmlMemBlocks();
6703        ch = gen_unsigned_int(n_ch, 0);
6704
6705        ret_val = xmlIsCombining(ch);
6706        desret_int(ret_val);
6707        call_tests++;
6708        des_unsigned_int(n_ch, ch, 0);
6709        xmlResetLastError();
6710        if (mem_base != xmlMemBlocks()) {
6711            printf("Leak of %d blocks found in xmlIsCombining",
6712	           xmlMemBlocks() - mem_base);
6713	    test_ret++;
6714            printf(" %d", n_ch);
6715            printf("\n");
6716        }
6717    }
6718    function_tests++;
6719
6720    return(test_ret);
6721}
6722
6723
6724static int
6725test_xmlIsDigit(void) {
6726    int test_ret = 0;
6727
6728    int mem_base;
6729    int ret_val;
6730    unsigned int ch; /* character to validate */
6731    int n_ch;
6732
6733    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6734        mem_base = xmlMemBlocks();
6735        ch = gen_unsigned_int(n_ch, 0);
6736
6737        ret_val = xmlIsDigit(ch);
6738        desret_int(ret_val);
6739        call_tests++;
6740        des_unsigned_int(n_ch, ch, 0);
6741        xmlResetLastError();
6742        if (mem_base != xmlMemBlocks()) {
6743            printf("Leak of %d blocks found in xmlIsDigit",
6744	           xmlMemBlocks() - mem_base);
6745	    test_ret++;
6746            printf(" %d", n_ch);
6747            printf("\n");
6748        }
6749    }
6750    function_tests++;
6751
6752    return(test_ret);
6753}
6754
6755
6756static int
6757test_xmlIsExtender(void) {
6758    int test_ret = 0;
6759
6760    int mem_base;
6761    int ret_val;
6762    unsigned int ch; /* character to validate */
6763    int n_ch;
6764
6765    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6766        mem_base = xmlMemBlocks();
6767        ch = gen_unsigned_int(n_ch, 0);
6768
6769        ret_val = xmlIsExtender(ch);
6770        desret_int(ret_val);
6771        call_tests++;
6772        des_unsigned_int(n_ch, ch, 0);
6773        xmlResetLastError();
6774        if (mem_base != xmlMemBlocks()) {
6775            printf("Leak of %d blocks found in xmlIsExtender",
6776	           xmlMemBlocks() - mem_base);
6777	    test_ret++;
6778            printf(" %d", n_ch);
6779            printf("\n");
6780        }
6781    }
6782    function_tests++;
6783
6784    return(test_ret);
6785}
6786
6787
6788static int
6789test_xmlIsIdeographic(void) {
6790    int test_ret = 0;
6791
6792    int mem_base;
6793    int ret_val;
6794    unsigned int ch; /* character to validate */
6795    int n_ch;
6796
6797    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6798        mem_base = xmlMemBlocks();
6799        ch = gen_unsigned_int(n_ch, 0);
6800
6801        ret_val = xmlIsIdeographic(ch);
6802        desret_int(ret_val);
6803        call_tests++;
6804        des_unsigned_int(n_ch, ch, 0);
6805        xmlResetLastError();
6806        if (mem_base != xmlMemBlocks()) {
6807            printf("Leak of %d blocks found in xmlIsIdeographic",
6808	           xmlMemBlocks() - mem_base);
6809	    test_ret++;
6810            printf(" %d", n_ch);
6811            printf("\n");
6812        }
6813    }
6814    function_tests++;
6815
6816    return(test_ret);
6817}
6818
6819
6820static int
6821test_xmlIsPubidChar(void) {
6822    int test_ret = 0;
6823
6824    int mem_base;
6825    int ret_val;
6826    unsigned int ch; /* character to validate */
6827    int n_ch;
6828
6829    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6830        mem_base = xmlMemBlocks();
6831        ch = gen_unsigned_int(n_ch, 0);
6832
6833        ret_val = xmlIsPubidChar(ch);
6834        desret_int(ret_val);
6835        call_tests++;
6836        des_unsigned_int(n_ch, ch, 0);
6837        xmlResetLastError();
6838        if (mem_base != xmlMemBlocks()) {
6839            printf("Leak of %d blocks found in xmlIsPubidChar",
6840	           xmlMemBlocks() - mem_base);
6841	    test_ret++;
6842            printf(" %d", n_ch);
6843            printf("\n");
6844        }
6845    }
6846    function_tests++;
6847
6848    return(test_ret);
6849}
6850
6851static int
6852test_chvalid(void) {
6853    int test_ret = 0;
6854
6855    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6856    test_ret += test_xmlCharInRange();
6857    test_ret += test_xmlIsBaseChar();
6858    test_ret += test_xmlIsBlank();
6859    test_ret += test_xmlIsChar();
6860    test_ret += test_xmlIsCombining();
6861    test_ret += test_xmlIsDigit();
6862    test_ret += test_xmlIsExtender();
6863    test_ret += test_xmlIsIdeographic();
6864    test_ret += test_xmlIsPubidChar();
6865
6866    if (test_ret != 0)
6867	printf("Module chvalid: %d errors\n", test_ret);
6868    return(test_ret);
6869}
6870
6871static int
6872test_xmlBoolToText(void) {
6873    int test_ret = 0;
6874
6875#if defined(LIBXML_DEBUG_ENABLED)
6876    int mem_base;
6877    const char * ret_val;
6878    int boolval; /* a bool to turn into text */
6879    int n_boolval;
6880
6881    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6882        mem_base = xmlMemBlocks();
6883        boolval = gen_int(n_boolval, 0);
6884
6885        ret_val = xmlBoolToText(boolval);
6886        desret_const_char_ptr(ret_val);
6887        call_tests++;
6888        des_int(n_boolval, boolval, 0);
6889        xmlResetLastError();
6890        if (mem_base != xmlMemBlocks()) {
6891            printf("Leak of %d blocks found in xmlBoolToText",
6892	           xmlMemBlocks() - mem_base);
6893	    test_ret++;
6894            printf(" %d", n_boolval);
6895            printf("\n");
6896        }
6897    }
6898    function_tests++;
6899#endif
6900
6901    return(test_ret);
6902}
6903
6904
6905static int
6906test_xmlDebugCheckDocument(void) {
6907    int test_ret = 0;
6908
6909#if defined(LIBXML_DEBUG_ENABLED)
6910    int mem_base;
6911    int ret_val;
6912    FILE * output; /* the FILE * for the output */
6913    int n_output;
6914    xmlDocPtr doc; /* the document */
6915    int n_doc;
6916
6917    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6918    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6919        mem_base = xmlMemBlocks();
6920        output = gen_debug_FILE_ptr(n_output, 0);
6921        doc = gen_xmlDocPtr(n_doc, 1);
6922
6923        ret_val = xmlDebugCheckDocument(output, doc);
6924        desret_int(ret_val);
6925        call_tests++;
6926        des_debug_FILE_ptr(n_output, output, 0);
6927        des_xmlDocPtr(n_doc, doc, 1);
6928        xmlResetLastError();
6929        if (mem_base != xmlMemBlocks()) {
6930            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6931	           xmlMemBlocks() - mem_base);
6932	    test_ret++;
6933            printf(" %d", n_output);
6934            printf(" %d", n_doc);
6935            printf("\n");
6936        }
6937    }
6938    }
6939    function_tests++;
6940#endif
6941
6942    return(test_ret);
6943}
6944
6945
6946static int
6947test_xmlDebugDumpAttr(void) {
6948    int test_ret = 0;
6949
6950#if defined(LIBXML_DEBUG_ENABLED)
6951    int mem_base;
6952    FILE * output; /* the FILE * for the output */
6953    int n_output;
6954    xmlAttrPtr attr; /* the attribute */
6955    int n_attr;
6956    int depth; /* the indentation level. */
6957    int n_depth;
6958
6959    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6960    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6961    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6962        mem_base = xmlMemBlocks();
6963        output = gen_debug_FILE_ptr(n_output, 0);
6964        attr = gen_xmlAttrPtr(n_attr, 1);
6965        depth = gen_int(n_depth, 2);
6966
6967        xmlDebugDumpAttr(output, attr, depth);
6968        call_tests++;
6969        des_debug_FILE_ptr(n_output, output, 0);
6970        des_xmlAttrPtr(n_attr, attr, 1);
6971        des_int(n_depth, depth, 2);
6972        xmlResetLastError();
6973        if (mem_base != xmlMemBlocks()) {
6974            printf("Leak of %d blocks found in xmlDebugDumpAttr",
6975	           xmlMemBlocks() - mem_base);
6976	    test_ret++;
6977            printf(" %d", n_output);
6978            printf(" %d", n_attr);
6979            printf(" %d", n_depth);
6980            printf("\n");
6981        }
6982    }
6983    }
6984    }
6985    function_tests++;
6986#endif
6987
6988    return(test_ret);
6989}
6990
6991
6992static int
6993test_xmlDebugDumpAttrList(void) {
6994    int test_ret = 0;
6995
6996#if defined(LIBXML_DEBUG_ENABLED)
6997    int mem_base;
6998    FILE * output; /* the FILE * for the output */
6999    int n_output;
7000    xmlAttrPtr attr; /* the attribute list */
7001    int n_attr;
7002    int depth; /* the indentation level. */
7003    int n_depth;
7004
7005    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7006    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7007    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7008        mem_base = xmlMemBlocks();
7009        output = gen_debug_FILE_ptr(n_output, 0);
7010        attr = gen_xmlAttrPtr(n_attr, 1);
7011        depth = gen_int(n_depth, 2);
7012
7013        xmlDebugDumpAttrList(output, attr, depth);
7014        call_tests++;
7015        des_debug_FILE_ptr(n_output, output, 0);
7016        des_xmlAttrPtr(n_attr, attr, 1);
7017        des_int(n_depth, depth, 2);
7018        xmlResetLastError();
7019        if (mem_base != xmlMemBlocks()) {
7020            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7021	           xmlMemBlocks() - mem_base);
7022	    test_ret++;
7023            printf(" %d", n_output);
7024            printf(" %d", n_attr);
7025            printf(" %d", n_depth);
7026            printf("\n");
7027        }
7028    }
7029    }
7030    }
7031    function_tests++;
7032#endif
7033
7034    return(test_ret);
7035}
7036
7037
7038static int
7039test_xmlDebugDumpDTD(void) {
7040    int test_ret = 0;
7041
7042#if defined(LIBXML_DEBUG_ENABLED)
7043    int mem_base;
7044    FILE * output; /* the FILE * for the output */
7045    int n_output;
7046    xmlDtdPtr dtd; /* the DTD */
7047    int n_dtd;
7048
7049    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7050    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7051        mem_base = xmlMemBlocks();
7052        output = gen_debug_FILE_ptr(n_output, 0);
7053        dtd = gen_xmlDtdPtr(n_dtd, 1);
7054
7055        xmlDebugDumpDTD(output, dtd);
7056        call_tests++;
7057        des_debug_FILE_ptr(n_output, output, 0);
7058        des_xmlDtdPtr(n_dtd, dtd, 1);
7059        xmlResetLastError();
7060        if (mem_base != xmlMemBlocks()) {
7061            printf("Leak of %d blocks found in xmlDebugDumpDTD",
7062	           xmlMemBlocks() - mem_base);
7063	    test_ret++;
7064            printf(" %d", n_output);
7065            printf(" %d", n_dtd);
7066            printf("\n");
7067        }
7068    }
7069    }
7070    function_tests++;
7071#endif
7072
7073    return(test_ret);
7074}
7075
7076
7077static int
7078test_xmlDebugDumpDocument(void) {
7079    int test_ret = 0;
7080
7081#if defined(LIBXML_DEBUG_ENABLED)
7082    int mem_base;
7083    FILE * output; /* the FILE * for the output */
7084    int n_output;
7085    xmlDocPtr doc; /* the document */
7086    int n_doc;
7087
7088    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7089    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7090        mem_base = xmlMemBlocks();
7091        output = gen_debug_FILE_ptr(n_output, 0);
7092        doc = gen_xmlDocPtr(n_doc, 1);
7093
7094        xmlDebugDumpDocument(output, doc);
7095        call_tests++;
7096        des_debug_FILE_ptr(n_output, output, 0);
7097        des_xmlDocPtr(n_doc, doc, 1);
7098        xmlResetLastError();
7099        if (mem_base != xmlMemBlocks()) {
7100            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7101	           xmlMemBlocks() - mem_base);
7102	    test_ret++;
7103            printf(" %d", n_output);
7104            printf(" %d", n_doc);
7105            printf("\n");
7106        }
7107    }
7108    }
7109    function_tests++;
7110#endif
7111
7112    return(test_ret);
7113}
7114
7115
7116static int
7117test_xmlDebugDumpDocumentHead(void) {
7118    int test_ret = 0;
7119
7120#if defined(LIBXML_DEBUG_ENABLED)
7121    int mem_base;
7122    FILE * output; /* the FILE * for the output */
7123    int n_output;
7124    xmlDocPtr doc; /* the document */
7125    int n_doc;
7126
7127    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7128    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7129        mem_base = xmlMemBlocks();
7130        output = gen_debug_FILE_ptr(n_output, 0);
7131        doc = gen_xmlDocPtr(n_doc, 1);
7132
7133        xmlDebugDumpDocumentHead(output, doc);
7134        call_tests++;
7135        des_debug_FILE_ptr(n_output, output, 0);
7136        des_xmlDocPtr(n_doc, doc, 1);
7137        xmlResetLastError();
7138        if (mem_base != xmlMemBlocks()) {
7139            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7140	           xmlMemBlocks() - mem_base);
7141	    test_ret++;
7142            printf(" %d", n_output);
7143            printf(" %d", n_doc);
7144            printf("\n");
7145        }
7146    }
7147    }
7148    function_tests++;
7149#endif
7150
7151    return(test_ret);
7152}
7153
7154
7155static int
7156test_xmlDebugDumpEntities(void) {
7157    int test_ret = 0;
7158
7159#if defined(LIBXML_DEBUG_ENABLED)
7160    int mem_base;
7161    FILE * output; /* the FILE * for the output */
7162    int n_output;
7163    xmlDocPtr doc; /* the document */
7164    int n_doc;
7165
7166    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7167    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7168        mem_base = xmlMemBlocks();
7169        output = gen_debug_FILE_ptr(n_output, 0);
7170        doc = gen_xmlDocPtr(n_doc, 1);
7171
7172        xmlDebugDumpEntities(output, doc);
7173        call_tests++;
7174        des_debug_FILE_ptr(n_output, output, 0);
7175        des_xmlDocPtr(n_doc, doc, 1);
7176        xmlResetLastError();
7177        if (mem_base != xmlMemBlocks()) {
7178            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7179	           xmlMemBlocks() - mem_base);
7180	    test_ret++;
7181            printf(" %d", n_output);
7182            printf(" %d", n_doc);
7183            printf("\n");
7184        }
7185    }
7186    }
7187    function_tests++;
7188#endif
7189
7190    return(test_ret);
7191}
7192
7193
7194static int
7195test_xmlDebugDumpNode(void) {
7196    int test_ret = 0;
7197
7198#if defined(LIBXML_DEBUG_ENABLED)
7199    int mem_base;
7200    FILE * output; /* the FILE * for the output */
7201    int n_output;
7202    xmlNodePtr node; /* the node */
7203    int n_node;
7204    int depth; /* the indentation level. */
7205    int n_depth;
7206
7207    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7208    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7209    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7210        mem_base = xmlMemBlocks();
7211        output = gen_debug_FILE_ptr(n_output, 0);
7212        node = gen_xmlNodePtr(n_node, 1);
7213        depth = gen_int(n_depth, 2);
7214
7215        xmlDebugDumpNode(output, node, depth);
7216        call_tests++;
7217        des_debug_FILE_ptr(n_output, output, 0);
7218        des_xmlNodePtr(n_node, node, 1);
7219        des_int(n_depth, depth, 2);
7220        xmlResetLastError();
7221        if (mem_base != xmlMemBlocks()) {
7222            printf("Leak of %d blocks found in xmlDebugDumpNode",
7223	           xmlMemBlocks() - mem_base);
7224	    test_ret++;
7225            printf(" %d", n_output);
7226            printf(" %d", n_node);
7227            printf(" %d", n_depth);
7228            printf("\n");
7229        }
7230    }
7231    }
7232    }
7233    function_tests++;
7234#endif
7235
7236    return(test_ret);
7237}
7238
7239
7240static int
7241test_xmlDebugDumpNodeList(void) {
7242    int test_ret = 0;
7243
7244#if defined(LIBXML_DEBUG_ENABLED)
7245    int mem_base;
7246    FILE * output; /* the FILE * for the output */
7247    int n_output;
7248    xmlNodePtr node; /* the node list */
7249    int n_node;
7250    int depth; /* the indentation level. */
7251    int n_depth;
7252
7253    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7254    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7255    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7256        mem_base = xmlMemBlocks();
7257        output = gen_debug_FILE_ptr(n_output, 0);
7258        node = gen_xmlNodePtr(n_node, 1);
7259        depth = gen_int(n_depth, 2);
7260
7261        xmlDebugDumpNodeList(output, node, depth);
7262        call_tests++;
7263        des_debug_FILE_ptr(n_output, output, 0);
7264        des_xmlNodePtr(n_node, node, 1);
7265        des_int(n_depth, depth, 2);
7266        xmlResetLastError();
7267        if (mem_base != xmlMemBlocks()) {
7268            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7269	           xmlMemBlocks() - mem_base);
7270	    test_ret++;
7271            printf(" %d", n_output);
7272            printf(" %d", n_node);
7273            printf(" %d", n_depth);
7274            printf("\n");
7275        }
7276    }
7277    }
7278    }
7279    function_tests++;
7280#endif
7281
7282    return(test_ret);
7283}
7284
7285
7286static int
7287test_xmlDebugDumpOneNode(void) {
7288    int test_ret = 0;
7289
7290#if defined(LIBXML_DEBUG_ENABLED)
7291    int mem_base;
7292    FILE * output; /* the FILE * for the output */
7293    int n_output;
7294    xmlNodePtr node; /* the node */
7295    int n_node;
7296    int depth; /* the indentation level. */
7297    int n_depth;
7298
7299    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7300    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7301    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7302        mem_base = xmlMemBlocks();
7303        output = gen_debug_FILE_ptr(n_output, 0);
7304        node = gen_xmlNodePtr(n_node, 1);
7305        depth = gen_int(n_depth, 2);
7306
7307        xmlDebugDumpOneNode(output, node, depth);
7308        call_tests++;
7309        des_debug_FILE_ptr(n_output, output, 0);
7310        des_xmlNodePtr(n_node, node, 1);
7311        des_int(n_depth, depth, 2);
7312        xmlResetLastError();
7313        if (mem_base != xmlMemBlocks()) {
7314            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7315	           xmlMemBlocks() - mem_base);
7316	    test_ret++;
7317            printf(" %d", n_output);
7318            printf(" %d", n_node);
7319            printf(" %d", n_depth);
7320            printf("\n");
7321        }
7322    }
7323    }
7324    }
7325    function_tests++;
7326#endif
7327
7328    return(test_ret);
7329}
7330
7331
7332static int
7333test_xmlDebugDumpString(void) {
7334    int test_ret = 0;
7335
7336#if defined(LIBXML_DEBUG_ENABLED)
7337    int mem_base;
7338    FILE * output; /* the FILE * for the output */
7339    int n_output;
7340    xmlChar * str; /* the string */
7341    int n_str;
7342
7343    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7344    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7345        mem_base = xmlMemBlocks();
7346        output = gen_debug_FILE_ptr(n_output, 0);
7347        str = gen_const_xmlChar_ptr(n_str, 1);
7348
7349        xmlDebugDumpString(output, (const xmlChar *)str);
7350        call_tests++;
7351        des_debug_FILE_ptr(n_output, output, 0);
7352        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7353        xmlResetLastError();
7354        if (mem_base != xmlMemBlocks()) {
7355            printf("Leak of %d blocks found in xmlDebugDumpString",
7356	           xmlMemBlocks() - mem_base);
7357	    test_ret++;
7358            printf(" %d", n_output);
7359            printf(" %d", n_str);
7360            printf("\n");
7361        }
7362    }
7363    }
7364    function_tests++;
7365#endif
7366
7367    return(test_ret);
7368}
7369
7370
7371static int
7372test_xmlLsCountNode(void) {
7373    int test_ret = 0;
7374
7375#if defined(LIBXML_DEBUG_ENABLED)
7376    int mem_base;
7377    int ret_val;
7378    xmlNodePtr node; /* the node to count */
7379    int n_node;
7380
7381    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7382        mem_base = xmlMemBlocks();
7383        node = gen_xmlNodePtr(n_node, 0);
7384
7385        ret_val = xmlLsCountNode(node);
7386        desret_int(ret_val);
7387        call_tests++;
7388        des_xmlNodePtr(n_node, node, 0);
7389        xmlResetLastError();
7390        if (mem_base != xmlMemBlocks()) {
7391            printf("Leak of %d blocks found in xmlLsCountNode",
7392	           xmlMemBlocks() - mem_base);
7393	    test_ret++;
7394            printf(" %d", n_node);
7395            printf("\n");
7396        }
7397    }
7398    function_tests++;
7399#endif
7400
7401    return(test_ret);
7402}
7403
7404
7405static int
7406test_xmlLsOneNode(void) {
7407    int test_ret = 0;
7408
7409#if defined(LIBXML_DEBUG_ENABLED)
7410    int mem_base;
7411    FILE * output; /* the FILE * for the output */
7412    int n_output;
7413    xmlNodePtr node; /* the node to dump */
7414    int n_node;
7415
7416    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7417    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7418        mem_base = xmlMemBlocks();
7419        output = gen_debug_FILE_ptr(n_output, 0);
7420        node = gen_xmlNodePtr(n_node, 1);
7421
7422        xmlLsOneNode(output, node);
7423        call_tests++;
7424        des_debug_FILE_ptr(n_output, output, 0);
7425        des_xmlNodePtr(n_node, node, 1);
7426        xmlResetLastError();
7427        if (mem_base != xmlMemBlocks()) {
7428            printf("Leak of %d blocks found in xmlLsOneNode",
7429	           xmlMemBlocks() - mem_base);
7430	    test_ret++;
7431            printf(" %d", n_output);
7432            printf(" %d", n_node);
7433            printf("\n");
7434        }
7435    }
7436    }
7437    function_tests++;
7438#endif
7439
7440    return(test_ret);
7441}
7442
7443
7444#define gen_nb_char_ptr 1
7445static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7446    return(NULL);
7447}
7448static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7449}
7450
7451static int
7452test_xmlShell(void) {
7453    int test_ret = 0;
7454
7455
7456    /* missing type support */
7457    return(test_ret);
7458}
7459
7460
7461static int
7462test_xmlShellBase(void) {
7463    int test_ret = 0;
7464
7465#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7466    int mem_base;
7467    int ret_val;
7468    xmlShellCtxtPtr ctxt; /* the shell context */
7469    int n_ctxt;
7470    char * arg; /* unused */
7471    int n_arg;
7472    xmlNodePtr node; /* a node */
7473    int n_node;
7474    xmlNodePtr node2; /* unused */
7475    int n_node2;
7476
7477    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7478    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7479    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7480    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7481        mem_base = xmlMemBlocks();
7482        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7483        arg = gen_char_ptr(n_arg, 1);
7484        node = gen_xmlNodePtr(n_node, 2);
7485        node2 = gen_xmlNodePtr(n_node2, 3);
7486
7487        ret_val = xmlShellBase(ctxt, arg, node, node2);
7488        desret_int(ret_val);
7489        call_tests++;
7490        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7491        des_char_ptr(n_arg, arg, 1);
7492        des_xmlNodePtr(n_node, node, 2);
7493        des_xmlNodePtr(n_node2, node2, 3);
7494        xmlResetLastError();
7495        if (mem_base != xmlMemBlocks()) {
7496            printf("Leak of %d blocks found in xmlShellBase",
7497	           xmlMemBlocks() - mem_base);
7498	    test_ret++;
7499            printf(" %d", n_ctxt);
7500            printf(" %d", n_arg);
7501            printf(" %d", n_node);
7502            printf(" %d", n_node2);
7503            printf("\n");
7504        }
7505    }
7506    }
7507    }
7508    }
7509    function_tests++;
7510#endif
7511
7512    return(test_ret);
7513}
7514
7515
7516static int
7517test_xmlShellCat(void) {
7518    int test_ret = 0;
7519
7520#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7521    int mem_base;
7522    int ret_val;
7523    xmlShellCtxtPtr ctxt; /* the shell context */
7524    int n_ctxt;
7525    char * arg; /* unused */
7526    int n_arg;
7527    xmlNodePtr node; /* a node */
7528    int n_node;
7529    xmlNodePtr node2; /* unused */
7530    int n_node2;
7531
7532    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7533    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7534    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7535    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7536        mem_base = xmlMemBlocks();
7537        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7538        arg = gen_char_ptr(n_arg, 1);
7539        node = gen_xmlNodePtr(n_node, 2);
7540        node2 = gen_xmlNodePtr(n_node2, 3);
7541
7542        ret_val = xmlShellCat(ctxt, arg, node, node2);
7543        desret_int(ret_val);
7544        call_tests++;
7545        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7546        des_char_ptr(n_arg, arg, 1);
7547        des_xmlNodePtr(n_node, node, 2);
7548        des_xmlNodePtr(n_node2, node2, 3);
7549        xmlResetLastError();
7550        if (mem_base != xmlMemBlocks()) {
7551            printf("Leak of %d blocks found in xmlShellCat",
7552	           xmlMemBlocks() - mem_base);
7553	    test_ret++;
7554            printf(" %d", n_ctxt);
7555            printf(" %d", n_arg);
7556            printf(" %d", n_node);
7557            printf(" %d", n_node2);
7558            printf("\n");
7559        }
7560    }
7561    }
7562    }
7563    }
7564    function_tests++;
7565#endif
7566
7567    return(test_ret);
7568}
7569
7570
7571static int
7572test_xmlShellDir(void) {
7573    int test_ret = 0;
7574
7575#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7576    int mem_base;
7577    int ret_val;
7578    xmlShellCtxtPtr ctxt; /* the shell context */
7579    int n_ctxt;
7580    char * arg; /* unused */
7581    int n_arg;
7582    xmlNodePtr node; /* a node */
7583    int n_node;
7584    xmlNodePtr node2; /* unused */
7585    int n_node2;
7586
7587    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7588    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7589    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7590    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7591        mem_base = xmlMemBlocks();
7592        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7593        arg = gen_char_ptr(n_arg, 1);
7594        node = gen_xmlNodePtr(n_node, 2);
7595        node2 = gen_xmlNodePtr(n_node2, 3);
7596
7597        ret_val = xmlShellDir(ctxt, arg, node, node2);
7598        desret_int(ret_val);
7599        call_tests++;
7600        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7601        des_char_ptr(n_arg, arg, 1);
7602        des_xmlNodePtr(n_node, node, 2);
7603        des_xmlNodePtr(n_node2, node2, 3);
7604        xmlResetLastError();
7605        if (mem_base != xmlMemBlocks()) {
7606            printf("Leak of %d blocks found in xmlShellDir",
7607	           xmlMemBlocks() - mem_base);
7608	    test_ret++;
7609            printf(" %d", n_ctxt);
7610            printf(" %d", n_arg);
7611            printf(" %d", n_node);
7612            printf(" %d", n_node2);
7613            printf("\n");
7614        }
7615    }
7616    }
7617    }
7618    }
7619    function_tests++;
7620#endif
7621
7622    return(test_ret);
7623}
7624
7625
7626static int
7627test_xmlShellDu(void) {
7628    int test_ret = 0;
7629
7630#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7631    int mem_base;
7632    int ret_val;
7633    xmlShellCtxtPtr ctxt; /* the shell context */
7634    int n_ctxt;
7635    char * arg; /* unused */
7636    int n_arg;
7637    xmlNodePtr tree; /* a node defining a subtree */
7638    int n_tree;
7639    xmlNodePtr node2; /* unused */
7640    int n_node2;
7641
7642    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7643    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7644    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7645    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7646        mem_base = xmlMemBlocks();
7647        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7648        arg = gen_char_ptr(n_arg, 1);
7649        tree = gen_xmlNodePtr(n_tree, 2);
7650        node2 = gen_xmlNodePtr(n_node2, 3);
7651
7652        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7653        desret_int(ret_val);
7654        call_tests++;
7655        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7656        des_char_ptr(n_arg, arg, 1);
7657        des_xmlNodePtr(n_tree, tree, 2);
7658        des_xmlNodePtr(n_node2, node2, 3);
7659        xmlResetLastError();
7660        if (mem_base != xmlMemBlocks()) {
7661            printf("Leak of %d blocks found in xmlShellDu",
7662	           xmlMemBlocks() - mem_base);
7663	    test_ret++;
7664            printf(" %d", n_ctxt);
7665            printf(" %d", n_arg);
7666            printf(" %d", n_tree);
7667            printf(" %d", n_node2);
7668            printf("\n");
7669        }
7670    }
7671    }
7672    }
7673    }
7674    function_tests++;
7675#endif
7676
7677    return(test_ret);
7678}
7679
7680
7681static int
7682test_xmlShellList(void) {
7683    int test_ret = 0;
7684
7685#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7686    int mem_base;
7687    int ret_val;
7688    xmlShellCtxtPtr ctxt; /* the shell context */
7689    int n_ctxt;
7690    char * arg; /* unused */
7691    int n_arg;
7692    xmlNodePtr node; /* a node */
7693    int n_node;
7694    xmlNodePtr node2; /* unused */
7695    int n_node2;
7696
7697    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7698    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7699    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7700    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7701        mem_base = xmlMemBlocks();
7702        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7703        arg = gen_char_ptr(n_arg, 1);
7704        node = gen_xmlNodePtr(n_node, 2);
7705        node2 = gen_xmlNodePtr(n_node2, 3);
7706
7707        ret_val = xmlShellList(ctxt, arg, node, node2);
7708        desret_int(ret_val);
7709        call_tests++;
7710        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7711        des_char_ptr(n_arg, arg, 1);
7712        des_xmlNodePtr(n_node, node, 2);
7713        des_xmlNodePtr(n_node2, node2, 3);
7714        xmlResetLastError();
7715        if (mem_base != xmlMemBlocks()) {
7716            printf("Leak of %d blocks found in xmlShellList",
7717	           xmlMemBlocks() - mem_base);
7718	    test_ret++;
7719            printf(" %d", n_ctxt);
7720            printf(" %d", n_arg);
7721            printf(" %d", n_node);
7722            printf(" %d", n_node2);
7723            printf("\n");
7724        }
7725    }
7726    }
7727    }
7728    }
7729    function_tests++;
7730#endif
7731
7732    return(test_ret);
7733}
7734
7735
7736static int
7737test_xmlShellLoad(void) {
7738    int test_ret = 0;
7739
7740#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7741    int mem_base;
7742    int ret_val;
7743    xmlShellCtxtPtr ctxt; /* the shell context */
7744    int n_ctxt;
7745    char * filename; /* the file name */
7746    int n_filename;
7747    xmlNodePtr node; /* unused */
7748    int n_node;
7749    xmlNodePtr node2; /* unused */
7750    int n_node2;
7751
7752    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7753    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7754    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7755    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7756        mem_base = xmlMemBlocks();
7757        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7758        filename = gen_char_ptr(n_filename, 1);
7759        node = gen_xmlNodePtr(n_node, 2);
7760        node2 = gen_xmlNodePtr(n_node2, 3);
7761
7762        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7763        desret_int(ret_val);
7764        call_tests++;
7765        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7766        des_char_ptr(n_filename, filename, 1);
7767        des_xmlNodePtr(n_node, node, 2);
7768        des_xmlNodePtr(n_node2, node2, 3);
7769        xmlResetLastError();
7770        if (mem_base != xmlMemBlocks()) {
7771            printf("Leak of %d blocks found in xmlShellLoad",
7772	           xmlMemBlocks() - mem_base);
7773	    test_ret++;
7774            printf(" %d", n_ctxt);
7775            printf(" %d", n_filename);
7776            printf(" %d", n_node);
7777            printf(" %d", n_node2);
7778            printf("\n");
7779        }
7780    }
7781    }
7782    }
7783    }
7784    function_tests++;
7785#endif
7786
7787    return(test_ret);
7788}
7789
7790
7791static int
7792test_xmlShellPrintXPathResult(void) {
7793    int test_ret = 0;
7794
7795#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7796    int mem_base;
7797    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7798    int n_list;
7799
7800    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7801        mem_base = xmlMemBlocks();
7802        list = gen_xmlXPathObjectPtr(n_list, 0);
7803
7804        xmlShellPrintXPathResult(list);
7805        call_tests++;
7806        des_xmlXPathObjectPtr(n_list, list, 0);
7807        xmlResetLastError();
7808        if (mem_base != xmlMemBlocks()) {
7809            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7810	           xmlMemBlocks() - mem_base);
7811	    test_ret++;
7812            printf(" %d", n_list);
7813            printf("\n");
7814        }
7815    }
7816    function_tests++;
7817#endif
7818
7819    return(test_ret);
7820}
7821
7822
7823static int
7824test_xmlShellPwd(void) {
7825    int test_ret = 0;
7826
7827#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7828    int mem_base;
7829    int ret_val;
7830    xmlShellCtxtPtr ctxt; /* the shell context */
7831    int n_ctxt;
7832    char * buffer; /* the output buffer */
7833    int n_buffer;
7834    xmlNodePtr node; /* a node */
7835    int n_node;
7836    xmlNodePtr node2; /* unused */
7837    int n_node2;
7838
7839    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7840    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7841    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7842    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7843        mem_base = xmlMemBlocks();
7844        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7845        buffer = gen_char_ptr(n_buffer, 1);
7846        node = gen_xmlNodePtr(n_node, 2);
7847        node2 = gen_xmlNodePtr(n_node2, 3);
7848
7849        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7850        desret_int(ret_val);
7851        call_tests++;
7852        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7853        des_char_ptr(n_buffer, buffer, 1);
7854        des_xmlNodePtr(n_node, node, 2);
7855        des_xmlNodePtr(n_node2, node2, 3);
7856        xmlResetLastError();
7857        if (mem_base != xmlMemBlocks()) {
7858            printf("Leak of %d blocks found in xmlShellPwd",
7859	           xmlMemBlocks() - mem_base);
7860	    test_ret++;
7861            printf(" %d", n_ctxt);
7862            printf(" %d", n_buffer);
7863            printf(" %d", n_node);
7864            printf(" %d", n_node2);
7865            printf("\n");
7866        }
7867    }
7868    }
7869    }
7870    }
7871    function_tests++;
7872#endif
7873
7874    return(test_ret);
7875}
7876
7877
7878static int
7879test_xmlShellSave(void) {
7880    int test_ret = 0;
7881
7882#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7883    int mem_base;
7884    int ret_val;
7885    xmlShellCtxtPtr ctxt; /* the shell context */
7886    int n_ctxt;
7887    char * filename; /* the file name (optional) */
7888    int n_filename;
7889    xmlNodePtr node; /* unused */
7890    int n_node;
7891    xmlNodePtr node2; /* unused */
7892    int n_node2;
7893
7894    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7895    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7896    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7897    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7898        mem_base = xmlMemBlocks();
7899        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7900        filename = gen_char_ptr(n_filename, 1);
7901        node = gen_xmlNodePtr(n_node, 2);
7902        node2 = gen_xmlNodePtr(n_node2, 3);
7903
7904        ret_val = xmlShellSave(ctxt, filename, node, node2);
7905        desret_int(ret_val);
7906        call_tests++;
7907        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7908        des_char_ptr(n_filename, filename, 1);
7909        des_xmlNodePtr(n_node, node, 2);
7910        des_xmlNodePtr(n_node2, node2, 3);
7911        xmlResetLastError();
7912        if (mem_base != xmlMemBlocks()) {
7913            printf("Leak of %d blocks found in xmlShellSave",
7914	           xmlMemBlocks() - mem_base);
7915	    test_ret++;
7916            printf(" %d", n_ctxt);
7917            printf(" %d", n_filename);
7918            printf(" %d", n_node);
7919            printf(" %d", n_node2);
7920            printf("\n");
7921        }
7922    }
7923    }
7924    }
7925    }
7926    function_tests++;
7927#endif
7928
7929    return(test_ret);
7930}
7931
7932
7933static int
7934test_xmlShellValidate(void) {
7935    int test_ret = 0;
7936
7937#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7938    int mem_base;
7939    int ret_val;
7940    xmlShellCtxtPtr ctxt; /* the shell context */
7941    int n_ctxt;
7942    char * dtd; /* the DTD URI (optional) */
7943    int n_dtd;
7944    xmlNodePtr node; /* unused */
7945    int n_node;
7946    xmlNodePtr node2; /* unused */
7947    int n_node2;
7948
7949    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7950    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7951    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7952    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7953        mem_base = xmlMemBlocks();
7954        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7955        dtd = gen_char_ptr(n_dtd, 1);
7956        node = gen_xmlNodePtr(n_node, 2);
7957        node2 = gen_xmlNodePtr(n_node2, 3);
7958
7959        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
7960        desret_int(ret_val);
7961        call_tests++;
7962        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7963        des_char_ptr(n_dtd, dtd, 1);
7964        des_xmlNodePtr(n_node, node, 2);
7965        des_xmlNodePtr(n_node2, node2, 3);
7966        xmlResetLastError();
7967        if (mem_base != xmlMemBlocks()) {
7968            printf("Leak of %d blocks found in xmlShellValidate",
7969	           xmlMemBlocks() - mem_base);
7970	    test_ret++;
7971            printf(" %d", n_ctxt);
7972            printf(" %d", n_dtd);
7973            printf(" %d", n_node);
7974            printf(" %d", n_node2);
7975            printf("\n");
7976        }
7977    }
7978    }
7979    }
7980    }
7981    function_tests++;
7982#endif
7983
7984    return(test_ret);
7985}
7986
7987
7988static int
7989test_xmlShellWrite(void) {
7990    int test_ret = 0;
7991
7992#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7993    int mem_base;
7994    int ret_val;
7995    xmlShellCtxtPtr ctxt; /* the shell context */
7996    int n_ctxt;
7997    char * filename; /* the file name */
7998    int n_filename;
7999    xmlNodePtr node; /* a node in the tree */
8000    int n_node;
8001    xmlNodePtr node2; /* unused */
8002    int n_node2;
8003
8004    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8005    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8006    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8007    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8008        mem_base = xmlMemBlocks();
8009        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8010        filename = gen_char_ptr(n_filename, 1);
8011        node = gen_xmlNodePtr(n_node, 2);
8012        node2 = gen_xmlNodePtr(n_node2, 3);
8013
8014        ret_val = xmlShellWrite(ctxt, filename, node, node2);
8015        desret_int(ret_val);
8016        call_tests++;
8017        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8018        des_char_ptr(n_filename, filename, 1);
8019        des_xmlNodePtr(n_node, node, 2);
8020        des_xmlNodePtr(n_node2, node2, 3);
8021        xmlResetLastError();
8022        if (mem_base != xmlMemBlocks()) {
8023            printf("Leak of %d blocks found in xmlShellWrite",
8024	           xmlMemBlocks() - mem_base);
8025	    test_ret++;
8026            printf(" %d", n_ctxt);
8027            printf(" %d", n_filename);
8028            printf(" %d", n_node);
8029            printf(" %d", n_node2);
8030            printf("\n");
8031        }
8032    }
8033    }
8034    }
8035    }
8036    function_tests++;
8037#endif
8038
8039    return(test_ret);
8040}
8041
8042static int
8043test_debugXML(void) {
8044    int test_ret = 0;
8045
8046    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8047    test_ret += test_xmlBoolToText();
8048    test_ret += test_xmlDebugCheckDocument();
8049    test_ret += test_xmlDebugDumpAttr();
8050    test_ret += test_xmlDebugDumpAttrList();
8051    test_ret += test_xmlDebugDumpDTD();
8052    test_ret += test_xmlDebugDumpDocument();
8053    test_ret += test_xmlDebugDumpDocumentHead();
8054    test_ret += test_xmlDebugDumpEntities();
8055    test_ret += test_xmlDebugDumpNode();
8056    test_ret += test_xmlDebugDumpNodeList();
8057    test_ret += test_xmlDebugDumpOneNode();
8058    test_ret += test_xmlDebugDumpString();
8059    test_ret += test_xmlLsCountNode();
8060    test_ret += test_xmlLsOneNode();
8061    test_ret += test_xmlShell();
8062    test_ret += test_xmlShellBase();
8063    test_ret += test_xmlShellCat();
8064    test_ret += test_xmlShellDir();
8065    test_ret += test_xmlShellDu();
8066    test_ret += test_xmlShellList();
8067    test_ret += test_xmlShellLoad();
8068    test_ret += test_xmlShellPrintXPathResult();
8069    test_ret += test_xmlShellPwd();
8070    test_ret += test_xmlShellSave();
8071    test_ret += test_xmlShellValidate();
8072    test_ret += test_xmlShellWrite();
8073
8074    if (test_ret != 0)
8075	printf("Module debugXML: %d errors\n", test_ret);
8076    return(test_ret);
8077}
8078
8079static int
8080test_xmlDictCleanup(void) {
8081    int test_ret = 0;
8082
8083    int mem_base;
8084
8085        mem_base = xmlMemBlocks();
8086
8087        xmlDictCleanup();
8088        call_tests++;
8089        xmlResetLastError();
8090        if (mem_base != xmlMemBlocks()) {
8091            printf("Leak of %d blocks found in xmlDictCleanup",
8092	           xmlMemBlocks() - mem_base);
8093	    test_ret++;
8094            printf("\n");
8095        }
8096    function_tests++;
8097
8098    return(test_ret);
8099}
8100
8101
8102static int
8103test_xmlDictCreate(void) {
8104    int test_ret = 0;
8105
8106    int mem_base;
8107    xmlDictPtr ret_val;
8108
8109        mem_base = xmlMemBlocks();
8110
8111        ret_val = xmlDictCreate();
8112        desret_xmlDictPtr(ret_val);
8113        call_tests++;
8114        xmlResetLastError();
8115        if (mem_base != xmlMemBlocks()) {
8116            printf("Leak of %d blocks found in xmlDictCreate",
8117	           xmlMemBlocks() - mem_base);
8118	    test_ret++;
8119            printf("\n");
8120        }
8121    function_tests++;
8122
8123    return(test_ret);
8124}
8125
8126
8127static int
8128test_xmlDictCreateSub(void) {
8129    int test_ret = 0;
8130
8131    int mem_base;
8132    xmlDictPtr ret_val;
8133    xmlDictPtr sub; /* an existing dictionnary */
8134    int n_sub;
8135
8136    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8137        mem_base = xmlMemBlocks();
8138        sub = gen_xmlDictPtr(n_sub, 0);
8139
8140        ret_val = xmlDictCreateSub(sub);
8141        desret_xmlDictPtr(ret_val);
8142        call_tests++;
8143        des_xmlDictPtr(n_sub, sub, 0);
8144        xmlResetLastError();
8145        if (mem_base != xmlMemBlocks()) {
8146            printf("Leak of %d blocks found in xmlDictCreateSub",
8147	           xmlMemBlocks() - mem_base);
8148	    test_ret++;
8149            printf(" %d", n_sub);
8150            printf("\n");
8151        }
8152    }
8153    function_tests++;
8154
8155    return(test_ret);
8156}
8157
8158
8159static int
8160test_xmlDictExists(void) {
8161    int test_ret = 0;
8162
8163    int mem_base;
8164    const xmlChar * ret_val;
8165    xmlDictPtr dict; /* the dictionnary */
8166    int n_dict;
8167    xmlChar * name; /* the name of the userdata */
8168    int n_name;
8169    int len; /* the length of the name, if -1 it is recomputed */
8170    int n_len;
8171
8172    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8173    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8174    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8175        mem_base = xmlMemBlocks();
8176        dict = gen_xmlDictPtr(n_dict, 0);
8177        name = gen_const_xmlChar_ptr(n_name, 1);
8178        len = gen_int(n_len, 2);
8179
8180        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8181        desret_const_xmlChar_ptr(ret_val);
8182        call_tests++;
8183        des_xmlDictPtr(n_dict, dict, 0);
8184        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8185        des_int(n_len, len, 2);
8186        xmlResetLastError();
8187        if (mem_base != xmlMemBlocks()) {
8188            printf("Leak of %d blocks found in xmlDictExists",
8189	           xmlMemBlocks() - mem_base);
8190	    test_ret++;
8191            printf(" %d", n_dict);
8192            printf(" %d", n_name);
8193            printf(" %d", n_len);
8194            printf("\n");
8195        }
8196    }
8197    }
8198    }
8199    function_tests++;
8200
8201    return(test_ret);
8202}
8203
8204
8205static int
8206test_xmlDictLookup(void) {
8207    int test_ret = 0;
8208
8209    int mem_base;
8210    const xmlChar * ret_val;
8211    xmlDictPtr dict; /* the dictionnary */
8212    int n_dict;
8213    xmlChar * name; /* the name of the userdata */
8214    int n_name;
8215    int len; /* the length of the name, if -1 it is recomputed */
8216    int n_len;
8217
8218    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8219    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8220    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8221        mem_base = xmlMemBlocks();
8222        dict = gen_xmlDictPtr(n_dict, 0);
8223        name = gen_const_xmlChar_ptr(n_name, 1);
8224        len = gen_int(n_len, 2);
8225
8226        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8227        desret_const_xmlChar_ptr(ret_val);
8228        call_tests++;
8229        des_xmlDictPtr(n_dict, dict, 0);
8230        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8231        des_int(n_len, len, 2);
8232        xmlResetLastError();
8233        if (mem_base != xmlMemBlocks()) {
8234            printf("Leak of %d blocks found in xmlDictLookup",
8235	           xmlMemBlocks() - mem_base);
8236	    test_ret++;
8237            printf(" %d", n_dict);
8238            printf(" %d", n_name);
8239            printf(" %d", n_len);
8240            printf("\n");
8241        }
8242    }
8243    }
8244    }
8245    function_tests++;
8246
8247    return(test_ret);
8248}
8249
8250
8251static int
8252test_xmlDictOwns(void) {
8253    int test_ret = 0;
8254
8255    int mem_base;
8256    int ret_val;
8257    xmlDictPtr dict; /* the dictionnary */
8258    int n_dict;
8259    xmlChar * str; /* the string */
8260    int n_str;
8261
8262    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8263    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8264        mem_base = xmlMemBlocks();
8265        dict = gen_xmlDictPtr(n_dict, 0);
8266        str = gen_const_xmlChar_ptr(n_str, 1);
8267
8268        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8269        desret_int(ret_val);
8270        call_tests++;
8271        des_xmlDictPtr(n_dict, dict, 0);
8272        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8273        xmlResetLastError();
8274        if (mem_base != xmlMemBlocks()) {
8275            printf("Leak of %d blocks found in xmlDictOwns",
8276	           xmlMemBlocks() - mem_base);
8277	    test_ret++;
8278            printf(" %d", n_dict);
8279            printf(" %d", n_str);
8280            printf("\n");
8281        }
8282    }
8283    }
8284    function_tests++;
8285
8286    return(test_ret);
8287}
8288
8289
8290static int
8291test_xmlDictQLookup(void) {
8292    int test_ret = 0;
8293
8294    int mem_base;
8295    const xmlChar * ret_val;
8296    xmlDictPtr dict; /* the dictionnary */
8297    int n_dict;
8298    xmlChar * prefix; /* the prefix */
8299    int n_prefix;
8300    xmlChar * name; /* the name */
8301    int n_name;
8302
8303    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8304    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8305    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8306        mem_base = xmlMemBlocks();
8307        dict = gen_xmlDictPtr(n_dict, 0);
8308        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8309        name = gen_const_xmlChar_ptr(n_name, 2);
8310
8311        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8312        desret_const_xmlChar_ptr(ret_val);
8313        call_tests++;
8314        des_xmlDictPtr(n_dict, dict, 0);
8315        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8316        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8317        xmlResetLastError();
8318        if (mem_base != xmlMemBlocks()) {
8319            printf("Leak of %d blocks found in xmlDictQLookup",
8320	           xmlMemBlocks() - mem_base);
8321	    test_ret++;
8322            printf(" %d", n_dict);
8323            printf(" %d", n_prefix);
8324            printf(" %d", n_name);
8325            printf("\n");
8326        }
8327    }
8328    }
8329    }
8330    function_tests++;
8331
8332    return(test_ret);
8333}
8334
8335
8336static int
8337test_xmlDictReference(void) {
8338    int test_ret = 0;
8339
8340    int mem_base;
8341    int ret_val;
8342    xmlDictPtr dict; /* the dictionnary */
8343    int n_dict;
8344
8345    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8346        mem_base = xmlMemBlocks();
8347        dict = gen_xmlDictPtr(n_dict, 0);
8348
8349        ret_val = xmlDictReference(dict);
8350        xmlDictFree(dict);
8351        desret_int(ret_val);
8352        call_tests++;
8353        des_xmlDictPtr(n_dict, dict, 0);
8354        xmlResetLastError();
8355        if (mem_base != xmlMemBlocks()) {
8356            printf("Leak of %d blocks found in xmlDictReference",
8357	           xmlMemBlocks() - mem_base);
8358	    test_ret++;
8359            printf(" %d", n_dict);
8360            printf("\n");
8361        }
8362    }
8363    function_tests++;
8364
8365    return(test_ret);
8366}
8367
8368
8369static int
8370test_xmlDictSize(void) {
8371    int test_ret = 0;
8372
8373    int mem_base;
8374    int ret_val;
8375    xmlDictPtr dict; /* the dictionnary */
8376    int n_dict;
8377
8378    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8379        mem_base = xmlMemBlocks();
8380        dict = gen_xmlDictPtr(n_dict, 0);
8381
8382        ret_val = xmlDictSize(dict);
8383        desret_int(ret_val);
8384        call_tests++;
8385        des_xmlDictPtr(n_dict, dict, 0);
8386        xmlResetLastError();
8387        if (mem_base != xmlMemBlocks()) {
8388            printf("Leak of %d blocks found in xmlDictSize",
8389	           xmlMemBlocks() - mem_base);
8390	    test_ret++;
8391            printf(" %d", n_dict);
8392            printf("\n");
8393        }
8394    }
8395    function_tests++;
8396
8397    return(test_ret);
8398}
8399
8400static int
8401test_dict(void) {
8402    int test_ret = 0;
8403
8404    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8405    test_ret += test_xmlDictCleanup();
8406    test_ret += test_xmlDictCreate();
8407    test_ret += test_xmlDictCreateSub();
8408    test_ret += test_xmlDictExists();
8409    test_ret += test_xmlDictLookup();
8410    test_ret += test_xmlDictOwns();
8411    test_ret += test_xmlDictQLookup();
8412    test_ret += test_xmlDictReference();
8413    test_ret += test_xmlDictSize();
8414
8415    if (test_ret != 0)
8416	printf("Module dict: %d errors\n", test_ret);
8417    return(test_ret);
8418}
8419
8420static int
8421test_UTF8Toisolat1(void) {
8422    int test_ret = 0;
8423
8424#if defined(LIBXML_OUTPUT_ENABLED)
8425#ifdef LIBXML_OUTPUT_ENABLED
8426    int mem_base;
8427    int ret_val;
8428    unsigned char * out; /* a pointer to an array of bytes to store the result */
8429    int n_out;
8430    int * outlen; /* the length of @out */
8431    int n_outlen;
8432    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8433    int n_in;
8434    int * inlen; /* the length of @in */
8435    int n_inlen;
8436
8437    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8438    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8439    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8440    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8441        mem_base = xmlMemBlocks();
8442        out = gen_unsigned_char_ptr(n_out, 0);
8443        outlen = gen_int_ptr(n_outlen, 1);
8444        in = gen_const_unsigned_char_ptr(n_in, 2);
8445        inlen = gen_int_ptr(n_inlen, 3);
8446
8447        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8448        desret_int(ret_val);
8449        call_tests++;
8450        des_unsigned_char_ptr(n_out, out, 0);
8451        des_int_ptr(n_outlen, outlen, 1);
8452        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8453        des_int_ptr(n_inlen, inlen, 3);
8454        xmlResetLastError();
8455        if (mem_base != xmlMemBlocks()) {
8456            printf("Leak of %d blocks found in UTF8Toisolat1",
8457	           xmlMemBlocks() - mem_base);
8458	    test_ret++;
8459            printf(" %d", n_out);
8460            printf(" %d", n_outlen);
8461            printf(" %d", n_in);
8462            printf(" %d", n_inlen);
8463            printf("\n");
8464        }
8465    }
8466    }
8467    }
8468    }
8469    function_tests++;
8470#endif
8471#endif
8472
8473    return(test_ret);
8474}
8475
8476
8477static int
8478test_isolat1ToUTF8(void) {
8479    int test_ret = 0;
8480
8481    int mem_base;
8482    int ret_val;
8483    unsigned char * out; /* a pointer to an array of bytes to store the result */
8484    int n_out;
8485    int * outlen; /* the length of @out */
8486    int n_outlen;
8487    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8488    int n_in;
8489    int * inlen; /* the length of @in */
8490    int n_inlen;
8491
8492    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8493    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8494    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8495    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8496        mem_base = xmlMemBlocks();
8497        out = gen_unsigned_char_ptr(n_out, 0);
8498        outlen = gen_int_ptr(n_outlen, 1);
8499        in = gen_const_unsigned_char_ptr(n_in, 2);
8500        inlen = gen_int_ptr(n_inlen, 3);
8501
8502        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8503        desret_int(ret_val);
8504        call_tests++;
8505        des_unsigned_char_ptr(n_out, out, 0);
8506        des_int_ptr(n_outlen, outlen, 1);
8507        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8508        des_int_ptr(n_inlen, inlen, 3);
8509        xmlResetLastError();
8510        if (mem_base != xmlMemBlocks()) {
8511            printf("Leak of %d blocks found in isolat1ToUTF8",
8512	           xmlMemBlocks() - mem_base);
8513	    test_ret++;
8514            printf(" %d", n_out);
8515            printf(" %d", n_outlen);
8516            printf(" %d", n_in);
8517            printf(" %d", n_inlen);
8518            printf("\n");
8519        }
8520    }
8521    }
8522    }
8523    }
8524    function_tests++;
8525
8526    return(test_ret);
8527}
8528
8529
8530static int
8531test_xmlAddEncodingAlias(void) {
8532    int test_ret = 0;
8533
8534    int ret_val;
8535    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8536    int n_name;
8537    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8538    int n_alias;
8539
8540    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8541    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8542        name = gen_const_char_ptr(n_name, 0);
8543        alias = gen_const_char_ptr(n_alias, 1);
8544
8545        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8546        desret_int(ret_val);
8547        call_tests++;
8548        des_const_char_ptr(n_name, (const char *)name, 0);
8549        des_const_char_ptr(n_alias, (const char *)alias, 1);
8550        xmlResetLastError();
8551    }
8552    }
8553    function_tests++;
8554
8555    return(test_ret);
8556}
8557
8558
8559#define gen_nb_xmlCharEncodingHandler_ptr 1
8560static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8561    return(NULL);
8562}
8563static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8564}
8565
8566static int
8567test_xmlCharEncCloseFunc(void) {
8568    int test_ret = 0;
8569
8570    int mem_base;
8571    int ret_val;
8572    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8573    int n_handler;
8574
8575    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8576        mem_base = xmlMemBlocks();
8577        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8578
8579        ret_val = xmlCharEncCloseFunc(handler);
8580        desret_int(ret_val);
8581        call_tests++;
8582        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8583        xmlResetLastError();
8584        if (mem_base != xmlMemBlocks()) {
8585            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8586	           xmlMemBlocks() - mem_base);
8587	    test_ret++;
8588            printf(" %d", n_handler);
8589            printf("\n");
8590        }
8591    }
8592    function_tests++;
8593
8594    return(test_ret);
8595}
8596
8597
8598static int
8599test_xmlCharEncFirstLine(void) {
8600    int test_ret = 0;
8601
8602    int mem_base;
8603    int ret_val;
8604    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8605    int n_handler;
8606    xmlBufferPtr out; /* an xmlBuffer for the output. */
8607    int n_out;
8608    xmlBufferPtr in; /* an xmlBuffer for the input */
8609    int n_in;
8610
8611    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8612    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8613    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8614        mem_base = xmlMemBlocks();
8615        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8616        out = gen_xmlBufferPtr(n_out, 1);
8617        in = gen_xmlBufferPtr(n_in, 2);
8618
8619        ret_val = xmlCharEncFirstLine(handler, out, in);
8620        desret_int(ret_val);
8621        call_tests++;
8622        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8623        des_xmlBufferPtr(n_out, out, 1);
8624        des_xmlBufferPtr(n_in, in, 2);
8625        xmlResetLastError();
8626        if (mem_base != xmlMemBlocks()) {
8627            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8628	           xmlMemBlocks() - mem_base);
8629	    test_ret++;
8630            printf(" %d", n_handler);
8631            printf(" %d", n_out);
8632            printf(" %d", n_in);
8633            printf("\n");
8634        }
8635    }
8636    }
8637    }
8638    function_tests++;
8639
8640    return(test_ret);
8641}
8642
8643
8644static int
8645test_xmlCharEncInFunc(void) {
8646    int test_ret = 0;
8647
8648    int mem_base;
8649    int ret_val;
8650    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8651    int n_handler;
8652    xmlBufferPtr out; /* an xmlBuffer for the output. */
8653    int n_out;
8654    xmlBufferPtr in; /* an xmlBuffer for the input */
8655    int n_in;
8656
8657    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8658    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8659    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8660        mem_base = xmlMemBlocks();
8661        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8662        out = gen_xmlBufferPtr(n_out, 1);
8663        in = gen_xmlBufferPtr(n_in, 2);
8664
8665        ret_val = xmlCharEncInFunc(handler, out, in);
8666        desret_int(ret_val);
8667        call_tests++;
8668        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8669        des_xmlBufferPtr(n_out, out, 1);
8670        des_xmlBufferPtr(n_in, in, 2);
8671        xmlResetLastError();
8672        if (mem_base != xmlMemBlocks()) {
8673            printf("Leak of %d blocks found in xmlCharEncInFunc",
8674	           xmlMemBlocks() - mem_base);
8675	    test_ret++;
8676            printf(" %d", n_handler);
8677            printf(" %d", n_out);
8678            printf(" %d", n_in);
8679            printf("\n");
8680        }
8681    }
8682    }
8683    }
8684    function_tests++;
8685
8686    return(test_ret);
8687}
8688
8689
8690static int
8691test_xmlCharEncOutFunc(void) {
8692    int test_ret = 0;
8693
8694    int mem_base;
8695    int ret_val;
8696    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8697    int n_handler;
8698    xmlBufferPtr out; /* an xmlBuffer for the output. */
8699    int n_out;
8700    xmlBufferPtr in; /* an xmlBuffer for the input */
8701    int n_in;
8702
8703    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8704    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8705    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8706        mem_base = xmlMemBlocks();
8707        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8708        out = gen_xmlBufferPtr(n_out, 1);
8709        in = gen_xmlBufferPtr(n_in, 2);
8710
8711        ret_val = xmlCharEncOutFunc(handler, out, in);
8712        desret_int(ret_val);
8713        call_tests++;
8714        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8715        des_xmlBufferPtr(n_out, out, 1);
8716        des_xmlBufferPtr(n_in, in, 2);
8717        xmlResetLastError();
8718        if (mem_base != xmlMemBlocks()) {
8719            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8720	           xmlMemBlocks() - mem_base);
8721	    test_ret++;
8722            printf(" %d", n_handler);
8723            printf(" %d", n_out);
8724            printf(" %d", n_in);
8725            printf("\n");
8726        }
8727    }
8728    }
8729    }
8730    function_tests++;
8731
8732    return(test_ret);
8733}
8734
8735
8736static int
8737test_xmlCleanupCharEncodingHandlers(void) {
8738    int test_ret = 0;
8739
8740
8741
8742        xmlCleanupCharEncodingHandlers();
8743        call_tests++;
8744        xmlResetLastError();
8745    function_tests++;
8746
8747    return(test_ret);
8748}
8749
8750
8751static int
8752test_xmlCleanupEncodingAliases(void) {
8753    int test_ret = 0;
8754
8755    int mem_base;
8756
8757        mem_base = xmlMemBlocks();
8758
8759        xmlCleanupEncodingAliases();
8760        call_tests++;
8761        xmlResetLastError();
8762        if (mem_base != xmlMemBlocks()) {
8763            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8764	           xmlMemBlocks() - mem_base);
8765	    test_ret++;
8766            printf("\n");
8767        }
8768    function_tests++;
8769
8770    return(test_ret);
8771}
8772
8773
8774static int
8775test_xmlDelEncodingAlias(void) {
8776    int test_ret = 0;
8777
8778    int mem_base;
8779    int ret_val;
8780    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8781    int n_alias;
8782
8783    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8784        mem_base = xmlMemBlocks();
8785        alias = gen_const_char_ptr(n_alias, 0);
8786
8787        ret_val = xmlDelEncodingAlias((const char *)alias);
8788        desret_int(ret_val);
8789        call_tests++;
8790        des_const_char_ptr(n_alias, (const char *)alias, 0);
8791        xmlResetLastError();
8792        if (mem_base != xmlMemBlocks()) {
8793            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8794	           xmlMemBlocks() - mem_base);
8795	    test_ret++;
8796            printf(" %d", n_alias);
8797            printf("\n");
8798        }
8799    }
8800    function_tests++;
8801
8802    return(test_ret);
8803}
8804
8805
8806static int
8807test_xmlDetectCharEncoding(void) {
8808    int test_ret = 0;
8809
8810    int mem_base;
8811    xmlCharEncoding ret_val;
8812    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). */
8813    int n_in;
8814    int len; /* pointer to the length of the buffer */
8815    int n_len;
8816
8817    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8818    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8819        mem_base = xmlMemBlocks();
8820        in = gen_const_unsigned_char_ptr(n_in, 0);
8821        len = gen_int(n_len, 1);
8822
8823        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8824        desret_xmlCharEncoding(ret_val);
8825        call_tests++;
8826        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8827        des_int(n_len, len, 1);
8828        xmlResetLastError();
8829        if (mem_base != xmlMemBlocks()) {
8830            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8831	           xmlMemBlocks() - mem_base);
8832	    test_ret++;
8833            printf(" %d", n_in);
8834            printf(" %d", n_len);
8835            printf("\n");
8836        }
8837    }
8838    }
8839    function_tests++;
8840
8841    return(test_ret);
8842}
8843
8844
8845static int
8846test_xmlFindCharEncodingHandler(void) {
8847    int test_ret = 0;
8848
8849
8850    /* missing type support */
8851    return(test_ret);
8852}
8853
8854
8855static int
8856test_xmlGetCharEncodingHandler(void) {
8857    int test_ret = 0;
8858
8859
8860    /* missing type support */
8861    return(test_ret);
8862}
8863
8864
8865static int
8866test_xmlGetCharEncodingName(void) {
8867    int test_ret = 0;
8868
8869    int mem_base;
8870    const char * ret_val;
8871    xmlCharEncoding enc; /* the encoding */
8872    int n_enc;
8873
8874    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8875        mem_base = xmlMemBlocks();
8876        enc = gen_xmlCharEncoding(n_enc, 0);
8877
8878        ret_val = xmlGetCharEncodingName(enc);
8879        desret_const_char_ptr(ret_val);
8880        call_tests++;
8881        des_xmlCharEncoding(n_enc, enc, 0);
8882        xmlResetLastError();
8883        if (mem_base != xmlMemBlocks()) {
8884            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8885	           xmlMemBlocks() - mem_base);
8886	    test_ret++;
8887            printf(" %d", n_enc);
8888            printf("\n");
8889        }
8890    }
8891    function_tests++;
8892
8893    return(test_ret);
8894}
8895
8896
8897static int
8898test_xmlGetEncodingAlias(void) {
8899    int test_ret = 0;
8900
8901    int mem_base;
8902    const char * ret_val;
8903    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8904    int n_alias;
8905
8906    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8907        mem_base = xmlMemBlocks();
8908        alias = gen_const_char_ptr(n_alias, 0);
8909
8910        ret_val = xmlGetEncodingAlias((const char *)alias);
8911        desret_const_char_ptr(ret_val);
8912        call_tests++;
8913        des_const_char_ptr(n_alias, (const char *)alias, 0);
8914        xmlResetLastError();
8915        if (mem_base != xmlMemBlocks()) {
8916            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8917	           xmlMemBlocks() - mem_base);
8918	    test_ret++;
8919            printf(" %d", n_alias);
8920            printf("\n");
8921        }
8922    }
8923    function_tests++;
8924
8925    return(test_ret);
8926}
8927
8928
8929static int
8930test_xmlInitCharEncodingHandlers(void) {
8931    int test_ret = 0;
8932
8933
8934
8935        xmlInitCharEncodingHandlers();
8936        call_tests++;
8937        xmlResetLastError();
8938    function_tests++;
8939
8940    return(test_ret);
8941}
8942
8943
8944static int
8945test_xmlNewCharEncodingHandler(void) {
8946    int test_ret = 0;
8947
8948
8949    /* missing type support */
8950    return(test_ret);
8951}
8952
8953
8954static int
8955test_xmlParseCharEncoding(void) {
8956    int test_ret = 0;
8957
8958    int mem_base;
8959    xmlCharEncoding ret_val;
8960    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8961    int n_name;
8962
8963    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8964        mem_base = xmlMemBlocks();
8965        name = gen_const_char_ptr(n_name, 0);
8966
8967        ret_val = xmlParseCharEncoding((const char *)name);
8968        desret_xmlCharEncoding(ret_val);
8969        call_tests++;
8970        des_const_char_ptr(n_name, (const char *)name, 0);
8971        xmlResetLastError();
8972        if (mem_base != xmlMemBlocks()) {
8973            printf("Leak of %d blocks found in xmlParseCharEncoding",
8974	           xmlMemBlocks() - mem_base);
8975	    test_ret++;
8976            printf(" %d", n_name);
8977            printf("\n");
8978        }
8979    }
8980    function_tests++;
8981
8982    return(test_ret);
8983}
8984
8985
8986#define gen_nb_xmlCharEncodingHandlerPtr 1
8987static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8988    return(NULL);
8989}
8990static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8991}
8992
8993static int
8994test_xmlRegisterCharEncodingHandler(void) {
8995    int test_ret = 0;
8996
8997    int mem_base;
8998    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
8999    int n_handler;
9000
9001    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9002        mem_base = xmlMemBlocks();
9003        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9004
9005        xmlRegisterCharEncodingHandler(handler);
9006        call_tests++;
9007        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9008        xmlResetLastError();
9009        if (mem_base != xmlMemBlocks()) {
9010            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9011	           xmlMemBlocks() - mem_base);
9012	    test_ret++;
9013            printf(" %d", n_handler);
9014            printf("\n");
9015        }
9016    }
9017    function_tests++;
9018
9019    return(test_ret);
9020}
9021
9022static int
9023test_encoding(void) {
9024    int test_ret = 0;
9025
9026    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9027    test_ret += test_UTF8Toisolat1();
9028    test_ret += test_isolat1ToUTF8();
9029    test_ret += test_xmlAddEncodingAlias();
9030    test_ret += test_xmlCharEncCloseFunc();
9031    test_ret += test_xmlCharEncFirstLine();
9032    test_ret += test_xmlCharEncInFunc();
9033    test_ret += test_xmlCharEncOutFunc();
9034    test_ret += test_xmlCleanupCharEncodingHandlers();
9035    test_ret += test_xmlCleanupEncodingAliases();
9036    test_ret += test_xmlDelEncodingAlias();
9037    test_ret += test_xmlDetectCharEncoding();
9038    test_ret += test_xmlFindCharEncodingHandler();
9039    test_ret += test_xmlGetCharEncodingHandler();
9040    test_ret += test_xmlGetCharEncodingName();
9041    test_ret += test_xmlGetEncodingAlias();
9042    test_ret += test_xmlInitCharEncodingHandlers();
9043    test_ret += test_xmlNewCharEncodingHandler();
9044    test_ret += test_xmlParseCharEncoding();
9045    test_ret += test_xmlRegisterCharEncodingHandler();
9046
9047    if (test_ret != 0)
9048	printf("Module encoding: %d errors\n", test_ret);
9049    return(test_ret);
9050}
9051
9052static int
9053test_xmlAddDocEntity(void) {
9054    int test_ret = 0;
9055
9056    int mem_base;
9057    xmlEntityPtr ret_val;
9058    xmlDocPtr doc; /* the document */
9059    int n_doc;
9060    xmlChar * name; /* the entity name */
9061    int n_name;
9062    int type; /* the entity type XML_xxx_yyy_ENTITY */
9063    int n_type;
9064    xmlChar * ExternalID; /* the entity external ID if available */
9065    int n_ExternalID;
9066    xmlChar * SystemID; /* the entity system ID if available */
9067    int n_SystemID;
9068    xmlChar * content; /* the entity content */
9069    int n_content;
9070
9071    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9072    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9073    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9074    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9075    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9076    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9077        mem_base = xmlMemBlocks();
9078        doc = gen_xmlDocPtr(n_doc, 0);
9079        name = gen_const_xmlChar_ptr(n_name, 1);
9080        type = gen_int(n_type, 2);
9081        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9082        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9083        content = gen_const_xmlChar_ptr(n_content, 5);
9084
9085        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9086        desret_xmlEntityPtr(ret_val);
9087        call_tests++;
9088        des_xmlDocPtr(n_doc, doc, 0);
9089        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9090        des_int(n_type, type, 2);
9091        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9092        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9093        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9094        xmlResetLastError();
9095        if (mem_base != xmlMemBlocks()) {
9096            printf("Leak of %d blocks found in xmlAddDocEntity",
9097	           xmlMemBlocks() - mem_base);
9098	    test_ret++;
9099            printf(" %d", n_doc);
9100            printf(" %d", n_name);
9101            printf(" %d", n_type);
9102            printf(" %d", n_ExternalID);
9103            printf(" %d", n_SystemID);
9104            printf(" %d", n_content);
9105            printf("\n");
9106        }
9107    }
9108    }
9109    }
9110    }
9111    }
9112    }
9113    function_tests++;
9114
9115    return(test_ret);
9116}
9117
9118
9119static int
9120test_xmlAddDtdEntity(void) {
9121    int test_ret = 0;
9122
9123    int mem_base;
9124    xmlEntityPtr ret_val;
9125    xmlDocPtr doc; /* the document */
9126    int n_doc;
9127    xmlChar * name; /* the entity name */
9128    int n_name;
9129    int type; /* the entity type XML_xxx_yyy_ENTITY */
9130    int n_type;
9131    xmlChar * ExternalID; /* the entity external ID if available */
9132    int n_ExternalID;
9133    xmlChar * SystemID; /* the entity system ID if available */
9134    int n_SystemID;
9135    xmlChar * content; /* the entity content */
9136    int n_content;
9137
9138    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9139    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9140    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9141    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9142    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9143    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9144        mem_base = xmlMemBlocks();
9145        doc = gen_xmlDocPtr(n_doc, 0);
9146        name = gen_const_xmlChar_ptr(n_name, 1);
9147        type = gen_int(n_type, 2);
9148        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9149        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9150        content = gen_const_xmlChar_ptr(n_content, 5);
9151
9152        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9153        desret_xmlEntityPtr(ret_val);
9154        call_tests++;
9155        des_xmlDocPtr(n_doc, doc, 0);
9156        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9157        des_int(n_type, type, 2);
9158        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9159        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9160        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9161        xmlResetLastError();
9162        if (mem_base != xmlMemBlocks()) {
9163            printf("Leak of %d blocks found in xmlAddDtdEntity",
9164	           xmlMemBlocks() - mem_base);
9165	    test_ret++;
9166            printf(" %d", n_doc);
9167            printf(" %d", n_name);
9168            printf(" %d", n_type);
9169            printf(" %d", n_ExternalID);
9170            printf(" %d", n_SystemID);
9171            printf(" %d", n_content);
9172            printf("\n");
9173        }
9174    }
9175    }
9176    }
9177    }
9178    }
9179    }
9180    function_tests++;
9181
9182    return(test_ret);
9183}
9184
9185
9186static int
9187test_xmlCleanupPredefinedEntities(void) {
9188    int test_ret = 0;
9189
9190#if defined(LIBXML_LEGACY_ENABLED)
9191#ifdef LIBXML_LEGACY_ENABLED
9192    int mem_base;
9193
9194        mem_base = xmlMemBlocks();
9195
9196        xmlCleanupPredefinedEntities();
9197        call_tests++;
9198        xmlResetLastError();
9199        if (mem_base != xmlMemBlocks()) {
9200            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9201	           xmlMemBlocks() - mem_base);
9202	    test_ret++;
9203            printf("\n");
9204        }
9205    function_tests++;
9206#endif
9207#endif
9208
9209    return(test_ret);
9210}
9211
9212
9213#define gen_nb_xmlEntitiesTablePtr 1
9214static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9215    return(NULL);
9216}
9217static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9218}
9219
9220static int
9221test_xmlCopyEntitiesTable(void) {
9222    int test_ret = 0;
9223
9224
9225    /* missing type support */
9226    return(test_ret);
9227}
9228
9229
9230static int
9231test_xmlCreateEntitiesTable(void) {
9232    int test_ret = 0;
9233
9234
9235    /* missing type support */
9236    return(test_ret);
9237}
9238
9239
9240static int
9241test_xmlDumpEntitiesTable(void) {
9242    int test_ret = 0;
9243
9244#if defined(LIBXML_OUTPUT_ENABLED)
9245    int mem_base;
9246    xmlBufferPtr buf; /* An XML buffer. */
9247    int n_buf;
9248    xmlEntitiesTablePtr table; /* An entity table */
9249    int n_table;
9250
9251    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9252    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9253        mem_base = xmlMemBlocks();
9254        buf = gen_xmlBufferPtr(n_buf, 0);
9255        table = gen_xmlEntitiesTablePtr(n_table, 1);
9256
9257        xmlDumpEntitiesTable(buf, table);
9258        call_tests++;
9259        des_xmlBufferPtr(n_buf, buf, 0);
9260        des_xmlEntitiesTablePtr(n_table, table, 1);
9261        xmlResetLastError();
9262        if (mem_base != xmlMemBlocks()) {
9263            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9264	           xmlMemBlocks() - mem_base);
9265	    test_ret++;
9266            printf(" %d", n_buf);
9267            printf(" %d", n_table);
9268            printf("\n");
9269        }
9270    }
9271    }
9272    function_tests++;
9273#endif
9274
9275    return(test_ret);
9276}
9277
9278
9279#define gen_nb_xmlEntityPtr 1
9280static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9281    return(NULL);
9282}
9283static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9284}
9285
9286static int
9287test_xmlDumpEntityDecl(void) {
9288    int test_ret = 0;
9289
9290#if defined(LIBXML_OUTPUT_ENABLED)
9291    int mem_base;
9292    xmlBufferPtr buf; /* An XML buffer. */
9293    int n_buf;
9294    xmlEntityPtr ent; /* An entity table */
9295    int n_ent;
9296
9297    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9298    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9299        mem_base = xmlMemBlocks();
9300        buf = gen_xmlBufferPtr(n_buf, 0);
9301        ent = gen_xmlEntityPtr(n_ent, 1);
9302
9303        xmlDumpEntityDecl(buf, ent);
9304        call_tests++;
9305        des_xmlBufferPtr(n_buf, buf, 0);
9306        des_xmlEntityPtr(n_ent, ent, 1);
9307        xmlResetLastError();
9308        if (mem_base != xmlMemBlocks()) {
9309            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9310	           xmlMemBlocks() - mem_base);
9311	    test_ret++;
9312            printf(" %d", n_buf);
9313            printf(" %d", n_ent);
9314            printf("\n");
9315        }
9316    }
9317    }
9318    function_tests++;
9319#endif
9320
9321    return(test_ret);
9322}
9323
9324
9325static int
9326test_xmlEncodeEntitiesReentrant(void) {
9327    int test_ret = 0;
9328
9329    int mem_base;
9330    xmlChar * ret_val;
9331    xmlDocPtr doc; /* the document containing the string */
9332    int n_doc;
9333    xmlChar * input; /* A string to convert to XML. */
9334    int n_input;
9335
9336    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9337    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9338        mem_base = xmlMemBlocks();
9339        doc = gen_xmlDocPtr(n_doc, 0);
9340        input = gen_const_xmlChar_ptr(n_input, 1);
9341
9342        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9343        desret_xmlChar_ptr(ret_val);
9344        call_tests++;
9345        des_xmlDocPtr(n_doc, doc, 0);
9346        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9347        xmlResetLastError();
9348        if (mem_base != xmlMemBlocks()) {
9349            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9350	           xmlMemBlocks() - mem_base);
9351	    test_ret++;
9352            printf(" %d", n_doc);
9353            printf(" %d", n_input);
9354            printf("\n");
9355        }
9356    }
9357    }
9358    function_tests++;
9359
9360    return(test_ret);
9361}
9362
9363
9364static int
9365test_xmlEncodeSpecialChars(void) {
9366    int test_ret = 0;
9367
9368    int mem_base;
9369    xmlChar * ret_val;
9370    xmlDocPtr doc; /* the document containing the string */
9371    int n_doc;
9372    xmlChar * input; /* A string to convert to XML. */
9373    int n_input;
9374
9375    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9376    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9377        mem_base = xmlMemBlocks();
9378        doc = gen_xmlDocPtr(n_doc, 0);
9379        input = gen_const_xmlChar_ptr(n_input, 1);
9380
9381        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9382        desret_xmlChar_ptr(ret_val);
9383        call_tests++;
9384        des_xmlDocPtr(n_doc, doc, 0);
9385        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9386        xmlResetLastError();
9387        if (mem_base != xmlMemBlocks()) {
9388            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9389	           xmlMemBlocks() - mem_base);
9390	    test_ret++;
9391            printf(" %d", n_doc);
9392            printf(" %d", n_input);
9393            printf("\n");
9394        }
9395    }
9396    }
9397    function_tests++;
9398
9399    return(test_ret);
9400}
9401
9402
9403static int
9404test_xmlGetDocEntity(void) {
9405    int test_ret = 0;
9406
9407    int mem_base;
9408    xmlEntityPtr ret_val;
9409    xmlDocPtr doc; /* the document referencing the entity */
9410    int n_doc;
9411    xmlChar * name; /* the entity name */
9412    int n_name;
9413
9414    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9415    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9416        mem_base = xmlMemBlocks();
9417        doc = gen_xmlDocPtr(n_doc, 0);
9418        name = gen_const_xmlChar_ptr(n_name, 1);
9419
9420        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9421        desret_xmlEntityPtr(ret_val);
9422        call_tests++;
9423        des_xmlDocPtr(n_doc, doc, 0);
9424        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9425        xmlResetLastError();
9426        if (mem_base != xmlMemBlocks()) {
9427            printf("Leak of %d blocks found in xmlGetDocEntity",
9428	           xmlMemBlocks() - mem_base);
9429	    test_ret++;
9430            printf(" %d", n_doc);
9431            printf(" %d", n_name);
9432            printf("\n");
9433        }
9434    }
9435    }
9436    function_tests++;
9437
9438    return(test_ret);
9439}
9440
9441
9442static int
9443test_xmlGetDtdEntity(void) {
9444    int test_ret = 0;
9445
9446    int mem_base;
9447    xmlEntityPtr ret_val;
9448    xmlDocPtr doc; /* the document referencing the entity */
9449    int n_doc;
9450    xmlChar * name; /* the entity name */
9451    int n_name;
9452
9453    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9454    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9455        mem_base = xmlMemBlocks();
9456        doc = gen_xmlDocPtr(n_doc, 0);
9457        name = gen_const_xmlChar_ptr(n_name, 1);
9458
9459        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9460        desret_xmlEntityPtr(ret_val);
9461        call_tests++;
9462        des_xmlDocPtr(n_doc, doc, 0);
9463        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9464        xmlResetLastError();
9465        if (mem_base != xmlMemBlocks()) {
9466            printf("Leak of %d blocks found in xmlGetDtdEntity",
9467	           xmlMemBlocks() - mem_base);
9468	    test_ret++;
9469            printf(" %d", n_doc);
9470            printf(" %d", n_name);
9471            printf("\n");
9472        }
9473    }
9474    }
9475    function_tests++;
9476
9477    return(test_ret);
9478}
9479
9480
9481static int
9482test_xmlGetParameterEntity(void) {
9483    int test_ret = 0;
9484
9485    int mem_base;
9486    xmlEntityPtr ret_val;
9487    xmlDocPtr doc; /* the document referencing the entity */
9488    int n_doc;
9489    xmlChar * name; /* the entity name */
9490    int n_name;
9491
9492    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9493    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9494        mem_base = xmlMemBlocks();
9495        doc = gen_xmlDocPtr(n_doc, 0);
9496        name = gen_const_xmlChar_ptr(n_name, 1);
9497
9498        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9499        desret_xmlEntityPtr(ret_val);
9500        call_tests++;
9501        des_xmlDocPtr(n_doc, doc, 0);
9502        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9503        xmlResetLastError();
9504        if (mem_base != xmlMemBlocks()) {
9505            printf("Leak of %d blocks found in xmlGetParameterEntity",
9506	           xmlMemBlocks() - mem_base);
9507	    test_ret++;
9508            printf(" %d", n_doc);
9509            printf(" %d", n_name);
9510            printf("\n");
9511        }
9512    }
9513    }
9514    function_tests++;
9515
9516    return(test_ret);
9517}
9518
9519
9520static int
9521test_xmlGetPredefinedEntity(void) {
9522    int test_ret = 0;
9523
9524    int mem_base;
9525    xmlEntityPtr ret_val;
9526    xmlChar * name; /* the entity name */
9527    int n_name;
9528
9529    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9530        mem_base = xmlMemBlocks();
9531        name = gen_const_xmlChar_ptr(n_name, 0);
9532
9533        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9534        desret_xmlEntityPtr(ret_val);
9535        call_tests++;
9536        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9537        xmlResetLastError();
9538        if (mem_base != xmlMemBlocks()) {
9539            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9540	           xmlMemBlocks() - mem_base);
9541	    test_ret++;
9542            printf(" %d", n_name);
9543            printf("\n");
9544        }
9545    }
9546    function_tests++;
9547
9548    return(test_ret);
9549}
9550
9551
9552static int
9553test_xmlInitializePredefinedEntities(void) {
9554    int test_ret = 0;
9555
9556#if defined(LIBXML_LEGACY_ENABLED)
9557#ifdef LIBXML_LEGACY_ENABLED
9558    int mem_base;
9559
9560        mem_base = xmlMemBlocks();
9561
9562        xmlInitializePredefinedEntities();
9563        call_tests++;
9564        xmlResetLastError();
9565        if (mem_base != xmlMemBlocks()) {
9566            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9567	           xmlMemBlocks() - mem_base);
9568	    test_ret++;
9569            printf("\n");
9570        }
9571    function_tests++;
9572#endif
9573#endif
9574
9575    return(test_ret);
9576}
9577
9578static int
9579test_entities(void) {
9580    int test_ret = 0;
9581
9582    if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
9583    test_ret += test_xmlAddDocEntity();
9584    test_ret += test_xmlAddDtdEntity();
9585    test_ret += test_xmlCleanupPredefinedEntities();
9586    test_ret += test_xmlCopyEntitiesTable();
9587    test_ret += test_xmlCreateEntitiesTable();
9588    test_ret += test_xmlDumpEntitiesTable();
9589    test_ret += test_xmlDumpEntityDecl();
9590    test_ret += test_xmlEncodeEntitiesReentrant();
9591    test_ret += test_xmlEncodeSpecialChars();
9592    test_ret += test_xmlGetDocEntity();
9593    test_ret += test_xmlGetDtdEntity();
9594    test_ret += test_xmlGetParameterEntity();
9595    test_ret += test_xmlGetPredefinedEntity();
9596    test_ret += test_xmlInitializePredefinedEntities();
9597
9598    if (test_ret != 0)
9599	printf("Module entities: %d errors\n", test_ret);
9600    return(test_ret);
9601}
9602
9603static int
9604test_xmlHashAddEntry(void) {
9605    int test_ret = 0;
9606
9607    int mem_base;
9608    int ret_val;
9609    xmlHashTablePtr table; /* the hash table */
9610    int n_table;
9611    xmlChar * name; /* the name of the userdata */
9612    int n_name;
9613    void * userdata; /* a pointer to the userdata */
9614    int n_userdata;
9615
9616    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9617    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9618    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9619        mem_base = xmlMemBlocks();
9620        table = gen_xmlHashTablePtr(n_table, 0);
9621        name = gen_const_xmlChar_ptr(n_name, 1);
9622        userdata = gen_userdata(n_userdata, 2);
9623
9624        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9625        desret_int(ret_val);
9626        call_tests++;
9627        des_xmlHashTablePtr(n_table, table, 0);
9628        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9629        des_userdata(n_userdata, userdata, 2);
9630        xmlResetLastError();
9631        if (mem_base != xmlMemBlocks()) {
9632            printf("Leak of %d blocks found in xmlHashAddEntry",
9633	           xmlMemBlocks() - mem_base);
9634	    test_ret++;
9635            printf(" %d", n_table);
9636            printf(" %d", n_name);
9637            printf(" %d", n_userdata);
9638            printf("\n");
9639        }
9640    }
9641    }
9642    }
9643    function_tests++;
9644
9645    return(test_ret);
9646}
9647
9648
9649static int
9650test_xmlHashAddEntry2(void) {
9651    int test_ret = 0;
9652
9653    int mem_base;
9654    int ret_val;
9655    xmlHashTablePtr table; /* the hash table */
9656    int n_table;
9657    xmlChar * name; /* the name of the userdata */
9658    int n_name;
9659    xmlChar * name2; /* a second name of the userdata */
9660    int n_name2;
9661    void * userdata; /* a pointer to the userdata */
9662    int n_userdata;
9663
9664    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9665    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9666    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9667    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9668        mem_base = xmlMemBlocks();
9669        table = gen_xmlHashTablePtr(n_table, 0);
9670        name = gen_const_xmlChar_ptr(n_name, 1);
9671        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9672        userdata = gen_userdata(n_userdata, 3);
9673
9674        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9675        desret_int(ret_val);
9676        call_tests++;
9677        des_xmlHashTablePtr(n_table, table, 0);
9678        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9679        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9680        des_userdata(n_userdata, userdata, 3);
9681        xmlResetLastError();
9682        if (mem_base != xmlMemBlocks()) {
9683            printf("Leak of %d blocks found in xmlHashAddEntry2",
9684	           xmlMemBlocks() - mem_base);
9685	    test_ret++;
9686            printf(" %d", n_table);
9687            printf(" %d", n_name);
9688            printf(" %d", n_name2);
9689            printf(" %d", n_userdata);
9690            printf("\n");
9691        }
9692    }
9693    }
9694    }
9695    }
9696    function_tests++;
9697
9698    return(test_ret);
9699}
9700
9701
9702static int
9703test_xmlHashAddEntry3(void) {
9704    int test_ret = 0;
9705
9706    int mem_base;
9707    int ret_val;
9708    xmlHashTablePtr table; /* the hash table */
9709    int n_table;
9710    xmlChar * name; /* the name of the userdata */
9711    int n_name;
9712    xmlChar * name2; /* a second name of the userdata */
9713    int n_name2;
9714    xmlChar * name3; /* a third name of the userdata */
9715    int n_name3;
9716    void * userdata; /* a pointer to the userdata */
9717    int n_userdata;
9718
9719    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9720    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9721    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9722    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9723    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9724        mem_base = xmlMemBlocks();
9725        table = gen_xmlHashTablePtr(n_table, 0);
9726        name = gen_const_xmlChar_ptr(n_name, 1);
9727        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9728        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9729        userdata = gen_userdata(n_userdata, 4);
9730
9731        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9732        desret_int(ret_val);
9733        call_tests++;
9734        des_xmlHashTablePtr(n_table, table, 0);
9735        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9736        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9737        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9738        des_userdata(n_userdata, userdata, 4);
9739        xmlResetLastError();
9740        if (mem_base != xmlMemBlocks()) {
9741            printf("Leak of %d blocks found in xmlHashAddEntry3",
9742	           xmlMemBlocks() - mem_base);
9743	    test_ret++;
9744            printf(" %d", n_table);
9745            printf(" %d", n_name);
9746            printf(" %d", n_name2);
9747            printf(" %d", n_name3);
9748            printf(" %d", n_userdata);
9749            printf("\n");
9750        }
9751    }
9752    }
9753    }
9754    }
9755    }
9756    function_tests++;
9757
9758    return(test_ret);
9759}
9760
9761
9762static int
9763test_xmlHashCopy(void) {
9764    int test_ret = 0;
9765
9766
9767    /* missing type support */
9768    return(test_ret);
9769}
9770
9771
9772static int
9773test_xmlHashCreate(void) {
9774    int test_ret = 0;
9775
9776
9777    /* missing type support */
9778    return(test_ret);
9779}
9780
9781
9782static int
9783test_xmlHashCreateDict(void) {
9784    int test_ret = 0;
9785
9786
9787    /* missing type support */
9788    return(test_ret);
9789}
9790
9791
9792static int
9793test_xmlHashLookup(void) {
9794    int test_ret = 0;
9795
9796    int mem_base;
9797    void * ret_val;
9798    xmlHashTablePtr table; /* the hash table */
9799    int n_table;
9800    xmlChar * name; /* the name of the userdata */
9801    int n_name;
9802
9803    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9804    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9805        mem_base = xmlMemBlocks();
9806        table = gen_xmlHashTablePtr(n_table, 0);
9807        name = gen_const_xmlChar_ptr(n_name, 1);
9808
9809        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9810        desret_void_ptr(ret_val);
9811        call_tests++;
9812        des_xmlHashTablePtr(n_table, table, 0);
9813        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9814        xmlResetLastError();
9815        if (mem_base != xmlMemBlocks()) {
9816            printf("Leak of %d blocks found in xmlHashLookup",
9817	           xmlMemBlocks() - mem_base);
9818	    test_ret++;
9819            printf(" %d", n_table);
9820            printf(" %d", n_name);
9821            printf("\n");
9822        }
9823    }
9824    }
9825    function_tests++;
9826
9827    return(test_ret);
9828}
9829
9830
9831static int
9832test_xmlHashLookup2(void) {
9833    int test_ret = 0;
9834
9835    int mem_base;
9836    void * ret_val;
9837    xmlHashTablePtr table; /* the hash table */
9838    int n_table;
9839    xmlChar * name; /* the name of the userdata */
9840    int n_name;
9841    xmlChar * name2; /* a second name of the userdata */
9842    int n_name2;
9843
9844    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9845    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9846    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9847        mem_base = xmlMemBlocks();
9848        table = gen_xmlHashTablePtr(n_table, 0);
9849        name = gen_const_xmlChar_ptr(n_name, 1);
9850        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9851
9852        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9853        desret_void_ptr(ret_val);
9854        call_tests++;
9855        des_xmlHashTablePtr(n_table, table, 0);
9856        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9857        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9858        xmlResetLastError();
9859        if (mem_base != xmlMemBlocks()) {
9860            printf("Leak of %d blocks found in xmlHashLookup2",
9861	           xmlMemBlocks() - mem_base);
9862	    test_ret++;
9863            printf(" %d", n_table);
9864            printf(" %d", n_name);
9865            printf(" %d", n_name2);
9866            printf("\n");
9867        }
9868    }
9869    }
9870    }
9871    function_tests++;
9872
9873    return(test_ret);
9874}
9875
9876
9877static int
9878test_xmlHashLookup3(void) {
9879    int test_ret = 0;
9880
9881    int mem_base;
9882    void * ret_val;
9883    xmlHashTablePtr table; /* the hash table */
9884    int n_table;
9885    xmlChar * name; /* the name of the userdata */
9886    int n_name;
9887    xmlChar * name2; /* a second name of the userdata */
9888    int n_name2;
9889    xmlChar * name3; /* a third name of the userdata */
9890    int n_name3;
9891
9892    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9893    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9894    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9895    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9896        mem_base = xmlMemBlocks();
9897        table = gen_xmlHashTablePtr(n_table, 0);
9898        name = gen_const_xmlChar_ptr(n_name, 1);
9899        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9900        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9901
9902        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
9903        desret_void_ptr(ret_val);
9904        call_tests++;
9905        des_xmlHashTablePtr(n_table, table, 0);
9906        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9907        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9908        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9909        xmlResetLastError();
9910        if (mem_base != xmlMemBlocks()) {
9911            printf("Leak of %d blocks found in xmlHashLookup3",
9912	           xmlMemBlocks() - mem_base);
9913	    test_ret++;
9914            printf(" %d", n_table);
9915            printf(" %d", n_name);
9916            printf(" %d", n_name2);
9917            printf(" %d", n_name3);
9918            printf("\n");
9919        }
9920    }
9921    }
9922    }
9923    }
9924    function_tests++;
9925
9926    return(test_ret);
9927}
9928
9929
9930static int
9931test_xmlHashQLookup(void) {
9932    int test_ret = 0;
9933
9934    int mem_base;
9935    void * ret_val;
9936    xmlHashTablePtr table; /* the hash table */
9937    int n_table;
9938    xmlChar * prefix; /* the prefix of the userdata */
9939    int n_prefix;
9940    xmlChar * name; /* the name of the userdata */
9941    int n_name;
9942
9943    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9944    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9945    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9946        mem_base = xmlMemBlocks();
9947        table = gen_xmlHashTablePtr(n_table, 0);
9948        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9949        name = gen_const_xmlChar_ptr(n_name, 2);
9950
9951        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
9952        desret_void_ptr(ret_val);
9953        call_tests++;
9954        des_xmlHashTablePtr(n_table, table, 0);
9955        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9956        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9957        xmlResetLastError();
9958        if (mem_base != xmlMemBlocks()) {
9959            printf("Leak of %d blocks found in xmlHashQLookup",
9960	           xmlMemBlocks() - mem_base);
9961	    test_ret++;
9962            printf(" %d", n_table);
9963            printf(" %d", n_prefix);
9964            printf(" %d", n_name);
9965            printf("\n");
9966        }
9967    }
9968    }
9969    }
9970    function_tests++;
9971
9972    return(test_ret);
9973}
9974
9975
9976static int
9977test_xmlHashQLookup2(void) {
9978    int test_ret = 0;
9979
9980    int mem_base;
9981    void * ret_val;
9982    xmlHashTablePtr table; /* the hash table */
9983    int n_table;
9984    xmlChar * prefix; /* the prefix of the userdata */
9985    int n_prefix;
9986    xmlChar * name; /* the name of the userdata */
9987    int n_name;
9988    xmlChar * prefix2; /* the second prefix of the userdata */
9989    int n_prefix2;
9990    xmlChar * name2; /* a second name of the userdata */
9991    int n_name2;
9992
9993    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9994    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9995    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9996    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9997    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9998        mem_base = xmlMemBlocks();
9999        table = gen_xmlHashTablePtr(n_table, 0);
10000        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10001        name = gen_const_xmlChar_ptr(n_name, 2);
10002        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10003        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10004
10005        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10006        desret_void_ptr(ret_val);
10007        call_tests++;
10008        des_xmlHashTablePtr(n_table, table, 0);
10009        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10010        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10011        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10012        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10013        xmlResetLastError();
10014        if (mem_base != xmlMemBlocks()) {
10015            printf("Leak of %d blocks found in xmlHashQLookup2",
10016	           xmlMemBlocks() - mem_base);
10017	    test_ret++;
10018            printf(" %d", n_table);
10019            printf(" %d", n_prefix);
10020            printf(" %d", n_name);
10021            printf(" %d", n_prefix2);
10022            printf(" %d", n_name2);
10023            printf("\n");
10024        }
10025    }
10026    }
10027    }
10028    }
10029    }
10030    function_tests++;
10031
10032    return(test_ret);
10033}
10034
10035
10036static int
10037test_xmlHashQLookup3(void) {
10038    int test_ret = 0;
10039
10040    int mem_base;
10041    void * ret_val;
10042    xmlHashTablePtr table; /* the hash table */
10043    int n_table;
10044    xmlChar * prefix; /* the prefix of the userdata */
10045    int n_prefix;
10046    xmlChar * name; /* the name of the userdata */
10047    int n_name;
10048    xmlChar * prefix2; /* the second prefix of the userdata */
10049    int n_prefix2;
10050    xmlChar * name2; /* a second name of the userdata */
10051    int n_name2;
10052    xmlChar * prefix3; /* the third prefix of the userdata */
10053    int n_prefix3;
10054    xmlChar * name3; /* a third name of the userdata */
10055    int n_name3;
10056
10057    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10058    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10059    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10060    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10061    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10062    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10063    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10064        mem_base = xmlMemBlocks();
10065        table = gen_xmlHashTablePtr(n_table, 0);
10066        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10067        name = gen_const_xmlChar_ptr(n_name, 2);
10068        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10069        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10070        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10071        name3 = gen_const_xmlChar_ptr(n_name3, 6);
10072
10073        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10074        desret_void_ptr(ret_val);
10075        call_tests++;
10076        des_xmlHashTablePtr(n_table, table, 0);
10077        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10078        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10079        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10080        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10081        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10082        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10083        xmlResetLastError();
10084        if (mem_base != xmlMemBlocks()) {
10085            printf("Leak of %d blocks found in xmlHashQLookup3",
10086	           xmlMemBlocks() - mem_base);
10087	    test_ret++;
10088            printf(" %d", n_table);
10089            printf(" %d", n_prefix);
10090            printf(" %d", n_name);
10091            printf(" %d", n_prefix2);
10092            printf(" %d", n_name2);
10093            printf(" %d", n_prefix3);
10094            printf(" %d", n_name3);
10095            printf("\n");
10096        }
10097    }
10098    }
10099    }
10100    }
10101    }
10102    }
10103    }
10104    function_tests++;
10105
10106    return(test_ret);
10107}
10108
10109
10110static int
10111test_xmlHashRemoveEntry(void) {
10112    int test_ret = 0;
10113
10114    int mem_base;
10115    int ret_val;
10116    xmlHashTablePtr table; /* the hash table */
10117    int n_table;
10118    xmlChar * name; /* the name of the userdata */
10119    int n_name;
10120    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10121    int n_f;
10122
10123    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10124    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10125    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10126        mem_base = xmlMemBlocks();
10127        table = gen_xmlHashTablePtr(n_table, 0);
10128        name = gen_const_xmlChar_ptr(n_name, 1);
10129        f = gen_xmlHashDeallocator(n_f, 2);
10130
10131        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10132        desret_int(ret_val);
10133        call_tests++;
10134        des_xmlHashTablePtr(n_table, table, 0);
10135        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10136        des_xmlHashDeallocator(n_f, f, 2);
10137        xmlResetLastError();
10138        if (mem_base != xmlMemBlocks()) {
10139            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10140	           xmlMemBlocks() - mem_base);
10141	    test_ret++;
10142            printf(" %d", n_table);
10143            printf(" %d", n_name);
10144            printf(" %d", n_f);
10145            printf("\n");
10146        }
10147    }
10148    }
10149    }
10150    function_tests++;
10151
10152    return(test_ret);
10153}
10154
10155
10156static int
10157test_xmlHashRemoveEntry2(void) {
10158    int test_ret = 0;
10159
10160    int mem_base;
10161    int ret_val;
10162    xmlHashTablePtr table; /* the hash table */
10163    int n_table;
10164    xmlChar * name; /* the name of the userdata */
10165    int n_name;
10166    xmlChar * name2; /* a second name of the userdata */
10167    int n_name2;
10168    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10169    int n_f;
10170
10171    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10172    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10173    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10174    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10175        mem_base = xmlMemBlocks();
10176        table = gen_xmlHashTablePtr(n_table, 0);
10177        name = gen_const_xmlChar_ptr(n_name, 1);
10178        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10179        f = gen_xmlHashDeallocator(n_f, 3);
10180
10181        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10182        desret_int(ret_val);
10183        call_tests++;
10184        des_xmlHashTablePtr(n_table, table, 0);
10185        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10186        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10187        des_xmlHashDeallocator(n_f, f, 3);
10188        xmlResetLastError();
10189        if (mem_base != xmlMemBlocks()) {
10190            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10191	           xmlMemBlocks() - mem_base);
10192	    test_ret++;
10193            printf(" %d", n_table);
10194            printf(" %d", n_name);
10195            printf(" %d", n_name2);
10196            printf(" %d", n_f);
10197            printf("\n");
10198        }
10199    }
10200    }
10201    }
10202    }
10203    function_tests++;
10204
10205    return(test_ret);
10206}
10207
10208
10209static int
10210test_xmlHashRemoveEntry3(void) {
10211    int test_ret = 0;
10212
10213    int mem_base;
10214    int ret_val;
10215    xmlHashTablePtr table; /* the hash table */
10216    int n_table;
10217    xmlChar * name; /* the name of the userdata */
10218    int n_name;
10219    xmlChar * name2; /* a second name of the userdata */
10220    int n_name2;
10221    xmlChar * name3; /* a third name of the userdata */
10222    int n_name3;
10223    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10224    int n_f;
10225
10226    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10227    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10228    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10229    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10230    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10231        mem_base = xmlMemBlocks();
10232        table = gen_xmlHashTablePtr(n_table, 0);
10233        name = gen_const_xmlChar_ptr(n_name, 1);
10234        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10235        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10236        f = gen_xmlHashDeallocator(n_f, 4);
10237
10238        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10239        desret_int(ret_val);
10240        call_tests++;
10241        des_xmlHashTablePtr(n_table, table, 0);
10242        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10243        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10244        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10245        des_xmlHashDeallocator(n_f, f, 4);
10246        xmlResetLastError();
10247        if (mem_base != xmlMemBlocks()) {
10248            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10249	           xmlMemBlocks() - mem_base);
10250	    test_ret++;
10251            printf(" %d", n_table);
10252            printf(" %d", n_name);
10253            printf(" %d", n_name2);
10254            printf(" %d", n_name3);
10255            printf(" %d", n_f);
10256            printf("\n");
10257        }
10258    }
10259    }
10260    }
10261    }
10262    }
10263    function_tests++;
10264
10265    return(test_ret);
10266}
10267
10268
10269static int
10270test_xmlHashScan(void) {
10271    int test_ret = 0;
10272
10273
10274    /* missing type support */
10275    return(test_ret);
10276}
10277
10278
10279static int
10280test_xmlHashScan3(void) {
10281    int test_ret = 0;
10282
10283
10284    /* missing type support */
10285    return(test_ret);
10286}
10287
10288
10289static int
10290test_xmlHashScanFull(void) {
10291    int test_ret = 0;
10292
10293
10294    /* missing type support */
10295    return(test_ret);
10296}
10297
10298
10299static int
10300test_xmlHashScanFull3(void) {
10301    int test_ret = 0;
10302
10303
10304    /* missing type support */
10305    return(test_ret);
10306}
10307
10308
10309static int
10310test_xmlHashSize(void) {
10311    int test_ret = 0;
10312
10313    int mem_base;
10314    int ret_val;
10315    xmlHashTablePtr table; /* the hash table */
10316    int n_table;
10317
10318    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10319        mem_base = xmlMemBlocks();
10320        table = gen_xmlHashTablePtr(n_table, 0);
10321
10322        ret_val = xmlHashSize(table);
10323        desret_int(ret_val);
10324        call_tests++;
10325        des_xmlHashTablePtr(n_table, table, 0);
10326        xmlResetLastError();
10327        if (mem_base != xmlMemBlocks()) {
10328            printf("Leak of %d blocks found in xmlHashSize",
10329	           xmlMemBlocks() - mem_base);
10330	    test_ret++;
10331            printf(" %d", n_table);
10332            printf("\n");
10333        }
10334    }
10335    function_tests++;
10336
10337    return(test_ret);
10338}
10339
10340
10341static int
10342test_xmlHashUpdateEntry(void) {
10343    int test_ret = 0;
10344
10345    int mem_base;
10346    int ret_val;
10347    xmlHashTablePtr table; /* the hash table */
10348    int n_table;
10349    xmlChar * name; /* the name of the userdata */
10350    int n_name;
10351    void * userdata; /* a pointer to the userdata */
10352    int n_userdata;
10353    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10354    int n_f;
10355
10356    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10357    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10358    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10359    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10360        mem_base = xmlMemBlocks();
10361        table = gen_xmlHashTablePtr(n_table, 0);
10362        name = gen_const_xmlChar_ptr(n_name, 1);
10363        userdata = gen_userdata(n_userdata, 2);
10364        f = gen_xmlHashDeallocator(n_f, 3);
10365
10366        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10367        desret_int(ret_val);
10368        call_tests++;
10369        des_xmlHashTablePtr(n_table, table, 0);
10370        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10371        des_userdata(n_userdata, userdata, 2);
10372        des_xmlHashDeallocator(n_f, f, 3);
10373        xmlResetLastError();
10374        if (mem_base != xmlMemBlocks()) {
10375            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10376	           xmlMemBlocks() - mem_base);
10377	    test_ret++;
10378            printf(" %d", n_table);
10379            printf(" %d", n_name);
10380            printf(" %d", n_userdata);
10381            printf(" %d", n_f);
10382            printf("\n");
10383        }
10384    }
10385    }
10386    }
10387    }
10388    function_tests++;
10389
10390    return(test_ret);
10391}
10392
10393
10394static int
10395test_xmlHashUpdateEntry2(void) {
10396    int test_ret = 0;
10397
10398    int mem_base;
10399    int ret_val;
10400    xmlHashTablePtr table; /* the hash table */
10401    int n_table;
10402    xmlChar * name; /* the name of the userdata */
10403    int n_name;
10404    xmlChar * name2; /* a second name of the userdata */
10405    int n_name2;
10406    void * userdata; /* a pointer to the userdata */
10407    int n_userdata;
10408    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10409    int n_f;
10410
10411    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10412    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10413    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10414    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10415    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10416        mem_base = xmlMemBlocks();
10417        table = gen_xmlHashTablePtr(n_table, 0);
10418        name = gen_const_xmlChar_ptr(n_name, 1);
10419        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10420        userdata = gen_userdata(n_userdata, 3);
10421        f = gen_xmlHashDeallocator(n_f, 4);
10422
10423        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10424        desret_int(ret_val);
10425        call_tests++;
10426        des_xmlHashTablePtr(n_table, table, 0);
10427        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10428        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10429        des_userdata(n_userdata, userdata, 3);
10430        des_xmlHashDeallocator(n_f, f, 4);
10431        xmlResetLastError();
10432        if (mem_base != xmlMemBlocks()) {
10433            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10434	           xmlMemBlocks() - mem_base);
10435	    test_ret++;
10436            printf(" %d", n_table);
10437            printf(" %d", n_name);
10438            printf(" %d", n_name2);
10439            printf(" %d", n_userdata);
10440            printf(" %d", n_f);
10441            printf("\n");
10442        }
10443    }
10444    }
10445    }
10446    }
10447    }
10448    function_tests++;
10449
10450    return(test_ret);
10451}
10452
10453
10454static int
10455test_xmlHashUpdateEntry3(void) {
10456    int test_ret = 0;
10457
10458    int mem_base;
10459    int ret_val;
10460    xmlHashTablePtr table; /* the hash table */
10461    int n_table;
10462    xmlChar * name; /* the name of the userdata */
10463    int n_name;
10464    xmlChar * name2; /* a second name of the userdata */
10465    int n_name2;
10466    xmlChar * name3; /* a third name of the userdata */
10467    int n_name3;
10468    void * userdata; /* a pointer to the userdata */
10469    int n_userdata;
10470    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10471    int n_f;
10472
10473    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10474    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10475    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10476    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10477    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10478    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10479        mem_base = xmlMemBlocks();
10480        table = gen_xmlHashTablePtr(n_table, 0);
10481        name = gen_const_xmlChar_ptr(n_name, 1);
10482        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10483        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10484        userdata = gen_userdata(n_userdata, 4);
10485        f = gen_xmlHashDeallocator(n_f, 5);
10486
10487        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10488        desret_int(ret_val);
10489        call_tests++;
10490        des_xmlHashTablePtr(n_table, table, 0);
10491        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10492        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10493        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10494        des_userdata(n_userdata, userdata, 4);
10495        des_xmlHashDeallocator(n_f, f, 5);
10496        xmlResetLastError();
10497        if (mem_base != xmlMemBlocks()) {
10498            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10499	           xmlMemBlocks() - mem_base);
10500	    test_ret++;
10501            printf(" %d", n_table);
10502            printf(" %d", n_name);
10503            printf(" %d", n_name2);
10504            printf(" %d", n_name3);
10505            printf(" %d", n_userdata);
10506            printf(" %d", n_f);
10507            printf("\n");
10508        }
10509    }
10510    }
10511    }
10512    }
10513    }
10514    }
10515    function_tests++;
10516
10517    return(test_ret);
10518}
10519
10520static int
10521test_hash(void) {
10522    int test_ret = 0;
10523
10524    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10525    test_ret += test_xmlHashAddEntry();
10526    test_ret += test_xmlHashAddEntry2();
10527    test_ret += test_xmlHashAddEntry3();
10528    test_ret += test_xmlHashCopy();
10529    test_ret += test_xmlHashCreate();
10530    test_ret += test_xmlHashCreateDict();
10531    test_ret += test_xmlHashLookup();
10532    test_ret += test_xmlHashLookup2();
10533    test_ret += test_xmlHashLookup3();
10534    test_ret += test_xmlHashQLookup();
10535    test_ret += test_xmlHashQLookup2();
10536    test_ret += test_xmlHashQLookup3();
10537    test_ret += test_xmlHashRemoveEntry();
10538    test_ret += test_xmlHashRemoveEntry2();
10539    test_ret += test_xmlHashRemoveEntry3();
10540    test_ret += test_xmlHashScan();
10541    test_ret += test_xmlHashScan3();
10542    test_ret += test_xmlHashScanFull();
10543    test_ret += test_xmlHashScanFull3();
10544    test_ret += test_xmlHashSize();
10545    test_ret += test_xmlHashUpdateEntry();
10546    test_ret += test_xmlHashUpdateEntry2();
10547    test_ret += test_xmlHashUpdateEntry3();
10548
10549    if (test_ret != 0)
10550	printf("Module hash: %d errors\n", test_ret);
10551    return(test_ret);
10552}
10553
10554#define gen_nb_xmlLinkPtr 1
10555static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10556    return(NULL);
10557}
10558static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10559}
10560
10561static int
10562test_xmlLinkGetData(void) {
10563    int test_ret = 0;
10564
10565    int mem_base;
10566    void * ret_val;
10567    xmlLinkPtr lk; /* a link */
10568    int n_lk;
10569
10570    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10571        mem_base = xmlMemBlocks();
10572        lk = gen_xmlLinkPtr(n_lk, 0);
10573
10574        ret_val = xmlLinkGetData(lk);
10575        desret_void_ptr(ret_val);
10576        call_tests++;
10577        des_xmlLinkPtr(n_lk, lk, 0);
10578        xmlResetLastError();
10579        if (mem_base != xmlMemBlocks()) {
10580            printf("Leak of %d blocks found in xmlLinkGetData",
10581	           xmlMemBlocks() - mem_base);
10582	    test_ret++;
10583            printf(" %d", n_lk);
10584            printf("\n");
10585        }
10586    }
10587    function_tests++;
10588
10589    return(test_ret);
10590}
10591
10592
10593static int
10594test_xmlListAppend(void) {
10595    int test_ret = 0;
10596
10597    int mem_base;
10598    int ret_val;
10599    xmlListPtr l; /* a list */
10600    int n_l;
10601    void * data; /* the data */
10602    int n_data;
10603
10604    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10605    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10606        mem_base = xmlMemBlocks();
10607        l = gen_xmlListPtr(n_l, 0);
10608        data = gen_userdata(n_data, 1);
10609
10610        ret_val = xmlListAppend(l, data);
10611        desret_int(ret_val);
10612        call_tests++;
10613        des_xmlListPtr(n_l, l, 0);
10614        des_userdata(n_data, data, 1);
10615        xmlResetLastError();
10616        if (mem_base != xmlMemBlocks()) {
10617            printf("Leak of %d blocks found in xmlListAppend",
10618	           xmlMemBlocks() - mem_base);
10619	    test_ret++;
10620            printf(" %d", n_l);
10621            printf(" %d", n_data);
10622            printf("\n");
10623        }
10624    }
10625    }
10626    function_tests++;
10627
10628    return(test_ret);
10629}
10630
10631
10632static int
10633test_xmlListClear(void) {
10634    int test_ret = 0;
10635
10636    int mem_base;
10637    xmlListPtr l; /* a list */
10638    int n_l;
10639
10640    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10641        mem_base = xmlMemBlocks();
10642        l = gen_xmlListPtr(n_l, 0);
10643
10644        xmlListClear(l);
10645        call_tests++;
10646        des_xmlListPtr(n_l, l, 0);
10647        xmlResetLastError();
10648        if (mem_base != xmlMemBlocks()) {
10649            printf("Leak of %d blocks found in xmlListClear",
10650	           xmlMemBlocks() - mem_base);
10651	    test_ret++;
10652            printf(" %d", n_l);
10653            printf("\n");
10654        }
10655    }
10656    function_tests++;
10657
10658    return(test_ret);
10659}
10660
10661
10662#define gen_nb_const_xmlListPtr 1
10663static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10664    return(NULL);
10665}
10666static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10667}
10668
10669static int
10670test_xmlListCopy(void) {
10671    int test_ret = 0;
10672
10673    int mem_base;
10674    int ret_val;
10675    xmlListPtr cur; /* the new list */
10676    int n_cur;
10677    xmlListPtr old; /* the old list */
10678    int n_old;
10679
10680    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10681    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10682        mem_base = xmlMemBlocks();
10683        cur = gen_xmlListPtr(n_cur, 0);
10684        old = gen_const_xmlListPtr(n_old, 1);
10685
10686        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10687        desret_int(ret_val);
10688        call_tests++;
10689        des_xmlListPtr(n_cur, cur, 0);
10690        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10691        xmlResetLastError();
10692        if (mem_base != xmlMemBlocks()) {
10693            printf("Leak of %d blocks found in xmlListCopy",
10694	           xmlMemBlocks() - mem_base);
10695	    test_ret++;
10696            printf(" %d", n_cur);
10697            printf(" %d", n_old);
10698            printf("\n");
10699        }
10700    }
10701    }
10702    function_tests++;
10703
10704    return(test_ret);
10705}
10706
10707
10708static int
10709test_xmlListCreate(void) {
10710    int test_ret = 0;
10711
10712
10713    /* missing type support */
10714    return(test_ret);
10715}
10716
10717
10718static int
10719test_xmlListDup(void) {
10720    int test_ret = 0;
10721
10722
10723    /* missing type support */
10724    return(test_ret);
10725}
10726
10727
10728static int
10729test_xmlListEmpty(void) {
10730    int test_ret = 0;
10731
10732    int mem_base;
10733    int ret_val;
10734    xmlListPtr l; /* a list */
10735    int n_l;
10736
10737    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10738        mem_base = xmlMemBlocks();
10739        l = gen_xmlListPtr(n_l, 0);
10740
10741        ret_val = xmlListEmpty(l);
10742        desret_int(ret_val);
10743        call_tests++;
10744        des_xmlListPtr(n_l, l, 0);
10745        xmlResetLastError();
10746        if (mem_base != xmlMemBlocks()) {
10747            printf("Leak of %d blocks found in xmlListEmpty",
10748	           xmlMemBlocks() - mem_base);
10749	    test_ret++;
10750            printf(" %d", n_l);
10751            printf("\n");
10752        }
10753    }
10754    function_tests++;
10755
10756    return(test_ret);
10757}
10758
10759
10760static int
10761test_xmlListEnd(void) {
10762    int test_ret = 0;
10763
10764
10765    /* missing type support */
10766    return(test_ret);
10767}
10768
10769
10770static int
10771test_xmlListFront(void) {
10772    int test_ret = 0;
10773
10774
10775    /* missing type support */
10776    return(test_ret);
10777}
10778
10779
10780static int
10781test_xmlListInsert(void) {
10782    int test_ret = 0;
10783
10784    int mem_base;
10785    int ret_val;
10786    xmlListPtr l; /* a list */
10787    int n_l;
10788    void * data; /* the data */
10789    int n_data;
10790
10791    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10792    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10793        mem_base = xmlMemBlocks();
10794        l = gen_xmlListPtr(n_l, 0);
10795        data = gen_userdata(n_data, 1);
10796
10797        ret_val = xmlListInsert(l, data);
10798        desret_int(ret_val);
10799        call_tests++;
10800        des_xmlListPtr(n_l, l, 0);
10801        des_userdata(n_data, data, 1);
10802        xmlResetLastError();
10803        if (mem_base != xmlMemBlocks()) {
10804            printf("Leak of %d blocks found in xmlListInsert",
10805	           xmlMemBlocks() - mem_base);
10806	    test_ret++;
10807            printf(" %d", n_l);
10808            printf(" %d", n_data);
10809            printf("\n");
10810        }
10811    }
10812    }
10813    function_tests++;
10814
10815    return(test_ret);
10816}
10817
10818
10819static int
10820test_xmlListMerge(void) {
10821    int test_ret = 0;
10822
10823    int mem_base;
10824    xmlListPtr l1; /* the original list */
10825    int n_l1;
10826    xmlListPtr l2; /* the new list */
10827    int n_l2;
10828
10829    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10830    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10831        mem_base = xmlMemBlocks();
10832        l1 = gen_xmlListPtr(n_l1, 0);
10833        l2 = gen_xmlListPtr(n_l2, 1);
10834
10835        xmlListMerge(l1, l2);
10836        call_tests++;
10837        des_xmlListPtr(n_l1, l1, 0);
10838        des_xmlListPtr(n_l2, l2, 1);
10839        xmlResetLastError();
10840        if (mem_base != xmlMemBlocks()) {
10841            printf("Leak of %d blocks found in xmlListMerge",
10842	           xmlMemBlocks() - mem_base);
10843	    test_ret++;
10844            printf(" %d", n_l1);
10845            printf(" %d", n_l2);
10846            printf("\n");
10847        }
10848    }
10849    }
10850    function_tests++;
10851
10852    return(test_ret);
10853}
10854
10855
10856static int
10857test_xmlListPopBack(void) {
10858    int test_ret = 0;
10859
10860    int mem_base;
10861    xmlListPtr l; /* a list */
10862    int n_l;
10863
10864    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10865        mem_base = xmlMemBlocks();
10866        l = gen_xmlListPtr(n_l, 0);
10867
10868        xmlListPopBack(l);
10869        call_tests++;
10870        des_xmlListPtr(n_l, l, 0);
10871        xmlResetLastError();
10872        if (mem_base != xmlMemBlocks()) {
10873            printf("Leak of %d blocks found in xmlListPopBack",
10874	           xmlMemBlocks() - mem_base);
10875	    test_ret++;
10876            printf(" %d", n_l);
10877            printf("\n");
10878        }
10879    }
10880    function_tests++;
10881
10882    return(test_ret);
10883}
10884
10885
10886static int
10887test_xmlListPopFront(void) {
10888    int test_ret = 0;
10889
10890    int mem_base;
10891    xmlListPtr l; /* a list */
10892    int n_l;
10893
10894    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10895        mem_base = xmlMemBlocks();
10896        l = gen_xmlListPtr(n_l, 0);
10897
10898        xmlListPopFront(l);
10899        call_tests++;
10900        des_xmlListPtr(n_l, l, 0);
10901        xmlResetLastError();
10902        if (mem_base != xmlMemBlocks()) {
10903            printf("Leak of %d blocks found in xmlListPopFront",
10904	           xmlMemBlocks() - mem_base);
10905	    test_ret++;
10906            printf(" %d", n_l);
10907            printf("\n");
10908        }
10909    }
10910    function_tests++;
10911
10912    return(test_ret);
10913}
10914
10915
10916static int
10917test_xmlListPushBack(void) {
10918    int test_ret = 0;
10919
10920    int mem_base;
10921    int ret_val;
10922    xmlListPtr l; /* a list */
10923    int n_l;
10924    void * data; /* new data */
10925    int n_data;
10926
10927    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10928    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10929        mem_base = xmlMemBlocks();
10930        l = gen_xmlListPtr(n_l, 0);
10931        data = gen_userdata(n_data, 1);
10932
10933        ret_val = xmlListPushBack(l, data);
10934        desret_int(ret_val);
10935        call_tests++;
10936        des_xmlListPtr(n_l, l, 0);
10937        des_userdata(n_data, data, 1);
10938        xmlResetLastError();
10939        if (mem_base != xmlMemBlocks()) {
10940            printf("Leak of %d blocks found in xmlListPushBack",
10941	           xmlMemBlocks() - mem_base);
10942	    test_ret++;
10943            printf(" %d", n_l);
10944            printf(" %d", n_data);
10945            printf("\n");
10946        }
10947    }
10948    }
10949    function_tests++;
10950
10951    return(test_ret);
10952}
10953
10954
10955static int
10956test_xmlListPushFront(void) {
10957    int test_ret = 0;
10958
10959    int mem_base;
10960    int ret_val;
10961    xmlListPtr l; /* a list */
10962    int n_l;
10963    void * data; /* new data */
10964    int n_data;
10965
10966    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10967    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10968        mem_base = xmlMemBlocks();
10969        l = gen_xmlListPtr(n_l, 0);
10970        data = gen_userdata(n_data, 1);
10971
10972        ret_val = xmlListPushFront(l, data);
10973        desret_int(ret_val);
10974        call_tests++;
10975        des_xmlListPtr(n_l, l, 0);
10976        des_userdata(n_data, data, 1);
10977        xmlResetLastError();
10978        if (mem_base != xmlMemBlocks()) {
10979            printf("Leak of %d blocks found in xmlListPushFront",
10980	           xmlMemBlocks() - mem_base);
10981	    test_ret++;
10982            printf(" %d", n_l);
10983            printf(" %d", n_data);
10984            printf("\n");
10985        }
10986    }
10987    }
10988    function_tests++;
10989
10990    return(test_ret);
10991}
10992
10993
10994static int
10995test_xmlListRemoveAll(void) {
10996    int test_ret = 0;
10997
10998    int mem_base;
10999    int ret_val;
11000    xmlListPtr l; /* a list */
11001    int n_l;
11002    void * data; /* list data */
11003    int n_data;
11004
11005    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11006    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11007        mem_base = xmlMemBlocks();
11008        l = gen_xmlListPtr(n_l, 0);
11009        data = gen_userdata(n_data, 1);
11010
11011        ret_val = xmlListRemoveAll(l, data);
11012        desret_int(ret_val);
11013        call_tests++;
11014        des_xmlListPtr(n_l, l, 0);
11015        des_userdata(n_data, data, 1);
11016        xmlResetLastError();
11017        if (mem_base != xmlMemBlocks()) {
11018            printf("Leak of %d blocks found in xmlListRemoveAll",
11019	           xmlMemBlocks() - mem_base);
11020	    test_ret++;
11021            printf(" %d", n_l);
11022            printf(" %d", n_data);
11023            printf("\n");
11024        }
11025    }
11026    }
11027    function_tests++;
11028
11029    return(test_ret);
11030}
11031
11032
11033static int
11034test_xmlListRemoveFirst(void) {
11035    int test_ret = 0;
11036
11037    int mem_base;
11038    int ret_val;
11039    xmlListPtr l; /* a list */
11040    int n_l;
11041    void * data; /* list data */
11042    int n_data;
11043
11044    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11045    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11046        mem_base = xmlMemBlocks();
11047        l = gen_xmlListPtr(n_l, 0);
11048        data = gen_userdata(n_data, 1);
11049
11050        ret_val = xmlListRemoveFirst(l, data);
11051        desret_int(ret_val);
11052        call_tests++;
11053        des_xmlListPtr(n_l, l, 0);
11054        des_userdata(n_data, data, 1);
11055        xmlResetLastError();
11056        if (mem_base != xmlMemBlocks()) {
11057            printf("Leak of %d blocks found in xmlListRemoveFirst",
11058	           xmlMemBlocks() - mem_base);
11059	    test_ret++;
11060            printf(" %d", n_l);
11061            printf(" %d", n_data);
11062            printf("\n");
11063        }
11064    }
11065    }
11066    function_tests++;
11067
11068    return(test_ret);
11069}
11070
11071
11072static int
11073test_xmlListRemoveLast(void) {
11074    int test_ret = 0;
11075
11076    int mem_base;
11077    int ret_val;
11078    xmlListPtr l; /* a list */
11079    int n_l;
11080    void * data; /* list data */
11081    int n_data;
11082
11083    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11084    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11085        mem_base = xmlMemBlocks();
11086        l = gen_xmlListPtr(n_l, 0);
11087        data = gen_userdata(n_data, 1);
11088
11089        ret_val = xmlListRemoveLast(l, data);
11090        desret_int(ret_val);
11091        call_tests++;
11092        des_xmlListPtr(n_l, l, 0);
11093        des_userdata(n_data, data, 1);
11094        xmlResetLastError();
11095        if (mem_base != xmlMemBlocks()) {
11096            printf("Leak of %d blocks found in xmlListRemoveLast",
11097	           xmlMemBlocks() - mem_base);
11098	    test_ret++;
11099            printf(" %d", n_l);
11100            printf(" %d", n_data);
11101            printf("\n");
11102        }
11103    }
11104    }
11105    function_tests++;
11106
11107    return(test_ret);
11108}
11109
11110
11111static int
11112test_xmlListReverse(void) {
11113    int test_ret = 0;
11114
11115    int mem_base;
11116    xmlListPtr l; /* a list */
11117    int n_l;
11118
11119    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11120        mem_base = xmlMemBlocks();
11121        l = gen_xmlListPtr(n_l, 0);
11122
11123        xmlListReverse(l);
11124        call_tests++;
11125        des_xmlListPtr(n_l, l, 0);
11126        xmlResetLastError();
11127        if (mem_base != xmlMemBlocks()) {
11128            printf("Leak of %d blocks found in xmlListReverse",
11129	           xmlMemBlocks() - mem_base);
11130	    test_ret++;
11131            printf(" %d", n_l);
11132            printf("\n");
11133        }
11134    }
11135    function_tests++;
11136
11137    return(test_ret);
11138}
11139
11140
11141static int
11142test_xmlListReverseSearch(void) {
11143    int test_ret = 0;
11144
11145    int mem_base;
11146    void * ret_val;
11147    xmlListPtr l; /* a list */
11148    int n_l;
11149    void * data; /* a search value */
11150    int n_data;
11151
11152    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11153    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11154        mem_base = xmlMemBlocks();
11155        l = gen_xmlListPtr(n_l, 0);
11156        data = gen_userdata(n_data, 1);
11157
11158        ret_val = xmlListReverseSearch(l, data);
11159        desret_void_ptr(ret_val);
11160        call_tests++;
11161        des_xmlListPtr(n_l, l, 0);
11162        des_userdata(n_data, data, 1);
11163        xmlResetLastError();
11164        if (mem_base != xmlMemBlocks()) {
11165            printf("Leak of %d blocks found in xmlListReverseSearch",
11166	           xmlMemBlocks() - mem_base);
11167	    test_ret++;
11168            printf(" %d", n_l);
11169            printf(" %d", n_data);
11170            printf("\n");
11171        }
11172    }
11173    }
11174    function_tests++;
11175
11176    return(test_ret);
11177}
11178
11179
11180static int
11181test_xmlListReverseWalk(void) {
11182    int test_ret = 0;
11183
11184
11185    /* missing type support */
11186    return(test_ret);
11187}
11188
11189
11190static int
11191test_xmlListSearch(void) {
11192    int test_ret = 0;
11193
11194    int mem_base;
11195    void * ret_val;
11196    xmlListPtr l; /* a list */
11197    int n_l;
11198    void * data; /* a search value */
11199    int n_data;
11200
11201    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11202    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11203        mem_base = xmlMemBlocks();
11204        l = gen_xmlListPtr(n_l, 0);
11205        data = gen_userdata(n_data, 1);
11206
11207        ret_val = xmlListSearch(l, data);
11208        desret_void_ptr(ret_val);
11209        call_tests++;
11210        des_xmlListPtr(n_l, l, 0);
11211        des_userdata(n_data, data, 1);
11212        xmlResetLastError();
11213        if (mem_base != xmlMemBlocks()) {
11214            printf("Leak of %d blocks found in xmlListSearch",
11215	           xmlMemBlocks() - mem_base);
11216	    test_ret++;
11217            printf(" %d", n_l);
11218            printf(" %d", n_data);
11219            printf("\n");
11220        }
11221    }
11222    }
11223    function_tests++;
11224
11225    return(test_ret);
11226}
11227
11228
11229static int
11230test_xmlListSize(void) {
11231    int test_ret = 0;
11232
11233    int mem_base;
11234    int ret_val;
11235    xmlListPtr l; /* a list */
11236    int n_l;
11237
11238    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11239        mem_base = xmlMemBlocks();
11240        l = gen_xmlListPtr(n_l, 0);
11241
11242        ret_val = xmlListSize(l);
11243        desret_int(ret_val);
11244        call_tests++;
11245        des_xmlListPtr(n_l, l, 0);
11246        xmlResetLastError();
11247        if (mem_base != xmlMemBlocks()) {
11248            printf("Leak of %d blocks found in xmlListSize",
11249	           xmlMemBlocks() - mem_base);
11250	    test_ret++;
11251            printf(" %d", n_l);
11252            printf("\n");
11253        }
11254    }
11255    function_tests++;
11256
11257    return(test_ret);
11258}
11259
11260
11261static int
11262test_xmlListSort(void) {
11263    int test_ret = 0;
11264
11265    int mem_base;
11266    xmlListPtr l; /* a list */
11267    int n_l;
11268
11269    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11270        mem_base = xmlMemBlocks();
11271        l = gen_xmlListPtr(n_l, 0);
11272
11273        xmlListSort(l);
11274        call_tests++;
11275        des_xmlListPtr(n_l, l, 0);
11276        xmlResetLastError();
11277        if (mem_base != xmlMemBlocks()) {
11278            printf("Leak of %d blocks found in xmlListSort",
11279	           xmlMemBlocks() - mem_base);
11280	    test_ret++;
11281            printf(" %d", n_l);
11282            printf("\n");
11283        }
11284    }
11285    function_tests++;
11286
11287    return(test_ret);
11288}
11289
11290
11291static int
11292test_xmlListWalk(void) {
11293    int test_ret = 0;
11294
11295
11296    /* missing type support */
11297    return(test_ret);
11298}
11299
11300static int
11301test_list(void) {
11302    int test_ret = 0;
11303
11304    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11305    test_ret += test_xmlLinkGetData();
11306    test_ret += test_xmlListAppend();
11307    test_ret += test_xmlListClear();
11308    test_ret += test_xmlListCopy();
11309    test_ret += test_xmlListCreate();
11310    test_ret += test_xmlListDup();
11311    test_ret += test_xmlListEmpty();
11312    test_ret += test_xmlListEnd();
11313    test_ret += test_xmlListFront();
11314    test_ret += test_xmlListInsert();
11315    test_ret += test_xmlListMerge();
11316    test_ret += test_xmlListPopBack();
11317    test_ret += test_xmlListPopFront();
11318    test_ret += test_xmlListPushBack();
11319    test_ret += test_xmlListPushFront();
11320    test_ret += test_xmlListRemoveAll();
11321    test_ret += test_xmlListRemoveFirst();
11322    test_ret += test_xmlListRemoveLast();
11323    test_ret += test_xmlListReverse();
11324    test_ret += test_xmlListReverseSearch();
11325    test_ret += test_xmlListReverseWalk();
11326    test_ret += test_xmlListSearch();
11327    test_ret += test_xmlListSize();
11328    test_ret += test_xmlListSort();
11329    test_ret += test_xmlListWalk();
11330
11331    if (test_ret != 0)
11332	printf("Module list: %d errors\n", test_ret);
11333    return(test_ret);
11334}
11335
11336static int
11337test_xmlNanoFTPCheckResponse(void) {
11338    int test_ret = 0;
11339
11340#if defined(LIBXML_FTP_ENABLED)
11341    int mem_base;
11342    int ret_val;
11343    void * ctx; /* an FTP context */
11344    int n_ctx;
11345
11346    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11347        mem_base = xmlMemBlocks();
11348        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11349
11350        ret_val = xmlNanoFTPCheckResponse(ctx);
11351        desret_int(ret_val);
11352        call_tests++;
11353        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11354        xmlResetLastError();
11355        if (mem_base != xmlMemBlocks()) {
11356            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11357	           xmlMemBlocks() - mem_base);
11358	    test_ret++;
11359            printf(" %d", n_ctx);
11360            printf("\n");
11361        }
11362    }
11363    function_tests++;
11364#endif
11365
11366    return(test_ret);
11367}
11368
11369
11370static int
11371test_xmlNanoFTPCleanup(void) {
11372    int test_ret = 0;
11373
11374#if defined(LIBXML_FTP_ENABLED)
11375    int mem_base;
11376
11377        mem_base = xmlMemBlocks();
11378
11379        xmlNanoFTPCleanup();
11380        call_tests++;
11381        xmlResetLastError();
11382        if (mem_base != xmlMemBlocks()) {
11383            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11384	           xmlMemBlocks() - mem_base);
11385	    test_ret++;
11386            printf("\n");
11387        }
11388    function_tests++;
11389#endif
11390
11391    return(test_ret);
11392}
11393
11394
11395static int
11396test_xmlNanoFTPCloseConnection(void) {
11397    int test_ret = 0;
11398
11399#if defined(LIBXML_FTP_ENABLED)
11400    int mem_base;
11401    int ret_val;
11402    void * ctx; /* an FTP context */
11403    int n_ctx;
11404
11405    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11406        mem_base = xmlMemBlocks();
11407        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11408
11409        ret_val = xmlNanoFTPCloseConnection(ctx);
11410        desret_int(ret_val);
11411        call_tests++;
11412        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11413        xmlResetLastError();
11414        if (mem_base != xmlMemBlocks()) {
11415            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11416	           xmlMemBlocks() - mem_base);
11417	    test_ret++;
11418            printf(" %d", n_ctx);
11419            printf("\n");
11420        }
11421    }
11422    function_tests++;
11423#endif
11424
11425    return(test_ret);
11426}
11427
11428
11429static int
11430test_xmlNanoFTPCwd(void) {
11431    int test_ret = 0;
11432
11433#if defined(LIBXML_FTP_ENABLED)
11434    int mem_base;
11435    int ret_val;
11436    void * ctx; /* an FTP context */
11437    int n_ctx;
11438    char * directory; /* a directory on the server */
11439    int n_directory;
11440
11441    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11442    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11443        mem_base = xmlMemBlocks();
11444        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11445        directory = gen_const_char_ptr(n_directory, 1);
11446
11447        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11448        desret_int(ret_val);
11449        call_tests++;
11450        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11451        des_const_char_ptr(n_directory, (const char *)directory, 1);
11452        xmlResetLastError();
11453        if (mem_base != xmlMemBlocks()) {
11454            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11455	           xmlMemBlocks() - mem_base);
11456	    test_ret++;
11457            printf(" %d", n_ctx);
11458            printf(" %d", n_directory);
11459            printf("\n");
11460        }
11461    }
11462    }
11463    function_tests++;
11464#endif
11465
11466    return(test_ret);
11467}
11468
11469
11470static int
11471test_xmlNanoFTPDele(void) {
11472    int test_ret = 0;
11473
11474#if defined(LIBXML_FTP_ENABLED)
11475    int mem_base;
11476    int ret_val;
11477    void * ctx; /* an FTP context */
11478    int n_ctx;
11479    const char * file; /* a file or directory on the server */
11480    int n_file;
11481
11482    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11483    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11484        mem_base = xmlMemBlocks();
11485        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11486        file = gen_filepath(n_file, 1);
11487
11488        ret_val = xmlNanoFTPDele(ctx, file);
11489        desret_int(ret_val);
11490        call_tests++;
11491        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11492        des_filepath(n_file, file, 1);
11493        xmlResetLastError();
11494        if (mem_base != xmlMemBlocks()) {
11495            printf("Leak of %d blocks found in xmlNanoFTPDele",
11496	           xmlMemBlocks() - mem_base);
11497	    test_ret++;
11498            printf(" %d", n_ctx);
11499            printf(" %d", n_file);
11500            printf("\n");
11501        }
11502    }
11503    }
11504    function_tests++;
11505#endif
11506
11507    return(test_ret);
11508}
11509
11510
11511static int
11512test_xmlNanoFTPGet(void) {
11513    int test_ret = 0;
11514
11515
11516    /* missing type support */
11517    return(test_ret);
11518}
11519
11520
11521static int
11522test_xmlNanoFTPGetConnection(void) {
11523    int test_ret = 0;
11524
11525#if defined(LIBXML_FTP_ENABLED)
11526    int mem_base;
11527    int ret_val;
11528    void * ctx; /* an FTP context */
11529    int n_ctx;
11530
11531    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11532        mem_base = xmlMemBlocks();
11533        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11534
11535        ret_val = xmlNanoFTPGetConnection(ctx);
11536        desret_int(ret_val);
11537        call_tests++;
11538        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11539        xmlResetLastError();
11540        if (mem_base != xmlMemBlocks()) {
11541            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11542	           xmlMemBlocks() - mem_base);
11543	    test_ret++;
11544            printf(" %d", n_ctx);
11545            printf("\n");
11546        }
11547    }
11548    function_tests++;
11549#endif
11550
11551    return(test_ret);
11552}
11553
11554
11555static int
11556test_xmlNanoFTPGetResponse(void) {
11557    int test_ret = 0;
11558
11559#if defined(LIBXML_FTP_ENABLED)
11560    int mem_base;
11561    int ret_val;
11562    void * ctx; /* an FTP context */
11563    int n_ctx;
11564
11565    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11566        mem_base = xmlMemBlocks();
11567        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11568
11569        ret_val = xmlNanoFTPGetResponse(ctx);
11570        desret_int(ret_val);
11571        call_tests++;
11572        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11573        xmlResetLastError();
11574        if (mem_base != xmlMemBlocks()) {
11575            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11576	           xmlMemBlocks() - mem_base);
11577	    test_ret++;
11578            printf(" %d", n_ctx);
11579            printf("\n");
11580        }
11581    }
11582    function_tests++;
11583#endif
11584
11585    return(test_ret);
11586}
11587
11588
11589static int
11590test_xmlNanoFTPGetSocket(void) {
11591    int test_ret = 0;
11592
11593#if defined(LIBXML_FTP_ENABLED)
11594    int mem_base;
11595    int ret_val;
11596    void * ctx; /* an FTP context */
11597    int n_ctx;
11598    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11599    int n_filename;
11600
11601    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11602    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11603        mem_base = xmlMemBlocks();
11604        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11605        filename = gen_filepath(n_filename, 1);
11606
11607        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11608        desret_int(ret_val);
11609        call_tests++;
11610        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11611        des_filepath(n_filename, filename, 1);
11612        xmlResetLastError();
11613        if (mem_base != xmlMemBlocks()) {
11614            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11615	           xmlMemBlocks() - mem_base);
11616	    test_ret++;
11617            printf(" %d", n_ctx);
11618            printf(" %d", n_filename);
11619            printf("\n");
11620        }
11621    }
11622    }
11623    function_tests++;
11624#endif
11625
11626    return(test_ret);
11627}
11628
11629
11630static int
11631test_xmlNanoFTPInit(void) {
11632    int test_ret = 0;
11633
11634#if defined(LIBXML_FTP_ENABLED)
11635    int mem_base;
11636
11637        mem_base = xmlMemBlocks();
11638
11639        xmlNanoFTPInit();
11640        call_tests++;
11641        xmlResetLastError();
11642        if (mem_base != xmlMemBlocks()) {
11643            printf("Leak of %d blocks found in xmlNanoFTPInit",
11644	           xmlMemBlocks() - mem_base);
11645	    test_ret++;
11646            printf("\n");
11647        }
11648    function_tests++;
11649#endif
11650
11651    return(test_ret);
11652}
11653
11654
11655static int
11656test_xmlNanoFTPList(void) {
11657    int test_ret = 0;
11658
11659
11660    /* missing type support */
11661    return(test_ret);
11662}
11663
11664
11665static int
11666test_xmlNanoFTPNewCtxt(void) {
11667    int test_ret = 0;
11668
11669#if defined(LIBXML_FTP_ENABLED)
11670    int mem_base;
11671    void * ret_val;
11672    const char * URL; /* The URL used to initialize the context */
11673    int n_URL;
11674
11675    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11676        mem_base = xmlMemBlocks();
11677        URL = gen_filepath(n_URL, 0);
11678
11679        ret_val = xmlNanoFTPNewCtxt(URL);
11680        desret_xmlNanoFTPCtxtPtr(ret_val);
11681        call_tests++;
11682        des_filepath(n_URL, URL, 0);
11683        xmlResetLastError();
11684        if (mem_base != xmlMemBlocks()) {
11685            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11686	           xmlMemBlocks() - mem_base);
11687	    test_ret++;
11688            printf(" %d", n_URL);
11689            printf("\n");
11690        }
11691    }
11692    function_tests++;
11693#endif
11694
11695    return(test_ret);
11696}
11697
11698
11699static int
11700test_xmlNanoFTPOpen(void) {
11701    int test_ret = 0;
11702
11703#if defined(LIBXML_FTP_ENABLED)
11704    int mem_base;
11705    void * ret_val;
11706    const char * URL; /* the URL to the resource */
11707    int n_URL;
11708
11709    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11710        mem_base = xmlMemBlocks();
11711        URL = gen_filepath(n_URL, 0);
11712
11713        ret_val = xmlNanoFTPOpen(URL);
11714        desret_xmlNanoFTPCtxtPtr(ret_val);
11715        call_tests++;
11716        des_filepath(n_URL, URL, 0);
11717        xmlResetLastError();
11718        if (mem_base != xmlMemBlocks()) {
11719            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11720	           xmlMemBlocks() - mem_base);
11721	    test_ret++;
11722            printf(" %d", n_URL);
11723            printf("\n");
11724        }
11725    }
11726    function_tests++;
11727#endif
11728
11729    return(test_ret);
11730}
11731
11732
11733static int
11734test_xmlNanoFTPProxy(void) {
11735    int test_ret = 0;
11736
11737#if defined(LIBXML_FTP_ENABLED)
11738    char * host; /* the proxy host name */
11739    int n_host;
11740    int port; /* the proxy port */
11741    int n_port;
11742    char * user; /* the proxy user name */
11743    int n_user;
11744    char * passwd; /* the proxy password */
11745    int n_passwd;
11746    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11747    int n_type;
11748
11749    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11750    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11751    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11752    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11753    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11754        host = gen_const_char_ptr(n_host, 0);
11755        port = gen_int(n_port, 1);
11756        user = gen_const_char_ptr(n_user, 2);
11757        passwd = gen_const_char_ptr(n_passwd, 3);
11758        type = gen_int(n_type, 4);
11759
11760        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11761        call_tests++;
11762        des_const_char_ptr(n_host, (const char *)host, 0);
11763        des_int(n_port, port, 1);
11764        des_const_char_ptr(n_user, (const char *)user, 2);
11765        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11766        des_int(n_type, type, 4);
11767        xmlResetLastError();
11768    }
11769    }
11770    }
11771    }
11772    }
11773    function_tests++;
11774#endif
11775
11776    return(test_ret);
11777}
11778
11779
11780static int
11781test_xmlNanoFTPQuit(void) {
11782    int test_ret = 0;
11783
11784#if defined(LIBXML_FTP_ENABLED)
11785    int mem_base;
11786    int ret_val;
11787    void * ctx; /* an FTP context */
11788    int n_ctx;
11789
11790    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11791        mem_base = xmlMemBlocks();
11792        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11793
11794        ret_val = xmlNanoFTPQuit(ctx);
11795        desret_int(ret_val);
11796        call_tests++;
11797        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11798        xmlResetLastError();
11799        if (mem_base != xmlMemBlocks()) {
11800            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11801	           xmlMemBlocks() - mem_base);
11802	    test_ret++;
11803            printf(" %d", n_ctx);
11804            printf("\n");
11805        }
11806    }
11807    function_tests++;
11808#endif
11809
11810    return(test_ret);
11811}
11812
11813
11814static int
11815test_xmlNanoFTPRead(void) {
11816    int test_ret = 0;
11817
11818#if defined(LIBXML_FTP_ENABLED)
11819    int mem_base;
11820    int ret_val;
11821    void * ctx; /* the FTP context */
11822    int n_ctx;
11823    void * dest; /* a buffer */
11824    int n_dest;
11825    int len; /* the buffer length */
11826    int n_len;
11827
11828    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11829    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11830    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11831        mem_base = xmlMemBlocks();
11832        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11833        dest = gen_void_ptr(n_dest, 1);
11834        len = gen_int(n_len, 2);
11835
11836        ret_val = xmlNanoFTPRead(ctx, dest, len);
11837        desret_int(ret_val);
11838        call_tests++;
11839        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11840        des_void_ptr(n_dest, dest, 1);
11841        des_int(n_len, len, 2);
11842        xmlResetLastError();
11843        if (mem_base != xmlMemBlocks()) {
11844            printf("Leak of %d blocks found in xmlNanoFTPRead",
11845	           xmlMemBlocks() - mem_base);
11846	    test_ret++;
11847            printf(" %d", n_ctx);
11848            printf(" %d", n_dest);
11849            printf(" %d", n_len);
11850            printf("\n");
11851        }
11852    }
11853    }
11854    }
11855    function_tests++;
11856#endif
11857
11858    return(test_ret);
11859}
11860
11861
11862static int
11863test_xmlNanoFTPScanProxy(void) {
11864    int test_ret = 0;
11865
11866#if defined(LIBXML_FTP_ENABLED)
11867    const char * URL; /* The proxy URL used to initialize the proxy context */
11868    int n_URL;
11869
11870    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11871        URL = gen_filepath(n_URL, 0);
11872
11873        xmlNanoFTPScanProxy(URL);
11874        call_tests++;
11875        des_filepath(n_URL, URL, 0);
11876        xmlResetLastError();
11877    }
11878    function_tests++;
11879#endif
11880
11881    return(test_ret);
11882}
11883
11884
11885static int
11886test_xmlNanoFTPUpdateURL(void) {
11887    int test_ret = 0;
11888
11889#if defined(LIBXML_FTP_ENABLED)
11890    int mem_base;
11891    int ret_val;
11892    void * ctx; /* an FTP context */
11893    int n_ctx;
11894    const char * URL; /* The URL used to update the context */
11895    int n_URL;
11896
11897    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11898    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11899        mem_base = xmlMemBlocks();
11900        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11901        URL = gen_filepath(n_URL, 1);
11902
11903        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11904        desret_int(ret_val);
11905        call_tests++;
11906        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11907        des_filepath(n_URL, URL, 1);
11908        xmlResetLastError();
11909        if (mem_base != xmlMemBlocks()) {
11910            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11911	           xmlMemBlocks() - mem_base);
11912	    test_ret++;
11913            printf(" %d", n_ctx);
11914            printf(" %d", n_URL);
11915            printf("\n");
11916        }
11917    }
11918    }
11919    function_tests++;
11920#endif
11921
11922    return(test_ret);
11923}
11924
11925static int
11926test_nanoftp(void) {
11927    int test_ret = 0;
11928
11929    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
11930    test_ret += test_xmlNanoFTPCheckResponse();
11931    test_ret += test_xmlNanoFTPCleanup();
11932    test_ret += test_xmlNanoFTPCloseConnection();
11933    test_ret += test_xmlNanoFTPCwd();
11934    test_ret += test_xmlNanoFTPDele();
11935    test_ret += test_xmlNanoFTPGet();
11936    test_ret += test_xmlNanoFTPGetConnection();
11937    test_ret += test_xmlNanoFTPGetResponse();
11938    test_ret += test_xmlNanoFTPGetSocket();
11939    test_ret += test_xmlNanoFTPInit();
11940    test_ret += test_xmlNanoFTPList();
11941    test_ret += test_xmlNanoFTPNewCtxt();
11942    test_ret += test_xmlNanoFTPOpen();
11943    test_ret += test_xmlNanoFTPProxy();
11944    test_ret += test_xmlNanoFTPQuit();
11945    test_ret += test_xmlNanoFTPRead();
11946    test_ret += test_xmlNanoFTPScanProxy();
11947    test_ret += test_xmlNanoFTPUpdateURL();
11948
11949    if (test_ret != 0)
11950	printf("Module nanoftp: %d errors\n", test_ret);
11951    return(test_ret);
11952}
11953
11954static int
11955test_xmlNanoHTTPAuthHeader(void) {
11956    int test_ret = 0;
11957
11958#if defined(LIBXML_HTTP_ENABLED)
11959    int mem_base;
11960    const char * ret_val;
11961    void * ctx; /* the HTTP context */
11962    int n_ctx;
11963
11964    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11965        mem_base = xmlMemBlocks();
11966        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11967
11968        ret_val = xmlNanoHTTPAuthHeader(ctx);
11969        desret_const_char_ptr(ret_val);
11970        call_tests++;
11971        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11972        xmlResetLastError();
11973        if (mem_base != xmlMemBlocks()) {
11974            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11975	           xmlMemBlocks() - mem_base);
11976	    test_ret++;
11977            printf(" %d", n_ctx);
11978            printf("\n");
11979        }
11980    }
11981    function_tests++;
11982#endif
11983
11984    return(test_ret);
11985}
11986
11987
11988static int
11989test_xmlNanoHTTPCleanup(void) {
11990    int test_ret = 0;
11991
11992#if defined(LIBXML_HTTP_ENABLED)
11993    int mem_base;
11994
11995        mem_base = xmlMemBlocks();
11996
11997        xmlNanoHTTPCleanup();
11998        call_tests++;
11999        xmlResetLastError();
12000        if (mem_base != xmlMemBlocks()) {
12001            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12002	           xmlMemBlocks() - mem_base);
12003	    test_ret++;
12004            printf("\n");
12005        }
12006    function_tests++;
12007#endif
12008
12009    return(test_ret);
12010}
12011
12012
12013static int
12014test_xmlNanoHTTPContentLength(void) {
12015    int test_ret = 0;
12016
12017#if defined(LIBXML_HTTP_ENABLED)
12018    int mem_base;
12019    int ret_val;
12020    void * ctx; /* the HTTP context */
12021    int n_ctx;
12022
12023    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12024        mem_base = xmlMemBlocks();
12025        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12026
12027        ret_val = xmlNanoHTTPContentLength(ctx);
12028        desret_int(ret_val);
12029        call_tests++;
12030        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12031        xmlResetLastError();
12032        if (mem_base != xmlMemBlocks()) {
12033            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12034	           xmlMemBlocks() - mem_base);
12035	    test_ret++;
12036            printf(" %d", n_ctx);
12037            printf("\n");
12038        }
12039    }
12040    function_tests++;
12041#endif
12042
12043    return(test_ret);
12044}
12045
12046
12047static int
12048test_xmlNanoHTTPEncoding(void) {
12049    int test_ret = 0;
12050
12051#if defined(LIBXML_HTTP_ENABLED)
12052    int mem_base;
12053    const char * ret_val;
12054    void * ctx; /* the HTTP context */
12055    int n_ctx;
12056
12057    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12058        mem_base = xmlMemBlocks();
12059        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12060
12061        ret_val = xmlNanoHTTPEncoding(ctx);
12062        desret_const_char_ptr(ret_val);
12063        call_tests++;
12064        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12065        xmlResetLastError();
12066        if (mem_base != xmlMemBlocks()) {
12067            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12068	           xmlMemBlocks() - mem_base);
12069	    test_ret++;
12070            printf(" %d", n_ctx);
12071            printf("\n");
12072        }
12073    }
12074    function_tests++;
12075#endif
12076
12077    return(test_ret);
12078}
12079
12080
12081#define gen_nb_char_ptr_ptr 1
12082static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12083    return(NULL);
12084}
12085static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12086}
12087
12088static int
12089test_xmlNanoHTTPFetch(void) {
12090    int test_ret = 0;
12091
12092#if defined(LIBXML_HTTP_ENABLED)
12093    int mem_base;
12094    int ret_val;
12095    const char * URL; /* The URL to load */
12096    int n_URL;
12097    const char * filename; /* the filename where the content should be saved */
12098    int n_filename;
12099    char ** contentType; /* if available the Content-Type information will be returned at that location */
12100    int n_contentType;
12101
12102    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12103    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12104    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12105        mem_base = xmlMemBlocks();
12106        URL = gen_fileoutput(n_URL, 0);
12107        filename = gen_fileoutput(n_filename, 1);
12108        contentType = gen_char_ptr_ptr(n_contentType, 2);
12109
12110        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12111        desret_int(ret_val);
12112        call_tests++;
12113        des_fileoutput(n_URL, URL, 0);
12114        des_fileoutput(n_filename, filename, 1);
12115        des_char_ptr_ptr(n_contentType, contentType, 2);
12116        xmlResetLastError();
12117        if (mem_base != xmlMemBlocks()) {
12118            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12119	           xmlMemBlocks() - mem_base);
12120	    test_ret++;
12121            printf(" %d", n_URL);
12122            printf(" %d", n_filename);
12123            printf(" %d", n_contentType);
12124            printf("\n");
12125        }
12126    }
12127    }
12128    }
12129    function_tests++;
12130#endif
12131
12132    return(test_ret);
12133}
12134
12135
12136static int
12137test_xmlNanoHTTPInit(void) {
12138    int test_ret = 0;
12139
12140#if defined(LIBXML_HTTP_ENABLED)
12141    int mem_base;
12142
12143        mem_base = xmlMemBlocks();
12144
12145        xmlNanoHTTPInit();
12146        call_tests++;
12147        xmlResetLastError();
12148        if (mem_base != xmlMemBlocks()) {
12149            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12150	           xmlMemBlocks() - mem_base);
12151	    test_ret++;
12152            printf("\n");
12153        }
12154    function_tests++;
12155#endif
12156
12157    return(test_ret);
12158}
12159
12160
12161static int
12162test_xmlNanoHTTPMimeType(void) {
12163    int test_ret = 0;
12164
12165#if defined(LIBXML_HTTP_ENABLED)
12166    int mem_base;
12167    const char * ret_val;
12168    void * ctx; /* the HTTP context */
12169    int n_ctx;
12170
12171    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12172        mem_base = xmlMemBlocks();
12173        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12174
12175        ret_val = xmlNanoHTTPMimeType(ctx);
12176        desret_const_char_ptr(ret_val);
12177        call_tests++;
12178        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12179        xmlResetLastError();
12180        if (mem_base != xmlMemBlocks()) {
12181            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12182	           xmlMemBlocks() - mem_base);
12183	    test_ret++;
12184            printf(" %d", n_ctx);
12185            printf("\n");
12186        }
12187    }
12188    function_tests++;
12189#endif
12190
12191    return(test_ret);
12192}
12193
12194
12195static int
12196test_xmlNanoHTTPOpen(void) {
12197    int test_ret = 0;
12198
12199#if defined(LIBXML_HTTP_ENABLED)
12200    int mem_base;
12201    void * ret_val;
12202    const char * URL; /* The URL to load */
12203    int n_URL;
12204    char ** contentType; /* if available the Content-Type information will be returned at that location */
12205    int n_contentType;
12206
12207    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12208    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12209        mem_base = xmlMemBlocks();
12210        URL = gen_filepath(n_URL, 0);
12211        contentType = gen_char_ptr_ptr(n_contentType, 1);
12212
12213        ret_val = xmlNanoHTTPOpen(URL, contentType);
12214        desret_xmlNanoHTTPCtxtPtr(ret_val);
12215        call_tests++;
12216        des_filepath(n_URL, URL, 0);
12217        des_char_ptr_ptr(n_contentType, contentType, 1);
12218        xmlResetLastError();
12219        if (mem_base != xmlMemBlocks()) {
12220            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12221	           xmlMemBlocks() - mem_base);
12222	    test_ret++;
12223            printf(" %d", n_URL);
12224            printf(" %d", n_contentType);
12225            printf("\n");
12226        }
12227    }
12228    }
12229    function_tests++;
12230#endif
12231
12232    return(test_ret);
12233}
12234
12235
12236static int
12237test_xmlNanoHTTPOpenRedir(void) {
12238    int test_ret = 0;
12239
12240#if defined(LIBXML_HTTP_ENABLED)
12241    int mem_base;
12242    void * ret_val;
12243    const char * URL; /* The URL to load */
12244    int n_URL;
12245    char ** contentType; /* if available the Content-Type information will be returned at that location */
12246    int n_contentType;
12247    char ** redir; /* if available the redirected URL will be returned */
12248    int n_redir;
12249
12250    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12251    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12252    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12253        mem_base = xmlMemBlocks();
12254        URL = gen_filepath(n_URL, 0);
12255        contentType = gen_char_ptr_ptr(n_contentType, 1);
12256        redir = gen_char_ptr_ptr(n_redir, 2);
12257
12258        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12259        desret_xmlNanoHTTPCtxtPtr(ret_val);
12260        call_tests++;
12261        des_filepath(n_URL, URL, 0);
12262        des_char_ptr_ptr(n_contentType, contentType, 1);
12263        des_char_ptr_ptr(n_redir, redir, 2);
12264        xmlResetLastError();
12265        if (mem_base != xmlMemBlocks()) {
12266            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12267	           xmlMemBlocks() - mem_base);
12268	    test_ret++;
12269            printf(" %d", n_URL);
12270            printf(" %d", n_contentType);
12271            printf(" %d", n_redir);
12272            printf("\n");
12273        }
12274    }
12275    }
12276    }
12277    function_tests++;
12278#endif
12279
12280    return(test_ret);
12281}
12282
12283
12284static int
12285test_xmlNanoHTTPRead(void) {
12286    int test_ret = 0;
12287
12288#if defined(LIBXML_HTTP_ENABLED)
12289    int mem_base;
12290    int ret_val;
12291    void * ctx; /* the HTTP context */
12292    int n_ctx;
12293    void * dest; /* a buffer */
12294    int n_dest;
12295    int len; /* the buffer length */
12296    int n_len;
12297
12298    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12299    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12300    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12301        mem_base = xmlMemBlocks();
12302        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12303        dest = gen_void_ptr(n_dest, 1);
12304        len = gen_int(n_len, 2);
12305
12306        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12307        desret_int(ret_val);
12308        call_tests++;
12309        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12310        des_void_ptr(n_dest, dest, 1);
12311        des_int(n_len, len, 2);
12312        xmlResetLastError();
12313        if (mem_base != xmlMemBlocks()) {
12314            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12315	           xmlMemBlocks() - mem_base);
12316	    test_ret++;
12317            printf(" %d", n_ctx);
12318            printf(" %d", n_dest);
12319            printf(" %d", n_len);
12320            printf("\n");
12321        }
12322    }
12323    }
12324    }
12325    function_tests++;
12326#endif
12327
12328    return(test_ret);
12329}
12330
12331
12332static int
12333test_xmlNanoHTTPRedir(void) {
12334    int test_ret = 0;
12335
12336
12337    /* missing type support */
12338    return(test_ret);
12339}
12340
12341
12342static int
12343test_xmlNanoHTTPReturnCode(void) {
12344    int test_ret = 0;
12345
12346#if defined(LIBXML_HTTP_ENABLED)
12347    int mem_base;
12348    int ret_val;
12349    void * ctx; /* the HTTP context */
12350    int n_ctx;
12351
12352    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12353        mem_base = xmlMemBlocks();
12354        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12355
12356        ret_val = xmlNanoHTTPReturnCode(ctx);
12357        desret_int(ret_val);
12358        call_tests++;
12359        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12360        xmlResetLastError();
12361        if (mem_base != xmlMemBlocks()) {
12362            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12363	           xmlMemBlocks() - mem_base);
12364	    test_ret++;
12365            printf(" %d", n_ctx);
12366            printf("\n");
12367        }
12368    }
12369    function_tests++;
12370#endif
12371
12372    return(test_ret);
12373}
12374
12375
12376static int
12377test_xmlNanoHTTPSave(void) {
12378    int test_ret = 0;
12379
12380#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12381    int mem_base;
12382    int ret_val;
12383    void * ctxt; /* the HTTP context */
12384    int n_ctxt;
12385    const char * filename; /* the filename where the content should be saved */
12386    int n_filename;
12387
12388    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12389    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12390        mem_base = xmlMemBlocks();
12391        ctxt = gen_void_ptr(n_ctxt, 0);
12392        filename = gen_fileoutput(n_filename, 1);
12393
12394        ret_val = xmlNanoHTTPSave(ctxt, filename);
12395        desret_int(ret_val);
12396        call_tests++;
12397        des_void_ptr(n_ctxt, ctxt, 0);
12398        des_fileoutput(n_filename, filename, 1);
12399        xmlResetLastError();
12400        if (mem_base != xmlMemBlocks()) {
12401            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12402	           xmlMemBlocks() - mem_base);
12403	    test_ret++;
12404            printf(" %d", n_ctxt);
12405            printf(" %d", n_filename);
12406            printf("\n");
12407        }
12408    }
12409    }
12410    function_tests++;
12411#endif
12412
12413    return(test_ret);
12414}
12415
12416
12417static int
12418test_xmlNanoHTTPScanProxy(void) {
12419    int test_ret = 0;
12420
12421#if defined(LIBXML_HTTP_ENABLED)
12422    const char * URL; /* The proxy URL used to initialize the proxy context */
12423    int n_URL;
12424
12425    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12426        URL = gen_filepath(n_URL, 0);
12427
12428        xmlNanoHTTPScanProxy(URL);
12429        call_tests++;
12430        des_filepath(n_URL, URL, 0);
12431        xmlResetLastError();
12432    }
12433    function_tests++;
12434#endif
12435
12436    return(test_ret);
12437}
12438
12439static int
12440test_nanohttp(void) {
12441    int test_ret = 0;
12442
12443    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12444    test_ret += test_xmlNanoHTTPAuthHeader();
12445    test_ret += test_xmlNanoHTTPCleanup();
12446    test_ret += test_xmlNanoHTTPContentLength();
12447    test_ret += test_xmlNanoHTTPEncoding();
12448    test_ret += test_xmlNanoHTTPFetch();
12449    test_ret += test_xmlNanoHTTPInit();
12450    test_ret += test_xmlNanoHTTPMimeType();
12451    test_ret += test_xmlNanoHTTPOpen();
12452    test_ret += test_xmlNanoHTTPOpenRedir();
12453    test_ret += test_xmlNanoHTTPRead();
12454    test_ret += test_xmlNanoHTTPRedir();
12455    test_ret += test_xmlNanoHTTPReturnCode();
12456    test_ret += test_xmlNanoHTTPSave();
12457    test_ret += test_xmlNanoHTTPScanProxy();
12458
12459    if (test_ret != 0)
12460	printf("Module nanohttp: %d errors\n", test_ret);
12461    return(test_ret);
12462}
12463
12464static int
12465test_xmlByteConsumed(void) {
12466    int test_ret = 0;
12467
12468    int mem_base;
12469    long ret_val;
12470    xmlParserCtxtPtr ctxt; /* an XML parser context */
12471    int n_ctxt;
12472
12473    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12474        mem_base = xmlMemBlocks();
12475        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12476
12477        ret_val = xmlByteConsumed(ctxt);
12478        desret_long(ret_val);
12479        call_tests++;
12480        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12481        xmlResetLastError();
12482        if (mem_base != xmlMemBlocks()) {
12483            printf("Leak of %d blocks found in xmlByteConsumed",
12484	           xmlMemBlocks() - mem_base);
12485	    test_ret++;
12486            printf(" %d", n_ctxt);
12487            printf("\n");
12488        }
12489    }
12490    function_tests++;
12491
12492    return(test_ret);
12493}
12494
12495
12496static int
12497test_xmlClearNodeInfoSeq(void) {
12498    int test_ret = 0;
12499
12500    int mem_base;
12501    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12502    int n_seq;
12503
12504    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12505        mem_base = xmlMemBlocks();
12506        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12507
12508        xmlClearNodeInfoSeq(seq);
12509        call_tests++;
12510        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12511        xmlResetLastError();
12512        if (mem_base != xmlMemBlocks()) {
12513            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12514	           xmlMemBlocks() - mem_base);
12515	    test_ret++;
12516            printf(" %d", n_seq);
12517            printf("\n");
12518        }
12519    }
12520    function_tests++;
12521
12522    return(test_ret);
12523}
12524
12525
12526static int
12527test_xmlClearParserCtxt(void) {
12528    int test_ret = 0;
12529
12530    int mem_base;
12531    xmlParserCtxtPtr ctxt; /* an XML parser context */
12532    int n_ctxt;
12533
12534    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12535        mem_base = xmlMemBlocks();
12536        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12537
12538        xmlClearParserCtxt(ctxt);
12539        call_tests++;
12540        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12541        xmlResetLastError();
12542        if (mem_base != xmlMemBlocks()) {
12543            printf("Leak of %d blocks found in xmlClearParserCtxt",
12544	           xmlMemBlocks() - mem_base);
12545	    test_ret++;
12546            printf(" %d", n_ctxt);
12547            printf("\n");
12548        }
12549    }
12550    function_tests++;
12551
12552    return(test_ret);
12553}
12554
12555
12556static int
12557test_xmlCreateDocParserCtxt(void) {
12558    int test_ret = 0;
12559
12560    int mem_base;
12561    xmlParserCtxtPtr ret_val;
12562    xmlChar * cur; /* a pointer to an array of xmlChar */
12563    int n_cur;
12564
12565    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12566        mem_base = xmlMemBlocks();
12567        cur = gen_const_xmlChar_ptr(n_cur, 0);
12568
12569        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12570        desret_xmlParserCtxtPtr(ret_val);
12571        call_tests++;
12572        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12573        xmlResetLastError();
12574        if (mem_base != xmlMemBlocks()) {
12575            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12576	           xmlMemBlocks() - mem_base);
12577	    test_ret++;
12578            printf(" %d", n_cur);
12579            printf("\n");
12580        }
12581    }
12582    function_tests++;
12583
12584    return(test_ret);
12585}
12586
12587
12588static int
12589test_xmlCreatePushParserCtxt(void) {
12590    int test_ret = 0;
12591
12592#if defined(LIBXML_PUSH_ENABLED)
12593    int mem_base;
12594    xmlParserCtxtPtr ret_val;
12595    xmlSAXHandlerPtr sax; /* a SAX handler */
12596    int n_sax;
12597    void * user_data; /* The user data returned on SAX callbacks */
12598    int n_user_data;
12599    char * chunk; /* a pointer to an array of chars */
12600    int n_chunk;
12601    int size; /* number of chars in the array */
12602    int n_size;
12603    const char * filename; /* an optional file name or URI */
12604    int n_filename;
12605
12606    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12607    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12608    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12609    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12610    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12611        mem_base = xmlMemBlocks();
12612        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12613        user_data = gen_userdata(n_user_data, 1);
12614        chunk = gen_const_char_ptr(n_chunk, 2);
12615        size = gen_int(n_size, 3);
12616        filename = gen_fileoutput(n_filename, 4);
12617
12618        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12619        desret_xmlParserCtxtPtr(ret_val);
12620        call_tests++;
12621        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12622        des_userdata(n_user_data, user_data, 1);
12623        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12624        des_int(n_size, size, 3);
12625        des_fileoutput(n_filename, filename, 4);
12626        xmlResetLastError();
12627        if (mem_base != xmlMemBlocks()) {
12628            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12629	           xmlMemBlocks() - mem_base);
12630	    test_ret++;
12631            printf(" %d", n_sax);
12632            printf(" %d", n_user_data);
12633            printf(" %d", n_chunk);
12634            printf(" %d", n_size);
12635            printf(" %d", n_filename);
12636            printf("\n");
12637        }
12638    }
12639    }
12640    }
12641    }
12642    }
12643    function_tests++;
12644#endif
12645
12646    return(test_ret);
12647}
12648
12649
12650static int
12651test_xmlCtxtReadDoc(void) {
12652    int test_ret = 0;
12653
12654    int mem_base;
12655    xmlDocPtr ret_val;
12656    xmlParserCtxtPtr ctxt; /* an XML parser context */
12657    int n_ctxt;
12658    xmlChar * cur; /* a pointer to a zero terminated string */
12659    int n_cur;
12660    const char * URL; /* the base URL to use for the document */
12661    int n_URL;
12662    char * encoding; /* the document encoding, or NULL */
12663    int n_encoding;
12664    int options; /* a combination of xmlParserOption */
12665    int n_options;
12666
12667    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12668    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12669    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12670    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12671    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12672        mem_base = xmlMemBlocks();
12673        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12674        cur = gen_const_xmlChar_ptr(n_cur, 1);
12675        URL = gen_filepath(n_URL, 2);
12676        encoding = gen_const_char_ptr(n_encoding, 3);
12677        options = gen_parseroptions(n_options, 4);
12678
12679        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12680        desret_xmlDocPtr(ret_val);
12681        call_tests++;
12682        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12683        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12684        des_filepath(n_URL, URL, 2);
12685        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12686        des_parseroptions(n_options, options, 4);
12687        xmlResetLastError();
12688        if (mem_base != xmlMemBlocks()) {
12689            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12690	           xmlMemBlocks() - mem_base);
12691	    test_ret++;
12692            printf(" %d", n_ctxt);
12693            printf(" %d", n_cur);
12694            printf(" %d", n_URL);
12695            printf(" %d", n_encoding);
12696            printf(" %d", n_options);
12697            printf("\n");
12698        }
12699    }
12700    }
12701    }
12702    }
12703    }
12704    function_tests++;
12705
12706    return(test_ret);
12707}
12708
12709
12710static int
12711test_xmlCtxtReadFile(void) {
12712    int test_ret = 0;
12713
12714    int mem_base;
12715    xmlDocPtr ret_val;
12716    xmlParserCtxtPtr ctxt; /* an XML parser context */
12717    int n_ctxt;
12718    const char * filename; /* a file or URL */
12719    int n_filename;
12720    char * encoding; /* the document encoding, or NULL */
12721    int n_encoding;
12722    int options; /* a combination of xmlParserOption */
12723    int n_options;
12724
12725    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12726    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12727    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12728    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12729        mem_base = xmlMemBlocks();
12730        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12731        filename = gen_filepath(n_filename, 1);
12732        encoding = gen_const_char_ptr(n_encoding, 2);
12733        options = gen_parseroptions(n_options, 3);
12734
12735        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12736        desret_xmlDocPtr(ret_val);
12737        call_tests++;
12738        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12739        des_filepath(n_filename, filename, 1);
12740        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12741        des_parseroptions(n_options, options, 3);
12742        xmlResetLastError();
12743        if (mem_base != xmlMemBlocks()) {
12744            printf("Leak of %d blocks found in xmlCtxtReadFile",
12745	           xmlMemBlocks() - mem_base);
12746	    test_ret++;
12747            printf(" %d", n_ctxt);
12748            printf(" %d", n_filename);
12749            printf(" %d", n_encoding);
12750            printf(" %d", n_options);
12751            printf("\n");
12752        }
12753    }
12754    }
12755    }
12756    }
12757    function_tests++;
12758
12759    return(test_ret);
12760}
12761
12762
12763static int
12764test_xmlCtxtReadMemory(void) {
12765    int test_ret = 0;
12766
12767    int mem_base;
12768    xmlDocPtr ret_val;
12769    xmlParserCtxtPtr ctxt; /* an XML parser context */
12770    int n_ctxt;
12771    char * buffer; /* a pointer to a char array */
12772    int n_buffer;
12773    int size; /* the size of the array */
12774    int n_size;
12775    const char * URL; /* the base URL to use for the document */
12776    int n_URL;
12777    char * encoding; /* the document encoding, or NULL */
12778    int n_encoding;
12779    int options; /* a combination of xmlParserOption */
12780    int n_options;
12781
12782    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12783    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12784    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12785    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12786    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12787    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12788        mem_base = xmlMemBlocks();
12789        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12790        buffer = gen_const_char_ptr(n_buffer, 1);
12791        size = gen_int(n_size, 2);
12792        URL = gen_filepath(n_URL, 3);
12793        encoding = gen_const_char_ptr(n_encoding, 4);
12794        options = gen_parseroptions(n_options, 5);
12795
12796        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12797        desret_xmlDocPtr(ret_val);
12798        call_tests++;
12799        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12800        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12801        des_int(n_size, size, 2);
12802        des_filepath(n_URL, URL, 3);
12803        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12804        des_parseroptions(n_options, options, 5);
12805        xmlResetLastError();
12806        if (mem_base != xmlMemBlocks()) {
12807            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12808	           xmlMemBlocks() - mem_base);
12809	    test_ret++;
12810            printf(" %d", n_ctxt);
12811            printf(" %d", n_buffer);
12812            printf(" %d", n_size);
12813            printf(" %d", n_URL);
12814            printf(" %d", n_encoding);
12815            printf(" %d", n_options);
12816            printf("\n");
12817        }
12818    }
12819    }
12820    }
12821    }
12822    }
12823    }
12824    function_tests++;
12825
12826    return(test_ret);
12827}
12828
12829
12830static int
12831test_xmlCtxtReset(void) {
12832    int test_ret = 0;
12833
12834    int mem_base;
12835    xmlParserCtxtPtr ctxt; /* an XML parser context */
12836    int n_ctxt;
12837
12838    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12839        mem_base = xmlMemBlocks();
12840        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12841
12842        xmlCtxtReset(ctxt);
12843        call_tests++;
12844        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12845        xmlResetLastError();
12846        if (mem_base != xmlMemBlocks()) {
12847            printf("Leak of %d blocks found in xmlCtxtReset",
12848	           xmlMemBlocks() - mem_base);
12849	    test_ret++;
12850            printf(" %d", n_ctxt);
12851            printf("\n");
12852        }
12853    }
12854    function_tests++;
12855
12856    return(test_ret);
12857}
12858
12859
12860static int
12861test_xmlCtxtResetPush(void) {
12862    int test_ret = 0;
12863
12864    int mem_base;
12865    int ret_val;
12866    xmlParserCtxtPtr ctxt; /* an XML parser context */
12867    int n_ctxt;
12868    char * chunk; /* a pointer to an array of chars */
12869    int n_chunk;
12870    int size; /* number of chars in the array */
12871    int n_size;
12872    const char * filename; /* an optional file name or URI */
12873    int n_filename;
12874    char * encoding; /* the document encoding, or NULL */
12875    int n_encoding;
12876
12877    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12878    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12879    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12880    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12881    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12882        mem_base = xmlMemBlocks();
12883        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12884        chunk = gen_const_char_ptr(n_chunk, 1);
12885        size = gen_int(n_size, 2);
12886        filename = gen_filepath(n_filename, 3);
12887        encoding = gen_const_char_ptr(n_encoding, 4);
12888
12889        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12890        desret_int(ret_val);
12891        call_tests++;
12892        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12893        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12894        des_int(n_size, size, 2);
12895        des_filepath(n_filename, filename, 3);
12896        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12897        xmlResetLastError();
12898        if (mem_base != xmlMemBlocks()) {
12899            printf("Leak of %d blocks found in xmlCtxtResetPush",
12900	           xmlMemBlocks() - mem_base);
12901	    test_ret++;
12902            printf(" %d", n_ctxt);
12903            printf(" %d", n_chunk);
12904            printf(" %d", n_size);
12905            printf(" %d", n_filename);
12906            printf(" %d", n_encoding);
12907            printf("\n");
12908        }
12909    }
12910    }
12911    }
12912    }
12913    }
12914    function_tests++;
12915
12916    return(test_ret);
12917}
12918
12919
12920static int
12921test_xmlCtxtUseOptions(void) {
12922    int test_ret = 0;
12923
12924    int mem_base;
12925    int ret_val;
12926    xmlParserCtxtPtr ctxt; /* an XML parser context */
12927    int n_ctxt;
12928    int options; /* a combination of xmlParserOption */
12929    int n_options;
12930
12931    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12932    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12933        mem_base = xmlMemBlocks();
12934        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12935        options = gen_parseroptions(n_options, 1);
12936
12937        ret_val = xmlCtxtUseOptions(ctxt, options);
12938        desret_int(ret_val);
12939        call_tests++;
12940        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12941        des_parseroptions(n_options, options, 1);
12942        xmlResetLastError();
12943        if (mem_base != xmlMemBlocks()) {
12944            printf("Leak of %d blocks found in xmlCtxtUseOptions",
12945	           xmlMemBlocks() - mem_base);
12946	    test_ret++;
12947            printf(" %d", n_ctxt);
12948            printf(" %d", n_options);
12949            printf("\n");
12950        }
12951    }
12952    }
12953    function_tests++;
12954
12955    return(test_ret);
12956}
12957
12958
12959static int
12960test_xmlGetExternalEntityLoader(void) {
12961    int test_ret = 0;
12962
12963
12964    /* missing type support */
12965    return(test_ret);
12966}
12967
12968
12969static int
12970test_xmlGetFeature(void) {
12971    int test_ret = 0;
12972
12973#if defined(LIBXML_LEGACY_ENABLED)
12974#ifdef LIBXML_LEGACY_ENABLED
12975    int mem_base;
12976    int ret_val;
12977    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
12978    int n_ctxt;
12979    char * name; /* the feature name */
12980    int n_name;
12981    void * result; /* location to store the result */
12982    int n_result;
12983
12984    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12985    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
12986    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
12987        mem_base = xmlMemBlocks();
12988        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12989        name = gen_const_char_ptr(n_name, 1);
12990        result = gen_void_ptr(n_result, 2);
12991
12992        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
12993        desret_int(ret_val);
12994        call_tests++;
12995        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12996        des_const_char_ptr(n_name, (const char *)name, 1);
12997        des_void_ptr(n_result, result, 2);
12998        xmlResetLastError();
12999        if (mem_base != xmlMemBlocks()) {
13000            printf("Leak of %d blocks found in xmlGetFeature",
13001	           xmlMemBlocks() - mem_base);
13002	    test_ret++;
13003            printf(" %d", n_ctxt);
13004            printf(" %d", n_name);
13005            printf(" %d", n_result);
13006            printf("\n");
13007        }
13008    }
13009    }
13010    }
13011    function_tests++;
13012#endif
13013#endif
13014
13015    return(test_ret);
13016}
13017
13018
13019#define gen_nb_const_char_ptr_ptr 1
13020static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13021    return(NULL);
13022}
13023static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13024}
13025
13026static int
13027test_xmlGetFeaturesList(void) {
13028    int test_ret = 0;
13029
13030#if defined(LIBXML_LEGACY_ENABLED)
13031#ifdef LIBXML_LEGACY_ENABLED
13032    int mem_base;
13033    int ret_val;
13034    int * len; /* the length of the features name array (input/output) */
13035    int n_len;
13036    char ** result; /* an array of string to be filled with the features name. */
13037    int n_result;
13038
13039    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13040    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13041        mem_base = xmlMemBlocks();
13042        len = gen_int_ptr(n_len, 0);
13043        result = gen_const_char_ptr_ptr(n_result, 1);
13044
13045        ret_val = xmlGetFeaturesList(len, (const char **)result);
13046        desret_int(ret_val);
13047        call_tests++;
13048        des_int_ptr(n_len, len, 0);
13049        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13050        xmlResetLastError();
13051        if (mem_base != xmlMemBlocks()) {
13052            printf("Leak of %d blocks found in xmlGetFeaturesList",
13053	           xmlMemBlocks() - mem_base);
13054	    test_ret++;
13055            printf(" %d", n_len);
13056            printf(" %d", n_result);
13057            printf("\n");
13058        }
13059    }
13060    }
13061    function_tests++;
13062#endif
13063#endif
13064
13065    return(test_ret);
13066}
13067
13068
13069static int
13070test_xmlHasFeature(void) {
13071    int test_ret = 0;
13072
13073    int mem_base;
13074    int ret_val;
13075    xmlFeature feature; /* the feature to be examined */
13076    int n_feature;
13077
13078    for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13079        mem_base = xmlMemBlocks();
13080        feature = gen_xmlFeature(n_feature, 0);
13081
13082        ret_val = xmlHasFeature(feature);
13083        desret_int(ret_val);
13084        call_tests++;
13085        des_xmlFeature(n_feature, feature, 0);
13086        xmlResetLastError();
13087        if (mem_base != xmlMemBlocks()) {
13088            printf("Leak of %d blocks found in xmlHasFeature",
13089	           xmlMemBlocks() - mem_base);
13090	    test_ret++;
13091            printf(" %d", n_feature);
13092            printf("\n");
13093        }
13094    }
13095    function_tests++;
13096
13097    return(test_ret);
13098}
13099
13100
13101static int
13102test_xmlIOParseDTD(void) {
13103    int test_ret = 0;
13104
13105#if defined(LIBXML_VALID_ENABLED)
13106#ifdef LIBXML_VALID_ENABLED
13107    int mem_base;
13108    xmlDtdPtr ret_val;
13109    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13110    int n_sax;
13111    xmlParserInputBufferPtr input; /* an Input Buffer */
13112    int n_input;
13113    xmlCharEncoding enc; /* the charset encoding if known */
13114    int n_enc;
13115
13116    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13117    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13118    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13119        mem_base = xmlMemBlocks();
13120        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13121        input = gen_xmlParserInputBufferPtr(n_input, 1);
13122        enc = gen_xmlCharEncoding(n_enc, 2);
13123
13124        ret_val = xmlIOParseDTD(sax, input, enc);
13125        input = NULL;
13126        desret_xmlDtdPtr(ret_val);
13127        call_tests++;
13128        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13129        des_xmlParserInputBufferPtr(n_input, input, 1);
13130        des_xmlCharEncoding(n_enc, enc, 2);
13131        xmlResetLastError();
13132        if (mem_base != xmlMemBlocks()) {
13133            printf("Leak of %d blocks found in xmlIOParseDTD",
13134	           xmlMemBlocks() - mem_base);
13135	    test_ret++;
13136            printf(" %d", n_sax);
13137            printf(" %d", n_input);
13138            printf(" %d", n_enc);
13139            printf("\n");
13140        }
13141    }
13142    }
13143    }
13144    function_tests++;
13145#endif
13146#endif
13147
13148    return(test_ret);
13149}
13150
13151
13152static int
13153test_xmlInitNodeInfoSeq(void) {
13154    int test_ret = 0;
13155
13156    int mem_base;
13157    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13158    int n_seq;
13159
13160    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13161        mem_base = xmlMemBlocks();
13162        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13163
13164        xmlInitNodeInfoSeq(seq);
13165        call_tests++;
13166        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13167        xmlResetLastError();
13168        if (mem_base != xmlMemBlocks()) {
13169            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13170	           xmlMemBlocks() - mem_base);
13171	    test_ret++;
13172            printf(" %d", n_seq);
13173            printf("\n");
13174        }
13175    }
13176    function_tests++;
13177
13178    return(test_ret);
13179}
13180
13181
13182static int
13183test_xmlInitParser(void) {
13184    int test_ret = 0;
13185
13186    int mem_base;
13187
13188        mem_base = xmlMemBlocks();
13189
13190        xmlInitParser();
13191        call_tests++;
13192        xmlResetLastError();
13193        if (mem_base != xmlMemBlocks()) {
13194            printf("Leak of %d blocks found in xmlInitParser",
13195	           xmlMemBlocks() - mem_base);
13196	    test_ret++;
13197            printf("\n");
13198        }
13199    function_tests++;
13200
13201    return(test_ret);
13202}
13203
13204
13205static int
13206test_xmlInitParserCtxt(void) {
13207    int test_ret = 0;
13208
13209    int mem_base;
13210    int ret_val;
13211    xmlParserCtxtPtr ctxt; /* an XML parser context */
13212    int n_ctxt;
13213
13214    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13215        mem_base = xmlMemBlocks();
13216        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13217
13218        ret_val = xmlInitParserCtxt(ctxt);
13219        desret_int(ret_val);
13220        call_tests++;
13221        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13222        xmlResetLastError();
13223        if (mem_base != xmlMemBlocks()) {
13224            printf("Leak of %d blocks found in xmlInitParserCtxt",
13225	           xmlMemBlocks() - mem_base);
13226	    test_ret++;
13227            printf(" %d", n_ctxt);
13228            printf("\n");
13229        }
13230    }
13231    function_tests++;
13232
13233    return(test_ret);
13234}
13235
13236
13237static int
13238test_xmlKeepBlanksDefault(void) {
13239    int test_ret = 0;
13240
13241    int mem_base;
13242    int ret_val;
13243    int val; /* int 0 or 1 */
13244    int n_val;
13245
13246    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13247        mem_base = xmlMemBlocks();
13248        val = gen_int(n_val, 0);
13249
13250        ret_val = xmlKeepBlanksDefault(val);
13251        desret_int(ret_val);
13252        call_tests++;
13253        des_int(n_val, val, 0);
13254        xmlResetLastError();
13255        if (mem_base != xmlMemBlocks()) {
13256            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13257	           xmlMemBlocks() - mem_base);
13258	    test_ret++;
13259            printf(" %d", n_val);
13260            printf("\n");
13261        }
13262    }
13263    function_tests++;
13264
13265    return(test_ret);
13266}
13267
13268
13269static int
13270test_xmlLineNumbersDefault(void) {
13271    int test_ret = 0;
13272
13273    int mem_base;
13274    int ret_val;
13275    int val; /* int 0 or 1 */
13276    int n_val;
13277
13278    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13279        mem_base = xmlMemBlocks();
13280        val = gen_int(n_val, 0);
13281
13282        ret_val = xmlLineNumbersDefault(val);
13283        desret_int(ret_val);
13284        call_tests++;
13285        des_int(n_val, val, 0);
13286        xmlResetLastError();
13287        if (mem_base != xmlMemBlocks()) {
13288            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13289	           xmlMemBlocks() - mem_base);
13290	    test_ret++;
13291            printf(" %d", n_val);
13292            printf("\n");
13293        }
13294    }
13295    function_tests++;
13296
13297    return(test_ret);
13298}
13299
13300
13301static int
13302test_xmlLoadExternalEntity(void) {
13303    int test_ret = 0;
13304
13305    int mem_base;
13306    xmlParserInputPtr ret_val;
13307    const char * URL; /* the URL for the entity to load */
13308    int n_URL;
13309    char * ID; /* the Public ID for the entity to load */
13310    int n_ID;
13311    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13312    int n_ctxt;
13313
13314    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13315    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13316    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13317        mem_base = xmlMemBlocks();
13318        URL = gen_filepath(n_URL, 0);
13319        ID = gen_const_char_ptr(n_ID, 1);
13320        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13321
13322        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13323        desret_xmlParserInputPtr(ret_val);
13324        call_tests++;
13325        des_filepath(n_URL, URL, 0);
13326        des_const_char_ptr(n_ID, (const char *)ID, 1);
13327        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13328        xmlResetLastError();
13329        if (mem_base != xmlMemBlocks()) {
13330            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13331	           xmlMemBlocks() - mem_base);
13332	    test_ret++;
13333            printf(" %d", n_URL);
13334            printf(" %d", n_ID);
13335            printf(" %d", n_ctxt);
13336            printf("\n");
13337        }
13338    }
13339    }
13340    }
13341    function_tests++;
13342
13343    return(test_ret);
13344}
13345
13346
13347static int
13348test_xmlNewIOInputStream(void) {
13349    int test_ret = 0;
13350
13351    int mem_base;
13352    xmlParserInputPtr ret_val;
13353    xmlParserCtxtPtr ctxt; /* an XML parser context */
13354    int n_ctxt;
13355    xmlParserInputBufferPtr input; /* an I/O Input */
13356    int n_input;
13357    xmlCharEncoding enc; /* the charset encoding if known */
13358    int n_enc;
13359
13360    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13361    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13362    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13363        mem_base = xmlMemBlocks();
13364        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13365        input = gen_xmlParserInputBufferPtr(n_input, 1);
13366        enc = gen_xmlCharEncoding(n_enc, 2);
13367
13368        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13369        if (ret_val != NULL) input = NULL;
13370        desret_xmlParserInputPtr(ret_val);
13371        call_tests++;
13372        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13373        des_xmlParserInputBufferPtr(n_input, input, 1);
13374        des_xmlCharEncoding(n_enc, enc, 2);
13375        xmlResetLastError();
13376        if (mem_base != xmlMemBlocks()) {
13377            printf("Leak of %d blocks found in xmlNewIOInputStream",
13378	           xmlMemBlocks() - mem_base);
13379	    test_ret++;
13380            printf(" %d", n_ctxt);
13381            printf(" %d", n_input);
13382            printf(" %d", n_enc);
13383            printf("\n");
13384        }
13385    }
13386    }
13387    }
13388    function_tests++;
13389
13390    return(test_ret);
13391}
13392
13393
13394static int
13395test_xmlNewParserCtxt(void) {
13396    int test_ret = 0;
13397
13398    int mem_base;
13399    xmlParserCtxtPtr ret_val;
13400
13401        mem_base = xmlMemBlocks();
13402
13403        ret_val = xmlNewParserCtxt();
13404        desret_xmlParserCtxtPtr(ret_val);
13405        call_tests++;
13406        xmlResetLastError();
13407        if (mem_base != xmlMemBlocks()) {
13408            printf("Leak of %d blocks found in xmlNewParserCtxt",
13409	           xmlMemBlocks() - mem_base);
13410	    test_ret++;
13411            printf("\n");
13412        }
13413    function_tests++;
13414
13415    return(test_ret);
13416}
13417
13418
13419#define gen_nb_xmlNodePtr_ptr 1
13420static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13421    return(NULL);
13422}
13423static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13424}
13425
13426static int
13427test_xmlParseBalancedChunkMemory(void) {
13428    int test_ret = 0;
13429
13430#if defined(LIBXML_SAX1_ENABLED)
13431#ifdef LIBXML_SAX1_ENABLED
13432    int mem_base;
13433    int ret_val;
13434    xmlDocPtr doc; /* the document the chunk pertains to */
13435    int n_doc;
13436    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13437    int n_sax;
13438    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13439    int n_user_data;
13440    int depth; /* Used for loop detection, use 0 */
13441    int n_depth;
13442    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13443    int n_string;
13444    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13445    int n_lst;
13446
13447    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13448    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13449    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13450    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13451    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13452    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13453        mem_base = xmlMemBlocks();
13454        doc = gen_xmlDocPtr(n_doc, 0);
13455        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13456        user_data = gen_userdata(n_user_data, 2);
13457        depth = gen_int(n_depth, 3);
13458        string = gen_const_xmlChar_ptr(n_string, 4);
13459        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13460
13461#ifdef LIBXML_SAX1_ENABLED
13462        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13463#endif
13464
13465
13466        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13467        desret_int(ret_val);
13468        call_tests++;
13469        des_xmlDocPtr(n_doc, doc, 0);
13470        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13471        des_userdata(n_user_data, user_data, 2);
13472        des_int(n_depth, depth, 3);
13473        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13474        des_xmlNodePtr_ptr(n_lst, lst, 5);
13475        xmlResetLastError();
13476        if (mem_base != xmlMemBlocks()) {
13477            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13478	           xmlMemBlocks() - mem_base);
13479	    test_ret++;
13480            printf(" %d", n_doc);
13481            printf(" %d", n_sax);
13482            printf(" %d", n_user_data);
13483            printf(" %d", n_depth);
13484            printf(" %d", n_string);
13485            printf(" %d", n_lst);
13486            printf("\n");
13487        }
13488    }
13489    }
13490    }
13491    }
13492    }
13493    }
13494    function_tests++;
13495#endif
13496#endif
13497
13498    return(test_ret);
13499}
13500
13501
13502static int
13503test_xmlParseBalancedChunkMemoryRecover(void) {
13504    int test_ret = 0;
13505
13506#if defined(LIBXML_SAX1_ENABLED)
13507#ifdef LIBXML_SAX1_ENABLED
13508    int mem_base;
13509    int ret_val;
13510    xmlDocPtr doc; /* the document the chunk pertains to */
13511    int n_doc;
13512    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13513    int n_sax;
13514    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13515    int n_user_data;
13516    int depth; /* Used for loop detection, use 0 */
13517    int n_depth;
13518    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13519    int n_string;
13520    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13521    int n_lst;
13522    int recover; /* return nodes even if the data is broken (use 0) */
13523    int n_recover;
13524
13525    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13526    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13527    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13528    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13529    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13530    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13531    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13532        mem_base = xmlMemBlocks();
13533        doc = gen_xmlDocPtr(n_doc, 0);
13534        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13535        user_data = gen_userdata(n_user_data, 2);
13536        depth = gen_int(n_depth, 3);
13537        string = gen_const_xmlChar_ptr(n_string, 4);
13538        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13539        recover = gen_int(n_recover, 6);
13540
13541#ifdef LIBXML_SAX1_ENABLED
13542        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13543#endif
13544
13545
13546        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13547        desret_int(ret_val);
13548        call_tests++;
13549        des_xmlDocPtr(n_doc, doc, 0);
13550        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13551        des_userdata(n_user_data, user_data, 2);
13552        des_int(n_depth, depth, 3);
13553        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13554        des_xmlNodePtr_ptr(n_lst, lst, 5);
13555        des_int(n_recover, recover, 6);
13556        xmlResetLastError();
13557        if (mem_base != xmlMemBlocks()) {
13558            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13559	           xmlMemBlocks() - mem_base);
13560	    test_ret++;
13561            printf(" %d", n_doc);
13562            printf(" %d", n_sax);
13563            printf(" %d", n_user_data);
13564            printf(" %d", n_depth);
13565            printf(" %d", n_string);
13566            printf(" %d", n_lst);
13567            printf(" %d", n_recover);
13568            printf("\n");
13569        }
13570    }
13571    }
13572    }
13573    }
13574    }
13575    }
13576    }
13577    function_tests++;
13578#endif
13579#endif
13580
13581    return(test_ret);
13582}
13583
13584
13585static int
13586test_xmlParseChunk(void) {
13587    int test_ret = 0;
13588
13589#if defined(LIBXML_PUSH_ENABLED)
13590    int mem_base;
13591    int ret_val;
13592    xmlParserCtxtPtr ctxt; /* an XML parser context */
13593    int n_ctxt;
13594    char * chunk; /* an char array */
13595    int n_chunk;
13596    int size; /* the size in byte of the chunk */
13597    int n_size;
13598    int terminate; /* last chunk indicator */
13599    int n_terminate;
13600
13601    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13602    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13603    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13604    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13605        mem_base = xmlMemBlocks();
13606        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13607        chunk = gen_const_char_ptr(n_chunk, 1);
13608        size = gen_int(n_size, 2);
13609        terminate = gen_int(n_terminate, 3);
13610
13611        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13612        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13613        desret_int(ret_val);
13614        call_tests++;
13615        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13616        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13617        des_int(n_size, size, 2);
13618        des_int(n_terminate, terminate, 3);
13619        xmlResetLastError();
13620        if (mem_base != xmlMemBlocks()) {
13621            printf("Leak of %d blocks found in xmlParseChunk",
13622	           xmlMemBlocks() - mem_base);
13623	    test_ret++;
13624            printf(" %d", n_ctxt);
13625            printf(" %d", n_chunk);
13626            printf(" %d", n_size);
13627            printf(" %d", n_terminate);
13628            printf("\n");
13629        }
13630    }
13631    }
13632    }
13633    }
13634    function_tests++;
13635#endif
13636
13637    return(test_ret);
13638}
13639
13640
13641static int
13642test_xmlParseCtxtExternalEntity(void) {
13643    int test_ret = 0;
13644
13645    int mem_base;
13646    int ret_val;
13647    xmlParserCtxtPtr ctx; /* the existing parsing context */
13648    int n_ctx;
13649    xmlChar * URL; /* the URL for the entity to load */
13650    int n_URL;
13651    xmlChar * ID; /* the System ID for the entity to load */
13652    int n_ID;
13653    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13654    int n_lst;
13655
13656    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13657    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13658    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13659    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13660        mem_base = xmlMemBlocks();
13661        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13662        URL = gen_const_xmlChar_ptr(n_URL, 1);
13663        ID = gen_const_xmlChar_ptr(n_ID, 2);
13664        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13665
13666        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13667        desret_int(ret_val);
13668        call_tests++;
13669        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13670        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13671        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13672        des_xmlNodePtr_ptr(n_lst, lst, 3);
13673        xmlResetLastError();
13674        if (mem_base != xmlMemBlocks()) {
13675            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13676	           xmlMemBlocks() - mem_base);
13677	    test_ret++;
13678            printf(" %d", n_ctx);
13679            printf(" %d", n_URL);
13680            printf(" %d", n_ID);
13681            printf(" %d", n_lst);
13682            printf("\n");
13683        }
13684    }
13685    }
13686    }
13687    }
13688    function_tests++;
13689
13690    return(test_ret);
13691}
13692
13693
13694static int
13695test_xmlParseDTD(void) {
13696    int test_ret = 0;
13697
13698#if defined(LIBXML_VALID_ENABLED)
13699#ifdef LIBXML_VALID_ENABLED
13700    int mem_base;
13701    xmlDtdPtr ret_val;
13702    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13703    int n_ExternalID;
13704    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13705    int n_SystemID;
13706
13707    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13708    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13709        mem_base = xmlMemBlocks();
13710        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13711        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13712
13713        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13714        desret_xmlDtdPtr(ret_val);
13715        call_tests++;
13716        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13717        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13718        xmlResetLastError();
13719        if (mem_base != xmlMemBlocks()) {
13720            printf("Leak of %d blocks found in xmlParseDTD",
13721	           xmlMemBlocks() - mem_base);
13722	    test_ret++;
13723            printf(" %d", n_ExternalID);
13724            printf(" %d", n_SystemID);
13725            printf("\n");
13726        }
13727    }
13728    }
13729    function_tests++;
13730#endif
13731#endif
13732
13733    return(test_ret);
13734}
13735
13736
13737static int
13738test_xmlParseDoc(void) {
13739    int test_ret = 0;
13740
13741#if defined(LIBXML_SAX1_ENABLED)
13742#ifdef LIBXML_SAX1_ENABLED
13743    int mem_base;
13744    xmlDocPtr ret_val;
13745    xmlChar * cur; /* a pointer to an array of xmlChar */
13746    int n_cur;
13747
13748    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13749        mem_base = xmlMemBlocks();
13750        cur = gen_const_xmlChar_ptr(n_cur, 0);
13751
13752        ret_val = xmlParseDoc((const xmlChar *)cur);
13753        desret_xmlDocPtr(ret_val);
13754        call_tests++;
13755        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13756        xmlResetLastError();
13757        if (mem_base != xmlMemBlocks()) {
13758            printf("Leak of %d blocks found in xmlParseDoc",
13759	           xmlMemBlocks() - mem_base);
13760	    test_ret++;
13761            printf(" %d", n_cur);
13762            printf("\n");
13763        }
13764    }
13765    function_tests++;
13766#endif
13767#endif
13768
13769    return(test_ret);
13770}
13771
13772
13773static int
13774test_xmlParseDocument(void) {
13775    int test_ret = 0;
13776
13777    int mem_base;
13778    int ret_val;
13779    xmlParserCtxtPtr ctxt; /* an XML parser context */
13780    int n_ctxt;
13781
13782    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13783        mem_base = xmlMemBlocks();
13784        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13785
13786        ret_val = xmlParseDocument(ctxt);
13787        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13788        desret_int(ret_val);
13789        call_tests++;
13790        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13791        xmlResetLastError();
13792        if (mem_base != xmlMemBlocks()) {
13793            printf("Leak of %d blocks found in xmlParseDocument",
13794	           xmlMemBlocks() - mem_base);
13795	    test_ret++;
13796            printf(" %d", n_ctxt);
13797            printf("\n");
13798        }
13799    }
13800    function_tests++;
13801
13802    return(test_ret);
13803}
13804
13805
13806static int
13807test_xmlParseEntity(void) {
13808    int test_ret = 0;
13809
13810#if defined(LIBXML_SAX1_ENABLED)
13811#ifdef LIBXML_SAX1_ENABLED
13812    int mem_base;
13813    xmlDocPtr ret_val;
13814    const char * filename; /* the filename */
13815    int n_filename;
13816
13817    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13818        mem_base = xmlMemBlocks();
13819        filename = gen_filepath(n_filename, 0);
13820
13821        ret_val = xmlParseEntity(filename);
13822        desret_xmlDocPtr(ret_val);
13823        call_tests++;
13824        des_filepath(n_filename, filename, 0);
13825        xmlResetLastError();
13826        if (mem_base != xmlMemBlocks()) {
13827            printf("Leak of %d blocks found in xmlParseEntity",
13828	           xmlMemBlocks() - mem_base);
13829	    test_ret++;
13830            printf(" %d", n_filename);
13831            printf("\n");
13832        }
13833    }
13834    function_tests++;
13835#endif
13836#endif
13837
13838    return(test_ret);
13839}
13840
13841
13842static int
13843test_xmlParseExtParsedEnt(void) {
13844    int test_ret = 0;
13845
13846    int mem_base;
13847    int ret_val;
13848    xmlParserCtxtPtr ctxt; /* an XML parser context */
13849    int n_ctxt;
13850
13851    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13852        mem_base = xmlMemBlocks();
13853        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13854
13855        ret_val = xmlParseExtParsedEnt(ctxt);
13856        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13857        desret_int(ret_val);
13858        call_tests++;
13859        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13860        xmlResetLastError();
13861        if (mem_base != xmlMemBlocks()) {
13862            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13863	           xmlMemBlocks() - mem_base);
13864	    test_ret++;
13865            printf(" %d", n_ctxt);
13866            printf("\n");
13867        }
13868    }
13869    function_tests++;
13870
13871    return(test_ret);
13872}
13873
13874
13875static int
13876test_xmlParseExternalEntity(void) {
13877    int test_ret = 0;
13878
13879#if defined(LIBXML_SAX1_ENABLED)
13880#ifdef LIBXML_SAX1_ENABLED
13881    int mem_base;
13882    int ret_val;
13883    xmlDocPtr doc; /* the document the chunk pertains to */
13884    int n_doc;
13885    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13886    int n_sax;
13887    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13888    int n_user_data;
13889    int depth; /* Used for loop detection, use 0 */
13890    int n_depth;
13891    xmlChar * URL; /* the URL for the entity to load */
13892    int n_URL;
13893    xmlChar * ID; /* the System ID for the entity to load */
13894    int n_ID;
13895    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13896    int n_lst;
13897
13898    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13899    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13900    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13901    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13902    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13903    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13904    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13905        mem_base = xmlMemBlocks();
13906        doc = gen_xmlDocPtr(n_doc, 0);
13907        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13908        user_data = gen_userdata(n_user_data, 2);
13909        depth = gen_int(n_depth, 3);
13910        URL = gen_const_xmlChar_ptr(n_URL, 4);
13911        ID = gen_const_xmlChar_ptr(n_ID, 5);
13912        lst = gen_xmlNodePtr_ptr(n_lst, 6);
13913
13914        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13915        desret_int(ret_val);
13916        call_tests++;
13917        des_xmlDocPtr(n_doc, doc, 0);
13918        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13919        des_userdata(n_user_data, user_data, 2);
13920        des_int(n_depth, depth, 3);
13921        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13922        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13923        des_xmlNodePtr_ptr(n_lst, lst, 6);
13924        xmlResetLastError();
13925        if (mem_base != xmlMemBlocks()) {
13926            printf("Leak of %d blocks found in xmlParseExternalEntity",
13927	           xmlMemBlocks() - mem_base);
13928	    test_ret++;
13929            printf(" %d", n_doc);
13930            printf(" %d", n_sax);
13931            printf(" %d", n_user_data);
13932            printf(" %d", n_depth);
13933            printf(" %d", n_URL);
13934            printf(" %d", n_ID);
13935            printf(" %d", n_lst);
13936            printf("\n");
13937        }
13938    }
13939    }
13940    }
13941    }
13942    }
13943    }
13944    }
13945    function_tests++;
13946#endif
13947#endif
13948
13949    return(test_ret);
13950}
13951
13952
13953static int
13954test_xmlParseFile(void) {
13955    int test_ret = 0;
13956
13957#if defined(LIBXML_SAX1_ENABLED)
13958#ifdef LIBXML_SAX1_ENABLED
13959    int mem_base;
13960    xmlDocPtr ret_val;
13961    const char * filename; /* the filename */
13962    int n_filename;
13963
13964    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13965        mem_base = xmlMemBlocks();
13966        filename = gen_filepath(n_filename, 0);
13967
13968        ret_val = xmlParseFile(filename);
13969        desret_xmlDocPtr(ret_val);
13970        call_tests++;
13971        des_filepath(n_filename, filename, 0);
13972        xmlResetLastError();
13973        if (mem_base != xmlMemBlocks()) {
13974            printf("Leak of %d blocks found in xmlParseFile",
13975	           xmlMemBlocks() - mem_base);
13976	    test_ret++;
13977            printf(" %d", n_filename);
13978            printf("\n");
13979        }
13980    }
13981    function_tests++;
13982#endif
13983#endif
13984
13985    return(test_ret);
13986}
13987
13988
13989static int
13990test_xmlParseInNodeContext(void) {
13991    int test_ret = 0;
13992
13993    int mem_base;
13994    xmlParserErrors ret_val;
13995    xmlNodePtr node; /* the context node */
13996    int n_node;
13997    char * data; /* the input string */
13998    int n_data;
13999    int datalen; /* the input string length in bytes */
14000    int n_datalen;
14001    int options; /* a combination of xmlParserOption */
14002    int n_options;
14003    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14004    int n_lst;
14005
14006    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14007    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14008    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14009    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14010    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14011        mem_base = xmlMemBlocks();
14012        node = gen_xmlNodePtr(n_node, 0);
14013        data = gen_const_char_ptr(n_data, 1);
14014        datalen = gen_int(n_datalen, 2);
14015        options = gen_parseroptions(n_options, 3);
14016        lst = gen_xmlNodePtr_ptr(n_lst, 4);
14017
14018        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14019        desret_xmlParserErrors(ret_val);
14020        call_tests++;
14021        des_xmlNodePtr(n_node, node, 0);
14022        des_const_char_ptr(n_data, (const char *)data, 1);
14023        des_int(n_datalen, datalen, 2);
14024        des_parseroptions(n_options, options, 3);
14025        des_xmlNodePtr_ptr(n_lst, lst, 4);
14026        xmlResetLastError();
14027        if (mem_base != xmlMemBlocks()) {
14028            printf("Leak of %d blocks found in xmlParseInNodeContext",
14029	           xmlMemBlocks() - mem_base);
14030	    test_ret++;
14031            printf(" %d", n_node);
14032            printf(" %d", n_data);
14033            printf(" %d", n_datalen);
14034            printf(" %d", n_options);
14035            printf(" %d", n_lst);
14036            printf("\n");
14037        }
14038    }
14039    }
14040    }
14041    }
14042    }
14043    function_tests++;
14044
14045    return(test_ret);
14046}
14047
14048
14049static int
14050test_xmlParseMemory(void) {
14051    int test_ret = 0;
14052
14053#if defined(LIBXML_SAX1_ENABLED)
14054#ifdef LIBXML_SAX1_ENABLED
14055    int mem_base;
14056    xmlDocPtr ret_val;
14057    char * buffer; /* an pointer to a char array */
14058    int n_buffer;
14059    int size; /* the size of the array */
14060    int n_size;
14061
14062    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14063    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14064        mem_base = xmlMemBlocks();
14065        buffer = gen_const_char_ptr(n_buffer, 0);
14066        size = gen_int(n_size, 1);
14067
14068        ret_val = xmlParseMemory((const char *)buffer, size);
14069        desret_xmlDocPtr(ret_val);
14070        call_tests++;
14071        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14072        des_int(n_size, size, 1);
14073        xmlResetLastError();
14074        if (mem_base != xmlMemBlocks()) {
14075            printf("Leak of %d blocks found in xmlParseMemory",
14076	           xmlMemBlocks() - mem_base);
14077	    test_ret++;
14078            printf(" %d", n_buffer);
14079            printf(" %d", n_size);
14080            printf("\n");
14081        }
14082    }
14083    }
14084    function_tests++;
14085#endif
14086#endif
14087
14088    return(test_ret);
14089}
14090
14091
14092#define gen_nb_const_xmlParserNodeInfoPtr 1
14093static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14094    return(NULL);
14095}
14096static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14097}
14098
14099static int
14100test_xmlParserAddNodeInfo(void) {
14101    int test_ret = 0;
14102
14103    int mem_base;
14104    xmlParserCtxtPtr ctxt; /* an XML parser context */
14105    int n_ctxt;
14106    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14107    int n_info;
14108
14109    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14110    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14111        mem_base = xmlMemBlocks();
14112        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14113        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14114
14115        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14116        call_tests++;
14117        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14118        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14119        xmlResetLastError();
14120        if (mem_base != xmlMemBlocks()) {
14121            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14122	           xmlMemBlocks() - mem_base);
14123	    test_ret++;
14124            printf(" %d", n_ctxt);
14125            printf(" %d", n_info);
14126            printf("\n");
14127        }
14128    }
14129    }
14130    function_tests++;
14131
14132    return(test_ret);
14133}
14134
14135
14136#define gen_nb_const_xmlParserCtxtPtr 1
14137static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14138    return(NULL);
14139}
14140static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14141}
14142
14143#define gen_nb_const_xmlNodePtr 1
14144static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14145    return(NULL);
14146}
14147static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14148}
14149
14150static int
14151test_xmlParserFindNodeInfo(void) {
14152    int test_ret = 0;
14153
14154    int mem_base;
14155    const xmlParserNodeInfo * ret_val;
14156    xmlParserCtxtPtr ctx; /* an XML parser context */
14157    int n_ctx;
14158    xmlNodePtr node; /* an XML node within the tree */
14159    int n_node;
14160
14161    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14162    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14163        mem_base = xmlMemBlocks();
14164        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14165        node = gen_const_xmlNodePtr(n_node, 1);
14166
14167        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14168        desret_const_xmlParserNodeInfo_ptr(ret_val);
14169        call_tests++;
14170        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14171        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14172        xmlResetLastError();
14173        if (mem_base != xmlMemBlocks()) {
14174            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14175	           xmlMemBlocks() - mem_base);
14176	    test_ret++;
14177            printf(" %d", n_ctx);
14178            printf(" %d", n_node);
14179            printf("\n");
14180        }
14181    }
14182    }
14183    function_tests++;
14184
14185    return(test_ret);
14186}
14187
14188
14189#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14190static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14191    return(NULL);
14192}
14193static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14194}
14195
14196static int
14197test_xmlParserFindNodeInfoIndex(void) {
14198    int test_ret = 0;
14199
14200    int mem_base;
14201    unsigned long ret_val;
14202    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14203    int n_seq;
14204    xmlNodePtr node; /* an XML node pointer */
14205    int n_node;
14206
14207    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14208    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14209        mem_base = xmlMemBlocks();
14210        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14211        node = gen_const_xmlNodePtr(n_node, 1);
14212
14213        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14214        desret_unsigned_long(ret_val);
14215        call_tests++;
14216        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14217        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14218        xmlResetLastError();
14219        if (mem_base != xmlMemBlocks()) {
14220            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14221	           xmlMemBlocks() - mem_base);
14222	    test_ret++;
14223            printf(" %d", n_seq);
14224            printf(" %d", n_node);
14225            printf("\n");
14226        }
14227    }
14228    }
14229    function_tests++;
14230
14231    return(test_ret);
14232}
14233
14234
14235#define gen_nb_xmlParserInputPtr 1
14236static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14237    return(NULL);
14238}
14239static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14240}
14241
14242static int
14243test_xmlParserInputGrow(void) {
14244    int test_ret = 0;
14245
14246    int mem_base;
14247    int ret_val;
14248    xmlParserInputPtr in; /* an XML parser input */
14249    int n_in;
14250    int len; /* an indicative size for the lookahead */
14251    int n_len;
14252
14253    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14254    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14255        mem_base = xmlMemBlocks();
14256        in = gen_xmlParserInputPtr(n_in, 0);
14257        len = gen_int(n_len, 1);
14258
14259        ret_val = xmlParserInputGrow(in, len);
14260        desret_int(ret_val);
14261        call_tests++;
14262        des_xmlParserInputPtr(n_in, in, 0);
14263        des_int(n_len, len, 1);
14264        xmlResetLastError();
14265        if (mem_base != xmlMemBlocks()) {
14266            printf("Leak of %d blocks found in xmlParserInputGrow",
14267	           xmlMemBlocks() - mem_base);
14268	    test_ret++;
14269            printf(" %d", n_in);
14270            printf(" %d", n_len);
14271            printf("\n");
14272        }
14273    }
14274    }
14275    function_tests++;
14276
14277    return(test_ret);
14278}
14279
14280
14281static int
14282test_xmlParserInputRead(void) {
14283    int test_ret = 0;
14284
14285    int mem_base;
14286    int ret_val;
14287    xmlParserInputPtr in; /* an XML parser input */
14288    int n_in;
14289    int len; /* an indicative size for the lookahead */
14290    int n_len;
14291
14292    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14293    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14294        mem_base = xmlMemBlocks();
14295        in = gen_xmlParserInputPtr(n_in, 0);
14296        len = gen_int(n_len, 1);
14297
14298        ret_val = xmlParserInputRead(in, len);
14299        desret_int(ret_val);
14300        call_tests++;
14301        des_xmlParserInputPtr(n_in, in, 0);
14302        des_int(n_len, len, 1);
14303        xmlResetLastError();
14304        if (mem_base != xmlMemBlocks()) {
14305            printf("Leak of %d blocks found in xmlParserInputRead",
14306	           xmlMemBlocks() - mem_base);
14307	    test_ret++;
14308            printf(" %d", n_in);
14309            printf(" %d", n_len);
14310            printf("\n");
14311        }
14312    }
14313    }
14314    function_tests++;
14315
14316    return(test_ret);
14317}
14318
14319
14320static int
14321test_xmlPedanticParserDefault(void) {
14322    int test_ret = 0;
14323
14324    int mem_base;
14325    int ret_val;
14326    int val; /* int 0 or 1 */
14327    int n_val;
14328
14329    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14330        mem_base = xmlMemBlocks();
14331        val = gen_int(n_val, 0);
14332
14333        ret_val = xmlPedanticParserDefault(val);
14334        desret_int(ret_val);
14335        call_tests++;
14336        des_int(n_val, val, 0);
14337        xmlResetLastError();
14338        if (mem_base != xmlMemBlocks()) {
14339            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14340	           xmlMemBlocks() - mem_base);
14341	    test_ret++;
14342            printf(" %d", n_val);
14343            printf("\n");
14344        }
14345    }
14346    function_tests++;
14347
14348    return(test_ret);
14349}
14350
14351
14352static int
14353test_xmlReadDoc(void) {
14354    int test_ret = 0;
14355
14356    int mem_base;
14357    xmlDocPtr ret_val;
14358    xmlChar * cur; /* a pointer to a zero terminated string */
14359    int n_cur;
14360    const char * URL; /* the base URL to use for the document */
14361    int n_URL;
14362    char * encoding; /* the document encoding, or NULL */
14363    int n_encoding;
14364    int options; /* a combination of xmlParserOption */
14365    int n_options;
14366
14367    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14368    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14369    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14370    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14371        mem_base = xmlMemBlocks();
14372        cur = gen_const_xmlChar_ptr(n_cur, 0);
14373        URL = gen_filepath(n_URL, 1);
14374        encoding = gen_const_char_ptr(n_encoding, 2);
14375        options = gen_parseroptions(n_options, 3);
14376
14377        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14378        desret_xmlDocPtr(ret_val);
14379        call_tests++;
14380        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14381        des_filepath(n_URL, URL, 1);
14382        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14383        des_parseroptions(n_options, options, 3);
14384        xmlResetLastError();
14385        if (mem_base != xmlMemBlocks()) {
14386            printf("Leak of %d blocks found in xmlReadDoc",
14387	           xmlMemBlocks() - mem_base);
14388	    test_ret++;
14389            printf(" %d", n_cur);
14390            printf(" %d", n_URL);
14391            printf(" %d", n_encoding);
14392            printf(" %d", n_options);
14393            printf("\n");
14394        }
14395    }
14396    }
14397    }
14398    }
14399    function_tests++;
14400
14401    return(test_ret);
14402}
14403
14404
14405static int
14406test_xmlReadFile(void) {
14407    int test_ret = 0;
14408
14409    int mem_base;
14410    xmlDocPtr ret_val;
14411    const char * filename; /* a file or URL */
14412    int n_filename;
14413    char * encoding; /* the document encoding, or NULL */
14414    int n_encoding;
14415    int options; /* a combination of xmlParserOption */
14416    int n_options;
14417
14418    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14419    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14420    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14421        mem_base = xmlMemBlocks();
14422        filename = gen_filepath(n_filename, 0);
14423        encoding = gen_const_char_ptr(n_encoding, 1);
14424        options = gen_parseroptions(n_options, 2);
14425
14426        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14427        desret_xmlDocPtr(ret_val);
14428        call_tests++;
14429        des_filepath(n_filename, filename, 0);
14430        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14431        des_parseroptions(n_options, options, 2);
14432        xmlResetLastError();
14433        if (mem_base != xmlMemBlocks()) {
14434            printf("Leak of %d blocks found in xmlReadFile",
14435	           xmlMemBlocks() - mem_base);
14436	    test_ret++;
14437            printf(" %d", n_filename);
14438            printf(" %d", n_encoding);
14439            printf(" %d", n_options);
14440            printf("\n");
14441        }
14442    }
14443    }
14444    }
14445    function_tests++;
14446
14447    return(test_ret);
14448}
14449
14450
14451static int
14452test_xmlReadMemory(void) {
14453    int test_ret = 0;
14454
14455    int mem_base;
14456    xmlDocPtr ret_val;
14457    char * buffer; /* a pointer to a char array */
14458    int n_buffer;
14459    int size; /* the size of the array */
14460    int n_size;
14461    const char * URL; /* the base URL to use for the document */
14462    int n_URL;
14463    char * encoding; /* the document encoding, or NULL */
14464    int n_encoding;
14465    int options; /* a combination of xmlParserOption */
14466    int n_options;
14467
14468    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14469    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14470    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14471    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14472    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14473        mem_base = xmlMemBlocks();
14474        buffer = gen_const_char_ptr(n_buffer, 0);
14475        size = gen_int(n_size, 1);
14476        URL = gen_filepath(n_URL, 2);
14477        encoding = gen_const_char_ptr(n_encoding, 3);
14478        options = gen_parseroptions(n_options, 4);
14479
14480        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14481        desret_xmlDocPtr(ret_val);
14482        call_tests++;
14483        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14484        des_int(n_size, size, 1);
14485        des_filepath(n_URL, URL, 2);
14486        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14487        des_parseroptions(n_options, options, 4);
14488        xmlResetLastError();
14489        if (mem_base != xmlMemBlocks()) {
14490            printf("Leak of %d blocks found in xmlReadMemory",
14491	           xmlMemBlocks() - mem_base);
14492	    test_ret++;
14493            printf(" %d", n_buffer);
14494            printf(" %d", n_size);
14495            printf(" %d", n_URL);
14496            printf(" %d", n_encoding);
14497            printf(" %d", n_options);
14498            printf("\n");
14499        }
14500    }
14501    }
14502    }
14503    }
14504    }
14505    function_tests++;
14506
14507    return(test_ret);
14508}
14509
14510
14511static int
14512test_xmlRecoverDoc(void) {
14513    int test_ret = 0;
14514
14515#if defined(LIBXML_SAX1_ENABLED)
14516#ifdef LIBXML_SAX1_ENABLED
14517    int mem_base;
14518    xmlDocPtr ret_val;
14519    xmlChar * cur; /* a pointer to an array of xmlChar */
14520    int n_cur;
14521
14522    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14523        mem_base = xmlMemBlocks();
14524        cur = gen_xmlChar_ptr(n_cur, 0);
14525
14526        ret_val = xmlRecoverDoc(cur);
14527        desret_xmlDocPtr(ret_val);
14528        call_tests++;
14529        des_xmlChar_ptr(n_cur, cur, 0);
14530        xmlResetLastError();
14531        if (mem_base != xmlMemBlocks()) {
14532            printf("Leak of %d blocks found in xmlRecoverDoc",
14533	           xmlMemBlocks() - mem_base);
14534	    test_ret++;
14535            printf(" %d", n_cur);
14536            printf("\n");
14537        }
14538    }
14539    function_tests++;
14540#endif
14541#endif
14542
14543    return(test_ret);
14544}
14545
14546
14547static int
14548test_xmlRecoverFile(void) {
14549    int test_ret = 0;
14550
14551#if defined(LIBXML_SAX1_ENABLED)
14552#ifdef LIBXML_SAX1_ENABLED
14553    int mem_base;
14554    xmlDocPtr ret_val;
14555    const char * filename; /* the filename */
14556    int n_filename;
14557
14558    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14559        mem_base = xmlMemBlocks();
14560        filename = gen_filepath(n_filename, 0);
14561
14562        ret_val = xmlRecoverFile(filename);
14563        desret_xmlDocPtr(ret_val);
14564        call_tests++;
14565        des_filepath(n_filename, filename, 0);
14566        xmlResetLastError();
14567        if (mem_base != xmlMemBlocks()) {
14568            printf("Leak of %d blocks found in xmlRecoverFile",
14569	           xmlMemBlocks() - mem_base);
14570	    test_ret++;
14571            printf(" %d", n_filename);
14572            printf("\n");
14573        }
14574    }
14575    function_tests++;
14576#endif
14577#endif
14578
14579    return(test_ret);
14580}
14581
14582
14583static int
14584test_xmlRecoverMemory(void) {
14585    int test_ret = 0;
14586
14587#if defined(LIBXML_SAX1_ENABLED)
14588#ifdef LIBXML_SAX1_ENABLED
14589    int mem_base;
14590    xmlDocPtr ret_val;
14591    char * buffer; /* an pointer to a char array */
14592    int n_buffer;
14593    int size; /* the size of the array */
14594    int n_size;
14595
14596    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14597    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14598        mem_base = xmlMemBlocks();
14599        buffer = gen_const_char_ptr(n_buffer, 0);
14600        size = gen_int(n_size, 1);
14601
14602        ret_val = xmlRecoverMemory((const char *)buffer, size);
14603        desret_xmlDocPtr(ret_val);
14604        call_tests++;
14605        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14606        des_int(n_size, size, 1);
14607        xmlResetLastError();
14608        if (mem_base != xmlMemBlocks()) {
14609            printf("Leak of %d blocks found in xmlRecoverMemory",
14610	           xmlMemBlocks() - mem_base);
14611	    test_ret++;
14612            printf(" %d", n_buffer);
14613            printf(" %d", n_size);
14614            printf("\n");
14615        }
14616    }
14617    }
14618    function_tests++;
14619#endif
14620#endif
14621
14622    return(test_ret);
14623}
14624
14625
14626static int
14627test_xmlSAXParseDTD(void) {
14628    int test_ret = 0;
14629
14630#if defined(LIBXML_VALID_ENABLED)
14631#ifdef LIBXML_SAX1_ENABLED
14632    int mem_base;
14633    xmlDtdPtr ret_val;
14634    xmlSAXHandlerPtr sax; /* the SAX handler block */
14635    int n_sax;
14636    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14637    int n_ExternalID;
14638    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14639    int n_SystemID;
14640
14641    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14642    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14643    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14644        mem_base = xmlMemBlocks();
14645        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14646        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14647        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14648
14649        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14650        desret_xmlDtdPtr(ret_val);
14651        call_tests++;
14652        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14653        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14654        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14655        xmlResetLastError();
14656        if (mem_base != xmlMemBlocks()) {
14657            printf("Leak of %d blocks found in xmlSAXParseDTD",
14658	           xmlMemBlocks() - mem_base);
14659	    test_ret++;
14660            printf(" %d", n_sax);
14661            printf(" %d", n_ExternalID);
14662            printf(" %d", n_SystemID);
14663            printf("\n");
14664        }
14665    }
14666    }
14667    }
14668    function_tests++;
14669#endif
14670#endif
14671
14672    return(test_ret);
14673}
14674
14675
14676static int
14677test_xmlSAXParseDoc(void) {
14678    int test_ret = 0;
14679
14680#if defined(LIBXML_SAX1_ENABLED)
14681#ifdef LIBXML_SAX1_ENABLED
14682    int mem_base;
14683    xmlDocPtr ret_val;
14684    xmlSAXHandlerPtr sax; /* the SAX handler block */
14685    int n_sax;
14686    xmlChar * cur; /* a pointer to an array of xmlChar */
14687    int n_cur;
14688    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14689    int n_recovery;
14690
14691    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14692    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14693    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14694        mem_base = xmlMemBlocks();
14695        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14696        cur = gen_const_xmlChar_ptr(n_cur, 1);
14697        recovery = gen_int(n_recovery, 2);
14698
14699        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14700        desret_xmlDocPtr(ret_val);
14701        call_tests++;
14702        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14703        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14704        des_int(n_recovery, recovery, 2);
14705        xmlResetLastError();
14706        if (mem_base != xmlMemBlocks()) {
14707            printf("Leak of %d blocks found in xmlSAXParseDoc",
14708	           xmlMemBlocks() - mem_base);
14709	    test_ret++;
14710            printf(" %d", n_sax);
14711            printf(" %d", n_cur);
14712            printf(" %d", n_recovery);
14713            printf("\n");
14714        }
14715    }
14716    }
14717    }
14718    function_tests++;
14719#endif
14720#endif
14721
14722    return(test_ret);
14723}
14724
14725
14726static int
14727test_xmlSAXParseEntity(void) {
14728    int test_ret = 0;
14729
14730#if defined(LIBXML_SAX1_ENABLED)
14731#ifdef LIBXML_SAX1_ENABLED
14732    int mem_base;
14733    xmlDocPtr ret_val;
14734    xmlSAXHandlerPtr sax; /* the SAX handler block */
14735    int n_sax;
14736    const char * filename; /* the filename */
14737    int n_filename;
14738
14739    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14740    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14741        mem_base = xmlMemBlocks();
14742        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14743        filename = gen_filepath(n_filename, 1);
14744
14745        ret_val = xmlSAXParseEntity(sax, filename);
14746        desret_xmlDocPtr(ret_val);
14747        call_tests++;
14748        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14749        des_filepath(n_filename, filename, 1);
14750        xmlResetLastError();
14751        if (mem_base != xmlMemBlocks()) {
14752            printf("Leak of %d blocks found in xmlSAXParseEntity",
14753	           xmlMemBlocks() - mem_base);
14754	    test_ret++;
14755            printf(" %d", n_sax);
14756            printf(" %d", n_filename);
14757            printf("\n");
14758        }
14759    }
14760    }
14761    function_tests++;
14762#endif
14763#endif
14764
14765    return(test_ret);
14766}
14767
14768
14769static int
14770test_xmlSAXParseFile(void) {
14771    int test_ret = 0;
14772
14773#if defined(LIBXML_SAX1_ENABLED)
14774#ifdef LIBXML_SAX1_ENABLED
14775    int mem_base;
14776    xmlDocPtr ret_val;
14777    xmlSAXHandlerPtr sax; /* the SAX handler block */
14778    int n_sax;
14779    const char * filename; /* the filename */
14780    int n_filename;
14781    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14782    int n_recovery;
14783
14784    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14785    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14786    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14787        mem_base = xmlMemBlocks();
14788        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14789        filename = gen_filepath(n_filename, 1);
14790        recovery = gen_int(n_recovery, 2);
14791
14792        ret_val = xmlSAXParseFile(sax, filename, recovery);
14793        desret_xmlDocPtr(ret_val);
14794        call_tests++;
14795        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14796        des_filepath(n_filename, filename, 1);
14797        des_int(n_recovery, recovery, 2);
14798        xmlResetLastError();
14799        if (mem_base != xmlMemBlocks()) {
14800            printf("Leak of %d blocks found in xmlSAXParseFile",
14801	           xmlMemBlocks() - mem_base);
14802	    test_ret++;
14803            printf(" %d", n_sax);
14804            printf(" %d", n_filename);
14805            printf(" %d", n_recovery);
14806            printf("\n");
14807        }
14808    }
14809    }
14810    }
14811    function_tests++;
14812#endif
14813#endif
14814
14815    return(test_ret);
14816}
14817
14818
14819static int
14820test_xmlSAXParseFileWithData(void) {
14821    int test_ret = 0;
14822
14823#if defined(LIBXML_SAX1_ENABLED)
14824#ifdef LIBXML_SAX1_ENABLED
14825    int mem_base;
14826    xmlDocPtr ret_val;
14827    xmlSAXHandlerPtr sax; /* the SAX handler block */
14828    int n_sax;
14829    const char * filename; /* the filename */
14830    int n_filename;
14831    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14832    int n_recovery;
14833    void * data; /* the userdata */
14834    int n_data;
14835
14836    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14837    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14838    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14839    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14840        mem_base = xmlMemBlocks();
14841        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14842        filename = gen_filepath(n_filename, 1);
14843        recovery = gen_int(n_recovery, 2);
14844        data = gen_userdata(n_data, 3);
14845
14846        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14847        desret_xmlDocPtr(ret_val);
14848        call_tests++;
14849        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14850        des_filepath(n_filename, filename, 1);
14851        des_int(n_recovery, recovery, 2);
14852        des_userdata(n_data, data, 3);
14853        xmlResetLastError();
14854        if (mem_base != xmlMemBlocks()) {
14855            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14856	           xmlMemBlocks() - mem_base);
14857	    test_ret++;
14858            printf(" %d", n_sax);
14859            printf(" %d", n_filename);
14860            printf(" %d", n_recovery);
14861            printf(" %d", n_data);
14862            printf("\n");
14863        }
14864    }
14865    }
14866    }
14867    }
14868    function_tests++;
14869#endif
14870#endif
14871
14872    return(test_ret);
14873}
14874
14875
14876static int
14877test_xmlSAXParseMemory(void) {
14878    int test_ret = 0;
14879
14880#if defined(LIBXML_SAX1_ENABLED)
14881#ifdef LIBXML_SAX1_ENABLED
14882    int mem_base;
14883    xmlDocPtr ret_val;
14884    xmlSAXHandlerPtr sax; /* the SAX handler block */
14885    int n_sax;
14886    char * buffer; /* an pointer to a char array */
14887    int n_buffer;
14888    int size; /* the size of the array */
14889    int n_size;
14890    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14891    int n_recovery;
14892
14893    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14894    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14895    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14896    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14897        mem_base = xmlMemBlocks();
14898        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14899        buffer = gen_const_char_ptr(n_buffer, 1);
14900        size = gen_int(n_size, 2);
14901        recovery = gen_int(n_recovery, 3);
14902
14903        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14904        desret_xmlDocPtr(ret_val);
14905        call_tests++;
14906        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14907        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14908        des_int(n_size, size, 2);
14909        des_int(n_recovery, recovery, 3);
14910        xmlResetLastError();
14911        if (mem_base != xmlMemBlocks()) {
14912            printf("Leak of %d blocks found in xmlSAXParseMemory",
14913	           xmlMemBlocks() - mem_base);
14914	    test_ret++;
14915            printf(" %d", n_sax);
14916            printf(" %d", n_buffer);
14917            printf(" %d", n_size);
14918            printf(" %d", n_recovery);
14919            printf("\n");
14920        }
14921    }
14922    }
14923    }
14924    }
14925    function_tests++;
14926#endif
14927#endif
14928
14929    return(test_ret);
14930}
14931
14932
14933static int
14934test_xmlSAXParseMemoryWithData(void) {
14935    int test_ret = 0;
14936
14937#if defined(LIBXML_SAX1_ENABLED)
14938#ifdef LIBXML_SAX1_ENABLED
14939    int mem_base;
14940    xmlDocPtr ret_val;
14941    xmlSAXHandlerPtr sax; /* the SAX handler block */
14942    int n_sax;
14943    char * buffer; /* an pointer to a char array */
14944    int n_buffer;
14945    int size; /* the size of the array */
14946    int n_size;
14947    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14948    int n_recovery;
14949    void * data; /* the userdata */
14950    int n_data;
14951
14952    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14953    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14954    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14955    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14956    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14957        mem_base = xmlMemBlocks();
14958        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14959        buffer = gen_const_char_ptr(n_buffer, 1);
14960        size = gen_int(n_size, 2);
14961        recovery = gen_int(n_recovery, 3);
14962        data = gen_userdata(n_data, 4);
14963
14964        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
14965        desret_xmlDocPtr(ret_val);
14966        call_tests++;
14967        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14968        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14969        des_int(n_size, size, 2);
14970        des_int(n_recovery, recovery, 3);
14971        des_userdata(n_data, data, 4);
14972        xmlResetLastError();
14973        if (mem_base != xmlMemBlocks()) {
14974            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14975	           xmlMemBlocks() - mem_base);
14976	    test_ret++;
14977            printf(" %d", n_sax);
14978            printf(" %d", n_buffer);
14979            printf(" %d", n_size);
14980            printf(" %d", n_recovery);
14981            printf(" %d", n_data);
14982            printf("\n");
14983        }
14984    }
14985    }
14986    }
14987    }
14988    }
14989    function_tests++;
14990#endif
14991#endif
14992
14993    return(test_ret);
14994}
14995
14996
14997static int
14998test_xmlSAXUserParseFile(void) {
14999    int test_ret = 0;
15000
15001#if defined(LIBXML_SAX1_ENABLED)
15002#ifdef LIBXML_SAX1_ENABLED
15003    int mem_base;
15004    int ret_val;
15005    xmlSAXHandlerPtr sax; /* a SAX handler */
15006    int n_sax;
15007    void * user_data; /* The user data returned on SAX callbacks */
15008    int n_user_data;
15009    const char * filename; /* a file name */
15010    int n_filename;
15011
15012    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15013    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15014    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15015        mem_base = xmlMemBlocks();
15016        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15017        user_data = gen_userdata(n_user_data, 1);
15018        filename = gen_filepath(n_filename, 2);
15019
15020#ifdef LIBXML_SAX1_ENABLED
15021        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15022#endif
15023
15024
15025        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15026        desret_int(ret_val);
15027        call_tests++;
15028        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15029        des_userdata(n_user_data, user_data, 1);
15030        des_filepath(n_filename, filename, 2);
15031        xmlResetLastError();
15032        if (mem_base != xmlMemBlocks()) {
15033            printf("Leak of %d blocks found in xmlSAXUserParseFile",
15034	           xmlMemBlocks() - mem_base);
15035	    test_ret++;
15036            printf(" %d", n_sax);
15037            printf(" %d", n_user_data);
15038            printf(" %d", n_filename);
15039            printf("\n");
15040        }
15041    }
15042    }
15043    }
15044    function_tests++;
15045#endif
15046#endif
15047
15048    return(test_ret);
15049}
15050
15051
15052static int
15053test_xmlSAXUserParseMemory(void) {
15054    int test_ret = 0;
15055
15056#if defined(LIBXML_SAX1_ENABLED)
15057#ifdef LIBXML_SAX1_ENABLED
15058    int mem_base;
15059    int ret_val;
15060    xmlSAXHandlerPtr sax; /* a SAX handler */
15061    int n_sax;
15062    void * user_data; /* The user data returned on SAX callbacks */
15063    int n_user_data;
15064    char * buffer; /* an in-memory XML document input */
15065    int n_buffer;
15066    int size; /* the length of the XML document in bytes */
15067    int n_size;
15068
15069    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15070    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15071    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15072    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15073        mem_base = xmlMemBlocks();
15074        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15075        user_data = gen_userdata(n_user_data, 1);
15076        buffer = gen_const_char_ptr(n_buffer, 2);
15077        size = gen_int(n_size, 3);
15078
15079#ifdef LIBXML_SAX1_ENABLED
15080        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15081#endif
15082
15083
15084        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15085        desret_int(ret_val);
15086        call_tests++;
15087        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15088        des_userdata(n_user_data, user_data, 1);
15089        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15090        des_int(n_size, size, 3);
15091        xmlResetLastError();
15092        if (mem_base != xmlMemBlocks()) {
15093            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15094	           xmlMemBlocks() - mem_base);
15095	    test_ret++;
15096            printf(" %d", n_sax);
15097            printf(" %d", n_user_data);
15098            printf(" %d", n_buffer);
15099            printf(" %d", n_size);
15100            printf("\n");
15101        }
15102    }
15103    }
15104    }
15105    }
15106    function_tests++;
15107#endif
15108#endif
15109
15110    return(test_ret);
15111}
15112
15113
15114static int
15115test_xmlSetExternalEntityLoader(void) {
15116    int test_ret = 0;
15117
15118
15119    /* missing type support */
15120    return(test_ret);
15121}
15122
15123
15124static int
15125test_xmlSetFeature(void) {
15126    int test_ret = 0;
15127
15128#if defined(LIBXML_LEGACY_ENABLED)
15129#ifdef LIBXML_LEGACY_ENABLED
15130    int mem_base;
15131    int ret_val;
15132    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15133    int n_ctxt;
15134    char * name; /* the feature name */
15135    int n_name;
15136    void * value; /* pointer to the location of the new value */
15137    int n_value;
15138
15139    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15140    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15141    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15142        mem_base = xmlMemBlocks();
15143        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15144        name = gen_const_char_ptr(n_name, 1);
15145        value = gen_void_ptr(n_value, 2);
15146
15147        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15148        desret_int(ret_val);
15149        call_tests++;
15150        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15151        des_const_char_ptr(n_name, (const char *)name, 1);
15152        des_void_ptr(n_value, value, 2);
15153        xmlResetLastError();
15154        if (mem_base != xmlMemBlocks()) {
15155            printf("Leak of %d blocks found in xmlSetFeature",
15156	           xmlMemBlocks() - mem_base);
15157	    test_ret++;
15158            printf(" %d", n_ctxt);
15159            printf(" %d", n_name);
15160            printf(" %d", n_value);
15161            printf("\n");
15162        }
15163    }
15164    }
15165    }
15166    function_tests++;
15167#endif
15168#endif
15169
15170    return(test_ret);
15171}
15172
15173
15174static int
15175test_xmlSetupParserForBuffer(void) {
15176    int test_ret = 0;
15177
15178#if defined(LIBXML_SAX1_ENABLED)
15179#ifdef LIBXML_SAX1_ENABLED
15180    int mem_base;
15181    xmlParserCtxtPtr ctxt; /* an XML parser context */
15182    int n_ctxt;
15183    xmlChar * buffer; /* a xmlChar * buffer */
15184    int n_buffer;
15185    const char * filename; /* a file name */
15186    int n_filename;
15187
15188    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15189    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15190    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15191        mem_base = xmlMemBlocks();
15192        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15193        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15194        filename = gen_filepath(n_filename, 2);
15195
15196        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15197        call_tests++;
15198        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15199        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15200        des_filepath(n_filename, filename, 2);
15201        xmlResetLastError();
15202        if (mem_base != xmlMemBlocks()) {
15203            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15204	           xmlMemBlocks() - mem_base);
15205	    test_ret++;
15206            printf(" %d", n_ctxt);
15207            printf(" %d", n_buffer);
15208            printf(" %d", n_filename);
15209            printf("\n");
15210        }
15211    }
15212    }
15213    }
15214    function_tests++;
15215#endif
15216#endif
15217
15218    return(test_ret);
15219}
15220
15221
15222static int
15223test_xmlStopParser(void) {
15224    int test_ret = 0;
15225
15226#ifdef LIBXML_PUSH_ENABLED
15227    int mem_base;
15228    xmlParserCtxtPtr ctxt; /* an XML parser context */
15229    int n_ctxt;
15230
15231    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15232        mem_base = xmlMemBlocks();
15233        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15234
15235        xmlStopParser(ctxt);
15236        call_tests++;
15237        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15238        xmlResetLastError();
15239        if (mem_base != xmlMemBlocks()) {
15240            printf("Leak of %d blocks found in xmlStopParser",
15241	           xmlMemBlocks() - mem_base);
15242	    test_ret++;
15243            printf(" %d", n_ctxt);
15244            printf("\n");
15245        }
15246    }
15247    function_tests++;
15248#endif
15249
15250    return(test_ret);
15251}
15252
15253
15254static int
15255test_xmlSubstituteEntitiesDefault(void) {
15256    int test_ret = 0;
15257
15258    int mem_base;
15259    int ret_val;
15260    int val; /* int 0 or 1 */
15261    int n_val;
15262
15263    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15264        mem_base = xmlMemBlocks();
15265        val = gen_int(n_val, 0);
15266
15267        ret_val = xmlSubstituteEntitiesDefault(val);
15268        desret_int(ret_val);
15269        call_tests++;
15270        des_int(n_val, val, 0);
15271        xmlResetLastError();
15272        if (mem_base != xmlMemBlocks()) {
15273            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15274	           xmlMemBlocks() - mem_base);
15275	    test_ret++;
15276            printf(" %d", n_val);
15277            printf("\n");
15278        }
15279    }
15280    function_tests++;
15281
15282    return(test_ret);
15283}
15284
15285static int
15286test_parser(void) {
15287    int test_ret = 0;
15288
15289    if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15290    test_ret += test_xmlByteConsumed();
15291    test_ret += test_xmlClearNodeInfoSeq();
15292    test_ret += test_xmlClearParserCtxt();
15293    test_ret += test_xmlCreateDocParserCtxt();
15294    test_ret += test_xmlCreatePushParserCtxt();
15295    test_ret += test_xmlCtxtReadDoc();
15296    test_ret += test_xmlCtxtReadFile();
15297    test_ret += test_xmlCtxtReadMemory();
15298    test_ret += test_xmlCtxtReset();
15299    test_ret += test_xmlCtxtResetPush();
15300    test_ret += test_xmlCtxtUseOptions();
15301    test_ret += test_xmlGetExternalEntityLoader();
15302    test_ret += test_xmlGetFeature();
15303    test_ret += test_xmlGetFeaturesList();
15304    test_ret += test_xmlHasFeature();
15305    test_ret += test_xmlIOParseDTD();
15306    test_ret += test_xmlInitNodeInfoSeq();
15307    test_ret += test_xmlInitParser();
15308    test_ret += test_xmlInitParserCtxt();
15309    test_ret += test_xmlKeepBlanksDefault();
15310    test_ret += test_xmlLineNumbersDefault();
15311    test_ret += test_xmlLoadExternalEntity();
15312    test_ret += test_xmlNewIOInputStream();
15313    test_ret += test_xmlNewParserCtxt();
15314    test_ret += test_xmlParseBalancedChunkMemory();
15315    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15316    test_ret += test_xmlParseChunk();
15317    test_ret += test_xmlParseCtxtExternalEntity();
15318    test_ret += test_xmlParseDTD();
15319    test_ret += test_xmlParseDoc();
15320    test_ret += test_xmlParseDocument();
15321    test_ret += test_xmlParseEntity();
15322    test_ret += test_xmlParseExtParsedEnt();
15323    test_ret += test_xmlParseExternalEntity();
15324    test_ret += test_xmlParseFile();
15325    test_ret += test_xmlParseInNodeContext();
15326    test_ret += test_xmlParseMemory();
15327    test_ret += test_xmlParserAddNodeInfo();
15328    test_ret += test_xmlParserFindNodeInfo();
15329    test_ret += test_xmlParserFindNodeInfoIndex();
15330    test_ret += test_xmlParserInputGrow();
15331    test_ret += test_xmlParserInputRead();
15332    test_ret += test_xmlPedanticParserDefault();
15333    test_ret += test_xmlReadDoc();
15334    test_ret += test_xmlReadFile();
15335    test_ret += test_xmlReadMemory();
15336    test_ret += test_xmlRecoverDoc();
15337    test_ret += test_xmlRecoverFile();
15338    test_ret += test_xmlRecoverMemory();
15339    test_ret += test_xmlSAXParseDTD();
15340    test_ret += test_xmlSAXParseDoc();
15341    test_ret += test_xmlSAXParseEntity();
15342    test_ret += test_xmlSAXParseFile();
15343    test_ret += test_xmlSAXParseFileWithData();
15344    test_ret += test_xmlSAXParseMemory();
15345    test_ret += test_xmlSAXParseMemoryWithData();
15346    test_ret += test_xmlSAXUserParseFile();
15347    test_ret += test_xmlSAXUserParseMemory();
15348    test_ret += test_xmlSetExternalEntityLoader();
15349    test_ret += test_xmlSetFeature();
15350    test_ret += test_xmlSetupParserForBuffer();
15351    test_ret += test_xmlStopParser();
15352    test_ret += test_xmlSubstituteEntitiesDefault();
15353
15354    if (test_ret != 0)
15355	printf("Module parser: %d errors\n", test_ret);
15356    return(test_ret);
15357}
15358
15359static int
15360test_htmlCreateFileParserCtxt(void) {
15361    int test_ret = 0;
15362
15363#if defined(LIBXML_HTML_ENABLED)
15364    int mem_base;
15365    htmlParserCtxtPtr ret_val;
15366    const char * filename; /* the filename */
15367    int n_filename;
15368    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15369    int n_encoding;
15370
15371    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15372    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15373        mem_base = xmlMemBlocks();
15374        filename = gen_fileoutput(n_filename, 0);
15375        encoding = gen_const_char_ptr(n_encoding, 1);
15376
15377        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15378        desret_htmlParserCtxtPtr(ret_val);
15379        call_tests++;
15380        des_fileoutput(n_filename, filename, 0);
15381        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15382        xmlResetLastError();
15383        if (mem_base != xmlMemBlocks()) {
15384            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15385	           xmlMemBlocks() - mem_base);
15386	    test_ret++;
15387            printf(" %d", n_filename);
15388            printf(" %d", n_encoding);
15389            printf("\n");
15390        }
15391    }
15392    }
15393    function_tests++;
15394#endif
15395
15396    return(test_ret);
15397}
15398
15399
15400static int
15401test_htmlInitAutoClose(void) {
15402    int test_ret = 0;
15403
15404#if defined(LIBXML_HTML_ENABLED)
15405    int mem_base;
15406
15407        mem_base = xmlMemBlocks();
15408
15409        htmlInitAutoClose();
15410        call_tests++;
15411        xmlResetLastError();
15412        if (mem_base != xmlMemBlocks()) {
15413            printf("Leak of %d blocks found in htmlInitAutoClose",
15414	           xmlMemBlocks() - mem_base);
15415	    test_ret++;
15416            printf("\n");
15417        }
15418    function_tests++;
15419#endif
15420
15421    return(test_ret);
15422}
15423
15424
15425static int
15426test_inputPop(void) {
15427    int test_ret = 0;
15428
15429    int mem_base;
15430    xmlParserInputPtr ret_val;
15431    xmlParserCtxtPtr ctxt; /* an XML parser context */
15432    int n_ctxt;
15433
15434    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15435        mem_base = xmlMemBlocks();
15436        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15437
15438        ret_val = inputPop(ctxt);
15439        desret_xmlParserInputPtr(ret_val);
15440        call_tests++;
15441        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15442        xmlResetLastError();
15443        if (mem_base != xmlMemBlocks()) {
15444            printf("Leak of %d blocks found in inputPop",
15445	           xmlMemBlocks() - mem_base);
15446	    test_ret++;
15447            printf(" %d", n_ctxt);
15448            printf("\n");
15449        }
15450    }
15451    function_tests++;
15452
15453    return(test_ret);
15454}
15455
15456
15457static int
15458test_inputPush(void) {
15459    int test_ret = 0;
15460
15461    int mem_base;
15462    int ret_val;
15463    xmlParserCtxtPtr ctxt; /* an XML parser context */
15464    int n_ctxt;
15465    xmlParserInputPtr value; /* the parser input */
15466    int n_value;
15467
15468    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15469    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15470        mem_base = xmlMemBlocks();
15471        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15472        value = gen_xmlParserInputPtr(n_value, 1);
15473
15474        ret_val = inputPush(ctxt, value);
15475        desret_int(ret_val);
15476        call_tests++;
15477        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15478        des_xmlParserInputPtr(n_value, value, 1);
15479        xmlResetLastError();
15480        if (mem_base != xmlMemBlocks()) {
15481            printf("Leak of %d blocks found in inputPush",
15482	           xmlMemBlocks() - mem_base);
15483	    test_ret++;
15484            printf(" %d", n_ctxt);
15485            printf(" %d", n_value);
15486            printf("\n");
15487        }
15488    }
15489    }
15490    function_tests++;
15491
15492    return(test_ret);
15493}
15494
15495
15496static int
15497test_namePop(void) {
15498    int test_ret = 0;
15499
15500    int mem_base;
15501    const xmlChar * ret_val;
15502    xmlParserCtxtPtr ctxt; /* an XML parser context */
15503    int n_ctxt;
15504
15505    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15506        mem_base = xmlMemBlocks();
15507        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15508
15509        ret_val = namePop(ctxt);
15510        desret_const_xmlChar_ptr(ret_val);
15511        call_tests++;
15512        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15513        xmlResetLastError();
15514        if (mem_base != xmlMemBlocks()) {
15515            printf("Leak of %d blocks found in namePop",
15516	           xmlMemBlocks() - mem_base);
15517	    test_ret++;
15518            printf(" %d", n_ctxt);
15519            printf("\n");
15520        }
15521    }
15522    function_tests++;
15523
15524    return(test_ret);
15525}
15526
15527
15528static int
15529test_namePush(void) {
15530    int test_ret = 0;
15531
15532    int mem_base;
15533    int ret_val;
15534    xmlParserCtxtPtr ctxt; /* an XML parser context */
15535    int n_ctxt;
15536    xmlChar * value; /* the element name */
15537    int n_value;
15538
15539    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15540    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15541        mem_base = xmlMemBlocks();
15542        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15543        value = gen_const_xmlChar_ptr(n_value, 1);
15544
15545        ret_val = namePush(ctxt, (const xmlChar *)value);
15546        desret_int(ret_val);
15547        call_tests++;
15548        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15549        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15550        xmlResetLastError();
15551        if (mem_base != xmlMemBlocks()) {
15552            printf("Leak of %d blocks found in namePush",
15553	           xmlMemBlocks() - mem_base);
15554	    test_ret++;
15555            printf(" %d", n_ctxt);
15556            printf(" %d", n_value);
15557            printf("\n");
15558        }
15559    }
15560    }
15561    function_tests++;
15562
15563    return(test_ret);
15564}
15565
15566
15567static int
15568test_nodePop(void) {
15569    int test_ret = 0;
15570
15571    int mem_base;
15572    xmlNodePtr ret_val;
15573    xmlParserCtxtPtr ctxt; /* an XML parser context */
15574    int n_ctxt;
15575
15576    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15577        mem_base = xmlMemBlocks();
15578        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15579
15580        ret_val = nodePop(ctxt);
15581        desret_xmlNodePtr(ret_val);
15582        call_tests++;
15583        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15584        xmlResetLastError();
15585        if (mem_base != xmlMemBlocks()) {
15586            printf("Leak of %d blocks found in nodePop",
15587	           xmlMemBlocks() - mem_base);
15588	    test_ret++;
15589            printf(" %d", n_ctxt);
15590            printf("\n");
15591        }
15592    }
15593    function_tests++;
15594
15595    return(test_ret);
15596}
15597
15598
15599static int
15600test_nodePush(void) {
15601    int test_ret = 0;
15602
15603    int mem_base;
15604    int ret_val;
15605    xmlParserCtxtPtr ctxt; /* an XML parser context */
15606    int n_ctxt;
15607    xmlNodePtr value; /* the element node */
15608    int n_value;
15609
15610    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15611    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15612        mem_base = xmlMemBlocks();
15613        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15614        value = gen_xmlNodePtr(n_value, 1);
15615
15616        ret_val = nodePush(ctxt, value);
15617        desret_int(ret_val);
15618        call_tests++;
15619        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15620        des_xmlNodePtr(n_value, value, 1);
15621        xmlResetLastError();
15622        if (mem_base != xmlMemBlocks()) {
15623            printf("Leak of %d blocks found in nodePush",
15624	           xmlMemBlocks() - mem_base);
15625	    test_ret++;
15626            printf(" %d", n_ctxt);
15627            printf(" %d", n_value);
15628            printf("\n");
15629        }
15630    }
15631    }
15632    function_tests++;
15633
15634    return(test_ret);
15635}
15636
15637
15638static int
15639test_xmlCheckLanguageID(void) {
15640    int test_ret = 0;
15641
15642    int mem_base;
15643    int ret_val;
15644    xmlChar * lang; /* pointer to the string value */
15645    int n_lang;
15646
15647    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15648        mem_base = xmlMemBlocks();
15649        lang = gen_const_xmlChar_ptr(n_lang, 0);
15650
15651        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15652        desret_int(ret_val);
15653        call_tests++;
15654        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15655        xmlResetLastError();
15656        if (mem_base != xmlMemBlocks()) {
15657            printf("Leak of %d blocks found in xmlCheckLanguageID",
15658	           xmlMemBlocks() - mem_base);
15659	    test_ret++;
15660            printf(" %d", n_lang);
15661            printf("\n");
15662        }
15663    }
15664    function_tests++;
15665
15666    return(test_ret);
15667}
15668
15669
15670static int
15671test_xmlCopyChar(void) {
15672    int test_ret = 0;
15673
15674    int mem_base;
15675    int ret_val;
15676    int len; /* Ignored, compatibility */
15677    int n_len;
15678    xmlChar * out; /* pointer to an array of xmlChar */
15679    int n_out;
15680    int val; /* the char value */
15681    int n_val;
15682
15683    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15684    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15685    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15686        mem_base = xmlMemBlocks();
15687        len = gen_int(n_len, 0);
15688        out = gen_xmlChar_ptr(n_out, 1);
15689        val = gen_int(n_val, 2);
15690
15691        ret_val = xmlCopyChar(len, out, val);
15692        desret_int(ret_val);
15693        call_tests++;
15694        des_int(n_len, len, 0);
15695        des_xmlChar_ptr(n_out, out, 1);
15696        des_int(n_val, val, 2);
15697        xmlResetLastError();
15698        if (mem_base != xmlMemBlocks()) {
15699            printf("Leak of %d blocks found in xmlCopyChar",
15700	           xmlMemBlocks() - mem_base);
15701	    test_ret++;
15702            printf(" %d", n_len);
15703            printf(" %d", n_out);
15704            printf(" %d", n_val);
15705            printf("\n");
15706        }
15707    }
15708    }
15709    }
15710    function_tests++;
15711
15712    return(test_ret);
15713}
15714
15715
15716static int
15717test_xmlCopyCharMultiByte(void) {
15718    int test_ret = 0;
15719
15720    int mem_base;
15721    int ret_val;
15722    xmlChar * out; /* pointer to an array of xmlChar */
15723    int n_out;
15724    int val; /* the char value */
15725    int n_val;
15726
15727    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15728    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15729        mem_base = xmlMemBlocks();
15730        out = gen_xmlChar_ptr(n_out, 0);
15731        val = gen_int(n_val, 1);
15732
15733        ret_val = xmlCopyCharMultiByte(out, val);
15734        desret_int(ret_val);
15735        call_tests++;
15736        des_xmlChar_ptr(n_out, out, 0);
15737        des_int(n_val, val, 1);
15738        xmlResetLastError();
15739        if (mem_base != xmlMemBlocks()) {
15740            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15741	           xmlMemBlocks() - mem_base);
15742	    test_ret++;
15743            printf(" %d", n_out);
15744            printf(" %d", n_val);
15745            printf("\n");
15746        }
15747    }
15748    }
15749    function_tests++;
15750
15751    return(test_ret);
15752}
15753
15754
15755static int
15756test_xmlCreateEntityParserCtxt(void) {
15757    int test_ret = 0;
15758
15759    int mem_base;
15760    xmlParserCtxtPtr ret_val;
15761    xmlChar * URL; /* the entity URL */
15762    int n_URL;
15763    xmlChar * ID; /* the entity PUBLIC ID */
15764    int n_ID;
15765    xmlChar * base; /* a possible base for the target URI */
15766    int n_base;
15767
15768    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15769    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15770    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15771        mem_base = xmlMemBlocks();
15772        URL = gen_const_xmlChar_ptr(n_URL, 0);
15773        ID = gen_const_xmlChar_ptr(n_ID, 1);
15774        base = gen_const_xmlChar_ptr(n_base, 2);
15775
15776        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15777        desret_xmlParserCtxtPtr(ret_val);
15778        call_tests++;
15779        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15780        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15781        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15782        xmlResetLastError();
15783        if (mem_base != xmlMemBlocks()) {
15784            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15785	           xmlMemBlocks() - mem_base);
15786	    test_ret++;
15787            printf(" %d", n_URL);
15788            printf(" %d", n_ID);
15789            printf(" %d", n_base);
15790            printf("\n");
15791        }
15792    }
15793    }
15794    }
15795    function_tests++;
15796
15797    return(test_ret);
15798}
15799
15800
15801static int
15802test_xmlCreateFileParserCtxt(void) {
15803    int test_ret = 0;
15804
15805    int mem_base;
15806    xmlParserCtxtPtr ret_val;
15807    const char * filename; /* the filename */
15808    int n_filename;
15809
15810    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15811        mem_base = xmlMemBlocks();
15812        filename = gen_fileoutput(n_filename, 0);
15813
15814        ret_val = xmlCreateFileParserCtxt(filename);
15815        desret_xmlParserCtxtPtr(ret_val);
15816        call_tests++;
15817        des_fileoutput(n_filename, filename, 0);
15818        xmlResetLastError();
15819        if (mem_base != xmlMemBlocks()) {
15820            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15821	           xmlMemBlocks() - mem_base);
15822	    test_ret++;
15823            printf(" %d", n_filename);
15824            printf("\n");
15825        }
15826    }
15827    function_tests++;
15828
15829    return(test_ret);
15830}
15831
15832
15833static int
15834test_xmlCreateMemoryParserCtxt(void) {
15835    int test_ret = 0;
15836
15837    int mem_base;
15838    xmlParserCtxtPtr ret_val;
15839    char * buffer; /* a pointer to a char array */
15840    int n_buffer;
15841    int size; /* the size of the array */
15842    int n_size;
15843
15844    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15845    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15846        mem_base = xmlMemBlocks();
15847        buffer = gen_const_char_ptr(n_buffer, 0);
15848        size = gen_int(n_size, 1);
15849
15850        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15851        desret_xmlParserCtxtPtr(ret_val);
15852        call_tests++;
15853        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15854        des_int(n_size, size, 1);
15855        xmlResetLastError();
15856        if (mem_base != xmlMemBlocks()) {
15857            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15858	           xmlMemBlocks() - mem_base);
15859	    test_ret++;
15860            printf(" %d", n_buffer);
15861            printf(" %d", n_size);
15862            printf("\n");
15863        }
15864    }
15865    }
15866    function_tests++;
15867
15868    return(test_ret);
15869}
15870
15871
15872static int
15873test_xmlCreateURLParserCtxt(void) {
15874    int test_ret = 0;
15875
15876    int mem_base;
15877    xmlParserCtxtPtr ret_val;
15878    const char * filename; /* the filename or URL */
15879    int n_filename;
15880    int options; /* a combination of xmlParserOption */
15881    int n_options;
15882
15883    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15884    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15885        mem_base = xmlMemBlocks();
15886        filename = gen_fileoutput(n_filename, 0);
15887        options = gen_int(n_options, 1);
15888
15889        ret_val = xmlCreateURLParserCtxt(filename, options);
15890        desret_xmlParserCtxtPtr(ret_val);
15891        call_tests++;
15892        des_fileoutput(n_filename, filename, 0);
15893        des_int(n_options, options, 1);
15894        xmlResetLastError();
15895        if (mem_base != xmlMemBlocks()) {
15896            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15897	           xmlMemBlocks() - mem_base);
15898	    test_ret++;
15899            printf(" %d", n_filename);
15900            printf(" %d", n_options);
15901            printf("\n");
15902        }
15903    }
15904    }
15905    function_tests++;
15906
15907    return(test_ret);
15908}
15909
15910
15911static int
15912test_xmlCurrentChar(void) {
15913    int test_ret = 0;
15914
15915    int mem_base;
15916    int ret_val;
15917    xmlParserCtxtPtr ctxt; /* the XML parser context */
15918    int n_ctxt;
15919    int * len; /* pointer to the length of the char read */
15920    int n_len;
15921
15922    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15923    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15924        mem_base = xmlMemBlocks();
15925        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15926        len = gen_int_ptr(n_len, 1);
15927
15928        ret_val = xmlCurrentChar(ctxt, len);
15929        desret_int(ret_val);
15930        call_tests++;
15931        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15932        des_int_ptr(n_len, len, 1);
15933        xmlResetLastError();
15934        if (mem_base != xmlMemBlocks()) {
15935            printf("Leak of %d blocks found in xmlCurrentChar",
15936	           xmlMemBlocks() - mem_base);
15937	    test_ret++;
15938            printf(" %d", n_ctxt);
15939            printf(" %d", n_len);
15940            printf("\n");
15941        }
15942    }
15943    }
15944    function_tests++;
15945
15946    return(test_ret);
15947}
15948
15949
15950static int
15951test_xmlErrMemory(void) {
15952    int test_ret = 0;
15953
15954    int mem_base;
15955    xmlParserCtxtPtr ctxt; /* an XML parser context */
15956    int n_ctxt;
15957    char * extra; /* extra informations */
15958    int n_extra;
15959
15960    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15961    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15962        mem_base = xmlMemBlocks();
15963        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15964        extra = gen_const_char_ptr(n_extra, 1);
15965
15966        xmlErrMemory(ctxt, (const char *)extra);
15967        call_tests++;
15968        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15969        des_const_char_ptr(n_extra, (const char *)extra, 1);
15970        xmlResetLastError();
15971        if (mem_base != xmlMemBlocks()) {
15972            printf("Leak of %d blocks found in xmlErrMemory",
15973	           xmlMemBlocks() - mem_base);
15974	    test_ret++;
15975            printf(" %d", n_ctxt);
15976            printf(" %d", n_extra);
15977            printf("\n");
15978        }
15979    }
15980    }
15981    function_tests++;
15982
15983    return(test_ret);
15984}
15985
15986
15987static int
15988test_xmlIsLetter(void) {
15989    int test_ret = 0;
15990
15991    int mem_base;
15992    int ret_val;
15993    int c; /* an unicode character (int) */
15994    int n_c;
15995
15996    for (n_c = 0;n_c < gen_nb_int;n_c++) {
15997        mem_base = xmlMemBlocks();
15998        c = gen_int(n_c, 0);
15999
16000        ret_val = xmlIsLetter(c);
16001        desret_int(ret_val);
16002        call_tests++;
16003        des_int(n_c, c, 0);
16004        xmlResetLastError();
16005        if (mem_base != xmlMemBlocks()) {
16006            printf("Leak of %d blocks found in xmlIsLetter",
16007	           xmlMemBlocks() - mem_base);
16008	    test_ret++;
16009            printf(" %d", n_c);
16010            printf("\n");
16011        }
16012    }
16013    function_tests++;
16014
16015    return(test_ret);
16016}
16017
16018
16019static int
16020test_xmlNewEntityInputStream(void) {
16021    int test_ret = 0;
16022
16023    int mem_base;
16024    xmlParserInputPtr ret_val;
16025    xmlParserCtxtPtr ctxt; /* an XML parser context */
16026    int n_ctxt;
16027    xmlEntityPtr entity; /* an Entity pointer */
16028    int n_entity;
16029
16030    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16031    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16032        mem_base = xmlMemBlocks();
16033        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16034        entity = gen_xmlEntityPtr(n_entity, 1);
16035
16036        ret_val = xmlNewEntityInputStream(ctxt, entity);
16037        desret_xmlParserInputPtr(ret_val);
16038        call_tests++;
16039        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16040        des_xmlEntityPtr(n_entity, entity, 1);
16041        xmlResetLastError();
16042        if (mem_base != xmlMemBlocks()) {
16043            printf("Leak of %d blocks found in xmlNewEntityInputStream",
16044	           xmlMemBlocks() - mem_base);
16045	    test_ret++;
16046            printf(" %d", n_ctxt);
16047            printf(" %d", n_entity);
16048            printf("\n");
16049        }
16050    }
16051    }
16052    function_tests++;
16053
16054    return(test_ret);
16055}
16056
16057
16058static int
16059test_xmlNewInputFromFile(void) {
16060    int test_ret = 0;
16061
16062    int mem_base;
16063    xmlParserInputPtr ret_val;
16064    xmlParserCtxtPtr ctxt; /* an XML parser context */
16065    int n_ctxt;
16066    const char * filename; /* the filename to use as entity */
16067    int n_filename;
16068
16069    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16070    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16071        mem_base = xmlMemBlocks();
16072        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16073        filename = gen_filepath(n_filename, 1);
16074
16075        ret_val = xmlNewInputFromFile(ctxt, filename);
16076        desret_xmlParserInputPtr(ret_val);
16077        call_tests++;
16078        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16079        des_filepath(n_filename, filename, 1);
16080        xmlResetLastError();
16081        if (mem_base != xmlMemBlocks()) {
16082            printf("Leak of %d blocks found in xmlNewInputFromFile",
16083	           xmlMemBlocks() - mem_base);
16084	    test_ret++;
16085            printf(" %d", n_ctxt);
16086            printf(" %d", n_filename);
16087            printf("\n");
16088        }
16089    }
16090    }
16091    function_tests++;
16092
16093    return(test_ret);
16094}
16095
16096
16097static int
16098test_xmlNewInputStream(void) {
16099    int test_ret = 0;
16100
16101    int mem_base;
16102    xmlParserInputPtr ret_val;
16103    xmlParserCtxtPtr ctxt; /* an XML parser context */
16104    int n_ctxt;
16105
16106    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16107        mem_base = xmlMemBlocks();
16108        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16109
16110        ret_val = xmlNewInputStream(ctxt);
16111        desret_xmlParserInputPtr(ret_val);
16112        call_tests++;
16113        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16114        xmlResetLastError();
16115        if (mem_base != xmlMemBlocks()) {
16116            printf("Leak of %d blocks found in xmlNewInputStream",
16117	           xmlMemBlocks() - mem_base);
16118	    test_ret++;
16119            printf(" %d", n_ctxt);
16120            printf("\n");
16121        }
16122    }
16123    function_tests++;
16124
16125    return(test_ret);
16126}
16127
16128
16129static int
16130test_xmlNewStringInputStream(void) {
16131    int test_ret = 0;
16132
16133    int mem_base;
16134    xmlParserInputPtr ret_val;
16135    xmlParserCtxtPtr ctxt; /* an XML parser context */
16136    int n_ctxt;
16137    xmlChar * buffer; /* an memory buffer */
16138    int n_buffer;
16139
16140    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16141    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16142        mem_base = xmlMemBlocks();
16143        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16144        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16145
16146        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16147        desret_xmlParserInputPtr(ret_val);
16148        call_tests++;
16149        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16150        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16151        xmlResetLastError();
16152        if (mem_base != xmlMemBlocks()) {
16153            printf("Leak of %d blocks found in xmlNewStringInputStream",
16154	           xmlMemBlocks() - mem_base);
16155	    test_ret++;
16156            printf(" %d", n_ctxt);
16157            printf(" %d", n_buffer);
16158            printf("\n");
16159        }
16160    }
16161    }
16162    function_tests++;
16163
16164    return(test_ret);
16165}
16166
16167
16168static int
16169test_xmlNextChar(void) {
16170    int test_ret = 0;
16171
16172    int mem_base;
16173    xmlParserCtxtPtr ctxt; /* the XML parser context */
16174    int n_ctxt;
16175
16176    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16177        mem_base = xmlMemBlocks();
16178        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16179
16180        xmlNextChar(ctxt);
16181        call_tests++;
16182        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16183        xmlResetLastError();
16184        if (mem_base != xmlMemBlocks()) {
16185            printf("Leak of %d blocks found in xmlNextChar",
16186	           xmlMemBlocks() - mem_base);
16187	    test_ret++;
16188            printf(" %d", n_ctxt);
16189            printf("\n");
16190        }
16191    }
16192    function_tests++;
16193
16194    return(test_ret);
16195}
16196
16197
16198static int
16199test_xmlParserInputShrink(void) {
16200    int test_ret = 0;
16201
16202    int mem_base;
16203    xmlParserInputPtr in; /* an XML parser input */
16204    int n_in;
16205
16206    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16207        mem_base = xmlMemBlocks();
16208        in = gen_xmlParserInputPtr(n_in, 0);
16209
16210        xmlParserInputShrink(in);
16211        call_tests++;
16212        des_xmlParserInputPtr(n_in, in, 0);
16213        xmlResetLastError();
16214        if (mem_base != xmlMemBlocks()) {
16215            printf("Leak of %d blocks found in xmlParserInputShrink",
16216	           xmlMemBlocks() - mem_base);
16217	    test_ret++;
16218            printf(" %d", n_in);
16219            printf("\n");
16220        }
16221    }
16222    function_tests++;
16223
16224    return(test_ret);
16225}
16226
16227
16228static int
16229test_xmlPopInput(void) {
16230    int test_ret = 0;
16231
16232    int mem_base;
16233    xmlChar ret_val;
16234    xmlParserCtxtPtr ctxt; /* an XML parser context */
16235    int n_ctxt;
16236
16237    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16238        mem_base = xmlMemBlocks();
16239        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16240
16241        ret_val = xmlPopInput(ctxt);
16242        desret_xmlChar(ret_val);
16243        call_tests++;
16244        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16245        xmlResetLastError();
16246        if (mem_base != xmlMemBlocks()) {
16247            printf("Leak of %d blocks found in xmlPopInput",
16248	           xmlMemBlocks() - mem_base);
16249	    test_ret++;
16250            printf(" %d", n_ctxt);
16251            printf("\n");
16252        }
16253    }
16254    function_tests++;
16255
16256    return(test_ret);
16257}
16258
16259
16260static int
16261test_xmlPushInput(void) {
16262    int test_ret = 0;
16263
16264    int mem_base;
16265    xmlParserCtxtPtr ctxt; /* an XML parser context */
16266    int n_ctxt;
16267    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16268    int n_input;
16269
16270    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16271    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16272        mem_base = xmlMemBlocks();
16273        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16274        input = gen_xmlParserInputPtr(n_input, 1);
16275
16276        xmlPushInput(ctxt, input);
16277        call_tests++;
16278        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16279        des_xmlParserInputPtr(n_input, input, 1);
16280        xmlResetLastError();
16281        if (mem_base != xmlMemBlocks()) {
16282            printf("Leak of %d blocks found in xmlPushInput",
16283	           xmlMemBlocks() - mem_base);
16284	    test_ret++;
16285            printf(" %d", n_ctxt);
16286            printf(" %d", n_input);
16287            printf("\n");
16288        }
16289    }
16290    }
16291    function_tests++;
16292
16293    return(test_ret);
16294}
16295
16296
16297static int
16298test_xmlSetEntityReferenceFunc(void) {
16299    int test_ret = 0;
16300
16301
16302    /* missing type support */
16303    return(test_ret);
16304}
16305
16306
16307static int
16308test_xmlSplitQName(void) {
16309    int test_ret = 0;
16310
16311    int mem_base;
16312    xmlChar * ret_val;
16313    xmlParserCtxtPtr ctxt; /* an XML parser context */
16314    int n_ctxt;
16315    xmlChar * name; /* an XML parser context */
16316    int n_name;
16317    xmlChar ** prefix; /* a xmlChar ** */
16318    int n_prefix;
16319
16320    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16321    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16322    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16323        mem_base = xmlMemBlocks();
16324        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16325        name = gen_const_xmlChar_ptr(n_name, 1);
16326        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16327
16328        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16329        desret_xmlChar_ptr(ret_val);
16330        call_tests++;
16331        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16332        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16333        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16334        xmlResetLastError();
16335        if (mem_base != xmlMemBlocks()) {
16336            printf("Leak of %d blocks found in xmlSplitQName",
16337	           xmlMemBlocks() - mem_base);
16338	    test_ret++;
16339            printf(" %d", n_ctxt);
16340            printf(" %d", n_name);
16341            printf(" %d", n_prefix);
16342            printf("\n");
16343        }
16344    }
16345    }
16346    }
16347    function_tests++;
16348
16349    return(test_ret);
16350}
16351
16352
16353static int
16354test_xmlStringCurrentChar(void) {
16355    int test_ret = 0;
16356
16357    int mem_base;
16358    int ret_val;
16359    xmlParserCtxtPtr ctxt; /* the XML parser context */
16360    int n_ctxt;
16361    xmlChar * cur; /* pointer to the beginning of the char */
16362    int n_cur;
16363    int * len; /* pointer to the length of the char read */
16364    int n_len;
16365
16366    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16367    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16368    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16369        mem_base = xmlMemBlocks();
16370        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16371        cur = gen_const_xmlChar_ptr(n_cur, 1);
16372        len = gen_int_ptr(n_len, 2);
16373
16374        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16375        desret_int(ret_val);
16376        call_tests++;
16377        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16378        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16379        des_int_ptr(n_len, len, 2);
16380        xmlResetLastError();
16381        if (mem_base != xmlMemBlocks()) {
16382            printf("Leak of %d blocks found in xmlStringCurrentChar",
16383	           xmlMemBlocks() - mem_base);
16384	    test_ret++;
16385            printf(" %d", n_ctxt);
16386            printf(" %d", n_cur);
16387            printf(" %d", n_len);
16388            printf("\n");
16389        }
16390    }
16391    }
16392    }
16393    function_tests++;
16394
16395    return(test_ret);
16396}
16397
16398
16399static int
16400test_xmlStringDecodeEntities(void) {
16401    int test_ret = 0;
16402
16403    int mem_base;
16404    xmlChar * ret_val;
16405    xmlParserCtxtPtr ctxt; /* the parser context */
16406    int n_ctxt;
16407    xmlChar * str; /* the input string */
16408    int n_str;
16409    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16410    int n_what;
16411    xmlChar end; /* an end marker xmlChar, 0 if none */
16412    int n_end;
16413    xmlChar end2; /* an end marker xmlChar, 0 if none */
16414    int n_end2;
16415    xmlChar end3; /* an end marker xmlChar, 0 if none */
16416    int n_end3;
16417
16418    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16419    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16420    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16421    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16422    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16423    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16424        mem_base = xmlMemBlocks();
16425        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16426        str = gen_const_xmlChar_ptr(n_str, 1);
16427        what = gen_int(n_what, 2);
16428        end = gen_xmlChar(n_end, 3);
16429        end2 = gen_xmlChar(n_end2, 4);
16430        end3 = gen_xmlChar(n_end3, 5);
16431
16432        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16433        desret_xmlChar_ptr(ret_val);
16434        call_tests++;
16435        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16436        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16437        des_int(n_what, what, 2);
16438        des_xmlChar(n_end, end, 3);
16439        des_xmlChar(n_end2, end2, 4);
16440        des_xmlChar(n_end3, end3, 5);
16441        xmlResetLastError();
16442        if (mem_base != xmlMemBlocks()) {
16443            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16444	           xmlMemBlocks() - mem_base);
16445	    test_ret++;
16446            printf(" %d", n_ctxt);
16447            printf(" %d", n_str);
16448            printf(" %d", n_what);
16449            printf(" %d", n_end);
16450            printf(" %d", n_end2);
16451            printf(" %d", n_end3);
16452            printf("\n");
16453        }
16454    }
16455    }
16456    }
16457    }
16458    }
16459    }
16460    function_tests++;
16461
16462    return(test_ret);
16463}
16464
16465
16466static int
16467test_xmlStringLenDecodeEntities(void) {
16468    int test_ret = 0;
16469
16470    int mem_base;
16471    xmlChar * ret_val;
16472    xmlParserCtxtPtr ctxt; /* the parser context */
16473    int n_ctxt;
16474    xmlChar * str; /* the input string */
16475    int n_str;
16476    int len; /* the string length */
16477    int n_len;
16478    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16479    int n_what;
16480    xmlChar end; /* an end marker xmlChar, 0 if none */
16481    int n_end;
16482    xmlChar end2; /* an end marker xmlChar, 0 if none */
16483    int n_end2;
16484    xmlChar end3; /* an end marker xmlChar, 0 if none */
16485    int n_end3;
16486
16487    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16488    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16489    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16490    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16491    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16492    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16493    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16494        mem_base = xmlMemBlocks();
16495        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16496        str = gen_const_xmlChar_ptr(n_str, 1);
16497        len = gen_int(n_len, 2);
16498        what = gen_int(n_what, 3);
16499        end = gen_xmlChar(n_end, 4);
16500        end2 = gen_xmlChar(n_end2, 5);
16501        end3 = gen_xmlChar(n_end3, 6);
16502
16503        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16504        desret_xmlChar_ptr(ret_val);
16505        call_tests++;
16506        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16507        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16508        des_int(n_len, len, 2);
16509        des_int(n_what, what, 3);
16510        des_xmlChar(n_end, end, 4);
16511        des_xmlChar(n_end2, end2, 5);
16512        des_xmlChar(n_end3, end3, 6);
16513        xmlResetLastError();
16514        if (mem_base != xmlMemBlocks()) {
16515            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16516	           xmlMemBlocks() - mem_base);
16517	    test_ret++;
16518            printf(" %d", n_ctxt);
16519            printf(" %d", n_str);
16520            printf(" %d", n_len);
16521            printf(" %d", n_what);
16522            printf(" %d", n_end);
16523            printf(" %d", n_end2);
16524            printf(" %d", n_end3);
16525            printf("\n");
16526        }
16527    }
16528    }
16529    }
16530    }
16531    }
16532    }
16533    }
16534    function_tests++;
16535
16536    return(test_ret);
16537}
16538
16539
16540static int
16541test_xmlSwitchEncoding(void) {
16542    int test_ret = 0;
16543
16544    int mem_base;
16545    int ret_val;
16546    xmlParserCtxtPtr ctxt; /* the parser context */
16547    int n_ctxt;
16548    xmlCharEncoding enc; /* the encoding value (number) */
16549    int n_enc;
16550
16551    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16552    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16553        mem_base = xmlMemBlocks();
16554        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16555        enc = gen_xmlCharEncoding(n_enc, 1);
16556
16557        ret_val = xmlSwitchEncoding(ctxt, enc);
16558        desret_int(ret_val);
16559        call_tests++;
16560        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16561        des_xmlCharEncoding(n_enc, enc, 1);
16562        xmlResetLastError();
16563        if (mem_base != xmlMemBlocks()) {
16564            printf("Leak of %d blocks found in xmlSwitchEncoding",
16565	           xmlMemBlocks() - mem_base);
16566	    test_ret++;
16567            printf(" %d", n_ctxt);
16568            printf(" %d", n_enc);
16569            printf("\n");
16570        }
16571    }
16572    }
16573    function_tests++;
16574
16575    return(test_ret);
16576}
16577
16578
16579static int
16580test_xmlSwitchInputEncoding(void) {
16581    int test_ret = 0;
16582
16583    int mem_base;
16584    int ret_val;
16585    xmlParserCtxtPtr ctxt; /* the parser context */
16586    int n_ctxt;
16587    xmlParserInputPtr input; /* the input stream */
16588    int n_input;
16589    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16590    int n_handler;
16591
16592    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16593    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16594    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16595        mem_base = xmlMemBlocks();
16596        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16597        input = gen_xmlParserInputPtr(n_input, 1);
16598        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16599
16600        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16601        desret_int(ret_val);
16602        call_tests++;
16603        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16604        des_xmlParserInputPtr(n_input, input, 1);
16605        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16606        xmlResetLastError();
16607        if (mem_base != xmlMemBlocks()) {
16608            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16609	           xmlMemBlocks() - mem_base);
16610	    test_ret++;
16611            printf(" %d", n_ctxt);
16612            printf(" %d", n_input);
16613            printf(" %d", n_handler);
16614            printf("\n");
16615        }
16616    }
16617    }
16618    }
16619    function_tests++;
16620
16621    return(test_ret);
16622}
16623
16624
16625static int
16626test_xmlSwitchToEncoding(void) {
16627    int test_ret = 0;
16628
16629    int mem_base;
16630    int ret_val;
16631    xmlParserCtxtPtr ctxt; /* the parser context */
16632    int n_ctxt;
16633    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16634    int n_handler;
16635
16636    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16637    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16638        mem_base = xmlMemBlocks();
16639        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16640        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16641
16642        ret_val = xmlSwitchToEncoding(ctxt, handler);
16643        desret_int(ret_val);
16644        call_tests++;
16645        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16646        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16647        xmlResetLastError();
16648        if (mem_base != xmlMemBlocks()) {
16649            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16650	           xmlMemBlocks() - mem_base);
16651	    test_ret++;
16652            printf(" %d", n_ctxt);
16653            printf(" %d", n_handler);
16654            printf("\n");
16655        }
16656    }
16657    }
16658    function_tests++;
16659
16660    return(test_ret);
16661}
16662
16663static int
16664test_parserInternals(void) {
16665    int test_ret = 0;
16666
16667    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16668    test_ret += test_htmlCreateFileParserCtxt();
16669    test_ret += test_htmlInitAutoClose();
16670    test_ret += test_inputPop();
16671    test_ret += test_inputPush();
16672    test_ret += test_namePop();
16673    test_ret += test_namePush();
16674    test_ret += test_nodePop();
16675    test_ret += test_nodePush();
16676    test_ret += test_xmlCheckLanguageID();
16677    test_ret += test_xmlCopyChar();
16678    test_ret += test_xmlCopyCharMultiByte();
16679    test_ret += test_xmlCreateEntityParserCtxt();
16680    test_ret += test_xmlCreateFileParserCtxt();
16681    test_ret += test_xmlCreateMemoryParserCtxt();
16682    test_ret += test_xmlCreateURLParserCtxt();
16683    test_ret += test_xmlCurrentChar();
16684    test_ret += test_xmlErrMemory();
16685    test_ret += test_xmlIsLetter();
16686    test_ret += test_xmlNewEntityInputStream();
16687    test_ret += test_xmlNewInputFromFile();
16688    test_ret += test_xmlNewInputStream();
16689    test_ret += test_xmlNewStringInputStream();
16690    test_ret += test_xmlNextChar();
16691    test_ret += test_xmlParserInputShrink();
16692    test_ret += test_xmlPopInput();
16693    test_ret += test_xmlPushInput();
16694    test_ret += test_xmlSetEntityReferenceFunc();
16695    test_ret += test_xmlSplitQName();
16696    test_ret += test_xmlStringCurrentChar();
16697    test_ret += test_xmlStringDecodeEntities();
16698    test_ret += test_xmlStringLenDecodeEntities();
16699    test_ret += test_xmlSwitchEncoding();
16700    test_ret += test_xmlSwitchInputEncoding();
16701    test_ret += test_xmlSwitchToEncoding();
16702
16703    if (test_ret != 0)
16704	printf("Module parserInternals: %d errors\n", test_ret);
16705    return(test_ret);
16706}
16707
16708static int
16709test_xmlPatternFromRoot(void) {
16710    int test_ret = 0;
16711
16712#if defined(LIBXML_PATTERN_ENABLED)
16713    int mem_base;
16714    int ret_val;
16715    xmlPatternPtr comp; /* the precompiled pattern */
16716    int n_comp;
16717
16718    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16719        mem_base = xmlMemBlocks();
16720        comp = gen_xmlPatternPtr(n_comp, 0);
16721
16722        ret_val = xmlPatternFromRoot(comp);
16723        desret_int(ret_val);
16724        call_tests++;
16725        des_xmlPatternPtr(n_comp, comp, 0);
16726        xmlResetLastError();
16727        if (mem_base != xmlMemBlocks()) {
16728            printf("Leak of %d blocks found in xmlPatternFromRoot",
16729	           xmlMemBlocks() - mem_base);
16730	    test_ret++;
16731            printf(" %d", n_comp);
16732            printf("\n");
16733        }
16734    }
16735    function_tests++;
16736#endif
16737
16738    return(test_ret);
16739}
16740
16741
16742static int
16743test_xmlPatternGetStreamCtxt(void) {
16744    int test_ret = 0;
16745
16746
16747    /* missing type support */
16748    return(test_ret);
16749}
16750
16751
16752static int
16753test_xmlPatternMatch(void) {
16754    int test_ret = 0;
16755
16756#if defined(LIBXML_PATTERN_ENABLED)
16757    int mem_base;
16758    int ret_val;
16759    xmlPatternPtr comp; /* the precompiled pattern */
16760    int n_comp;
16761    xmlNodePtr node; /* a node */
16762    int n_node;
16763
16764    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16765    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16766        mem_base = xmlMemBlocks();
16767        comp = gen_xmlPatternPtr(n_comp, 0);
16768        node = gen_xmlNodePtr(n_node, 1);
16769
16770        ret_val = xmlPatternMatch(comp, node);
16771        desret_int(ret_val);
16772        call_tests++;
16773        des_xmlPatternPtr(n_comp, comp, 0);
16774        des_xmlNodePtr(n_node, node, 1);
16775        xmlResetLastError();
16776        if (mem_base != xmlMemBlocks()) {
16777            printf("Leak of %d blocks found in xmlPatternMatch",
16778	           xmlMemBlocks() - mem_base);
16779	    test_ret++;
16780            printf(" %d", n_comp);
16781            printf(" %d", n_node);
16782            printf("\n");
16783        }
16784    }
16785    }
16786    function_tests++;
16787#endif
16788
16789    return(test_ret);
16790}
16791
16792
16793static int
16794test_xmlPatternMaxDepth(void) {
16795    int test_ret = 0;
16796
16797#if defined(LIBXML_PATTERN_ENABLED)
16798    int mem_base;
16799    int ret_val;
16800    xmlPatternPtr comp; /* the precompiled pattern */
16801    int n_comp;
16802
16803    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16804        mem_base = xmlMemBlocks();
16805        comp = gen_xmlPatternPtr(n_comp, 0);
16806
16807        ret_val = xmlPatternMaxDepth(comp);
16808        desret_int(ret_val);
16809        call_tests++;
16810        des_xmlPatternPtr(n_comp, comp, 0);
16811        xmlResetLastError();
16812        if (mem_base != xmlMemBlocks()) {
16813            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16814	           xmlMemBlocks() - mem_base);
16815	    test_ret++;
16816            printf(" %d", n_comp);
16817            printf("\n");
16818        }
16819    }
16820    function_tests++;
16821#endif
16822
16823    return(test_ret);
16824}
16825
16826
16827static int
16828test_xmlPatternMinDepth(void) {
16829    int test_ret = 0;
16830
16831#if defined(LIBXML_PATTERN_ENABLED)
16832    int mem_base;
16833    int ret_val;
16834    xmlPatternPtr comp; /* the precompiled pattern */
16835    int n_comp;
16836
16837    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16838        mem_base = xmlMemBlocks();
16839        comp = gen_xmlPatternPtr(n_comp, 0);
16840
16841        ret_val = xmlPatternMinDepth(comp);
16842        desret_int(ret_val);
16843        call_tests++;
16844        des_xmlPatternPtr(n_comp, comp, 0);
16845        xmlResetLastError();
16846        if (mem_base != xmlMemBlocks()) {
16847            printf("Leak of %d blocks found in xmlPatternMinDepth",
16848	           xmlMemBlocks() - mem_base);
16849	    test_ret++;
16850            printf(" %d", n_comp);
16851            printf("\n");
16852        }
16853    }
16854    function_tests++;
16855#endif
16856
16857    return(test_ret);
16858}
16859
16860
16861static int
16862test_xmlPatternStreamable(void) {
16863    int test_ret = 0;
16864
16865#if defined(LIBXML_PATTERN_ENABLED)
16866    int mem_base;
16867    int ret_val;
16868    xmlPatternPtr comp; /* the precompiled pattern */
16869    int n_comp;
16870
16871    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16872        mem_base = xmlMemBlocks();
16873        comp = gen_xmlPatternPtr(n_comp, 0);
16874
16875        ret_val = xmlPatternStreamable(comp);
16876        desret_int(ret_val);
16877        call_tests++;
16878        des_xmlPatternPtr(n_comp, comp, 0);
16879        xmlResetLastError();
16880        if (mem_base != xmlMemBlocks()) {
16881            printf("Leak of %d blocks found in xmlPatternStreamable",
16882	           xmlMemBlocks() - mem_base);
16883	    test_ret++;
16884            printf(" %d", n_comp);
16885            printf("\n");
16886        }
16887    }
16888    function_tests++;
16889#endif
16890
16891    return(test_ret);
16892}
16893
16894
16895static int
16896test_xmlPatterncompile(void) {
16897    int test_ret = 0;
16898
16899
16900    /* missing type support */
16901    return(test_ret);
16902}
16903
16904#ifdef LIBXML_PATTERN_ENABLED
16905
16906#define gen_nb_xmlStreamCtxtPtr 1
16907static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16908    return(NULL);
16909}
16910static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16911}
16912#endif
16913
16914
16915static int
16916test_xmlStreamPop(void) {
16917    int test_ret = 0;
16918
16919#if defined(LIBXML_PATTERN_ENABLED)
16920    int mem_base;
16921    int ret_val;
16922    xmlStreamCtxtPtr stream; /* the stream context */
16923    int n_stream;
16924
16925    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16926        mem_base = xmlMemBlocks();
16927        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16928
16929        ret_val = xmlStreamPop(stream);
16930        desret_int(ret_val);
16931        call_tests++;
16932        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16933        xmlResetLastError();
16934        if (mem_base != xmlMemBlocks()) {
16935            printf("Leak of %d blocks found in xmlStreamPop",
16936	           xmlMemBlocks() - mem_base);
16937	    test_ret++;
16938            printf(" %d", n_stream);
16939            printf("\n");
16940        }
16941    }
16942    function_tests++;
16943#endif
16944
16945    return(test_ret);
16946}
16947
16948
16949static int
16950test_xmlStreamPush(void) {
16951    int test_ret = 0;
16952
16953#if defined(LIBXML_PATTERN_ENABLED)
16954    int mem_base;
16955    int ret_val;
16956    xmlStreamCtxtPtr stream; /* the stream context */
16957    int n_stream;
16958    xmlChar * name; /* the current name */
16959    int n_name;
16960    xmlChar * ns; /* the namespace name */
16961    int n_ns;
16962
16963    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16964    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16965    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16966        mem_base = xmlMemBlocks();
16967        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16968        name = gen_const_xmlChar_ptr(n_name, 1);
16969        ns = gen_const_xmlChar_ptr(n_ns, 2);
16970
16971        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
16972        desret_int(ret_val);
16973        call_tests++;
16974        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16975        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16976        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16977        xmlResetLastError();
16978        if (mem_base != xmlMemBlocks()) {
16979            printf("Leak of %d blocks found in xmlStreamPush",
16980	           xmlMemBlocks() - mem_base);
16981	    test_ret++;
16982            printf(" %d", n_stream);
16983            printf(" %d", n_name);
16984            printf(" %d", n_ns);
16985            printf("\n");
16986        }
16987    }
16988    }
16989    }
16990    function_tests++;
16991#endif
16992
16993    return(test_ret);
16994}
16995
16996
16997static int
16998test_xmlStreamPushAttr(void) {
16999    int test_ret = 0;
17000
17001#if defined(LIBXML_PATTERN_ENABLED)
17002    int mem_base;
17003    int ret_val;
17004    xmlStreamCtxtPtr stream; /* the stream context */
17005    int n_stream;
17006    xmlChar * name; /* the current name */
17007    int n_name;
17008    xmlChar * ns; /* the namespace name */
17009    int n_ns;
17010
17011    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17012    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17013    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17014        mem_base = xmlMemBlocks();
17015        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17016        name = gen_const_xmlChar_ptr(n_name, 1);
17017        ns = gen_const_xmlChar_ptr(n_ns, 2);
17018
17019        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17020        desret_int(ret_val);
17021        call_tests++;
17022        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17023        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17024        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17025        xmlResetLastError();
17026        if (mem_base != xmlMemBlocks()) {
17027            printf("Leak of %d blocks found in xmlStreamPushAttr",
17028	           xmlMemBlocks() - mem_base);
17029	    test_ret++;
17030            printf(" %d", n_stream);
17031            printf(" %d", n_name);
17032            printf(" %d", n_ns);
17033            printf("\n");
17034        }
17035    }
17036    }
17037    }
17038    function_tests++;
17039#endif
17040
17041    return(test_ret);
17042}
17043
17044
17045static int
17046test_xmlStreamPushNode(void) {
17047    int test_ret = 0;
17048
17049#if defined(LIBXML_PATTERN_ENABLED)
17050    int mem_base;
17051    int ret_val;
17052    xmlStreamCtxtPtr stream; /* the stream context */
17053    int n_stream;
17054    xmlChar * name; /* the current name */
17055    int n_name;
17056    xmlChar * ns; /* the namespace name */
17057    int n_ns;
17058    int nodeType; /* the type of the node being pushed */
17059    int n_nodeType;
17060
17061    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17062    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17063    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17064    for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17065        mem_base = xmlMemBlocks();
17066        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17067        name = gen_const_xmlChar_ptr(n_name, 1);
17068        ns = gen_const_xmlChar_ptr(n_ns, 2);
17069        nodeType = gen_int(n_nodeType, 3);
17070
17071        ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17072        desret_int(ret_val);
17073        call_tests++;
17074        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17075        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17076        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17077        des_int(n_nodeType, nodeType, 3);
17078        xmlResetLastError();
17079        if (mem_base != xmlMemBlocks()) {
17080            printf("Leak of %d blocks found in xmlStreamPushNode",
17081	           xmlMemBlocks() - mem_base);
17082	    test_ret++;
17083            printf(" %d", n_stream);
17084            printf(" %d", n_name);
17085            printf(" %d", n_ns);
17086            printf(" %d", n_nodeType);
17087            printf("\n");
17088        }
17089    }
17090    }
17091    }
17092    }
17093    function_tests++;
17094#endif
17095
17096    return(test_ret);
17097}
17098
17099
17100static int
17101test_xmlStreamWantsAnyNode(void) {
17102    int test_ret = 0;
17103
17104#if defined(LIBXML_PATTERN_ENABLED)
17105    int mem_base;
17106    int ret_val;
17107    xmlStreamCtxtPtr streamCtxt; /* the stream context */
17108    int n_streamCtxt;
17109
17110    for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17111        mem_base = xmlMemBlocks();
17112        streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17113
17114        ret_val = xmlStreamWantsAnyNode(streamCtxt);
17115        desret_int(ret_val);
17116        call_tests++;
17117        des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17118        xmlResetLastError();
17119        if (mem_base != xmlMemBlocks()) {
17120            printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17121	           xmlMemBlocks() - mem_base);
17122	    test_ret++;
17123            printf(" %d", n_streamCtxt);
17124            printf("\n");
17125        }
17126    }
17127    function_tests++;
17128#endif
17129
17130    return(test_ret);
17131}
17132
17133static int
17134test_pattern(void) {
17135    int test_ret = 0;
17136
17137    if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17138    test_ret += test_xmlPatternFromRoot();
17139    test_ret += test_xmlPatternGetStreamCtxt();
17140    test_ret += test_xmlPatternMatch();
17141    test_ret += test_xmlPatternMaxDepth();
17142    test_ret += test_xmlPatternMinDepth();
17143    test_ret += test_xmlPatternStreamable();
17144    test_ret += test_xmlPatterncompile();
17145    test_ret += test_xmlStreamPop();
17146    test_ret += test_xmlStreamPush();
17147    test_ret += test_xmlStreamPushAttr();
17148    test_ret += test_xmlStreamPushNode();
17149    test_ret += test_xmlStreamWantsAnyNode();
17150
17151    if (test_ret != 0)
17152	printf("Module pattern: %d errors\n", test_ret);
17153    return(test_ret);
17154}
17155#ifdef LIBXML_SCHEMAS_ENABLED
17156
17157#define gen_nb_xmlRelaxNGPtr 1
17158static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17159    return(NULL);
17160}
17161static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17162}
17163#endif
17164
17165
17166static int
17167test_xmlRelaxNGDump(void) {
17168    int test_ret = 0;
17169
17170#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17171    int mem_base;
17172    FILE * output; /* the file output */
17173    int n_output;
17174    xmlRelaxNGPtr schema; /* a schema structure */
17175    int n_schema;
17176
17177    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17178    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17179        mem_base = xmlMemBlocks();
17180        output = gen_FILE_ptr(n_output, 0);
17181        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17182
17183        xmlRelaxNGDump(output, schema);
17184        call_tests++;
17185        des_FILE_ptr(n_output, output, 0);
17186        des_xmlRelaxNGPtr(n_schema, schema, 1);
17187        xmlResetLastError();
17188        if (mem_base != xmlMemBlocks()) {
17189            printf("Leak of %d blocks found in xmlRelaxNGDump",
17190	           xmlMemBlocks() - mem_base);
17191	    test_ret++;
17192            printf(" %d", n_output);
17193            printf(" %d", n_schema);
17194            printf("\n");
17195        }
17196    }
17197    }
17198    function_tests++;
17199#endif
17200
17201    return(test_ret);
17202}
17203
17204
17205static int
17206test_xmlRelaxNGDumpTree(void) {
17207    int test_ret = 0;
17208
17209#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17210    int mem_base;
17211    FILE * output; /* the file output */
17212    int n_output;
17213    xmlRelaxNGPtr schema; /* a schema structure */
17214    int n_schema;
17215
17216    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17217    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17218        mem_base = xmlMemBlocks();
17219        output = gen_FILE_ptr(n_output, 0);
17220        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17221
17222        xmlRelaxNGDumpTree(output, schema);
17223        call_tests++;
17224        des_FILE_ptr(n_output, output, 0);
17225        des_xmlRelaxNGPtr(n_schema, schema, 1);
17226        xmlResetLastError();
17227        if (mem_base != xmlMemBlocks()) {
17228            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17229	           xmlMemBlocks() - mem_base);
17230	    test_ret++;
17231            printf(" %d", n_output);
17232            printf(" %d", n_schema);
17233            printf("\n");
17234        }
17235    }
17236    }
17237    function_tests++;
17238#endif
17239
17240    return(test_ret);
17241}
17242
17243#ifdef LIBXML_SCHEMAS_ENABLED
17244
17245#define gen_nb_xmlRelaxNGParserCtxtPtr 1
17246static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17247    return(NULL);
17248}
17249static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17250}
17251#endif
17252
17253#ifdef LIBXML_SCHEMAS_ENABLED
17254
17255#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17256static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17257    return(NULL);
17258}
17259static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17260}
17261#endif
17262
17263#ifdef LIBXML_SCHEMAS_ENABLED
17264
17265#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17266static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17267    return(NULL);
17268}
17269static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17270}
17271#endif
17272
17273#ifdef LIBXML_SCHEMAS_ENABLED
17274
17275#define gen_nb_void_ptr_ptr 1
17276static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17277    return(NULL);
17278}
17279static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17280}
17281#endif
17282
17283
17284static int
17285test_xmlRelaxNGGetParserErrors(void) {
17286    int test_ret = 0;
17287
17288#if defined(LIBXML_SCHEMAS_ENABLED)
17289    int mem_base;
17290    int ret_val;
17291    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17292    int n_ctxt;
17293    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17294    int n_err;
17295    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17296    int n_warn;
17297    void ** ctx; /* contextual data for the callbacks result */
17298    int n_ctx;
17299
17300    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17301    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17302    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17303    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17304        mem_base = xmlMemBlocks();
17305        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17306        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17307        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17308        ctx = gen_void_ptr_ptr(n_ctx, 3);
17309
17310        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17311        desret_int(ret_val);
17312        call_tests++;
17313        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17314        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17315        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17316        des_void_ptr_ptr(n_ctx, ctx, 3);
17317        xmlResetLastError();
17318        if (mem_base != xmlMemBlocks()) {
17319            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17320	           xmlMemBlocks() - mem_base);
17321	    test_ret++;
17322            printf(" %d", n_ctxt);
17323            printf(" %d", n_err);
17324            printf(" %d", n_warn);
17325            printf(" %d", n_ctx);
17326            printf("\n");
17327        }
17328    }
17329    }
17330    }
17331    }
17332    function_tests++;
17333#endif
17334
17335    return(test_ret);
17336}
17337
17338#ifdef LIBXML_SCHEMAS_ENABLED
17339
17340#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17341static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17342    return(NULL);
17343}
17344static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17345}
17346#endif
17347
17348
17349static int
17350test_xmlRelaxNGGetValidErrors(void) {
17351    int test_ret = 0;
17352
17353#if defined(LIBXML_SCHEMAS_ENABLED)
17354    int mem_base;
17355    int ret_val;
17356    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17357    int n_ctxt;
17358    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17359    int n_err;
17360    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17361    int n_warn;
17362    void ** ctx; /* the functions context result */
17363    int n_ctx;
17364
17365    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17366    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17367    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17368    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17369        mem_base = xmlMemBlocks();
17370        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17371        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17372        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17373        ctx = gen_void_ptr_ptr(n_ctx, 3);
17374
17375        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17376        desret_int(ret_val);
17377        call_tests++;
17378        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17379        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17380        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17381        des_void_ptr_ptr(n_ctx, ctx, 3);
17382        xmlResetLastError();
17383        if (mem_base != xmlMemBlocks()) {
17384            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17385	           xmlMemBlocks() - mem_base);
17386	    test_ret++;
17387            printf(" %d", n_ctxt);
17388            printf(" %d", n_err);
17389            printf(" %d", n_warn);
17390            printf(" %d", n_ctx);
17391            printf("\n");
17392        }
17393    }
17394    }
17395    }
17396    }
17397    function_tests++;
17398#endif
17399
17400    return(test_ret);
17401}
17402
17403
17404static int
17405test_xmlRelaxNGInitTypes(void) {
17406    int test_ret = 0;
17407
17408#if defined(LIBXML_SCHEMAS_ENABLED)
17409    int mem_base;
17410    int ret_val;
17411
17412        mem_base = xmlMemBlocks();
17413
17414        ret_val = xmlRelaxNGInitTypes();
17415        desret_int(ret_val);
17416        call_tests++;
17417        xmlResetLastError();
17418        if (mem_base != xmlMemBlocks()) {
17419            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17420	           xmlMemBlocks() - mem_base);
17421	    test_ret++;
17422            printf("\n");
17423        }
17424    function_tests++;
17425#endif
17426
17427    return(test_ret);
17428}
17429
17430
17431static int
17432test_xmlRelaxNGNewDocParserCtxt(void) {
17433    int test_ret = 0;
17434
17435#if defined(LIBXML_SCHEMAS_ENABLED)
17436    int mem_base;
17437    xmlRelaxNGParserCtxtPtr ret_val;
17438    xmlDocPtr doc; /* a preparsed document tree */
17439    int n_doc;
17440
17441    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17442        mem_base = xmlMemBlocks();
17443        doc = gen_xmlDocPtr(n_doc, 0);
17444
17445        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17446        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17447        call_tests++;
17448        des_xmlDocPtr(n_doc, doc, 0);
17449        xmlResetLastError();
17450        if (mem_base != xmlMemBlocks()) {
17451            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17452	           xmlMemBlocks() - mem_base);
17453	    test_ret++;
17454            printf(" %d", n_doc);
17455            printf("\n");
17456        }
17457    }
17458    function_tests++;
17459#endif
17460
17461    return(test_ret);
17462}
17463
17464
17465static int
17466test_xmlRelaxNGNewMemParserCtxt(void) {
17467    int test_ret = 0;
17468
17469#if defined(LIBXML_SCHEMAS_ENABLED)
17470    int mem_base;
17471    xmlRelaxNGParserCtxtPtr ret_val;
17472    char * buffer; /* a pointer to a char array containing the schemas */
17473    int n_buffer;
17474    int size; /* the size of the array */
17475    int n_size;
17476
17477    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17478    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17479        mem_base = xmlMemBlocks();
17480        buffer = gen_const_char_ptr(n_buffer, 0);
17481        size = gen_int(n_size, 1);
17482
17483        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17484        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17485        call_tests++;
17486        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17487        des_int(n_size, size, 1);
17488        xmlResetLastError();
17489        if (mem_base != xmlMemBlocks()) {
17490            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17491	           xmlMemBlocks() - mem_base);
17492	    test_ret++;
17493            printf(" %d", n_buffer);
17494            printf(" %d", n_size);
17495            printf("\n");
17496        }
17497    }
17498    }
17499    function_tests++;
17500#endif
17501
17502    return(test_ret);
17503}
17504
17505
17506static int
17507test_xmlRelaxNGNewParserCtxt(void) {
17508    int test_ret = 0;
17509
17510#if defined(LIBXML_SCHEMAS_ENABLED)
17511    int mem_base;
17512    xmlRelaxNGParserCtxtPtr ret_val;
17513    char * URL; /* the location of the schema */
17514    int n_URL;
17515
17516    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17517        mem_base = xmlMemBlocks();
17518        URL = gen_const_char_ptr(n_URL, 0);
17519
17520        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17521        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17522        call_tests++;
17523        des_const_char_ptr(n_URL, (const char *)URL, 0);
17524        xmlResetLastError();
17525        if (mem_base != xmlMemBlocks()) {
17526            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17527	           xmlMemBlocks() - mem_base);
17528	    test_ret++;
17529            printf(" %d", n_URL);
17530            printf("\n");
17531        }
17532    }
17533    function_tests++;
17534#endif
17535
17536    return(test_ret);
17537}
17538
17539
17540static int
17541test_xmlRelaxNGNewValidCtxt(void) {
17542    int test_ret = 0;
17543
17544
17545    /* missing type support */
17546    return(test_ret);
17547}
17548
17549
17550static int
17551test_xmlRelaxNGParse(void) {
17552    int test_ret = 0;
17553
17554
17555    /* missing type support */
17556    return(test_ret);
17557}
17558
17559
17560static int
17561test_xmlRelaxNGSetParserErrors(void) {
17562    int test_ret = 0;
17563
17564
17565    /* missing type support */
17566    return(test_ret);
17567}
17568
17569
17570static int
17571test_xmlRelaxNGSetParserStructuredErrors(void) {
17572    int test_ret = 0;
17573
17574
17575    /* missing type support */
17576    return(test_ret);
17577}
17578
17579
17580static int
17581test_xmlRelaxNGSetValidErrors(void) {
17582    int test_ret = 0;
17583
17584
17585    /* missing type support */
17586    return(test_ret);
17587}
17588
17589
17590static int
17591test_xmlRelaxNGSetValidStructuredErrors(void) {
17592    int test_ret = 0;
17593
17594
17595    /* missing type support */
17596    return(test_ret);
17597}
17598
17599
17600static int
17601test_xmlRelaxNGValidateDoc(void) {
17602    int test_ret = 0;
17603
17604#if defined(LIBXML_SCHEMAS_ENABLED)
17605    int mem_base;
17606    int ret_val;
17607    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17608    int n_ctxt;
17609    xmlDocPtr doc; /* a parsed document tree */
17610    int n_doc;
17611
17612    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17613    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17614        mem_base = xmlMemBlocks();
17615        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17616        doc = gen_xmlDocPtr(n_doc, 1);
17617
17618        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17619        desret_int(ret_val);
17620        call_tests++;
17621        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17622        des_xmlDocPtr(n_doc, doc, 1);
17623        xmlResetLastError();
17624        if (mem_base != xmlMemBlocks()) {
17625            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17626	           xmlMemBlocks() - mem_base);
17627	    test_ret++;
17628            printf(" %d", n_ctxt);
17629            printf(" %d", n_doc);
17630            printf("\n");
17631        }
17632    }
17633    }
17634    function_tests++;
17635#endif
17636
17637    return(test_ret);
17638}
17639
17640
17641static int
17642test_xmlRelaxNGValidateFullElement(void) {
17643    int test_ret = 0;
17644
17645#if defined(LIBXML_SCHEMAS_ENABLED)
17646    int mem_base;
17647    int ret_val;
17648    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17649    int n_ctxt;
17650    xmlDocPtr doc; /* a document instance */
17651    int n_doc;
17652    xmlNodePtr elem; /* an element instance */
17653    int n_elem;
17654
17655    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17656    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17657    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17658        mem_base = xmlMemBlocks();
17659        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17660        doc = gen_xmlDocPtr(n_doc, 1);
17661        elem = gen_xmlNodePtr(n_elem, 2);
17662
17663        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17664        desret_int(ret_val);
17665        call_tests++;
17666        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17667        des_xmlDocPtr(n_doc, doc, 1);
17668        des_xmlNodePtr(n_elem, elem, 2);
17669        xmlResetLastError();
17670        if (mem_base != xmlMemBlocks()) {
17671            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17672	           xmlMemBlocks() - mem_base);
17673	    test_ret++;
17674            printf(" %d", n_ctxt);
17675            printf(" %d", n_doc);
17676            printf(" %d", n_elem);
17677            printf("\n");
17678        }
17679    }
17680    }
17681    }
17682    function_tests++;
17683#endif
17684
17685    return(test_ret);
17686}
17687
17688
17689static int
17690test_xmlRelaxNGValidatePopElement(void) {
17691    int test_ret = 0;
17692
17693#if defined(LIBXML_SCHEMAS_ENABLED)
17694    int mem_base;
17695    int ret_val;
17696    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17697    int n_ctxt;
17698    xmlDocPtr doc; /* a document instance */
17699    int n_doc;
17700    xmlNodePtr elem; /* an element instance */
17701    int n_elem;
17702
17703    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17704    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17705    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17706        mem_base = xmlMemBlocks();
17707        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17708        doc = gen_xmlDocPtr(n_doc, 1);
17709        elem = gen_xmlNodePtr(n_elem, 2);
17710
17711        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17712        desret_int(ret_val);
17713        call_tests++;
17714        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17715        des_xmlDocPtr(n_doc, doc, 1);
17716        des_xmlNodePtr(n_elem, elem, 2);
17717        xmlResetLastError();
17718        if (mem_base != xmlMemBlocks()) {
17719            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17720	           xmlMemBlocks() - mem_base);
17721	    test_ret++;
17722            printf(" %d", n_ctxt);
17723            printf(" %d", n_doc);
17724            printf(" %d", n_elem);
17725            printf("\n");
17726        }
17727    }
17728    }
17729    }
17730    function_tests++;
17731#endif
17732
17733    return(test_ret);
17734}
17735
17736
17737static int
17738test_xmlRelaxNGValidatePushCData(void) {
17739    int test_ret = 0;
17740
17741#if defined(LIBXML_SCHEMAS_ENABLED)
17742    int mem_base;
17743    int ret_val;
17744    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17745    int n_ctxt;
17746    xmlChar * data; /* some character data read */
17747    int n_data;
17748    int len; /* the lenght of the data */
17749    int n_len;
17750
17751    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17752    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17753    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17754        mem_base = xmlMemBlocks();
17755        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17756        data = gen_const_xmlChar_ptr(n_data, 1);
17757        len = gen_int(n_len, 2);
17758
17759        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17760        desret_int(ret_val);
17761        call_tests++;
17762        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17763        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17764        des_int(n_len, len, 2);
17765        xmlResetLastError();
17766        if (mem_base != xmlMemBlocks()) {
17767            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17768	           xmlMemBlocks() - mem_base);
17769	    test_ret++;
17770            printf(" %d", n_ctxt);
17771            printf(" %d", n_data);
17772            printf(" %d", n_len);
17773            printf("\n");
17774        }
17775    }
17776    }
17777    }
17778    function_tests++;
17779#endif
17780
17781    return(test_ret);
17782}
17783
17784
17785static int
17786test_xmlRelaxNGValidatePushElement(void) {
17787    int test_ret = 0;
17788
17789#if defined(LIBXML_SCHEMAS_ENABLED)
17790    int mem_base;
17791    int ret_val;
17792    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17793    int n_ctxt;
17794    xmlDocPtr doc; /* a document instance */
17795    int n_doc;
17796    xmlNodePtr elem; /* an element instance */
17797    int n_elem;
17798
17799    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17800    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17801    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17802        mem_base = xmlMemBlocks();
17803        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17804        doc = gen_xmlDocPtr(n_doc, 1);
17805        elem = gen_xmlNodePtr(n_elem, 2);
17806
17807        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17808        desret_int(ret_val);
17809        call_tests++;
17810        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17811        des_xmlDocPtr(n_doc, doc, 1);
17812        des_xmlNodePtr(n_elem, elem, 2);
17813        xmlResetLastError();
17814        if (mem_base != xmlMemBlocks()) {
17815            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17816	           xmlMemBlocks() - mem_base);
17817	    test_ret++;
17818            printf(" %d", n_ctxt);
17819            printf(" %d", n_doc);
17820            printf(" %d", n_elem);
17821            printf("\n");
17822        }
17823    }
17824    }
17825    }
17826    function_tests++;
17827#endif
17828
17829    return(test_ret);
17830}
17831
17832
17833static int
17834test_xmlRelaxParserSetFlag(void) {
17835    int test_ret = 0;
17836
17837#if defined(LIBXML_SCHEMAS_ENABLED)
17838    int mem_base;
17839    int ret_val;
17840    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17841    int n_ctxt;
17842    int flags; /* a set of flags values */
17843    int n_flags;
17844
17845    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17846    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17847        mem_base = xmlMemBlocks();
17848        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17849        flags = gen_int(n_flags, 1);
17850
17851        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17852        desret_int(ret_val);
17853        call_tests++;
17854        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17855        des_int(n_flags, flags, 1);
17856        xmlResetLastError();
17857        if (mem_base != xmlMemBlocks()) {
17858            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17859	           xmlMemBlocks() - mem_base);
17860	    test_ret++;
17861            printf(" %d", n_ctxt);
17862            printf(" %d", n_flags);
17863            printf("\n");
17864        }
17865    }
17866    }
17867    function_tests++;
17868#endif
17869
17870    return(test_ret);
17871}
17872
17873static int
17874test_relaxng(void) {
17875    int test_ret = 0;
17876
17877    if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17878    test_ret += test_xmlRelaxNGDump();
17879    test_ret += test_xmlRelaxNGDumpTree();
17880    test_ret += test_xmlRelaxNGGetParserErrors();
17881    test_ret += test_xmlRelaxNGGetValidErrors();
17882    test_ret += test_xmlRelaxNGInitTypes();
17883    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17884    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17885    test_ret += test_xmlRelaxNGNewParserCtxt();
17886    test_ret += test_xmlRelaxNGNewValidCtxt();
17887    test_ret += test_xmlRelaxNGParse();
17888    test_ret += test_xmlRelaxNGSetParserErrors();
17889    test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17890    test_ret += test_xmlRelaxNGSetValidErrors();
17891    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17892    test_ret += test_xmlRelaxNGValidateDoc();
17893    test_ret += test_xmlRelaxNGValidateFullElement();
17894    test_ret += test_xmlRelaxNGValidatePopElement();
17895    test_ret += test_xmlRelaxNGValidatePushCData();
17896    test_ret += test_xmlRelaxNGValidatePushElement();
17897    test_ret += test_xmlRelaxParserSetFlag();
17898
17899    if (test_ret != 0)
17900	printf("Module relaxng: %d errors\n", test_ret);
17901    return(test_ret);
17902}
17903static int
17904test_schemasInternals(void) {
17905    int test_ret = 0;
17906
17907    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17908
17909    if (test_ret != 0)
17910	printf("Module schemasInternals: %d errors\n", test_ret);
17911    return(test_ret);
17912}
17913
17914static int
17915test_xmlSchematronNewDocParserCtxt(void) {
17916    int test_ret = 0;
17917
17918
17919    /* missing type support */
17920    return(test_ret);
17921}
17922
17923
17924static int
17925test_xmlSchematronNewMemParserCtxt(void) {
17926    int test_ret = 0;
17927
17928
17929    /* missing type support */
17930    return(test_ret);
17931}
17932
17933
17934static int
17935test_xmlSchematronNewParserCtxt(void) {
17936    int test_ret = 0;
17937
17938
17939    /* missing type support */
17940    return(test_ret);
17941}
17942
17943#ifdef LIBXML_SCHEMATRON_ENABLED
17944
17945#define gen_nb_xmlSchematronPtr 1
17946static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17947    return(NULL);
17948}
17949static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17950}
17951#endif
17952
17953
17954static int
17955test_xmlSchematronNewValidCtxt(void) {
17956    int test_ret = 0;
17957
17958
17959    /* missing type support */
17960    return(test_ret);
17961}
17962
17963#ifdef LIBXML_SCHEMATRON_ENABLED
17964
17965#define gen_nb_xmlSchematronParserCtxtPtr 1
17966static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17967    return(NULL);
17968}
17969static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17970}
17971#endif
17972
17973
17974static int
17975test_xmlSchematronParse(void) {
17976    int test_ret = 0;
17977
17978
17979    /* missing type support */
17980    return(test_ret);
17981}
17982
17983#ifdef LIBXML_SCHEMATRON_ENABLED
17984
17985#define gen_nb_xmlSchematronValidCtxtPtr 1
17986static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17987    return(NULL);
17988}
17989static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17990}
17991#endif
17992
17993
17994static int
17995test_xmlSchematronValidateDoc(void) {
17996    int test_ret = 0;
17997
17998#if defined(LIBXML_SCHEMATRON_ENABLED)
17999    int mem_base;
18000    int ret_val;
18001    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18002    int n_ctxt;
18003    xmlDocPtr instance; /* the document instace tree */
18004    int n_instance;
18005
18006    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18007    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18008        mem_base = xmlMemBlocks();
18009        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18010        instance = gen_xmlDocPtr(n_instance, 1);
18011
18012        ret_val = xmlSchematronValidateDoc(ctxt, instance);
18013        desret_int(ret_val);
18014        call_tests++;
18015        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18016        des_xmlDocPtr(n_instance, instance, 1);
18017        xmlResetLastError();
18018        if (mem_base != xmlMemBlocks()) {
18019            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18020	           xmlMemBlocks() - mem_base);
18021	    test_ret++;
18022            printf(" %d", n_ctxt);
18023            printf(" %d", n_instance);
18024            printf("\n");
18025        }
18026    }
18027    }
18028    function_tests++;
18029#endif
18030
18031    return(test_ret);
18032}
18033
18034static int
18035test_schematron(void) {
18036    int test_ret = 0;
18037
18038    if (quiet == 0) printf("Testing schematron : 1 of 9 functions ...\n");
18039    test_ret += test_xmlSchematronNewDocParserCtxt();
18040    test_ret += test_xmlSchematronNewMemParserCtxt();
18041    test_ret += test_xmlSchematronNewParserCtxt();
18042    test_ret += test_xmlSchematronNewValidCtxt();
18043    test_ret += test_xmlSchematronParse();
18044    test_ret += test_xmlSchematronValidateDoc();
18045
18046    if (test_ret != 0)
18047	printf("Module schematron: %d errors\n", test_ret);
18048    return(test_ret);
18049}
18050
18051static int
18052test_xmlAddChild(void) {
18053    int test_ret = 0;
18054
18055    int mem_base;
18056    xmlNodePtr ret_val;
18057    xmlNodePtr parent; /* the parent node */
18058    int n_parent;
18059    xmlNodePtr cur; /* the child node */
18060    int n_cur;
18061
18062    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18063    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18064        mem_base = xmlMemBlocks();
18065        parent = gen_xmlNodePtr(n_parent, 0);
18066        cur = gen_xmlNodePtr_in(n_cur, 1);
18067
18068        ret_val = xmlAddChild(parent, cur);
18069        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18070        desret_xmlNodePtr(ret_val);
18071        call_tests++;
18072        des_xmlNodePtr(n_parent, parent, 0);
18073        des_xmlNodePtr_in(n_cur, cur, 1);
18074        xmlResetLastError();
18075        if (mem_base != xmlMemBlocks()) {
18076            printf("Leak of %d blocks found in xmlAddChild",
18077	           xmlMemBlocks() - mem_base);
18078	    test_ret++;
18079            printf(" %d", n_parent);
18080            printf(" %d", n_cur);
18081            printf("\n");
18082        }
18083    }
18084    }
18085    function_tests++;
18086
18087    return(test_ret);
18088}
18089
18090
18091static int
18092test_xmlAddChildList(void) {
18093    int test_ret = 0;
18094
18095    int mem_base;
18096    xmlNodePtr ret_val;
18097    xmlNodePtr parent; /* the parent node */
18098    int n_parent;
18099    xmlNodePtr cur; /* the first node in the list */
18100    int n_cur;
18101
18102    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18103    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18104        mem_base = xmlMemBlocks();
18105        parent = gen_xmlNodePtr(n_parent, 0);
18106        cur = gen_xmlNodePtr_in(n_cur, 1);
18107
18108        ret_val = xmlAddChildList(parent, cur);
18109        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18110        desret_xmlNodePtr(ret_val);
18111        call_tests++;
18112        des_xmlNodePtr(n_parent, parent, 0);
18113        des_xmlNodePtr_in(n_cur, cur, 1);
18114        xmlResetLastError();
18115        if (mem_base != xmlMemBlocks()) {
18116            printf("Leak of %d blocks found in xmlAddChildList",
18117	           xmlMemBlocks() - mem_base);
18118	    test_ret++;
18119            printf(" %d", n_parent);
18120            printf(" %d", n_cur);
18121            printf("\n");
18122        }
18123    }
18124    }
18125    function_tests++;
18126
18127    return(test_ret);
18128}
18129
18130
18131static int
18132test_xmlAddNextSibling(void) {
18133    int test_ret = 0;
18134
18135    int mem_base;
18136    xmlNodePtr ret_val;
18137    xmlNodePtr cur; /* the child node */
18138    int n_cur;
18139    xmlNodePtr elem; /* the new node */
18140    int n_elem;
18141
18142    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18143    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18144        mem_base = xmlMemBlocks();
18145        cur = gen_xmlNodePtr(n_cur, 0);
18146        elem = gen_xmlNodePtr_in(n_elem, 1);
18147
18148        ret_val = xmlAddNextSibling(cur, elem);
18149        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18150        desret_xmlNodePtr(ret_val);
18151        call_tests++;
18152        des_xmlNodePtr(n_cur, cur, 0);
18153        des_xmlNodePtr_in(n_elem, elem, 1);
18154        xmlResetLastError();
18155        if (mem_base != xmlMemBlocks()) {
18156            printf("Leak of %d blocks found in xmlAddNextSibling",
18157	           xmlMemBlocks() - mem_base);
18158	    test_ret++;
18159            printf(" %d", n_cur);
18160            printf(" %d", n_elem);
18161            printf("\n");
18162        }
18163    }
18164    }
18165    function_tests++;
18166
18167    return(test_ret);
18168}
18169
18170
18171static int
18172test_xmlAddPrevSibling(void) {
18173    int test_ret = 0;
18174
18175#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18176    int mem_base;
18177    xmlNodePtr ret_val;
18178    xmlNodePtr cur; /* the child node */
18179    int n_cur;
18180    xmlNodePtr elem; /* the new node */
18181    int n_elem;
18182
18183    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18184    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18185        mem_base = xmlMemBlocks();
18186        cur = gen_xmlNodePtr(n_cur, 0);
18187        elem = gen_xmlNodePtr_in(n_elem, 1);
18188
18189        ret_val = xmlAddPrevSibling(cur, elem);
18190        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18191        desret_xmlNodePtr(ret_val);
18192        call_tests++;
18193        des_xmlNodePtr(n_cur, cur, 0);
18194        des_xmlNodePtr_in(n_elem, elem, 1);
18195        xmlResetLastError();
18196        if (mem_base != xmlMemBlocks()) {
18197            printf("Leak of %d blocks found in xmlAddPrevSibling",
18198	           xmlMemBlocks() - mem_base);
18199	    test_ret++;
18200            printf(" %d", n_cur);
18201            printf(" %d", n_elem);
18202            printf("\n");
18203        }
18204    }
18205    }
18206    function_tests++;
18207#endif
18208
18209    return(test_ret);
18210}
18211
18212
18213static int
18214test_xmlAddSibling(void) {
18215    int test_ret = 0;
18216
18217    int mem_base;
18218    xmlNodePtr ret_val;
18219    xmlNodePtr cur; /* the child node */
18220    int n_cur;
18221    xmlNodePtr elem; /* the new node */
18222    int n_elem;
18223
18224    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18225    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18226        mem_base = xmlMemBlocks();
18227        cur = gen_xmlNodePtr(n_cur, 0);
18228        elem = gen_xmlNodePtr_in(n_elem, 1);
18229
18230        ret_val = xmlAddSibling(cur, elem);
18231        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18232        desret_xmlNodePtr(ret_val);
18233        call_tests++;
18234        des_xmlNodePtr(n_cur, cur, 0);
18235        des_xmlNodePtr_in(n_elem, elem, 1);
18236        xmlResetLastError();
18237        if (mem_base != xmlMemBlocks()) {
18238            printf("Leak of %d blocks found in xmlAddSibling",
18239	           xmlMemBlocks() - mem_base);
18240	    test_ret++;
18241            printf(" %d", n_cur);
18242            printf(" %d", n_elem);
18243            printf("\n");
18244        }
18245    }
18246    }
18247    function_tests++;
18248
18249    return(test_ret);
18250}
18251
18252
18253static int
18254test_xmlAttrSerializeTxtContent(void) {
18255    int test_ret = 0;
18256
18257#if defined(LIBXML_OUTPUT_ENABLED)
18258#ifdef LIBXML_OUTPUT_ENABLED
18259    int mem_base;
18260    xmlBufferPtr buf; /* the XML buffer output */
18261    int n_buf;
18262    xmlDocPtr doc; /* the document */
18263    int n_doc;
18264    xmlAttrPtr attr; /* the attribute node */
18265    int n_attr;
18266    xmlChar * string; /* the text content */
18267    int n_string;
18268
18269    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18270    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18271    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18272    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18273        mem_base = xmlMemBlocks();
18274        buf = gen_xmlBufferPtr(n_buf, 0);
18275        doc = gen_xmlDocPtr(n_doc, 1);
18276        attr = gen_xmlAttrPtr(n_attr, 2);
18277        string = gen_const_xmlChar_ptr(n_string, 3);
18278
18279        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18280        call_tests++;
18281        des_xmlBufferPtr(n_buf, buf, 0);
18282        des_xmlDocPtr(n_doc, doc, 1);
18283        des_xmlAttrPtr(n_attr, attr, 2);
18284        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18285        xmlResetLastError();
18286        if (mem_base != xmlMemBlocks()) {
18287            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18288	           xmlMemBlocks() - mem_base);
18289	    test_ret++;
18290            printf(" %d", n_buf);
18291            printf(" %d", n_doc);
18292            printf(" %d", n_attr);
18293            printf(" %d", n_string);
18294            printf("\n");
18295        }
18296    }
18297    }
18298    }
18299    }
18300    function_tests++;
18301#endif
18302#endif
18303
18304    return(test_ret);
18305}
18306
18307
18308static int
18309test_xmlBufferAdd(void) {
18310    int test_ret = 0;
18311
18312    int mem_base;
18313    int ret_val;
18314    xmlBufferPtr buf; /* the buffer to dump */
18315    int n_buf;
18316    xmlChar * str; /* the #xmlChar string */
18317    int n_str;
18318    int len; /* the number of #xmlChar to add */
18319    int n_len;
18320
18321    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18322    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18323    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18324        mem_base = xmlMemBlocks();
18325        buf = gen_xmlBufferPtr(n_buf, 0);
18326        str = gen_const_xmlChar_ptr(n_str, 1);
18327        len = gen_int(n_len, 2);
18328
18329        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18330        desret_int(ret_val);
18331        call_tests++;
18332        des_xmlBufferPtr(n_buf, buf, 0);
18333        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18334        des_int(n_len, len, 2);
18335        xmlResetLastError();
18336        if (mem_base != xmlMemBlocks()) {
18337            printf("Leak of %d blocks found in xmlBufferAdd",
18338	           xmlMemBlocks() - mem_base);
18339	    test_ret++;
18340            printf(" %d", n_buf);
18341            printf(" %d", n_str);
18342            printf(" %d", n_len);
18343            printf("\n");
18344        }
18345    }
18346    }
18347    }
18348    function_tests++;
18349
18350    return(test_ret);
18351}
18352
18353
18354static int
18355test_xmlBufferAddHead(void) {
18356    int test_ret = 0;
18357
18358    int mem_base;
18359    int ret_val;
18360    xmlBufferPtr buf; /* the buffer */
18361    int n_buf;
18362    xmlChar * str; /* the #xmlChar string */
18363    int n_str;
18364    int len; /* the number of #xmlChar to add */
18365    int n_len;
18366
18367    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18368    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18369    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18370        mem_base = xmlMemBlocks();
18371        buf = gen_xmlBufferPtr(n_buf, 0);
18372        str = gen_const_xmlChar_ptr(n_str, 1);
18373        len = gen_int(n_len, 2);
18374
18375        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18376        desret_int(ret_val);
18377        call_tests++;
18378        des_xmlBufferPtr(n_buf, buf, 0);
18379        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18380        des_int(n_len, len, 2);
18381        xmlResetLastError();
18382        if (mem_base != xmlMemBlocks()) {
18383            printf("Leak of %d blocks found in xmlBufferAddHead",
18384	           xmlMemBlocks() - mem_base);
18385	    test_ret++;
18386            printf(" %d", n_buf);
18387            printf(" %d", n_str);
18388            printf(" %d", n_len);
18389            printf("\n");
18390        }
18391    }
18392    }
18393    }
18394    function_tests++;
18395
18396    return(test_ret);
18397}
18398
18399
18400static int
18401test_xmlBufferCCat(void) {
18402    int test_ret = 0;
18403
18404    int mem_base;
18405    int ret_val;
18406    xmlBufferPtr buf; /* the buffer to dump */
18407    int n_buf;
18408    char * str; /* the C char string */
18409    int n_str;
18410
18411    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18412    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18413        mem_base = xmlMemBlocks();
18414        buf = gen_xmlBufferPtr(n_buf, 0);
18415        str = gen_const_char_ptr(n_str, 1);
18416
18417        ret_val = xmlBufferCCat(buf, (const char *)str);
18418        desret_int(ret_val);
18419        call_tests++;
18420        des_xmlBufferPtr(n_buf, buf, 0);
18421        des_const_char_ptr(n_str, (const char *)str, 1);
18422        xmlResetLastError();
18423        if (mem_base != xmlMemBlocks()) {
18424            printf("Leak of %d blocks found in xmlBufferCCat",
18425	           xmlMemBlocks() - mem_base);
18426	    test_ret++;
18427            printf(" %d", n_buf);
18428            printf(" %d", n_str);
18429            printf("\n");
18430        }
18431    }
18432    }
18433    function_tests++;
18434
18435    return(test_ret);
18436}
18437
18438
18439static int
18440test_xmlBufferCat(void) {
18441    int test_ret = 0;
18442
18443    int mem_base;
18444    int ret_val;
18445    xmlBufferPtr buf; /* the buffer to add to */
18446    int n_buf;
18447    xmlChar * str; /* the #xmlChar string */
18448    int n_str;
18449
18450    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18451    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18452        mem_base = xmlMemBlocks();
18453        buf = gen_xmlBufferPtr(n_buf, 0);
18454        str = gen_const_xmlChar_ptr(n_str, 1);
18455
18456        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18457        desret_int(ret_val);
18458        call_tests++;
18459        des_xmlBufferPtr(n_buf, buf, 0);
18460        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18461        xmlResetLastError();
18462        if (mem_base != xmlMemBlocks()) {
18463            printf("Leak of %d blocks found in xmlBufferCat",
18464	           xmlMemBlocks() - mem_base);
18465	    test_ret++;
18466            printf(" %d", n_buf);
18467            printf(" %d", n_str);
18468            printf("\n");
18469        }
18470    }
18471    }
18472    function_tests++;
18473
18474    return(test_ret);
18475}
18476
18477
18478#define gen_nb_const_xmlBufferPtr 1
18479static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18480    return(NULL);
18481}
18482static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18483}
18484
18485static int
18486test_xmlBufferContent(void) {
18487    int test_ret = 0;
18488
18489    int mem_base;
18490    const xmlChar * ret_val;
18491    xmlBufferPtr buf; /* the buffer */
18492    int n_buf;
18493
18494    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18495        mem_base = xmlMemBlocks();
18496        buf = gen_const_xmlBufferPtr(n_buf, 0);
18497
18498        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18499        desret_const_xmlChar_ptr(ret_val);
18500        call_tests++;
18501        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18502        xmlResetLastError();
18503        if (mem_base != xmlMemBlocks()) {
18504            printf("Leak of %d blocks found in xmlBufferContent",
18505	           xmlMemBlocks() - mem_base);
18506	    test_ret++;
18507            printf(" %d", n_buf);
18508            printf("\n");
18509        }
18510    }
18511    function_tests++;
18512
18513    return(test_ret);
18514}
18515
18516
18517static int
18518test_xmlBufferCreate(void) {
18519    int test_ret = 0;
18520
18521    int mem_base;
18522    xmlBufferPtr ret_val;
18523
18524        mem_base = xmlMemBlocks();
18525
18526        ret_val = xmlBufferCreate();
18527        desret_xmlBufferPtr(ret_val);
18528        call_tests++;
18529        xmlResetLastError();
18530        if (mem_base != xmlMemBlocks()) {
18531            printf("Leak of %d blocks found in xmlBufferCreate",
18532	           xmlMemBlocks() - mem_base);
18533	    test_ret++;
18534            printf("\n");
18535        }
18536    function_tests++;
18537
18538    return(test_ret);
18539}
18540
18541
18542static int
18543test_xmlBufferCreateSize(void) {
18544    int test_ret = 0;
18545
18546
18547    /* missing type support */
18548    return(test_ret);
18549}
18550
18551
18552static int
18553test_xmlBufferCreateStatic(void) {
18554    int test_ret = 0;
18555
18556
18557    /* missing type support */
18558    return(test_ret);
18559}
18560
18561
18562static int
18563test_xmlBufferEmpty(void) {
18564    int test_ret = 0;
18565
18566    int mem_base;
18567    xmlBufferPtr buf; /* the buffer */
18568    int n_buf;
18569
18570    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18571        mem_base = xmlMemBlocks();
18572        buf = gen_xmlBufferPtr(n_buf, 0);
18573
18574        xmlBufferEmpty(buf);
18575        call_tests++;
18576        des_xmlBufferPtr(n_buf, buf, 0);
18577        xmlResetLastError();
18578        if (mem_base != xmlMemBlocks()) {
18579            printf("Leak of %d blocks found in xmlBufferEmpty",
18580	           xmlMemBlocks() - mem_base);
18581	    test_ret++;
18582            printf(" %d", n_buf);
18583            printf("\n");
18584        }
18585    }
18586    function_tests++;
18587
18588    return(test_ret);
18589}
18590
18591
18592static int
18593test_xmlBufferGrow(void) {
18594    int test_ret = 0;
18595
18596    int mem_base;
18597    int ret_val;
18598    xmlBufferPtr buf; /* the buffer */
18599    int n_buf;
18600    unsigned int len; /* the minimum free size to allocate */
18601    int n_len;
18602
18603    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18604    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18605        mem_base = xmlMemBlocks();
18606        buf = gen_xmlBufferPtr(n_buf, 0);
18607        len = gen_unsigned_int(n_len, 1);
18608
18609        ret_val = xmlBufferGrow(buf, len);
18610        desret_int(ret_val);
18611        call_tests++;
18612        des_xmlBufferPtr(n_buf, buf, 0);
18613        des_unsigned_int(n_len, len, 1);
18614        xmlResetLastError();
18615        if (mem_base != xmlMemBlocks()) {
18616            printf("Leak of %d blocks found in xmlBufferGrow",
18617	           xmlMemBlocks() - mem_base);
18618	    test_ret++;
18619            printf(" %d", n_buf);
18620            printf(" %d", n_len);
18621            printf("\n");
18622        }
18623    }
18624    }
18625    function_tests++;
18626
18627    return(test_ret);
18628}
18629
18630
18631static int
18632test_xmlBufferLength(void) {
18633    int test_ret = 0;
18634
18635    int mem_base;
18636    int ret_val;
18637    xmlBufferPtr buf; /* the buffer */
18638    int n_buf;
18639
18640    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18641        mem_base = xmlMemBlocks();
18642        buf = gen_const_xmlBufferPtr(n_buf, 0);
18643
18644        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18645        desret_int(ret_val);
18646        call_tests++;
18647        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18648        xmlResetLastError();
18649        if (mem_base != xmlMemBlocks()) {
18650            printf("Leak of %d blocks found in xmlBufferLength",
18651	           xmlMemBlocks() - mem_base);
18652	    test_ret++;
18653            printf(" %d", n_buf);
18654            printf("\n");
18655        }
18656    }
18657    function_tests++;
18658
18659    return(test_ret);
18660}
18661
18662
18663static int
18664test_xmlBufferResize(void) {
18665    int test_ret = 0;
18666
18667    int mem_base;
18668    int ret_val;
18669    xmlBufferPtr buf; /* the buffer to resize */
18670    int n_buf;
18671    unsigned int size; /* the desired size */
18672    int n_size;
18673
18674    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18675    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18676        mem_base = xmlMemBlocks();
18677        buf = gen_xmlBufferPtr(n_buf, 0);
18678        size = gen_unsigned_int(n_size, 1);
18679
18680        ret_val = xmlBufferResize(buf, size);
18681        desret_int(ret_val);
18682        call_tests++;
18683        des_xmlBufferPtr(n_buf, buf, 0);
18684        des_unsigned_int(n_size, size, 1);
18685        xmlResetLastError();
18686        if (mem_base != xmlMemBlocks()) {
18687            printf("Leak of %d blocks found in xmlBufferResize",
18688	           xmlMemBlocks() - mem_base);
18689	    test_ret++;
18690            printf(" %d", n_buf);
18691            printf(" %d", n_size);
18692            printf("\n");
18693        }
18694    }
18695    }
18696    function_tests++;
18697
18698    return(test_ret);
18699}
18700
18701
18702static int
18703test_xmlBufferSetAllocationScheme(void) {
18704    int test_ret = 0;
18705
18706    int mem_base;
18707    xmlBufferPtr buf; /* the buffer to tune */
18708    int n_buf;
18709    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18710    int n_scheme;
18711
18712    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18713    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18714        mem_base = xmlMemBlocks();
18715        buf = gen_xmlBufferPtr(n_buf, 0);
18716        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18717
18718        xmlBufferSetAllocationScheme(buf, scheme);
18719        call_tests++;
18720        des_xmlBufferPtr(n_buf, buf, 0);
18721        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18722        xmlResetLastError();
18723        if (mem_base != xmlMemBlocks()) {
18724            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18725	           xmlMemBlocks() - mem_base);
18726	    test_ret++;
18727            printf(" %d", n_buf);
18728            printf(" %d", n_scheme);
18729            printf("\n");
18730        }
18731    }
18732    }
18733    function_tests++;
18734
18735    return(test_ret);
18736}
18737
18738
18739static int
18740test_xmlBufferShrink(void) {
18741    int test_ret = 0;
18742
18743    int mem_base;
18744    int ret_val;
18745    xmlBufferPtr buf; /* the buffer to dump */
18746    int n_buf;
18747    unsigned int len; /* the number of xmlChar to remove */
18748    int n_len;
18749
18750    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18751    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18752        mem_base = xmlMemBlocks();
18753        buf = gen_xmlBufferPtr(n_buf, 0);
18754        len = gen_unsigned_int(n_len, 1);
18755
18756        ret_val = xmlBufferShrink(buf, len);
18757        desret_int(ret_val);
18758        call_tests++;
18759        des_xmlBufferPtr(n_buf, buf, 0);
18760        des_unsigned_int(n_len, len, 1);
18761        xmlResetLastError();
18762        if (mem_base != xmlMemBlocks()) {
18763            printf("Leak of %d blocks found in xmlBufferShrink",
18764	           xmlMemBlocks() - mem_base);
18765	    test_ret++;
18766            printf(" %d", n_buf);
18767            printf(" %d", n_len);
18768            printf("\n");
18769        }
18770    }
18771    }
18772    function_tests++;
18773
18774    return(test_ret);
18775}
18776
18777
18778static int
18779test_xmlBufferWriteCHAR(void) {
18780    int test_ret = 0;
18781
18782    int mem_base;
18783    xmlBufferPtr buf; /* the XML buffer */
18784    int n_buf;
18785    xmlChar * string; /* the string to add */
18786    int n_string;
18787
18788    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18789    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18790        mem_base = xmlMemBlocks();
18791        buf = gen_xmlBufferPtr(n_buf, 0);
18792        string = gen_const_xmlChar_ptr(n_string, 1);
18793
18794        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18795        call_tests++;
18796        des_xmlBufferPtr(n_buf, buf, 0);
18797        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18798        xmlResetLastError();
18799        if (mem_base != xmlMemBlocks()) {
18800            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18801	           xmlMemBlocks() - mem_base);
18802	    test_ret++;
18803            printf(" %d", n_buf);
18804            printf(" %d", n_string);
18805            printf("\n");
18806        }
18807    }
18808    }
18809    function_tests++;
18810
18811    return(test_ret);
18812}
18813
18814
18815static int
18816test_xmlBufferWriteChar(void) {
18817    int test_ret = 0;
18818
18819    int mem_base;
18820    xmlBufferPtr buf; /* the XML buffer output */
18821    int n_buf;
18822    char * string; /* the string to add */
18823    int n_string;
18824
18825    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18826    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18827        mem_base = xmlMemBlocks();
18828        buf = gen_xmlBufferPtr(n_buf, 0);
18829        string = gen_const_char_ptr(n_string, 1);
18830
18831        xmlBufferWriteChar(buf, (const char *)string);
18832        call_tests++;
18833        des_xmlBufferPtr(n_buf, buf, 0);
18834        des_const_char_ptr(n_string, (const char *)string, 1);
18835        xmlResetLastError();
18836        if (mem_base != xmlMemBlocks()) {
18837            printf("Leak of %d blocks found in xmlBufferWriteChar",
18838	           xmlMemBlocks() - mem_base);
18839	    test_ret++;
18840            printf(" %d", n_buf);
18841            printf(" %d", n_string);
18842            printf("\n");
18843        }
18844    }
18845    }
18846    function_tests++;
18847
18848    return(test_ret);
18849}
18850
18851
18852static int
18853test_xmlBufferWriteQuotedString(void) {
18854    int test_ret = 0;
18855
18856    int mem_base;
18857    xmlBufferPtr buf; /* the XML buffer output */
18858    int n_buf;
18859    xmlChar * string; /* the string to add */
18860    int n_string;
18861
18862    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18863    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18864        mem_base = xmlMemBlocks();
18865        buf = gen_xmlBufferPtr(n_buf, 0);
18866        string = gen_const_xmlChar_ptr(n_string, 1);
18867
18868        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18869        call_tests++;
18870        des_xmlBufferPtr(n_buf, buf, 0);
18871        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18872        xmlResetLastError();
18873        if (mem_base != xmlMemBlocks()) {
18874            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18875	           xmlMemBlocks() - mem_base);
18876	    test_ret++;
18877            printf(" %d", n_buf);
18878            printf(" %d", n_string);
18879            printf("\n");
18880        }
18881    }
18882    }
18883    function_tests++;
18884
18885    return(test_ret);
18886}
18887
18888
18889static int
18890test_xmlBuildQName(void) {
18891    int test_ret = 0;
18892
18893    int mem_base;
18894    xmlChar * ret_val;
18895    xmlChar * ncname; /* the Name */
18896    int n_ncname;
18897    xmlChar * prefix; /* the prefix */
18898    int n_prefix;
18899    xmlChar * memory; /* preallocated memory */
18900    int n_memory;
18901    int len; /* preallocated memory length */
18902    int n_len;
18903
18904    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18905    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18906    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18907    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18908        mem_base = xmlMemBlocks();
18909        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18910        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18911        memory = gen_xmlChar_ptr(n_memory, 2);
18912        len = gen_int(n_len, 3);
18913
18914        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18915        if ((ret_val != NULL) && (ret_val != ncname) &&
18916              (ret_val != prefix) && (ret_val != memory))
18917              xmlFree(ret_val);
18918	  ret_val = NULL;
18919        desret_xmlChar_ptr(ret_val);
18920        call_tests++;
18921        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18922        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18923        des_xmlChar_ptr(n_memory, memory, 2);
18924        des_int(n_len, len, 3);
18925        xmlResetLastError();
18926        if (mem_base != xmlMemBlocks()) {
18927            printf("Leak of %d blocks found in xmlBuildQName",
18928	           xmlMemBlocks() - mem_base);
18929	    test_ret++;
18930            printf(" %d", n_ncname);
18931            printf(" %d", n_prefix);
18932            printf(" %d", n_memory);
18933            printf(" %d", n_len);
18934            printf("\n");
18935        }
18936    }
18937    }
18938    }
18939    }
18940    function_tests++;
18941
18942    return(test_ret);
18943}
18944
18945
18946static int
18947test_xmlCopyDoc(void) {
18948    int test_ret = 0;
18949
18950#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18951    int mem_base;
18952    xmlDocPtr ret_val;
18953    xmlDocPtr doc; /* the document */
18954    int n_doc;
18955    int recursive; /* if not zero do a recursive copy. */
18956    int n_recursive;
18957
18958    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18959    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18960        mem_base = xmlMemBlocks();
18961        doc = gen_xmlDocPtr(n_doc, 0);
18962        recursive = gen_int(n_recursive, 1);
18963
18964        ret_val = xmlCopyDoc(doc, recursive);
18965        desret_xmlDocPtr(ret_val);
18966        call_tests++;
18967        des_xmlDocPtr(n_doc, doc, 0);
18968        des_int(n_recursive, recursive, 1);
18969        xmlResetLastError();
18970        if (mem_base != xmlMemBlocks()) {
18971            printf("Leak of %d blocks found in xmlCopyDoc",
18972	           xmlMemBlocks() - mem_base);
18973	    test_ret++;
18974            printf(" %d", n_doc);
18975            printf(" %d", n_recursive);
18976            printf("\n");
18977        }
18978    }
18979    }
18980    function_tests++;
18981#endif
18982
18983    return(test_ret);
18984}
18985
18986
18987static int
18988test_xmlCopyDtd(void) {
18989    int test_ret = 0;
18990
18991#if defined(LIBXML_TREE_ENABLED)
18992    int mem_base;
18993    xmlDtdPtr ret_val;
18994    xmlDtdPtr dtd; /* the dtd */
18995    int n_dtd;
18996
18997    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18998        mem_base = xmlMemBlocks();
18999        dtd = gen_xmlDtdPtr(n_dtd, 0);
19000
19001        ret_val = xmlCopyDtd(dtd);
19002        desret_xmlDtdPtr(ret_val);
19003        call_tests++;
19004        des_xmlDtdPtr(n_dtd, dtd, 0);
19005        xmlResetLastError();
19006        if (mem_base != xmlMemBlocks()) {
19007            printf("Leak of %d blocks found in xmlCopyDtd",
19008	           xmlMemBlocks() - mem_base);
19009	    test_ret++;
19010            printf(" %d", n_dtd);
19011            printf("\n");
19012        }
19013    }
19014    function_tests++;
19015#endif
19016
19017    return(test_ret);
19018}
19019
19020
19021static int
19022test_xmlCopyNamespace(void) {
19023    int test_ret = 0;
19024
19025    int mem_base;
19026    xmlNsPtr ret_val;
19027    xmlNsPtr cur; /* the namespace */
19028    int n_cur;
19029
19030    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19031        mem_base = xmlMemBlocks();
19032        cur = gen_xmlNsPtr(n_cur, 0);
19033
19034        ret_val = xmlCopyNamespace(cur);
19035        if (ret_val != NULL) xmlFreeNs(ret_val);
19036        desret_xmlNsPtr(ret_val);
19037        call_tests++;
19038        des_xmlNsPtr(n_cur, cur, 0);
19039        xmlResetLastError();
19040        if (mem_base != xmlMemBlocks()) {
19041            printf("Leak of %d blocks found in xmlCopyNamespace",
19042	           xmlMemBlocks() - mem_base);
19043	    test_ret++;
19044            printf(" %d", n_cur);
19045            printf("\n");
19046        }
19047    }
19048    function_tests++;
19049
19050    return(test_ret);
19051}
19052
19053
19054static int
19055test_xmlCopyNamespaceList(void) {
19056    int test_ret = 0;
19057
19058    int mem_base;
19059    xmlNsPtr ret_val;
19060    xmlNsPtr cur; /* the first namespace */
19061    int n_cur;
19062
19063    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19064        mem_base = xmlMemBlocks();
19065        cur = gen_xmlNsPtr(n_cur, 0);
19066
19067        ret_val = xmlCopyNamespaceList(cur);
19068        if (ret_val != NULL) xmlFreeNsList(ret_val);
19069        desret_xmlNsPtr(ret_val);
19070        call_tests++;
19071        des_xmlNsPtr(n_cur, cur, 0);
19072        xmlResetLastError();
19073        if (mem_base != xmlMemBlocks()) {
19074            printf("Leak of %d blocks found in xmlCopyNamespaceList",
19075	           xmlMemBlocks() - mem_base);
19076	    test_ret++;
19077            printf(" %d", n_cur);
19078            printf("\n");
19079        }
19080    }
19081    function_tests++;
19082
19083    return(test_ret);
19084}
19085
19086
19087static int
19088test_xmlCopyNode(void) {
19089    int test_ret = 0;
19090
19091    int mem_base;
19092    xmlNodePtr ret_val;
19093    xmlNodePtr node; /* the node */
19094    int n_node;
19095    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19096    int n_extended;
19097
19098    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19099    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19100        mem_base = xmlMemBlocks();
19101        node = gen_const_xmlNodePtr(n_node, 0);
19102        extended = gen_int(n_extended, 1);
19103
19104        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19105        desret_xmlNodePtr(ret_val);
19106        call_tests++;
19107        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19108        des_int(n_extended, extended, 1);
19109        xmlResetLastError();
19110        if (mem_base != xmlMemBlocks()) {
19111            printf("Leak of %d blocks found in xmlCopyNode",
19112	           xmlMemBlocks() - mem_base);
19113	    test_ret++;
19114            printf(" %d", n_node);
19115            printf(" %d", n_extended);
19116            printf("\n");
19117        }
19118    }
19119    }
19120    function_tests++;
19121
19122    return(test_ret);
19123}
19124
19125
19126static int
19127test_xmlCopyNodeList(void) {
19128    int test_ret = 0;
19129
19130    int mem_base;
19131    xmlNodePtr ret_val;
19132    xmlNodePtr node; /* the first node in the list. */
19133    int n_node;
19134
19135    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19136        mem_base = xmlMemBlocks();
19137        node = gen_const_xmlNodePtr(n_node, 0);
19138
19139        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19140        desret_xmlNodePtr(ret_val);
19141        call_tests++;
19142        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19143        xmlResetLastError();
19144        if (mem_base != xmlMemBlocks()) {
19145            printf("Leak of %d blocks found in xmlCopyNodeList",
19146	           xmlMemBlocks() - mem_base);
19147	    test_ret++;
19148            printf(" %d", n_node);
19149            printf("\n");
19150        }
19151    }
19152    function_tests++;
19153
19154    return(test_ret);
19155}
19156
19157
19158static int
19159test_xmlCopyProp(void) {
19160    int test_ret = 0;
19161
19162    int mem_base;
19163    xmlAttrPtr ret_val;
19164    xmlNodePtr target; /* the element where the attribute will be grafted */
19165    int n_target;
19166    xmlAttrPtr cur; /* the attribute */
19167    int n_cur;
19168
19169    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19170    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19171        mem_base = xmlMemBlocks();
19172        target = gen_xmlNodePtr(n_target, 0);
19173        cur = gen_xmlAttrPtr(n_cur, 1);
19174
19175        ret_val = xmlCopyProp(target, cur);
19176        desret_xmlAttrPtr(ret_val);
19177        call_tests++;
19178        des_xmlNodePtr(n_target, target, 0);
19179        des_xmlAttrPtr(n_cur, cur, 1);
19180        xmlResetLastError();
19181        if (mem_base != xmlMemBlocks()) {
19182            printf("Leak of %d blocks found in xmlCopyProp",
19183	           xmlMemBlocks() - mem_base);
19184	    test_ret++;
19185            printf(" %d", n_target);
19186            printf(" %d", n_cur);
19187            printf("\n");
19188        }
19189    }
19190    }
19191    function_tests++;
19192
19193    return(test_ret);
19194}
19195
19196
19197static int
19198test_xmlCopyPropList(void) {
19199    int test_ret = 0;
19200
19201    int mem_base;
19202    xmlAttrPtr ret_val;
19203    xmlNodePtr target; /* the element where the attributes will be grafted */
19204    int n_target;
19205    xmlAttrPtr cur; /* the first attribute */
19206    int n_cur;
19207
19208    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19209    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19210        mem_base = xmlMemBlocks();
19211        target = gen_xmlNodePtr(n_target, 0);
19212        cur = gen_xmlAttrPtr(n_cur, 1);
19213
19214        ret_val = xmlCopyPropList(target, cur);
19215        desret_xmlAttrPtr(ret_val);
19216        call_tests++;
19217        des_xmlNodePtr(n_target, target, 0);
19218        des_xmlAttrPtr(n_cur, cur, 1);
19219        xmlResetLastError();
19220        if (mem_base != xmlMemBlocks()) {
19221            printf("Leak of %d blocks found in xmlCopyPropList",
19222	           xmlMemBlocks() - mem_base);
19223	    test_ret++;
19224            printf(" %d", n_target);
19225            printf(" %d", n_cur);
19226            printf("\n");
19227        }
19228    }
19229    }
19230    function_tests++;
19231
19232    return(test_ret);
19233}
19234
19235
19236static int
19237test_xmlCreateIntSubset(void) {
19238    int test_ret = 0;
19239
19240    int mem_base;
19241    xmlDtdPtr ret_val;
19242    xmlDocPtr doc; /* the document pointer */
19243    int n_doc;
19244    xmlChar * name; /* the DTD name */
19245    int n_name;
19246    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19247    int n_ExternalID;
19248    xmlChar * SystemID; /* the system ID */
19249    int n_SystemID;
19250
19251    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19252    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19253    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19254    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19255        mem_base = xmlMemBlocks();
19256        doc = gen_xmlDocPtr(n_doc, 0);
19257        name = gen_const_xmlChar_ptr(n_name, 1);
19258        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19259        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19260
19261        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19262        desret_xmlDtdPtr(ret_val);
19263        call_tests++;
19264        des_xmlDocPtr(n_doc, doc, 0);
19265        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19266        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19267        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19268        xmlResetLastError();
19269        if (mem_base != xmlMemBlocks()) {
19270            printf("Leak of %d blocks found in xmlCreateIntSubset",
19271	           xmlMemBlocks() - mem_base);
19272	    test_ret++;
19273            printf(" %d", n_doc);
19274            printf(" %d", n_name);
19275            printf(" %d", n_ExternalID);
19276            printf(" %d", n_SystemID);
19277            printf("\n");
19278        }
19279    }
19280    }
19281    }
19282    }
19283    function_tests++;
19284
19285    return(test_ret);
19286}
19287
19288
19289#define gen_nb_xmlDOMWrapCtxtPtr 1
19290static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19291    return(NULL);
19292}
19293static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19294}
19295
19296static int
19297test_xmlDOMWrapAdoptNode(void) {
19298    int test_ret = 0;
19299
19300    int mem_base;
19301    int ret_val;
19302    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19303    int n_ctxt;
19304    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19305    int n_sourceDoc;
19306    xmlNodePtr node; /* the node to start with */
19307    int n_node;
19308    xmlDocPtr destDoc; /* the destination doc */
19309    int n_destDoc;
19310    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19311    int n_destParent;
19312    int options; /* option flags */
19313    int n_options;
19314
19315    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19316    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19317    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19318    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19319    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19320    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19321        mem_base = xmlMemBlocks();
19322        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19323        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19324        node = gen_xmlNodePtr(n_node, 2);
19325        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19326        destParent = gen_xmlNodePtr(n_destParent, 4);
19327        options = gen_int(n_options, 5);
19328
19329        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19330        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19331        desret_int(ret_val);
19332        call_tests++;
19333        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19334        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19335        des_xmlNodePtr(n_node, node, 2);
19336        des_xmlDocPtr(n_destDoc, destDoc, 3);
19337        des_xmlNodePtr(n_destParent, destParent, 4);
19338        des_int(n_options, options, 5);
19339        xmlResetLastError();
19340        if (mem_base != xmlMemBlocks()) {
19341            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19342	           xmlMemBlocks() - mem_base);
19343	    test_ret++;
19344            printf(" %d", n_ctxt);
19345            printf(" %d", n_sourceDoc);
19346            printf(" %d", n_node);
19347            printf(" %d", n_destDoc);
19348            printf(" %d", n_destParent);
19349            printf(" %d", n_options);
19350            printf("\n");
19351        }
19352    }
19353    }
19354    }
19355    }
19356    }
19357    }
19358    function_tests++;
19359
19360    return(test_ret);
19361}
19362
19363
19364static int
19365test_xmlDOMWrapCloneNode(void) {
19366    int test_ret = 0;
19367
19368    int mem_base;
19369    int ret_val;
19370    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19371    int n_ctxt;
19372    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19373    int n_sourceDoc;
19374    xmlNodePtr node; /* the node to start with */
19375    int n_node;
19376    xmlNodePtr * resNode; /* the clone of the given @node */
19377    int n_resNode;
19378    xmlDocPtr destDoc; /* the destination doc */
19379    int n_destDoc;
19380    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19381    int n_destParent;
19382    int deep; /* descend into child if set */
19383    int n_deep;
19384    int options; /* option flags */
19385    int n_options;
19386
19387    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19388    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19389    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19390    for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19391    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19392    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19393    for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19394    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19395        mem_base = xmlMemBlocks();
19396        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19397        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19398        node = gen_xmlNodePtr(n_node, 2);
19399        resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19400        destDoc = gen_xmlDocPtr(n_destDoc, 4);
19401        destParent = gen_xmlNodePtr(n_destParent, 5);
19402        deep = gen_int(n_deep, 6);
19403        options = gen_int(n_options, 7);
19404
19405        ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19406        desret_int(ret_val);
19407        call_tests++;
19408        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19409        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19410        des_xmlNodePtr(n_node, node, 2);
19411        des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19412        des_xmlDocPtr(n_destDoc, destDoc, 4);
19413        des_xmlNodePtr(n_destParent, destParent, 5);
19414        des_int(n_deep, deep, 6);
19415        des_int(n_options, options, 7);
19416        xmlResetLastError();
19417        if (mem_base != xmlMemBlocks()) {
19418            printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19419	           xmlMemBlocks() - mem_base);
19420	    test_ret++;
19421            printf(" %d", n_ctxt);
19422            printf(" %d", n_sourceDoc);
19423            printf(" %d", n_node);
19424            printf(" %d", n_resNode);
19425            printf(" %d", n_destDoc);
19426            printf(" %d", n_destParent);
19427            printf(" %d", n_deep);
19428            printf(" %d", n_options);
19429            printf("\n");
19430        }
19431    }
19432    }
19433    }
19434    }
19435    }
19436    }
19437    }
19438    }
19439    function_tests++;
19440
19441    return(test_ret);
19442}
19443
19444
19445static int
19446test_xmlDOMWrapNewCtxt(void) {
19447    int test_ret = 0;
19448
19449
19450    /* missing type support */
19451    return(test_ret);
19452}
19453
19454
19455static int
19456test_xmlDOMWrapReconcileNamespaces(void) {
19457    int test_ret = 0;
19458
19459    int mem_base;
19460    int ret_val;
19461    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19462    int n_ctxt;
19463    xmlNodePtr elem; /* the element-node */
19464    int n_elem;
19465    int options; /* option flags */
19466    int n_options;
19467
19468    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19469    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19470    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19471        mem_base = xmlMemBlocks();
19472        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19473        elem = gen_xmlNodePtr(n_elem, 1);
19474        options = gen_int(n_options, 2);
19475
19476        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19477        desret_int(ret_val);
19478        call_tests++;
19479        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19480        des_xmlNodePtr(n_elem, elem, 1);
19481        des_int(n_options, options, 2);
19482        xmlResetLastError();
19483        if (mem_base != xmlMemBlocks()) {
19484            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19485	           xmlMemBlocks() - mem_base);
19486	    test_ret++;
19487            printf(" %d", n_ctxt);
19488            printf(" %d", n_elem);
19489            printf(" %d", n_options);
19490            printf("\n");
19491        }
19492    }
19493    }
19494    }
19495    function_tests++;
19496
19497    return(test_ret);
19498}
19499
19500
19501static int
19502test_xmlDOMWrapRemoveNode(void) {
19503    int test_ret = 0;
19504
19505    int mem_base;
19506    int ret_val;
19507    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19508    int n_ctxt;
19509    xmlDocPtr doc; /* the doc */
19510    int n_doc;
19511    xmlNodePtr node; /* the node to be removed. */
19512    int n_node;
19513    int options; /* set of options, unused at the moment */
19514    int n_options;
19515
19516    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19517    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19518    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19519    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19520        mem_base = xmlMemBlocks();
19521        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19522        doc = gen_xmlDocPtr(n_doc, 1);
19523        node = gen_xmlNodePtr(n_node, 2);
19524        options = gen_int(n_options, 3);
19525
19526        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19527        desret_int(ret_val);
19528        call_tests++;
19529        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19530        des_xmlDocPtr(n_doc, doc, 1);
19531        des_xmlNodePtr(n_node, node, 2);
19532        des_int(n_options, options, 3);
19533        xmlResetLastError();
19534        if (mem_base != xmlMemBlocks()) {
19535            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19536	           xmlMemBlocks() - mem_base);
19537	    test_ret++;
19538            printf(" %d", n_ctxt);
19539            printf(" %d", n_doc);
19540            printf(" %d", n_node);
19541            printf(" %d", n_options);
19542            printf("\n");
19543        }
19544    }
19545    }
19546    }
19547    }
19548    function_tests++;
19549
19550    return(test_ret);
19551}
19552
19553
19554static int
19555test_xmlDocCopyNode(void) {
19556    int test_ret = 0;
19557
19558    int mem_base;
19559    xmlNodePtr ret_val;
19560    xmlNodePtr node; /* the node */
19561    int n_node;
19562    xmlDocPtr doc; /* the document */
19563    int n_doc;
19564    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19565    int n_extended;
19566
19567    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19568    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19569    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19570        mem_base = xmlMemBlocks();
19571        node = gen_const_xmlNodePtr(n_node, 0);
19572        doc = gen_xmlDocPtr(n_doc, 1);
19573        extended = gen_int(n_extended, 2);
19574
19575        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19576        desret_xmlNodePtr(ret_val);
19577        call_tests++;
19578        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19579        des_xmlDocPtr(n_doc, doc, 1);
19580        des_int(n_extended, extended, 2);
19581        xmlResetLastError();
19582        if (mem_base != xmlMemBlocks()) {
19583            printf("Leak of %d blocks found in xmlDocCopyNode",
19584	           xmlMemBlocks() - mem_base);
19585	    test_ret++;
19586            printf(" %d", n_node);
19587            printf(" %d", n_doc);
19588            printf(" %d", n_extended);
19589            printf("\n");
19590        }
19591    }
19592    }
19593    }
19594    function_tests++;
19595
19596    return(test_ret);
19597}
19598
19599
19600static int
19601test_xmlDocCopyNodeList(void) {
19602    int test_ret = 0;
19603
19604    int mem_base;
19605    xmlNodePtr ret_val;
19606    xmlDocPtr doc; /* the target document */
19607    int n_doc;
19608    xmlNodePtr node; /* the first node in the list. */
19609    int n_node;
19610
19611    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19612    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19613        mem_base = xmlMemBlocks();
19614        doc = gen_xmlDocPtr(n_doc, 0);
19615        node = gen_const_xmlNodePtr(n_node, 1);
19616
19617        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19618        desret_xmlNodePtr(ret_val);
19619        call_tests++;
19620        des_xmlDocPtr(n_doc, doc, 0);
19621        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19622        xmlResetLastError();
19623        if (mem_base != xmlMemBlocks()) {
19624            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19625	           xmlMemBlocks() - mem_base);
19626	    test_ret++;
19627            printf(" %d", n_doc);
19628            printf(" %d", n_node);
19629            printf("\n");
19630        }
19631    }
19632    }
19633    function_tests++;
19634
19635    return(test_ret);
19636}
19637
19638
19639static int
19640test_xmlDocDump(void) {
19641    int test_ret = 0;
19642
19643#if defined(LIBXML_OUTPUT_ENABLED)
19644    int mem_base;
19645    int ret_val;
19646    FILE * f; /* the FILE* */
19647    int n_f;
19648    xmlDocPtr cur; /* the document */
19649    int n_cur;
19650
19651    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19652    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19653        mem_base = xmlMemBlocks();
19654        f = gen_FILE_ptr(n_f, 0);
19655        cur = gen_xmlDocPtr(n_cur, 1);
19656
19657        ret_val = xmlDocDump(f, cur);
19658        desret_int(ret_val);
19659        call_tests++;
19660        des_FILE_ptr(n_f, f, 0);
19661        des_xmlDocPtr(n_cur, cur, 1);
19662        xmlResetLastError();
19663        if (mem_base != xmlMemBlocks()) {
19664            printf("Leak of %d blocks found in xmlDocDump",
19665	           xmlMemBlocks() - mem_base);
19666	    test_ret++;
19667            printf(" %d", n_f);
19668            printf(" %d", n_cur);
19669            printf("\n");
19670        }
19671    }
19672    }
19673    function_tests++;
19674#endif
19675
19676    return(test_ret);
19677}
19678
19679
19680static int
19681test_xmlDocDumpFormatMemory(void) {
19682    int test_ret = 0;
19683
19684#if defined(LIBXML_OUTPUT_ENABLED)
19685    int mem_base;
19686    xmlDocPtr cur; /* the document */
19687    int n_cur;
19688    xmlChar ** mem; /* OUT: the memory pointer */
19689    int n_mem;
19690    int * size; /* OUT: the memory length */
19691    int n_size;
19692    int format; /* should formatting spaces been added */
19693    int n_format;
19694
19695    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19696    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19697    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19698    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19699        mem_base = xmlMemBlocks();
19700        cur = gen_xmlDocPtr(n_cur, 0);
19701        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19702        size = gen_int_ptr(n_size, 2);
19703        format = gen_int(n_format, 3);
19704
19705        xmlDocDumpFormatMemory(cur, mem, size, format);
19706        call_tests++;
19707        des_xmlDocPtr(n_cur, cur, 0);
19708        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19709        des_int_ptr(n_size, size, 2);
19710        des_int(n_format, format, 3);
19711        xmlResetLastError();
19712        if (mem_base != xmlMemBlocks()) {
19713            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19714	           xmlMemBlocks() - mem_base);
19715	    test_ret++;
19716            printf(" %d", n_cur);
19717            printf(" %d", n_mem);
19718            printf(" %d", n_size);
19719            printf(" %d", n_format);
19720            printf("\n");
19721        }
19722    }
19723    }
19724    }
19725    }
19726    function_tests++;
19727#endif
19728
19729    return(test_ret);
19730}
19731
19732
19733static int
19734test_xmlDocDumpFormatMemoryEnc(void) {
19735    int test_ret = 0;
19736
19737#if defined(LIBXML_OUTPUT_ENABLED)
19738    int mem_base;
19739    xmlDocPtr out_doc; /* Document to generate XML text from */
19740    int n_out_doc;
19741    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19742    int n_doc_txt_ptr;
19743    int * doc_txt_len; /* Length of the generated XML text */
19744    int n_doc_txt_len;
19745    char * txt_encoding; /* Character encoding to use when generating XML text */
19746    int n_txt_encoding;
19747    int format; /* should formatting spaces been added */
19748    int n_format;
19749
19750    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19751    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19752    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19753    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19754    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19755        mem_base = xmlMemBlocks();
19756        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19757        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19758        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19759        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19760        format = gen_int(n_format, 4);
19761
19762        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19763        call_tests++;
19764        des_xmlDocPtr(n_out_doc, out_doc, 0);
19765        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19766        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19767        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19768        des_int(n_format, format, 4);
19769        xmlResetLastError();
19770        if (mem_base != xmlMemBlocks()) {
19771            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19772	           xmlMemBlocks() - mem_base);
19773	    test_ret++;
19774            printf(" %d", n_out_doc);
19775            printf(" %d", n_doc_txt_ptr);
19776            printf(" %d", n_doc_txt_len);
19777            printf(" %d", n_txt_encoding);
19778            printf(" %d", n_format);
19779            printf("\n");
19780        }
19781    }
19782    }
19783    }
19784    }
19785    }
19786    function_tests++;
19787#endif
19788
19789    return(test_ret);
19790}
19791
19792
19793static int
19794test_xmlDocDumpMemory(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
19806    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19807    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19808    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19809        mem_base = xmlMemBlocks();
19810        cur = gen_xmlDocPtr(n_cur, 0);
19811        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19812        size = gen_int_ptr(n_size, 2);
19813
19814        xmlDocDumpMemory(cur, mem, size);
19815        call_tests++;
19816        des_xmlDocPtr(n_cur, cur, 0);
19817        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19818        des_int_ptr(n_size, size, 2);
19819        xmlResetLastError();
19820        if (mem_base != xmlMemBlocks()) {
19821            printf("Leak of %d blocks found in xmlDocDumpMemory",
19822	           xmlMemBlocks() - mem_base);
19823	    test_ret++;
19824            printf(" %d", n_cur);
19825            printf(" %d", n_mem);
19826            printf(" %d", n_size);
19827            printf("\n");
19828        }
19829    }
19830    }
19831    }
19832    function_tests++;
19833#endif
19834
19835    return(test_ret);
19836}
19837
19838
19839static int
19840test_xmlDocDumpMemoryEnc(void) {
19841    int test_ret = 0;
19842
19843#if defined(LIBXML_OUTPUT_ENABLED)
19844    int mem_base;
19845    xmlDocPtr out_doc; /* Document to generate XML text from */
19846    int n_out_doc;
19847    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19848    int n_doc_txt_ptr;
19849    int * doc_txt_len; /* Length of the generated XML text */
19850    int n_doc_txt_len;
19851    char * txt_encoding; /* Character encoding to use when generating XML text */
19852    int n_txt_encoding;
19853
19854    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19855    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19856    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19857    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19858        mem_base = xmlMemBlocks();
19859        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19860        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19861        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19862        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19863
19864        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19865        call_tests++;
19866        des_xmlDocPtr(n_out_doc, out_doc, 0);
19867        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19868        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19869        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19870        xmlResetLastError();
19871        if (mem_base != xmlMemBlocks()) {
19872            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19873	           xmlMemBlocks() - mem_base);
19874	    test_ret++;
19875            printf(" %d", n_out_doc);
19876            printf(" %d", n_doc_txt_ptr);
19877            printf(" %d", n_doc_txt_len);
19878            printf(" %d", n_txt_encoding);
19879            printf("\n");
19880        }
19881    }
19882    }
19883    }
19884    }
19885    function_tests++;
19886#endif
19887
19888    return(test_ret);
19889}
19890
19891
19892static int
19893test_xmlDocFormatDump(void) {
19894    int test_ret = 0;
19895
19896#if defined(LIBXML_OUTPUT_ENABLED)
19897    int mem_base;
19898    int ret_val;
19899    FILE * f; /* the FILE* */
19900    int n_f;
19901    xmlDocPtr cur; /* the document */
19902    int n_cur;
19903    int format; /* should formatting spaces been added */
19904    int n_format;
19905
19906    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19907    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19908    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19909        mem_base = xmlMemBlocks();
19910        f = gen_FILE_ptr(n_f, 0);
19911        cur = gen_xmlDocPtr(n_cur, 1);
19912        format = gen_int(n_format, 2);
19913
19914        ret_val = xmlDocFormatDump(f, cur, format);
19915        desret_int(ret_val);
19916        call_tests++;
19917        des_FILE_ptr(n_f, f, 0);
19918        des_xmlDocPtr(n_cur, cur, 1);
19919        des_int(n_format, format, 2);
19920        xmlResetLastError();
19921        if (mem_base != xmlMemBlocks()) {
19922            printf("Leak of %d blocks found in xmlDocFormatDump",
19923	           xmlMemBlocks() - mem_base);
19924	    test_ret++;
19925            printf(" %d", n_f);
19926            printf(" %d", n_cur);
19927            printf(" %d", n_format);
19928            printf("\n");
19929        }
19930    }
19931    }
19932    }
19933    function_tests++;
19934#endif
19935
19936    return(test_ret);
19937}
19938
19939
19940static int
19941test_xmlDocGetRootElement(void) {
19942    int test_ret = 0;
19943
19944    int mem_base;
19945    xmlNodePtr ret_val;
19946    xmlDocPtr doc; /* the document */
19947    int n_doc;
19948
19949    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19950        mem_base = xmlMemBlocks();
19951        doc = gen_xmlDocPtr(n_doc, 0);
19952
19953        ret_val = xmlDocGetRootElement(doc);
19954        desret_xmlNodePtr(ret_val);
19955        call_tests++;
19956        des_xmlDocPtr(n_doc, doc, 0);
19957        xmlResetLastError();
19958        if (mem_base != xmlMemBlocks()) {
19959            printf("Leak of %d blocks found in xmlDocGetRootElement",
19960	           xmlMemBlocks() - mem_base);
19961	    test_ret++;
19962            printf(" %d", n_doc);
19963            printf("\n");
19964        }
19965    }
19966    function_tests++;
19967
19968    return(test_ret);
19969}
19970
19971
19972static int
19973test_xmlDocSetRootElement(void) {
19974    int test_ret = 0;
19975
19976#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
19977    int mem_base;
19978    xmlNodePtr ret_val;
19979    xmlDocPtr doc; /* the document */
19980    int n_doc;
19981    xmlNodePtr root; /* the new document root element */
19982    int n_root;
19983
19984    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19985    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
19986        mem_base = xmlMemBlocks();
19987        doc = gen_xmlDocPtr(n_doc, 0);
19988        root = gen_xmlNodePtr_in(n_root, 1);
19989
19990        ret_val = xmlDocSetRootElement(doc, root);
19991        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
19992        desret_xmlNodePtr(ret_val);
19993        call_tests++;
19994        des_xmlDocPtr(n_doc, doc, 0);
19995        des_xmlNodePtr_in(n_root, root, 1);
19996        xmlResetLastError();
19997        if (mem_base != xmlMemBlocks()) {
19998            printf("Leak of %d blocks found in xmlDocSetRootElement",
19999	           xmlMemBlocks() - mem_base);
20000	    test_ret++;
20001            printf(" %d", n_doc);
20002            printf(" %d", n_root);
20003            printf("\n");
20004        }
20005    }
20006    }
20007    function_tests++;
20008#endif
20009
20010    return(test_ret);
20011}
20012
20013
20014static int
20015test_xmlElemDump(void) {
20016    int test_ret = 0;
20017
20018#if defined(LIBXML_OUTPUT_ENABLED)
20019    int mem_base;
20020    FILE * f; /* the FILE * for the output */
20021    int n_f;
20022    xmlDocPtr doc; /* the document */
20023    int n_doc;
20024    xmlNodePtr cur; /* the current node */
20025    int n_cur;
20026
20027    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20028    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20029    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20030        mem_base = xmlMemBlocks();
20031        f = gen_FILE_ptr(n_f, 0);
20032        doc = gen_xmlDocPtr(n_doc, 1);
20033        cur = gen_xmlNodePtr(n_cur, 2);
20034
20035        xmlElemDump(f, doc, cur);
20036        call_tests++;
20037        des_FILE_ptr(n_f, f, 0);
20038        des_xmlDocPtr(n_doc, doc, 1);
20039        des_xmlNodePtr(n_cur, cur, 2);
20040        xmlResetLastError();
20041        if (mem_base != xmlMemBlocks()) {
20042            printf("Leak of %d blocks found in xmlElemDump",
20043	           xmlMemBlocks() - mem_base);
20044	    test_ret++;
20045            printf(" %d", n_f);
20046            printf(" %d", n_doc);
20047            printf(" %d", n_cur);
20048            printf("\n");
20049        }
20050    }
20051    }
20052    }
20053    function_tests++;
20054#endif
20055
20056    return(test_ret);
20057}
20058
20059
20060static int
20061test_xmlGetBufferAllocationScheme(void) {
20062    int test_ret = 0;
20063
20064    int mem_base;
20065    xmlBufferAllocationScheme ret_val;
20066
20067        mem_base = xmlMemBlocks();
20068
20069        ret_val = xmlGetBufferAllocationScheme();
20070        desret_xmlBufferAllocationScheme(ret_val);
20071        call_tests++;
20072        xmlResetLastError();
20073        if (mem_base != xmlMemBlocks()) {
20074            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20075	           xmlMemBlocks() - mem_base);
20076	    test_ret++;
20077            printf("\n");
20078        }
20079    function_tests++;
20080
20081    return(test_ret);
20082}
20083
20084
20085static int
20086test_xmlGetCompressMode(void) {
20087    int test_ret = 0;
20088
20089    int mem_base;
20090    int ret_val;
20091
20092        mem_base = xmlMemBlocks();
20093
20094        ret_val = xmlGetCompressMode();
20095        desret_int(ret_val);
20096        call_tests++;
20097        xmlResetLastError();
20098        if (mem_base != xmlMemBlocks()) {
20099            printf("Leak of %d blocks found in xmlGetCompressMode",
20100	           xmlMemBlocks() - mem_base);
20101	    test_ret++;
20102            printf("\n");
20103        }
20104    function_tests++;
20105
20106    return(test_ret);
20107}
20108
20109
20110static int
20111test_xmlGetDocCompressMode(void) {
20112    int test_ret = 0;
20113
20114    int mem_base;
20115    int ret_val;
20116    xmlDocPtr doc; /* the document */
20117    int n_doc;
20118
20119    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20120        mem_base = xmlMemBlocks();
20121        doc = gen_xmlDocPtr(n_doc, 0);
20122
20123        ret_val = xmlGetDocCompressMode(doc);
20124        desret_int(ret_val);
20125        call_tests++;
20126        des_xmlDocPtr(n_doc, doc, 0);
20127        xmlResetLastError();
20128        if (mem_base != xmlMemBlocks()) {
20129            printf("Leak of %d blocks found in xmlGetDocCompressMode",
20130	           xmlMemBlocks() - mem_base);
20131	    test_ret++;
20132            printf(" %d", n_doc);
20133            printf("\n");
20134        }
20135    }
20136    function_tests++;
20137
20138    return(test_ret);
20139}
20140
20141
20142static int
20143test_xmlGetIntSubset(void) {
20144    int test_ret = 0;
20145
20146    int mem_base;
20147    xmlDtdPtr ret_val;
20148    xmlDocPtr doc; /* the document pointer */
20149    int n_doc;
20150
20151    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20152        mem_base = xmlMemBlocks();
20153        doc = gen_xmlDocPtr(n_doc, 0);
20154
20155        ret_val = xmlGetIntSubset(doc);
20156        desret_xmlDtdPtr(ret_val);
20157        call_tests++;
20158        des_xmlDocPtr(n_doc, doc, 0);
20159        xmlResetLastError();
20160        if (mem_base != xmlMemBlocks()) {
20161            printf("Leak of %d blocks found in xmlGetIntSubset",
20162	           xmlMemBlocks() - mem_base);
20163	    test_ret++;
20164            printf(" %d", n_doc);
20165            printf("\n");
20166        }
20167    }
20168    function_tests++;
20169
20170    return(test_ret);
20171}
20172
20173
20174static int
20175test_xmlGetLastChild(void) {
20176    int test_ret = 0;
20177
20178    int mem_base;
20179    xmlNodePtr ret_val;
20180    xmlNodePtr parent; /* the parent node */
20181    int n_parent;
20182
20183    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20184        mem_base = xmlMemBlocks();
20185        parent = gen_xmlNodePtr(n_parent, 0);
20186
20187        ret_val = xmlGetLastChild(parent);
20188        desret_xmlNodePtr(ret_val);
20189        call_tests++;
20190        des_xmlNodePtr(n_parent, parent, 0);
20191        xmlResetLastError();
20192        if (mem_base != xmlMemBlocks()) {
20193            printf("Leak of %d blocks found in xmlGetLastChild",
20194	           xmlMemBlocks() - mem_base);
20195	    test_ret++;
20196            printf(" %d", n_parent);
20197            printf("\n");
20198        }
20199    }
20200    function_tests++;
20201
20202    return(test_ret);
20203}
20204
20205
20206static int
20207test_xmlGetLineNo(void) {
20208    int test_ret = 0;
20209
20210    int mem_base;
20211    long ret_val;
20212    xmlNodePtr node; /* valid node */
20213    int n_node;
20214
20215    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20216        mem_base = xmlMemBlocks();
20217        node = gen_xmlNodePtr(n_node, 0);
20218
20219        ret_val = xmlGetLineNo(node);
20220        desret_long(ret_val);
20221        call_tests++;
20222        des_xmlNodePtr(n_node, node, 0);
20223        xmlResetLastError();
20224        if (mem_base != xmlMemBlocks()) {
20225            printf("Leak of %d blocks found in xmlGetLineNo",
20226	           xmlMemBlocks() - mem_base);
20227	    test_ret++;
20228            printf(" %d", n_node);
20229            printf("\n");
20230        }
20231    }
20232    function_tests++;
20233
20234    return(test_ret);
20235}
20236
20237
20238static int
20239test_xmlGetNoNsProp(void) {
20240    int test_ret = 0;
20241
20242    int mem_base;
20243    xmlChar * ret_val;
20244    xmlNodePtr node; /* the node */
20245    int n_node;
20246    xmlChar * name; /* the attribute name */
20247    int n_name;
20248
20249    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20250    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20251        mem_base = xmlMemBlocks();
20252        node = gen_xmlNodePtr(n_node, 0);
20253        name = gen_const_xmlChar_ptr(n_name, 1);
20254
20255        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20256        desret_xmlChar_ptr(ret_val);
20257        call_tests++;
20258        des_xmlNodePtr(n_node, node, 0);
20259        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20260        xmlResetLastError();
20261        if (mem_base != xmlMemBlocks()) {
20262            printf("Leak of %d blocks found in xmlGetNoNsProp",
20263	           xmlMemBlocks() - mem_base);
20264	    test_ret++;
20265            printf(" %d", n_node);
20266            printf(" %d", n_name);
20267            printf("\n");
20268        }
20269    }
20270    }
20271    function_tests++;
20272
20273    return(test_ret);
20274}
20275
20276
20277static int
20278test_xmlGetNodePath(void) {
20279    int test_ret = 0;
20280
20281#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20282    int mem_base;
20283    xmlChar * ret_val;
20284    xmlNodePtr node; /* a node */
20285    int n_node;
20286
20287    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20288        mem_base = xmlMemBlocks();
20289        node = gen_xmlNodePtr(n_node, 0);
20290
20291        ret_val = xmlGetNodePath(node);
20292        desret_xmlChar_ptr(ret_val);
20293        call_tests++;
20294        des_xmlNodePtr(n_node, node, 0);
20295        xmlResetLastError();
20296        if (mem_base != xmlMemBlocks()) {
20297            printf("Leak of %d blocks found in xmlGetNodePath",
20298	           xmlMemBlocks() - mem_base);
20299	    test_ret++;
20300            printf(" %d", n_node);
20301            printf("\n");
20302        }
20303    }
20304    function_tests++;
20305#endif
20306
20307    return(test_ret);
20308}
20309
20310
20311static int
20312test_xmlGetNsList(void) {
20313    int test_ret = 0;
20314
20315
20316    /* missing type support */
20317    return(test_ret);
20318}
20319
20320
20321static int
20322test_xmlGetNsProp(void) {
20323    int test_ret = 0;
20324
20325    int mem_base;
20326    xmlChar * ret_val;
20327    xmlNodePtr node; /* the node */
20328    int n_node;
20329    xmlChar * name; /* the attribute name */
20330    int n_name;
20331    xmlChar * nameSpace; /* the URI of the namespace */
20332    int n_nameSpace;
20333
20334    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20335    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20336    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20337        mem_base = xmlMemBlocks();
20338        node = gen_xmlNodePtr(n_node, 0);
20339        name = gen_const_xmlChar_ptr(n_name, 1);
20340        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20341
20342        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20343        desret_xmlChar_ptr(ret_val);
20344        call_tests++;
20345        des_xmlNodePtr(n_node, node, 0);
20346        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20347        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20348        xmlResetLastError();
20349        if (mem_base != xmlMemBlocks()) {
20350            printf("Leak of %d blocks found in xmlGetNsProp",
20351	           xmlMemBlocks() - mem_base);
20352	    test_ret++;
20353            printf(" %d", n_node);
20354            printf(" %d", n_name);
20355            printf(" %d", n_nameSpace);
20356            printf("\n");
20357        }
20358    }
20359    }
20360    }
20361    function_tests++;
20362
20363    return(test_ret);
20364}
20365
20366
20367static int
20368test_xmlGetProp(void) {
20369    int test_ret = 0;
20370
20371    int mem_base;
20372    xmlChar * ret_val;
20373    xmlNodePtr node; /* the node */
20374    int n_node;
20375    xmlChar * name; /* the attribute name */
20376    int n_name;
20377
20378    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20379    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20380        mem_base = xmlMemBlocks();
20381        node = gen_xmlNodePtr(n_node, 0);
20382        name = gen_const_xmlChar_ptr(n_name, 1);
20383
20384        ret_val = xmlGetProp(node, (const xmlChar *)name);
20385        desret_xmlChar_ptr(ret_val);
20386        call_tests++;
20387        des_xmlNodePtr(n_node, node, 0);
20388        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20389        xmlResetLastError();
20390        if (mem_base != xmlMemBlocks()) {
20391            printf("Leak of %d blocks found in xmlGetProp",
20392	           xmlMemBlocks() - mem_base);
20393	    test_ret++;
20394            printf(" %d", n_node);
20395            printf(" %d", n_name);
20396            printf("\n");
20397        }
20398    }
20399    }
20400    function_tests++;
20401
20402    return(test_ret);
20403}
20404
20405
20406static int
20407test_xmlHasNsProp(void) {
20408    int test_ret = 0;
20409
20410    int mem_base;
20411    xmlAttrPtr ret_val;
20412    xmlNodePtr node; /* the node */
20413    int n_node;
20414    xmlChar * name; /* the attribute name */
20415    int n_name;
20416    xmlChar * nameSpace; /* the URI of the namespace */
20417    int n_nameSpace;
20418
20419    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20420    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20421    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20422        mem_base = xmlMemBlocks();
20423        node = gen_xmlNodePtr(n_node, 0);
20424        name = gen_const_xmlChar_ptr(n_name, 1);
20425        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20426
20427        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20428        desret_xmlAttrPtr(ret_val);
20429        call_tests++;
20430        des_xmlNodePtr(n_node, node, 0);
20431        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20432        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20433        xmlResetLastError();
20434        if (mem_base != xmlMemBlocks()) {
20435            printf("Leak of %d blocks found in xmlHasNsProp",
20436	           xmlMemBlocks() - mem_base);
20437	    test_ret++;
20438            printf(" %d", n_node);
20439            printf(" %d", n_name);
20440            printf(" %d", n_nameSpace);
20441            printf("\n");
20442        }
20443    }
20444    }
20445    }
20446    function_tests++;
20447
20448    return(test_ret);
20449}
20450
20451
20452static int
20453test_xmlHasProp(void) {
20454    int test_ret = 0;
20455
20456    int mem_base;
20457    xmlAttrPtr ret_val;
20458    xmlNodePtr node; /* the node */
20459    int n_node;
20460    xmlChar * name; /* the attribute name */
20461    int n_name;
20462
20463    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20464    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20465        mem_base = xmlMemBlocks();
20466        node = gen_xmlNodePtr(n_node, 0);
20467        name = gen_const_xmlChar_ptr(n_name, 1);
20468
20469        ret_val = xmlHasProp(node, (const xmlChar *)name);
20470        desret_xmlAttrPtr(ret_val);
20471        call_tests++;
20472        des_xmlNodePtr(n_node, node, 0);
20473        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20474        xmlResetLastError();
20475        if (mem_base != xmlMemBlocks()) {
20476            printf("Leak of %d blocks found in xmlHasProp",
20477	           xmlMemBlocks() - mem_base);
20478	    test_ret++;
20479            printf(" %d", n_node);
20480            printf(" %d", n_name);
20481            printf("\n");
20482        }
20483    }
20484    }
20485    function_tests++;
20486
20487    return(test_ret);
20488}
20489
20490
20491static int
20492test_xmlIsBlankNode(void) {
20493    int test_ret = 0;
20494
20495    int mem_base;
20496    int ret_val;
20497    xmlNodePtr node; /* the node */
20498    int n_node;
20499
20500    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20501        mem_base = xmlMemBlocks();
20502        node = gen_xmlNodePtr(n_node, 0);
20503
20504        ret_val = xmlIsBlankNode(node);
20505        desret_int(ret_val);
20506        call_tests++;
20507        des_xmlNodePtr(n_node, node, 0);
20508        xmlResetLastError();
20509        if (mem_base != xmlMemBlocks()) {
20510            printf("Leak of %d blocks found in xmlIsBlankNode",
20511	           xmlMemBlocks() - mem_base);
20512	    test_ret++;
20513            printf(" %d", n_node);
20514            printf("\n");
20515        }
20516    }
20517    function_tests++;
20518
20519    return(test_ret);
20520}
20521
20522
20523static int
20524test_xmlIsXHTML(void) {
20525    int test_ret = 0;
20526
20527    int mem_base;
20528    int ret_val;
20529    xmlChar * systemID; /* the system identifier */
20530    int n_systemID;
20531    xmlChar * publicID; /* the public identifier */
20532    int n_publicID;
20533
20534    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20535    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20536        mem_base = xmlMemBlocks();
20537        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20538        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20539
20540        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20541        desret_int(ret_val);
20542        call_tests++;
20543        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20544        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20545        xmlResetLastError();
20546        if (mem_base != xmlMemBlocks()) {
20547            printf("Leak of %d blocks found in xmlIsXHTML",
20548	           xmlMemBlocks() - mem_base);
20549	    test_ret++;
20550            printf(" %d", n_systemID);
20551            printf(" %d", n_publicID);
20552            printf("\n");
20553        }
20554    }
20555    }
20556    function_tests++;
20557
20558    return(test_ret);
20559}
20560
20561
20562static int
20563test_xmlNewCDataBlock(void) {
20564    int test_ret = 0;
20565
20566    int mem_base;
20567    xmlNodePtr ret_val;
20568    xmlDocPtr doc; /* the document */
20569    int n_doc;
20570    xmlChar * content; /* the CDATA block content content */
20571    int n_content;
20572    int len; /* the length of the block */
20573    int n_len;
20574
20575    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20576    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20577    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20578        mem_base = xmlMemBlocks();
20579        doc = gen_xmlDocPtr(n_doc, 0);
20580        content = gen_const_xmlChar_ptr(n_content, 1);
20581        len = gen_int(n_len, 2);
20582
20583        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20584        desret_xmlNodePtr(ret_val);
20585        call_tests++;
20586        des_xmlDocPtr(n_doc, doc, 0);
20587        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20588        des_int(n_len, len, 2);
20589        xmlResetLastError();
20590        if (mem_base != xmlMemBlocks()) {
20591            printf("Leak of %d blocks found in xmlNewCDataBlock",
20592	           xmlMemBlocks() - mem_base);
20593	    test_ret++;
20594            printf(" %d", n_doc);
20595            printf(" %d", n_content);
20596            printf(" %d", n_len);
20597            printf("\n");
20598        }
20599    }
20600    }
20601    }
20602    function_tests++;
20603
20604    return(test_ret);
20605}
20606
20607
20608static int
20609test_xmlNewCharRef(void) {
20610    int test_ret = 0;
20611
20612    int mem_base;
20613    xmlNodePtr ret_val;
20614    xmlDocPtr doc; /* the document */
20615    int n_doc;
20616    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20617    int n_name;
20618
20619    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20620    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20621        mem_base = xmlMemBlocks();
20622        doc = gen_xmlDocPtr(n_doc, 0);
20623        name = gen_const_xmlChar_ptr(n_name, 1);
20624
20625        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20626        desret_xmlNodePtr(ret_val);
20627        call_tests++;
20628        des_xmlDocPtr(n_doc, doc, 0);
20629        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20630        xmlResetLastError();
20631        if (mem_base != xmlMemBlocks()) {
20632            printf("Leak of %d blocks found in xmlNewCharRef",
20633	           xmlMemBlocks() - mem_base);
20634	    test_ret++;
20635            printf(" %d", n_doc);
20636            printf(" %d", n_name);
20637            printf("\n");
20638        }
20639    }
20640    }
20641    function_tests++;
20642
20643    return(test_ret);
20644}
20645
20646
20647static int
20648test_xmlNewChild(void) {
20649    int test_ret = 0;
20650
20651#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20652#ifdef LIBXML_TREE_ENABLED
20653    int mem_base;
20654    xmlNodePtr ret_val;
20655    xmlNodePtr parent; /* the parent node */
20656    int n_parent;
20657    xmlNsPtr ns; /* a namespace if any */
20658    int n_ns;
20659    xmlChar * name; /* the name of the child */
20660    int n_name;
20661    xmlChar * content; /* the XML content of the child if any. */
20662    int n_content;
20663
20664    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20665    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20666    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20667    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20668        mem_base = xmlMemBlocks();
20669        parent = gen_xmlNodePtr(n_parent, 0);
20670        ns = gen_xmlNsPtr(n_ns, 1);
20671        name = gen_const_xmlChar_ptr(n_name, 2);
20672        content = gen_const_xmlChar_ptr(n_content, 3);
20673
20674        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20675        desret_xmlNodePtr(ret_val);
20676        call_tests++;
20677        des_xmlNodePtr(n_parent, parent, 0);
20678        des_xmlNsPtr(n_ns, ns, 1);
20679        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20680        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20681        xmlResetLastError();
20682        if (mem_base != xmlMemBlocks()) {
20683            printf("Leak of %d blocks found in xmlNewChild",
20684	           xmlMemBlocks() - mem_base);
20685	    test_ret++;
20686            printf(" %d", n_parent);
20687            printf(" %d", n_ns);
20688            printf(" %d", n_name);
20689            printf(" %d", n_content);
20690            printf("\n");
20691        }
20692    }
20693    }
20694    }
20695    }
20696    function_tests++;
20697#endif
20698#endif
20699
20700    return(test_ret);
20701}
20702
20703
20704static int
20705test_xmlNewComment(void) {
20706    int test_ret = 0;
20707
20708    int mem_base;
20709    xmlNodePtr ret_val;
20710    xmlChar * content; /* the comment content */
20711    int n_content;
20712
20713    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20714        mem_base = xmlMemBlocks();
20715        content = gen_const_xmlChar_ptr(n_content, 0);
20716
20717        ret_val = xmlNewComment((const xmlChar *)content);
20718        desret_xmlNodePtr(ret_val);
20719        call_tests++;
20720        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20721        xmlResetLastError();
20722        if (mem_base != xmlMemBlocks()) {
20723            printf("Leak of %d blocks found in xmlNewComment",
20724	           xmlMemBlocks() - mem_base);
20725	    test_ret++;
20726            printf(" %d", n_content);
20727            printf("\n");
20728        }
20729    }
20730    function_tests++;
20731
20732    return(test_ret);
20733}
20734
20735
20736static int
20737test_xmlNewDoc(void) {
20738    int test_ret = 0;
20739
20740    int mem_base;
20741    xmlDocPtr ret_val;
20742    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20743    int n_version;
20744
20745    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20746        mem_base = xmlMemBlocks();
20747        version = gen_const_xmlChar_ptr(n_version, 0);
20748
20749        ret_val = xmlNewDoc((const xmlChar *)version);
20750        desret_xmlDocPtr(ret_val);
20751        call_tests++;
20752        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20753        xmlResetLastError();
20754        if (mem_base != xmlMemBlocks()) {
20755            printf("Leak of %d blocks found in xmlNewDoc",
20756	           xmlMemBlocks() - mem_base);
20757	    test_ret++;
20758            printf(" %d", n_version);
20759            printf("\n");
20760        }
20761    }
20762    function_tests++;
20763
20764    return(test_ret);
20765}
20766
20767
20768static int
20769test_xmlNewDocComment(void) {
20770    int test_ret = 0;
20771
20772    int mem_base;
20773    xmlNodePtr ret_val;
20774    xmlDocPtr doc; /* the document */
20775    int n_doc;
20776    xmlChar * content; /* the comment content */
20777    int n_content;
20778
20779    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20780    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20781        mem_base = xmlMemBlocks();
20782        doc = gen_xmlDocPtr(n_doc, 0);
20783        content = gen_const_xmlChar_ptr(n_content, 1);
20784
20785        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20786        desret_xmlNodePtr(ret_val);
20787        call_tests++;
20788        des_xmlDocPtr(n_doc, doc, 0);
20789        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20790        xmlResetLastError();
20791        if (mem_base != xmlMemBlocks()) {
20792            printf("Leak of %d blocks found in xmlNewDocComment",
20793	           xmlMemBlocks() - mem_base);
20794	    test_ret++;
20795            printf(" %d", n_doc);
20796            printf(" %d", n_content);
20797            printf("\n");
20798        }
20799    }
20800    }
20801    function_tests++;
20802
20803    return(test_ret);
20804}
20805
20806
20807static int
20808test_xmlNewDocFragment(void) {
20809    int test_ret = 0;
20810
20811#if defined(LIBXML_TREE_ENABLED)
20812    int mem_base;
20813    xmlNodePtr ret_val;
20814    xmlDocPtr doc; /* the document owning the fragment */
20815    int n_doc;
20816
20817    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20818        mem_base = xmlMemBlocks();
20819        doc = gen_xmlDocPtr(n_doc, 0);
20820
20821        ret_val = xmlNewDocFragment(doc);
20822        desret_xmlNodePtr(ret_val);
20823        call_tests++;
20824        des_xmlDocPtr(n_doc, doc, 0);
20825        xmlResetLastError();
20826        if (mem_base != xmlMemBlocks()) {
20827            printf("Leak of %d blocks found in xmlNewDocFragment",
20828	           xmlMemBlocks() - mem_base);
20829	    test_ret++;
20830            printf(" %d", n_doc);
20831            printf("\n");
20832        }
20833    }
20834    function_tests++;
20835#endif
20836
20837    return(test_ret);
20838}
20839
20840
20841static int
20842test_xmlNewDocNode(void) {
20843    int test_ret = 0;
20844
20845    int mem_base;
20846    xmlNodePtr ret_val;
20847    xmlDocPtr doc; /* the document */
20848    int n_doc;
20849    xmlNsPtr ns; /* namespace if any */
20850    int n_ns;
20851    xmlChar * name; /* the node name */
20852    int n_name;
20853    xmlChar * content; /* the XML text content if any */
20854    int n_content;
20855
20856    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20857    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20858    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20859    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20860        mem_base = xmlMemBlocks();
20861        doc = gen_xmlDocPtr(n_doc, 0);
20862        ns = gen_xmlNsPtr(n_ns, 1);
20863        name = gen_const_xmlChar_ptr(n_name, 2);
20864        content = gen_const_xmlChar_ptr(n_content, 3);
20865
20866        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20867        desret_xmlNodePtr(ret_val);
20868        call_tests++;
20869        des_xmlDocPtr(n_doc, doc, 0);
20870        des_xmlNsPtr(n_ns, ns, 1);
20871        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20872        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20873        xmlResetLastError();
20874        if (mem_base != xmlMemBlocks()) {
20875            printf("Leak of %d blocks found in xmlNewDocNode",
20876	           xmlMemBlocks() - mem_base);
20877	    test_ret++;
20878            printf(" %d", n_doc);
20879            printf(" %d", n_ns);
20880            printf(" %d", n_name);
20881            printf(" %d", n_content);
20882            printf("\n");
20883        }
20884    }
20885    }
20886    }
20887    }
20888    function_tests++;
20889
20890    return(test_ret);
20891}
20892
20893
20894static int
20895test_xmlNewDocNodeEatName(void) {
20896    int test_ret = 0;
20897
20898    int mem_base;
20899    xmlNodePtr ret_val;
20900    xmlDocPtr doc; /* the document */
20901    int n_doc;
20902    xmlNsPtr ns; /* namespace if any */
20903    int n_ns;
20904    xmlChar * name; /* the node name */
20905    int n_name;
20906    xmlChar * content; /* the XML text content if any */
20907    int n_content;
20908
20909    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20910    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20911    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20912    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20913        mem_base = xmlMemBlocks();
20914        doc = gen_xmlDocPtr(n_doc, 0);
20915        ns = gen_xmlNsPtr(n_ns, 1);
20916        name = gen_eaten_name(n_name, 2);
20917        content = gen_const_xmlChar_ptr(n_content, 3);
20918
20919        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
20920        desret_xmlNodePtr(ret_val);
20921        call_tests++;
20922        des_xmlDocPtr(n_doc, doc, 0);
20923        des_xmlNsPtr(n_ns, ns, 1);
20924        des_eaten_name(n_name, name, 2);
20925        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20926        xmlResetLastError();
20927        if (mem_base != xmlMemBlocks()) {
20928            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20929	           xmlMemBlocks() - mem_base);
20930	    test_ret++;
20931            printf(" %d", n_doc);
20932            printf(" %d", n_ns);
20933            printf(" %d", n_name);
20934            printf(" %d", n_content);
20935            printf("\n");
20936        }
20937    }
20938    }
20939    }
20940    }
20941    function_tests++;
20942
20943    return(test_ret);
20944}
20945
20946
20947static int
20948test_xmlNewDocPI(void) {
20949    int test_ret = 0;
20950
20951    int mem_base;
20952    xmlNodePtr ret_val;
20953    xmlDocPtr doc; /* the target document */
20954    int n_doc;
20955    xmlChar * name; /* the processing instruction name */
20956    int n_name;
20957    xmlChar * content; /* the PI content */
20958    int n_content;
20959
20960    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20961    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20962    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20963        mem_base = xmlMemBlocks();
20964        doc = gen_xmlDocPtr(n_doc, 0);
20965        name = gen_const_xmlChar_ptr(n_name, 1);
20966        content = gen_const_xmlChar_ptr(n_content, 2);
20967
20968        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
20969        desret_xmlNodePtr(ret_val);
20970        call_tests++;
20971        des_xmlDocPtr(n_doc, doc, 0);
20972        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20973        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
20974        xmlResetLastError();
20975        if (mem_base != xmlMemBlocks()) {
20976            printf("Leak of %d blocks found in xmlNewDocPI",
20977	           xmlMemBlocks() - mem_base);
20978	    test_ret++;
20979            printf(" %d", n_doc);
20980            printf(" %d", n_name);
20981            printf(" %d", n_content);
20982            printf("\n");
20983        }
20984    }
20985    }
20986    }
20987    function_tests++;
20988
20989    return(test_ret);
20990}
20991
20992
20993static int
20994test_xmlNewDocProp(void) {
20995    int test_ret = 0;
20996
20997    int mem_base;
20998    xmlAttrPtr ret_val;
20999    xmlDocPtr doc; /* the document */
21000    int n_doc;
21001    xmlChar * name; /* the name of the attribute */
21002    int n_name;
21003    xmlChar * value; /* the value of the attribute */
21004    int n_value;
21005
21006    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21007    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21008    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21009        mem_base = xmlMemBlocks();
21010        doc = gen_xmlDocPtr(n_doc, 0);
21011        name = gen_const_xmlChar_ptr(n_name, 1);
21012        value = gen_const_xmlChar_ptr(n_value, 2);
21013
21014        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21015        desret_xmlAttrPtr(ret_val);
21016        call_tests++;
21017        des_xmlDocPtr(n_doc, doc, 0);
21018        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21019        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21020        xmlResetLastError();
21021        if (mem_base != xmlMemBlocks()) {
21022            printf("Leak of %d blocks found in xmlNewDocProp",
21023	           xmlMemBlocks() - mem_base);
21024	    test_ret++;
21025            printf(" %d", n_doc);
21026            printf(" %d", n_name);
21027            printf(" %d", n_value);
21028            printf("\n");
21029        }
21030    }
21031    }
21032    }
21033    function_tests++;
21034
21035    return(test_ret);
21036}
21037
21038
21039static int
21040test_xmlNewDocRawNode(void) {
21041    int test_ret = 0;
21042
21043#if defined(LIBXML_TREE_ENABLED)
21044#ifdef LIBXML_TREE_ENABLED
21045    int mem_base;
21046    xmlNodePtr ret_val;
21047    xmlDocPtr doc; /* the document */
21048    int n_doc;
21049    xmlNsPtr ns; /* namespace if any */
21050    int n_ns;
21051    xmlChar * name; /* the node name */
21052    int n_name;
21053    xmlChar * content; /* the text content if any */
21054    int n_content;
21055
21056    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21057    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21058    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21059    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21060        mem_base = xmlMemBlocks();
21061        doc = gen_xmlDocPtr(n_doc, 0);
21062        ns = gen_xmlNsPtr(n_ns, 1);
21063        name = gen_const_xmlChar_ptr(n_name, 2);
21064        content = gen_const_xmlChar_ptr(n_content, 3);
21065
21066        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21067        desret_xmlNodePtr(ret_val);
21068        call_tests++;
21069        des_xmlDocPtr(n_doc, doc, 0);
21070        des_xmlNsPtr(n_ns, ns, 1);
21071        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21072        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21073        xmlResetLastError();
21074        if (mem_base != xmlMemBlocks()) {
21075            printf("Leak of %d blocks found in xmlNewDocRawNode",
21076	           xmlMemBlocks() - mem_base);
21077	    test_ret++;
21078            printf(" %d", n_doc);
21079            printf(" %d", n_ns);
21080            printf(" %d", n_name);
21081            printf(" %d", n_content);
21082            printf("\n");
21083        }
21084    }
21085    }
21086    }
21087    }
21088    function_tests++;
21089#endif
21090#endif
21091
21092    return(test_ret);
21093}
21094
21095
21096static int
21097test_xmlNewDocText(void) {
21098    int test_ret = 0;
21099
21100    int mem_base;
21101    xmlNodePtr ret_val;
21102    xmlDocPtr doc; /* the document */
21103    int n_doc;
21104    xmlChar * content; /* the text content */
21105    int n_content;
21106
21107    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21108    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21109        mem_base = xmlMemBlocks();
21110        doc = gen_xmlDocPtr(n_doc, 0);
21111        content = gen_const_xmlChar_ptr(n_content, 1);
21112
21113        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21114        desret_xmlNodePtr(ret_val);
21115        call_tests++;
21116        des_xmlDocPtr(n_doc, doc, 0);
21117        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21118        xmlResetLastError();
21119        if (mem_base != xmlMemBlocks()) {
21120            printf("Leak of %d blocks found in xmlNewDocText",
21121	           xmlMemBlocks() - mem_base);
21122	    test_ret++;
21123            printf(" %d", n_doc);
21124            printf(" %d", n_content);
21125            printf("\n");
21126        }
21127    }
21128    }
21129    function_tests++;
21130
21131    return(test_ret);
21132}
21133
21134
21135static int
21136test_xmlNewDocTextLen(void) {
21137    int test_ret = 0;
21138
21139    int mem_base;
21140    xmlNodePtr ret_val;
21141    xmlDocPtr doc; /* the document */
21142    int n_doc;
21143    xmlChar * content; /* the text content */
21144    int n_content;
21145    int len; /* the text len. */
21146    int n_len;
21147
21148    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21149    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21150    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21151        mem_base = xmlMemBlocks();
21152        doc = gen_xmlDocPtr(n_doc, 0);
21153        content = gen_const_xmlChar_ptr(n_content, 1);
21154        len = gen_int(n_len, 2);
21155
21156        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21157        desret_xmlNodePtr(ret_val);
21158        call_tests++;
21159        des_xmlDocPtr(n_doc, doc, 0);
21160        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21161        des_int(n_len, len, 2);
21162        xmlResetLastError();
21163        if (mem_base != xmlMemBlocks()) {
21164            printf("Leak of %d blocks found in xmlNewDocTextLen",
21165	           xmlMemBlocks() - mem_base);
21166	    test_ret++;
21167            printf(" %d", n_doc);
21168            printf(" %d", n_content);
21169            printf(" %d", n_len);
21170            printf("\n");
21171        }
21172    }
21173    }
21174    }
21175    function_tests++;
21176
21177    return(test_ret);
21178}
21179
21180
21181static int
21182test_xmlNewDtd(void) {
21183    int test_ret = 0;
21184
21185    int mem_base;
21186    xmlDtdPtr ret_val;
21187    xmlDocPtr doc; /* the document pointer */
21188    int n_doc;
21189    xmlChar * name; /* the DTD name */
21190    int n_name;
21191    xmlChar * ExternalID; /* the external ID */
21192    int n_ExternalID;
21193    xmlChar * SystemID; /* the system ID */
21194    int n_SystemID;
21195
21196    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21197    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21198    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21199    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21200        mem_base = xmlMemBlocks();
21201        doc = gen_xmlDocPtr(n_doc, 0);
21202        name = gen_const_xmlChar_ptr(n_name, 1);
21203        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21204        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21205
21206        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21207        desret_xmlDtdPtr(ret_val);
21208        call_tests++;
21209        des_xmlDocPtr(n_doc, doc, 0);
21210        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21211        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21212        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21213        xmlResetLastError();
21214        if (mem_base != xmlMemBlocks()) {
21215            printf("Leak of %d blocks found in xmlNewDtd",
21216	           xmlMemBlocks() - mem_base);
21217	    test_ret++;
21218            printf(" %d", n_doc);
21219            printf(" %d", n_name);
21220            printf(" %d", n_ExternalID);
21221            printf(" %d", n_SystemID);
21222            printf("\n");
21223        }
21224    }
21225    }
21226    }
21227    }
21228    function_tests++;
21229
21230    return(test_ret);
21231}
21232
21233
21234static int
21235test_xmlNewNode(void) {
21236    int test_ret = 0;
21237
21238    int mem_base;
21239    xmlNodePtr ret_val;
21240    xmlNsPtr ns; /* namespace if any */
21241    int n_ns;
21242    xmlChar * name; /* the node name */
21243    int n_name;
21244
21245    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21246    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21247        mem_base = xmlMemBlocks();
21248        ns = gen_xmlNsPtr(n_ns, 0);
21249        name = gen_const_xmlChar_ptr(n_name, 1);
21250
21251        ret_val = xmlNewNode(ns, (const xmlChar *)name);
21252        desret_xmlNodePtr(ret_val);
21253        call_tests++;
21254        des_xmlNsPtr(n_ns, ns, 0);
21255        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21256        xmlResetLastError();
21257        if (mem_base != xmlMemBlocks()) {
21258            printf("Leak of %d blocks found in xmlNewNode",
21259	           xmlMemBlocks() - mem_base);
21260	    test_ret++;
21261            printf(" %d", n_ns);
21262            printf(" %d", n_name);
21263            printf("\n");
21264        }
21265    }
21266    }
21267    function_tests++;
21268
21269    return(test_ret);
21270}
21271
21272
21273static int
21274test_xmlNewNodeEatName(void) {
21275    int test_ret = 0;
21276
21277    int mem_base;
21278    xmlNodePtr ret_val;
21279    xmlNsPtr ns; /* namespace if any */
21280    int n_ns;
21281    xmlChar * name; /* the node name */
21282    int n_name;
21283
21284    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21285    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21286        mem_base = xmlMemBlocks();
21287        ns = gen_xmlNsPtr(n_ns, 0);
21288        name = gen_eaten_name(n_name, 1);
21289
21290        ret_val = xmlNewNodeEatName(ns, name);
21291        desret_xmlNodePtr(ret_val);
21292        call_tests++;
21293        des_xmlNsPtr(n_ns, ns, 0);
21294        des_eaten_name(n_name, name, 1);
21295        xmlResetLastError();
21296        if (mem_base != xmlMemBlocks()) {
21297            printf("Leak of %d blocks found in xmlNewNodeEatName",
21298	           xmlMemBlocks() - mem_base);
21299	    test_ret++;
21300            printf(" %d", n_ns);
21301            printf(" %d", n_name);
21302            printf("\n");
21303        }
21304    }
21305    }
21306    function_tests++;
21307
21308    return(test_ret);
21309}
21310
21311
21312static int
21313test_xmlNewNs(void) {
21314    int test_ret = 0;
21315
21316    int mem_base;
21317    xmlNsPtr ret_val;
21318    xmlNodePtr node; /* the element carrying the namespace */
21319    int n_node;
21320    xmlChar * href; /* the URI associated */
21321    int n_href;
21322    xmlChar * prefix; /* the prefix for the namespace */
21323    int n_prefix;
21324
21325    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21326    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21327    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21328        mem_base = xmlMemBlocks();
21329        node = gen_xmlNodePtr(n_node, 0);
21330        href = gen_const_xmlChar_ptr(n_href, 1);
21331        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21332
21333        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21334        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21335        desret_xmlNsPtr(ret_val);
21336        call_tests++;
21337        des_xmlNodePtr(n_node, node, 0);
21338        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21339        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21340        xmlResetLastError();
21341        if (mem_base != xmlMemBlocks()) {
21342            printf("Leak of %d blocks found in xmlNewNs",
21343	           xmlMemBlocks() - mem_base);
21344	    test_ret++;
21345            printf(" %d", n_node);
21346            printf(" %d", n_href);
21347            printf(" %d", n_prefix);
21348            printf("\n");
21349        }
21350    }
21351    }
21352    }
21353    function_tests++;
21354
21355    return(test_ret);
21356}
21357
21358
21359static int
21360test_xmlNewNsProp(void) {
21361    int test_ret = 0;
21362
21363    int mem_base;
21364    xmlAttrPtr ret_val;
21365    xmlNodePtr node; /* the holding node */
21366    int n_node;
21367    xmlNsPtr ns; /* the namespace */
21368    int n_ns;
21369    xmlChar * name; /* the name of the attribute */
21370    int n_name;
21371    xmlChar * value; /* the value of the attribute */
21372    int n_value;
21373
21374    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21375    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21376    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21377    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21378        mem_base = xmlMemBlocks();
21379        node = gen_xmlNodePtr(n_node, 0);
21380        ns = gen_xmlNsPtr(n_ns, 1);
21381        name = gen_const_xmlChar_ptr(n_name, 2);
21382        value = gen_const_xmlChar_ptr(n_value, 3);
21383
21384        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21385        desret_xmlAttrPtr(ret_val);
21386        call_tests++;
21387        des_xmlNodePtr(n_node, node, 0);
21388        des_xmlNsPtr(n_ns, ns, 1);
21389        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21390        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21391        xmlResetLastError();
21392        if (mem_base != xmlMemBlocks()) {
21393            printf("Leak of %d blocks found in xmlNewNsProp",
21394	           xmlMemBlocks() - mem_base);
21395	    test_ret++;
21396            printf(" %d", n_node);
21397            printf(" %d", n_ns);
21398            printf(" %d", n_name);
21399            printf(" %d", n_value);
21400            printf("\n");
21401        }
21402    }
21403    }
21404    }
21405    }
21406    function_tests++;
21407
21408    return(test_ret);
21409}
21410
21411
21412static int
21413test_xmlNewNsPropEatName(void) {
21414    int test_ret = 0;
21415
21416    int mem_base;
21417    xmlAttrPtr ret_val;
21418    xmlNodePtr node; /* the holding node */
21419    int n_node;
21420    xmlNsPtr ns; /* the namespace */
21421    int n_ns;
21422    xmlChar * name; /* the name of the attribute */
21423    int n_name;
21424    xmlChar * value; /* the value of the attribute */
21425    int n_value;
21426
21427    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21428    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21429    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21430    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21431        mem_base = xmlMemBlocks();
21432        node = gen_xmlNodePtr(n_node, 0);
21433        ns = gen_xmlNsPtr(n_ns, 1);
21434        name = gen_eaten_name(n_name, 2);
21435        value = gen_const_xmlChar_ptr(n_value, 3);
21436
21437        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21438        desret_xmlAttrPtr(ret_val);
21439        call_tests++;
21440        des_xmlNodePtr(n_node, node, 0);
21441        des_xmlNsPtr(n_ns, ns, 1);
21442        des_eaten_name(n_name, name, 2);
21443        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21444        xmlResetLastError();
21445        if (mem_base != xmlMemBlocks()) {
21446            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21447	           xmlMemBlocks() - mem_base);
21448	    test_ret++;
21449            printf(" %d", n_node);
21450            printf(" %d", n_ns);
21451            printf(" %d", n_name);
21452            printf(" %d", n_value);
21453            printf("\n");
21454        }
21455    }
21456    }
21457    }
21458    }
21459    function_tests++;
21460
21461    return(test_ret);
21462}
21463
21464
21465static int
21466test_xmlNewPI(void) {
21467    int test_ret = 0;
21468
21469    int mem_base;
21470    xmlNodePtr ret_val;
21471    xmlChar * name; /* the processing instruction name */
21472    int n_name;
21473    xmlChar * content; /* the PI content */
21474    int n_content;
21475
21476    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21477    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21478        mem_base = xmlMemBlocks();
21479        name = gen_const_xmlChar_ptr(n_name, 0);
21480        content = gen_const_xmlChar_ptr(n_content, 1);
21481
21482        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21483        desret_xmlNodePtr(ret_val);
21484        call_tests++;
21485        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21486        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21487        xmlResetLastError();
21488        if (mem_base != xmlMemBlocks()) {
21489            printf("Leak of %d blocks found in xmlNewPI",
21490	           xmlMemBlocks() - mem_base);
21491	    test_ret++;
21492            printf(" %d", n_name);
21493            printf(" %d", n_content);
21494            printf("\n");
21495        }
21496    }
21497    }
21498    function_tests++;
21499
21500    return(test_ret);
21501}
21502
21503
21504static int
21505test_xmlNewProp(void) {
21506    int test_ret = 0;
21507
21508#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21509#ifdef LIBXML_TREE_ENABLED
21510    int mem_base;
21511    xmlAttrPtr ret_val;
21512    xmlNodePtr node; /* the holding node */
21513    int n_node;
21514    xmlChar * name; /* the name of the attribute */
21515    int n_name;
21516    xmlChar * value; /* the value of the attribute */
21517    int n_value;
21518
21519    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21520    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21521    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21522        mem_base = xmlMemBlocks();
21523        node = gen_xmlNodePtr(n_node, 0);
21524        name = gen_const_xmlChar_ptr(n_name, 1);
21525        value = gen_const_xmlChar_ptr(n_value, 2);
21526
21527        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21528        desret_xmlAttrPtr(ret_val);
21529        call_tests++;
21530        des_xmlNodePtr(n_node, node, 0);
21531        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21532        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21533        xmlResetLastError();
21534        if (mem_base != xmlMemBlocks()) {
21535            printf("Leak of %d blocks found in xmlNewProp",
21536	           xmlMemBlocks() - mem_base);
21537	    test_ret++;
21538            printf(" %d", n_node);
21539            printf(" %d", n_name);
21540            printf(" %d", n_value);
21541            printf("\n");
21542        }
21543    }
21544    }
21545    }
21546    function_tests++;
21547#endif
21548#endif
21549
21550    return(test_ret);
21551}
21552
21553
21554static int
21555test_xmlNewReference(void) {
21556    int test_ret = 0;
21557
21558    int mem_base;
21559    xmlNodePtr ret_val;
21560    xmlDocPtr doc; /* the document */
21561    int n_doc;
21562    xmlChar * name; /* the reference name, or the reference string with & and ; */
21563    int n_name;
21564
21565    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21566    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21567        mem_base = xmlMemBlocks();
21568        doc = gen_xmlDocPtr(n_doc, 0);
21569        name = gen_const_xmlChar_ptr(n_name, 1);
21570
21571        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21572        desret_xmlNodePtr(ret_val);
21573        call_tests++;
21574        des_xmlDocPtr(n_doc, doc, 0);
21575        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21576        xmlResetLastError();
21577        if (mem_base != xmlMemBlocks()) {
21578            printf("Leak of %d blocks found in xmlNewReference",
21579	           xmlMemBlocks() - mem_base);
21580	    test_ret++;
21581            printf(" %d", n_doc);
21582            printf(" %d", n_name);
21583            printf("\n");
21584        }
21585    }
21586    }
21587    function_tests++;
21588
21589    return(test_ret);
21590}
21591
21592
21593static int
21594test_xmlNewText(void) {
21595    int test_ret = 0;
21596
21597    int mem_base;
21598    xmlNodePtr ret_val;
21599    xmlChar * content; /* the text content */
21600    int n_content;
21601
21602    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21603        mem_base = xmlMemBlocks();
21604        content = gen_const_xmlChar_ptr(n_content, 0);
21605
21606        ret_val = xmlNewText((const xmlChar *)content);
21607        desret_xmlNodePtr(ret_val);
21608        call_tests++;
21609        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21610        xmlResetLastError();
21611        if (mem_base != xmlMemBlocks()) {
21612            printf("Leak of %d blocks found in xmlNewText",
21613	           xmlMemBlocks() - mem_base);
21614	    test_ret++;
21615            printf(" %d", n_content);
21616            printf("\n");
21617        }
21618    }
21619    function_tests++;
21620
21621    return(test_ret);
21622}
21623
21624
21625static int
21626test_xmlNewTextChild(void) {
21627    int test_ret = 0;
21628
21629#if defined(LIBXML_TREE_ENABLED)
21630#ifdef LIBXML_TREE_ENABLED
21631    int mem_base;
21632    xmlNodePtr ret_val;
21633    xmlNodePtr parent; /* the parent node */
21634    int n_parent;
21635    xmlNsPtr ns; /* a namespace if any */
21636    int n_ns;
21637    xmlChar * name; /* the name of the child */
21638    int n_name;
21639    xmlChar * content; /* the text content of the child if any. */
21640    int n_content;
21641
21642    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21643    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21644    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21645    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21646        mem_base = xmlMemBlocks();
21647        parent = gen_xmlNodePtr(n_parent, 0);
21648        ns = gen_xmlNsPtr(n_ns, 1);
21649        name = gen_const_xmlChar_ptr(n_name, 2);
21650        content = gen_const_xmlChar_ptr(n_content, 3);
21651
21652        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21653        desret_xmlNodePtr(ret_val);
21654        call_tests++;
21655        des_xmlNodePtr(n_parent, parent, 0);
21656        des_xmlNsPtr(n_ns, ns, 1);
21657        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21658        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21659        xmlResetLastError();
21660        if (mem_base != xmlMemBlocks()) {
21661            printf("Leak of %d blocks found in xmlNewTextChild",
21662	           xmlMemBlocks() - mem_base);
21663	    test_ret++;
21664            printf(" %d", n_parent);
21665            printf(" %d", n_ns);
21666            printf(" %d", n_name);
21667            printf(" %d", n_content);
21668            printf("\n");
21669        }
21670    }
21671    }
21672    }
21673    }
21674    function_tests++;
21675#endif
21676#endif
21677
21678    return(test_ret);
21679}
21680
21681
21682static int
21683test_xmlNewTextLen(void) {
21684    int test_ret = 0;
21685
21686    int mem_base;
21687    xmlNodePtr ret_val;
21688    xmlChar * content; /* the text content */
21689    int n_content;
21690    int len; /* the text len. */
21691    int n_len;
21692
21693    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21694    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21695        mem_base = xmlMemBlocks();
21696        content = gen_const_xmlChar_ptr(n_content, 0);
21697        len = gen_int(n_len, 1);
21698
21699        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21700        desret_xmlNodePtr(ret_val);
21701        call_tests++;
21702        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21703        des_int(n_len, len, 1);
21704        xmlResetLastError();
21705        if (mem_base != xmlMemBlocks()) {
21706            printf("Leak of %d blocks found in xmlNewTextLen",
21707	           xmlMemBlocks() - mem_base);
21708	    test_ret++;
21709            printf(" %d", n_content);
21710            printf(" %d", n_len);
21711            printf("\n");
21712        }
21713    }
21714    }
21715    function_tests++;
21716
21717    return(test_ret);
21718}
21719
21720
21721static int
21722test_xmlNodeAddContent(void) {
21723    int test_ret = 0;
21724
21725    int mem_base;
21726    xmlNodePtr cur; /* the node being modified */
21727    int n_cur;
21728    xmlChar * content; /* extra content */
21729    int n_content;
21730
21731    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21732    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21733        mem_base = xmlMemBlocks();
21734        cur = gen_xmlNodePtr(n_cur, 0);
21735        content = gen_const_xmlChar_ptr(n_content, 1);
21736
21737        xmlNodeAddContent(cur, (const xmlChar *)content);
21738        call_tests++;
21739        des_xmlNodePtr(n_cur, cur, 0);
21740        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21741        xmlResetLastError();
21742        if (mem_base != xmlMemBlocks()) {
21743            printf("Leak of %d blocks found in xmlNodeAddContent",
21744	           xmlMemBlocks() - mem_base);
21745	    test_ret++;
21746            printf(" %d", n_cur);
21747            printf(" %d", n_content);
21748            printf("\n");
21749        }
21750    }
21751    }
21752    function_tests++;
21753
21754    return(test_ret);
21755}
21756
21757
21758static int
21759test_xmlNodeAddContentLen(void) {
21760    int test_ret = 0;
21761
21762    int mem_base;
21763    xmlNodePtr cur; /* the node being modified */
21764    int n_cur;
21765    xmlChar * content; /* extra content */
21766    int n_content;
21767    int len; /* the size of @content */
21768    int n_len;
21769
21770    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21771    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21772    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21773        mem_base = xmlMemBlocks();
21774        cur = gen_xmlNodePtr(n_cur, 0);
21775        content = gen_const_xmlChar_ptr(n_content, 1);
21776        len = gen_int(n_len, 2);
21777
21778        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21779        call_tests++;
21780        des_xmlNodePtr(n_cur, cur, 0);
21781        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21782        des_int(n_len, len, 2);
21783        xmlResetLastError();
21784        if (mem_base != xmlMemBlocks()) {
21785            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21786	           xmlMemBlocks() - mem_base);
21787	    test_ret++;
21788            printf(" %d", n_cur);
21789            printf(" %d", n_content);
21790            printf(" %d", n_len);
21791            printf("\n");
21792        }
21793    }
21794    }
21795    }
21796    function_tests++;
21797
21798    return(test_ret);
21799}
21800
21801
21802static int
21803test_xmlNodeBufGetContent(void) {
21804    int test_ret = 0;
21805
21806    int mem_base;
21807    int ret_val;
21808    xmlBufferPtr buffer; /* a buffer */
21809    int n_buffer;
21810    xmlNodePtr cur; /* the node being read */
21811    int n_cur;
21812
21813    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21814    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21815        mem_base = xmlMemBlocks();
21816        buffer = gen_xmlBufferPtr(n_buffer, 0);
21817        cur = gen_xmlNodePtr(n_cur, 1);
21818
21819        ret_val = xmlNodeBufGetContent(buffer, cur);
21820        desret_int(ret_val);
21821        call_tests++;
21822        des_xmlBufferPtr(n_buffer, buffer, 0);
21823        des_xmlNodePtr(n_cur, cur, 1);
21824        xmlResetLastError();
21825        if (mem_base != xmlMemBlocks()) {
21826            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21827	           xmlMemBlocks() - mem_base);
21828	    test_ret++;
21829            printf(" %d", n_buffer);
21830            printf(" %d", n_cur);
21831            printf("\n");
21832        }
21833    }
21834    }
21835    function_tests++;
21836
21837    return(test_ret);
21838}
21839
21840
21841static int
21842test_xmlNodeDump(void) {
21843    int test_ret = 0;
21844
21845#if defined(LIBXML_OUTPUT_ENABLED)
21846    int mem_base;
21847    int ret_val;
21848    xmlBufferPtr buf; /* the XML buffer output */
21849    int n_buf;
21850    xmlDocPtr doc; /* the document */
21851    int n_doc;
21852    xmlNodePtr cur; /* the current node */
21853    int n_cur;
21854    int level; /* the imbrication level for indenting */
21855    int n_level;
21856    int format; /* is formatting allowed */
21857    int n_format;
21858
21859    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21860    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21861    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21862    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21863    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21864        mem_base = xmlMemBlocks();
21865        buf = gen_xmlBufferPtr(n_buf, 0);
21866        doc = gen_xmlDocPtr(n_doc, 1);
21867        cur = gen_xmlNodePtr(n_cur, 2);
21868        level = gen_int(n_level, 3);
21869        format = gen_int(n_format, 4);
21870
21871        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21872        desret_int(ret_val);
21873        call_tests++;
21874        des_xmlBufferPtr(n_buf, buf, 0);
21875        des_xmlDocPtr(n_doc, doc, 1);
21876        des_xmlNodePtr(n_cur, cur, 2);
21877        des_int(n_level, level, 3);
21878        des_int(n_format, format, 4);
21879        xmlResetLastError();
21880        if (mem_base != xmlMemBlocks()) {
21881            printf("Leak of %d blocks found in xmlNodeDump",
21882	           xmlMemBlocks() - mem_base);
21883	    test_ret++;
21884            printf(" %d", n_buf);
21885            printf(" %d", n_doc);
21886            printf(" %d", n_cur);
21887            printf(" %d", n_level);
21888            printf(" %d", n_format);
21889            printf("\n");
21890        }
21891    }
21892    }
21893    }
21894    }
21895    }
21896    function_tests++;
21897#endif
21898
21899    return(test_ret);
21900}
21901
21902
21903static int
21904test_xmlNodeDumpOutput(void) {
21905    int test_ret = 0;
21906
21907#if defined(LIBXML_OUTPUT_ENABLED)
21908    int mem_base;
21909    xmlOutputBufferPtr buf; /* the XML buffer output */
21910    int n_buf;
21911    xmlDocPtr doc; /* the document */
21912    int n_doc;
21913    xmlNodePtr cur; /* the current node */
21914    int n_cur;
21915    int level; /* the imbrication level for indenting */
21916    int n_level;
21917    int format; /* is formatting allowed */
21918    int n_format;
21919    char * encoding; /* an optional encoding string */
21920    int n_encoding;
21921
21922    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21923    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21924    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21925    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21926    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21927    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21928        mem_base = xmlMemBlocks();
21929        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21930        doc = gen_xmlDocPtr(n_doc, 1);
21931        cur = gen_xmlNodePtr(n_cur, 2);
21932        level = gen_int(n_level, 3);
21933        format = gen_int(n_format, 4);
21934        encoding = gen_const_char_ptr(n_encoding, 5);
21935
21936        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
21937        call_tests++;
21938        des_xmlOutputBufferPtr(n_buf, buf, 0);
21939        des_xmlDocPtr(n_doc, doc, 1);
21940        des_xmlNodePtr(n_cur, cur, 2);
21941        des_int(n_level, level, 3);
21942        des_int(n_format, format, 4);
21943        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
21944        xmlResetLastError();
21945        if (mem_base != xmlMemBlocks()) {
21946            printf("Leak of %d blocks found in xmlNodeDumpOutput",
21947	           xmlMemBlocks() - mem_base);
21948	    test_ret++;
21949            printf(" %d", n_buf);
21950            printf(" %d", n_doc);
21951            printf(" %d", n_cur);
21952            printf(" %d", n_level);
21953            printf(" %d", n_format);
21954            printf(" %d", n_encoding);
21955            printf("\n");
21956        }
21957    }
21958    }
21959    }
21960    }
21961    }
21962    }
21963    function_tests++;
21964#endif
21965
21966    return(test_ret);
21967}
21968
21969
21970static int
21971test_xmlNodeGetBase(void) {
21972    int test_ret = 0;
21973
21974    int mem_base;
21975    xmlChar * ret_val;
21976    xmlDocPtr doc; /* the document the node pertains to */
21977    int n_doc;
21978    xmlNodePtr cur; /* the node being checked */
21979    int n_cur;
21980
21981    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21982    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21983        mem_base = xmlMemBlocks();
21984        doc = gen_xmlDocPtr(n_doc, 0);
21985        cur = gen_xmlNodePtr(n_cur, 1);
21986
21987        ret_val = xmlNodeGetBase(doc, cur);
21988        desret_xmlChar_ptr(ret_val);
21989        call_tests++;
21990        des_xmlDocPtr(n_doc, doc, 0);
21991        des_xmlNodePtr(n_cur, cur, 1);
21992        xmlResetLastError();
21993        if (mem_base != xmlMemBlocks()) {
21994            printf("Leak of %d blocks found in xmlNodeGetBase",
21995	           xmlMemBlocks() - mem_base);
21996	    test_ret++;
21997            printf(" %d", n_doc);
21998            printf(" %d", n_cur);
21999            printf("\n");
22000        }
22001    }
22002    }
22003    function_tests++;
22004
22005    return(test_ret);
22006}
22007
22008
22009static int
22010test_xmlNodeGetContent(void) {
22011    int test_ret = 0;
22012
22013    int mem_base;
22014    xmlChar * ret_val;
22015    xmlNodePtr cur; /* the node being read */
22016    int n_cur;
22017
22018    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22019        mem_base = xmlMemBlocks();
22020        cur = gen_xmlNodePtr(n_cur, 0);
22021
22022        ret_val = xmlNodeGetContent(cur);
22023        desret_xmlChar_ptr(ret_val);
22024        call_tests++;
22025        des_xmlNodePtr(n_cur, cur, 0);
22026        xmlResetLastError();
22027        if (mem_base != xmlMemBlocks()) {
22028            printf("Leak of %d blocks found in xmlNodeGetContent",
22029	           xmlMemBlocks() - mem_base);
22030	    test_ret++;
22031            printf(" %d", n_cur);
22032            printf("\n");
22033        }
22034    }
22035    function_tests++;
22036
22037    return(test_ret);
22038}
22039
22040
22041static int
22042test_xmlNodeGetLang(void) {
22043    int test_ret = 0;
22044
22045    int mem_base;
22046    xmlChar * ret_val;
22047    xmlNodePtr cur; /* the node being checked */
22048    int n_cur;
22049
22050    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22051        mem_base = xmlMemBlocks();
22052        cur = gen_xmlNodePtr(n_cur, 0);
22053
22054        ret_val = xmlNodeGetLang(cur);
22055        desret_xmlChar_ptr(ret_val);
22056        call_tests++;
22057        des_xmlNodePtr(n_cur, cur, 0);
22058        xmlResetLastError();
22059        if (mem_base != xmlMemBlocks()) {
22060            printf("Leak of %d blocks found in xmlNodeGetLang",
22061	           xmlMemBlocks() - mem_base);
22062	    test_ret++;
22063            printf(" %d", n_cur);
22064            printf("\n");
22065        }
22066    }
22067    function_tests++;
22068
22069    return(test_ret);
22070}
22071
22072
22073static int
22074test_xmlNodeGetSpacePreserve(void) {
22075    int test_ret = 0;
22076
22077    int mem_base;
22078    int ret_val;
22079    xmlNodePtr cur; /* the node being checked */
22080    int n_cur;
22081
22082    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22083        mem_base = xmlMemBlocks();
22084        cur = gen_xmlNodePtr(n_cur, 0);
22085
22086        ret_val = xmlNodeGetSpacePreserve(cur);
22087        desret_int(ret_val);
22088        call_tests++;
22089        des_xmlNodePtr(n_cur, cur, 0);
22090        xmlResetLastError();
22091        if (mem_base != xmlMemBlocks()) {
22092            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22093	           xmlMemBlocks() - mem_base);
22094	    test_ret++;
22095            printf(" %d", n_cur);
22096            printf("\n");
22097        }
22098    }
22099    function_tests++;
22100
22101    return(test_ret);
22102}
22103
22104
22105static int
22106test_xmlNodeIsText(void) {
22107    int test_ret = 0;
22108
22109    int mem_base;
22110    int ret_val;
22111    xmlNodePtr node; /* the node */
22112    int n_node;
22113
22114    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22115        mem_base = xmlMemBlocks();
22116        node = gen_xmlNodePtr(n_node, 0);
22117
22118        ret_val = xmlNodeIsText(node);
22119        desret_int(ret_val);
22120        call_tests++;
22121        des_xmlNodePtr(n_node, node, 0);
22122        xmlResetLastError();
22123        if (mem_base != xmlMemBlocks()) {
22124            printf("Leak of %d blocks found in xmlNodeIsText",
22125	           xmlMemBlocks() - mem_base);
22126	    test_ret++;
22127            printf(" %d", n_node);
22128            printf("\n");
22129        }
22130    }
22131    function_tests++;
22132
22133    return(test_ret);
22134}
22135
22136
22137static int
22138test_xmlNodeListGetRawString(void) {
22139    int test_ret = 0;
22140
22141#if defined(LIBXML_TREE_ENABLED)
22142    int mem_base;
22143    xmlChar * ret_val;
22144    xmlDocPtr doc; /* the document */
22145    int n_doc;
22146    xmlNodePtr list; /* a Node list */
22147    int n_list;
22148    int inLine; /* should we replace entity contents or show their external form */
22149    int n_inLine;
22150
22151    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22152    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22153    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22154        mem_base = xmlMemBlocks();
22155        doc = gen_xmlDocPtr(n_doc, 0);
22156        list = gen_xmlNodePtr(n_list, 1);
22157        inLine = gen_int(n_inLine, 2);
22158
22159        ret_val = xmlNodeListGetRawString(doc, list, inLine);
22160        desret_xmlChar_ptr(ret_val);
22161        call_tests++;
22162        des_xmlDocPtr(n_doc, doc, 0);
22163        des_xmlNodePtr(n_list, list, 1);
22164        des_int(n_inLine, inLine, 2);
22165        xmlResetLastError();
22166        if (mem_base != xmlMemBlocks()) {
22167            printf("Leak of %d blocks found in xmlNodeListGetRawString",
22168	           xmlMemBlocks() - mem_base);
22169	    test_ret++;
22170            printf(" %d", n_doc);
22171            printf(" %d", n_list);
22172            printf(" %d", n_inLine);
22173            printf("\n");
22174        }
22175    }
22176    }
22177    }
22178    function_tests++;
22179#endif
22180
22181    return(test_ret);
22182}
22183
22184
22185static int
22186test_xmlNodeListGetString(void) {
22187    int test_ret = 0;
22188
22189    int mem_base;
22190    xmlChar * ret_val;
22191    xmlDocPtr doc; /* the document */
22192    int n_doc;
22193    xmlNodePtr list; /* a Node list */
22194    int n_list;
22195    int inLine; /* should we replace entity contents or show their external form */
22196    int n_inLine;
22197
22198    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22199    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22200    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22201        mem_base = xmlMemBlocks();
22202        doc = gen_xmlDocPtr(n_doc, 0);
22203        list = gen_xmlNodePtr(n_list, 1);
22204        inLine = gen_int(n_inLine, 2);
22205
22206        ret_val = xmlNodeListGetString(doc, list, inLine);
22207        desret_xmlChar_ptr(ret_val);
22208        call_tests++;
22209        des_xmlDocPtr(n_doc, doc, 0);
22210        des_xmlNodePtr(n_list, list, 1);
22211        des_int(n_inLine, inLine, 2);
22212        xmlResetLastError();
22213        if (mem_base != xmlMemBlocks()) {
22214            printf("Leak of %d blocks found in xmlNodeListGetString",
22215	           xmlMemBlocks() - mem_base);
22216	    test_ret++;
22217            printf(" %d", n_doc);
22218            printf(" %d", n_list);
22219            printf(" %d", n_inLine);
22220            printf("\n");
22221        }
22222    }
22223    }
22224    }
22225    function_tests++;
22226
22227    return(test_ret);
22228}
22229
22230
22231static int
22232test_xmlNodeSetBase(void) {
22233    int test_ret = 0;
22234
22235#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22236    int mem_base;
22237    xmlNodePtr cur; /* the node being changed */
22238    int n_cur;
22239    xmlChar * uri; /* the new base URI */
22240    int n_uri;
22241
22242    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22243    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22244        mem_base = xmlMemBlocks();
22245        cur = gen_xmlNodePtr(n_cur, 0);
22246        uri = gen_const_xmlChar_ptr(n_uri, 1);
22247
22248        xmlNodeSetBase(cur, (const xmlChar *)uri);
22249        call_tests++;
22250        des_xmlNodePtr(n_cur, cur, 0);
22251        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22252        xmlResetLastError();
22253        if (mem_base != xmlMemBlocks()) {
22254            printf("Leak of %d blocks found in xmlNodeSetBase",
22255	           xmlMemBlocks() - mem_base);
22256	    test_ret++;
22257            printf(" %d", n_cur);
22258            printf(" %d", n_uri);
22259            printf("\n");
22260        }
22261    }
22262    }
22263    function_tests++;
22264#endif
22265
22266    return(test_ret);
22267}
22268
22269
22270static int
22271test_xmlNodeSetContent(void) {
22272    int test_ret = 0;
22273
22274    int mem_base;
22275    xmlNodePtr cur; /* the node being modified */
22276    int n_cur;
22277    xmlChar * content; /* the new value of the content */
22278    int n_content;
22279
22280    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22281    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22282        mem_base = xmlMemBlocks();
22283        cur = gen_xmlNodePtr(n_cur, 0);
22284        content = gen_const_xmlChar_ptr(n_content, 1);
22285
22286        xmlNodeSetContent(cur, (const xmlChar *)content);
22287        call_tests++;
22288        des_xmlNodePtr(n_cur, cur, 0);
22289        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22290        xmlResetLastError();
22291        if (mem_base != xmlMemBlocks()) {
22292            printf("Leak of %d blocks found in xmlNodeSetContent",
22293	           xmlMemBlocks() - mem_base);
22294	    test_ret++;
22295            printf(" %d", n_cur);
22296            printf(" %d", n_content);
22297            printf("\n");
22298        }
22299    }
22300    }
22301    function_tests++;
22302
22303    return(test_ret);
22304}
22305
22306
22307static int
22308test_xmlNodeSetContentLen(void) {
22309    int test_ret = 0;
22310
22311#if defined(LIBXML_TREE_ENABLED)
22312    int mem_base;
22313    xmlNodePtr cur; /* the node being modified */
22314    int n_cur;
22315    xmlChar * content; /* the new value of the content */
22316    int n_content;
22317    int len; /* the size of @content */
22318    int n_len;
22319
22320    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22321    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22322    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22323        mem_base = xmlMemBlocks();
22324        cur = gen_xmlNodePtr(n_cur, 0);
22325        content = gen_const_xmlChar_ptr(n_content, 1);
22326        len = gen_int(n_len, 2);
22327
22328        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22329        call_tests++;
22330        des_xmlNodePtr(n_cur, cur, 0);
22331        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22332        des_int(n_len, len, 2);
22333        xmlResetLastError();
22334        if (mem_base != xmlMemBlocks()) {
22335            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22336	           xmlMemBlocks() - mem_base);
22337	    test_ret++;
22338            printf(" %d", n_cur);
22339            printf(" %d", n_content);
22340            printf(" %d", n_len);
22341            printf("\n");
22342        }
22343    }
22344    }
22345    }
22346    function_tests++;
22347#endif
22348
22349    return(test_ret);
22350}
22351
22352
22353static int
22354test_xmlNodeSetLang(void) {
22355    int test_ret = 0;
22356
22357#if defined(LIBXML_TREE_ENABLED)
22358    int mem_base;
22359    xmlNodePtr cur; /* the node being changed */
22360    int n_cur;
22361    xmlChar * lang; /* the language description */
22362    int n_lang;
22363
22364    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22365    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22366        mem_base = xmlMemBlocks();
22367        cur = gen_xmlNodePtr(n_cur, 0);
22368        lang = gen_const_xmlChar_ptr(n_lang, 1);
22369
22370        xmlNodeSetLang(cur, (const xmlChar *)lang);
22371        call_tests++;
22372        des_xmlNodePtr(n_cur, cur, 0);
22373        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22374        xmlResetLastError();
22375        if (mem_base != xmlMemBlocks()) {
22376            printf("Leak of %d blocks found in xmlNodeSetLang",
22377	           xmlMemBlocks() - mem_base);
22378	    test_ret++;
22379            printf(" %d", n_cur);
22380            printf(" %d", n_lang);
22381            printf("\n");
22382        }
22383    }
22384    }
22385    function_tests++;
22386#endif
22387
22388    return(test_ret);
22389}
22390
22391
22392static int
22393test_xmlNodeSetName(void) {
22394    int test_ret = 0;
22395
22396#if defined(LIBXML_TREE_ENABLED)
22397    int mem_base;
22398    xmlNodePtr cur; /* the node being changed */
22399    int n_cur;
22400    xmlChar * name; /* the new tag name */
22401    int n_name;
22402
22403    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22404    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22405        mem_base = xmlMemBlocks();
22406        cur = gen_xmlNodePtr(n_cur, 0);
22407        name = gen_const_xmlChar_ptr(n_name, 1);
22408
22409        xmlNodeSetName(cur, (const xmlChar *)name);
22410        call_tests++;
22411        des_xmlNodePtr(n_cur, cur, 0);
22412        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22413        xmlResetLastError();
22414        if (mem_base != xmlMemBlocks()) {
22415            printf("Leak of %d blocks found in xmlNodeSetName",
22416	           xmlMemBlocks() - mem_base);
22417	    test_ret++;
22418            printf(" %d", n_cur);
22419            printf(" %d", n_name);
22420            printf("\n");
22421        }
22422    }
22423    }
22424    function_tests++;
22425#endif
22426
22427    return(test_ret);
22428}
22429
22430
22431static int
22432test_xmlNodeSetSpacePreserve(void) {
22433    int test_ret = 0;
22434
22435#if defined(LIBXML_TREE_ENABLED)
22436    int mem_base;
22437    xmlNodePtr cur; /* the node being changed */
22438    int n_cur;
22439    int val; /* the xml:space value ("0": default, 1: "preserve") */
22440    int n_val;
22441
22442    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22443    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22444        mem_base = xmlMemBlocks();
22445        cur = gen_xmlNodePtr(n_cur, 0);
22446        val = gen_int(n_val, 1);
22447
22448        xmlNodeSetSpacePreserve(cur, val);
22449        call_tests++;
22450        des_xmlNodePtr(n_cur, cur, 0);
22451        des_int(n_val, val, 1);
22452        xmlResetLastError();
22453        if (mem_base != xmlMemBlocks()) {
22454            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22455	           xmlMemBlocks() - mem_base);
22456	    test_ret++;
22457            printf(" %d", n_cur);
22458            printf(" %d", n_val);
22459            printf("\n");
22460        }
22461    }
22462    }
22463    function_tests++;
22464#endif
22465
22466    return(test_ret);
22467}
22468
22469
22470static int
22471test_xmlReconciliateNs(void) {
22472    int test_ret = 0;
22473
22474#if defined(LIBXML_TREE_ENABLED)
22475#ifdef LIBXML_TREE_ENABLED
22476    int mem_base;
22477    int ret_val;
22478    xmlDocPtr doc; /* the document */
22479    int n_doc;
22480    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22481    int n_tree;
22482
22483    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22484    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22485        mem_base = xmlMemBlocks();
22486        doc = gen_xmlDocPtr(n_doc, 0);
22487        tree = gen_xmlNodePtr(n_tree, 1);
22488
22489        ret_val = xmlReconciliateNs(doc, tree);
22490        desret_int(ret_val);
22491        call_tests++;
22492        des_xmlDocPtr(n_doc, doc, 0);
22493        des_xmlNodePtr(n_tree, tree, 1);
22494        xmlResetLastError();
22495        if (mem_base != xmlMemBlocks()) {
22496            printf("Leak of %d blocks found in xmlReconciliateNs",
22497	           xmlMemBlocks() - mem_base);
22498	    test_ret++;
22499            printf(" %d", n_doc);
22500            printf(" %d", n_tree);
22501            printf("\n");
22502        }
22503    }
22504    }
22505    function_tests++;
22506#endif
22507#endif
22508
22509    return(test_ret);
22510}
22511
22512
22513static int
22514test_xmlRemoveProp(void) {
22515    int test_ret = 0;
22516
22517    int mem_base;
22518    int ret_val;
22519    xmlAttrPtr cur; /* an attribute */
22520    int n_cur;
22521
22522    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22523        mem_base = xmlMemBlocks();
22524        cur = gen_xmlAttrPtr(n_cur, 0);
22525
22526        ret_val = xmlRemoveProp(cur);
22527        cur = NULL;
22528        desret_int(ret_val);
22529        call_tests++;
22530        des_xmlAttrPtr(n_cur, cur, 0);
22531        xmlResetLastError();
22532        if (mem_base != xmlMemBlocks()) {
22533            printf("Leak of %d blocks found in xmlRemoveProp",
22534	           xmlMemBlocks() - mem_base);
22535	    test_ret++;
22536            printf(" %d", n_cur);
22537            printf("\n");
22538        }
22539    }
22540    function_tests++;
22541
22542    return(test_ret);
22543}
22544
22545
22546static int
22547test_xmlReplaceNode(void) {
22548    int test_ret = 0;
22549
22550#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22551    int mem_base;
22552    xmlNodePtr ret_val;
22553    xmlNodePtr old; /* the old node */
22554    int n_old;
22555    xmlNodePtr cur; /* the node */
22556    int n_cur;
22557
22558    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22559    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22560        mem_base = xmlMemBlocks();
22561        old = gen_xmlNodePtr(n_old, 0);
22562        cur = gen_xmlNodePtr_in(n_cur, 1);
22563
22564        ret_val = xmlReplaceNode(old, cur);
22565        if (cur != NULL) {
22566              xmlUnlinkNode(cur);
22567              xmlFreeNode(cur) ; cur = NULL ; }
22568          if (old != NULL) {
22569              xmlUnlinkNode(old);
22570              xmlFreeNode(old) ; old = NULL ; }
22571	  ret_val = NULL;
22572        desret_xmlNodePtr(ret_val);
22573        call_tests++;
22574        des_xmlNodePtr(n_old, old, 0);
22575        des_xmlNodePtr_in(n_cur, cur, 1);
22576        xmlResetLastError();
22577        if (mem_base != xmlMemBlocks()) {
22578            printf("Leak of %d blocks found in xmlReplaceNode",
22579	           xmlMemBlocks() - mem_base);
22580	    test_ret++;
22581            printf(" %d", n_old);
22582            printf(" %d", n_cur);
22583            printf("\n");
22584        }
22585    }
22586    }
22587    function_tests++;
22588#endif
22589
22590    return(test_ret);
22591}
22592
22593
22594static int
22595test_xmlSaveFile(void) {
22596    int test_ret = 0;
22597
22598#if defined(LIBXML_OUTPUT_ENABLED)
22599    int mem_base;
22600    int ret_val;
22601    const char * filename; /* the filename (or URL) */
22602    int n_filename;
22603    xmlDocPtr cur; /* the document */
22604    int n_cur;
22605
22606    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22607    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22608        mem_base = xmlMemBlocks();
22609        filename = gen_fileoutput(n_filename, 0);
22610        cur = gen_xmlDocPtr(n_cur, 1);
22611
22612        ret_val = xmlSaveFile(filename, cur);
22613        desret_int(ret_val);
22614        call_tests++;
22615        des_fileoutput(n_filename, filename, 0);
22616        des_xmlDocPtr(n_cur, cur, 1);
22617        xmlResetLastError();
22618        if (mem_base != xmlMemBlocks()) {
22619            printf("Leak of %d blocks found in xmlSaveFile",
22620	           xmlMemBlocks() - mem_base);
22621	    test_ret++;
22622            printf(" %d", n_filename);
22623            printf(" %d", n_cur);
22624            printf("\n");
22625        }
22626    }
22627    }
22628    function_tests++;
22629#endif
22630
22631    return(test_ret);
22632}
22633
22634
22635static int
22636test_xmlSaveFileEnc(void) {
22637    int test_ret = 0;
22638
22639#if defined(LIBXML_OUTPUT_ENABLED)
22640    int mem_base;
22641    int ret_val;
22642    const char * filename; /* the filename (or URL) */
22643    int n_filename;
22644    xmlDocPtr cur; /* the document */
22645    int n_cur;
22646    char * encoding; /* the name of an encoding (or NULL) */
22647    int n_encoding;
22648
22649    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22650    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22651    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22652        mem_base = xmlMemBlocks();
22653        filename = gen_fileoutput(n_filename, 0);
22654        cur = gen_xmlDocPtr(n_cur, 1);
22655        encoding = gen_const_char_ptr(n_encoding, 2);
22656
22657        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22658        desret_int(ret_val);
22659        call_tests++;
22660        des_fileoutput(n_filename, filename, 0);
22661        des_xmlDocPtr(n_cur, cur, 1);
22662        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22663        xmlResetLastError();
22664        if (mem_base != xmlMemBlocks()) {
22665            printf("Leak of %d blocks found in xmlSaveFileEnc",
22666	           xmlMemBlocks() - mem_base);
22667	    test_ret++;
22668            printf(" %d", n_filename);
22669            printf(" %d", n_cur);
22670            printf(" %d", n_encoding);
22671            printf("\n");
22672        }
22673    }
22674    }
22675    }
22676    function_tests++;
22677#endif
22678
22679    return(test_ret);
22680}
22681
22682
22683static int
22684test_xmlSaveFileTo(void) {
22685    int test_ret = 0;
22686
22687#if defined(LIBXML_OUTPUT_ENABLED)
22688    int mem_base;
22689    int ret_val;
22690    xmlOutputBufferPtr buf; /* an output I/O buffer */
22691    int n_buf;
22692    xmlDocPtr cur; /* the document */
22693    int n_cur;
22694    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22695    int n_encoding;
22696
22697    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22698    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22699    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22700        mem_base = xmlMemBlocks();
22701        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22702        cur = gen_xmlDocPtr(n_cur, 1);
22703        encoding = gen_const_char_ptr(n_encoding, 2);
22704
22705        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22706        buf = NULL;
22707        desret_int(ret_val);
22708        call_tests++;
22709        des_xmlOutputBufferPtr(n_buf, buf, 0);
22710        des_xmlDocPtr(n_cur, cur, 1);
22711        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22712        xmlResetLastError();
22713        if (mem_base != xmlMemBlocks()) {
22714            printf("Leak of %d blocks found in xmlSaveFileTo",
22715	           xmlMemBlocks() - mem_base);
22716	    test_ret++;
22717            printf(" %d", n_buf);
22718            printf(" %d", n_cur);
22719            printf(" %d", n_encoding);
22720            printf("\n");
22721        }
22722    }
22723    }
22724    }
22725    function_tests++;
22726#endif
22727
22728    return(test_ret);
22729}
22730
22731
22732static int
22733test_xmlSaveFormatFile(void) {
22734    int test_ret = 0;
22735
22736#if defined(LIBXML_OUTPUT_ENABLED)
22737    int mem_base;
22738    int ret_val;
22739    const char * filename; /* the filename (or URL) */
22740    int n_filename;
22741    xmlDocPtr cur; /* the document */
22742    int n_cur;
22743    int format; /* should formatting spaces been added */
22744    int n_format;
22745
22746    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22747    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22748    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22749        mem_base = xmlMemBlocks();
22750        filename = gen_fileoutput(n_filename, 0);
22751        cur = gen_xmlDocPtr(n_cur, 1);
22752        format = gen_int(n_format, 2);
22753
22754        ret_val = xmlSaveFormatFile(filename, cur, format);
22755        desret_int(ret_val);
22756        call_tests++;
22757        des_fileoutput(n_filename, filename, 0);
22758        des_xmlDocPtr(n_cur, cur, 1);
22759        des_int(n_format, format, 2);
22760        xmlResetLastError();
22761        if (mem_base != xmlMemBlocks()) {
22762            printf("Leak of %d blocks found in xmlSaveFormatFile",
22763	           xmlMemBlocks() - mem_base);
22764	    test_ret++;
22765            printf(" %d", n_filename);
22766            printf(" %d", n_cur);
22767            printf(" %d", n_format);
22768            printf("\n");
22769        }
22770    }
22771    }
22772    }
22773    function_tests++;
22774#endif
22775
22776    return(test_ret);
22777}
22778
22779
22780static int
22781test_xmlSaveFormatFileEnc(void) {
22782    int test_ret = 0;
22783
22784#if defined(LIBXML_OUTPUT_ENABLED)
22785    int mem_base;
22786    int ret_val;
22787    const char * filename; /* the filename or URL to output */
22788    int n_filename;
22789    xmlDocPtr cur; /* the document being saved */
22790    int n_cur;
22791    char * encoding; /* the name of the encoding to use or NULL. */
22792    int n_encoding;
22793    int format; /* should formatting spaces be added. */
22794    int n_format;
22795
22796    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22797    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22798    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22799    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22800        mem_base = xmlMemBlocks();
22801        filename = gen_fileoutput(n_filename, 0);
22802        cur = gen_xmlDocPtr(n_cur, 1);
22803        encoding = gen_const_char_ptr(n_encoding, 2);
22804        format = gen_int(n_format, 3);
22805
22806        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22807        desret_int(ret_val);
22808        call_tests++;
22809        des_fileoutput(n_filename, filename, 0);
22810        des_xmlDocPtr(n_cur, cur, 1);
22811        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22812        des_int(n_format, format, 3);
22813        xmlResetLastError();
22814        if (mem_base != xmlMemBlocks()) {
22815            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22816	           xmlMemBlocks() - mem_base);
22817	    test_ret++;
22818            printf(" %d", n_filename);
22819            printf(" %d", n_cur);
22820            printf(" %d", n_encoding);
22821            printf(" %d", n_format);
22822            printf("\n");
22823        }
22824    }
22825    }
22826    }
22827    }
22828    function_tests++;
22829#endif
22830
22831    return(test_ret);
22832}
22833
22834
22835static int
22836test_xmlSaveFormatFileTo(void) {
22837    int test_ret = 0;
22838
22839#if defined(LIBXML_OUTPUT_ENABLED)
22840    int mem_base;
22841    int ret_val;
22842    xmlOutputBufferPtr buf; /* an output I/O buffer */
22843    int n_buf;
22844    xmlDocPtr cur; /* the document */
22845    int n_cur;
22846    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22847    int n_encoding;
22848    int format; /* should formatting spaces been added */
22849    int n_format;
22850
22851    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22852    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22853    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22854    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22855        mem_base = xmlMemBlocks();
22856        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22857        cur = gen_xmlDocPtr(n_cur, 1);
22858        encoding = gen_const_char_ptr(n_encoding, 2);
22859        format = gen_int(n_format, 3);
22860
22861        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22862        buf = NULL;
22863        desret_int(ret_val);
22864        call_tests++;
22865        des_xmlOutputBufferPtr(n_buf, buf, 0);
22866        des_xmlDocPtr(n_cur, cur, 1);
22867        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22868        des_int(n_format, format, 3);
22869        xmlResetLastError();
22870        if (mem_base != xmlMemBlocks()) {
22871            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22872	           xmlMemBlocks() - mem_base);
22873	    test_ret++;
22874            printf(" %d", n_buf);
22875            printf(" %d", n_cur);
22876            printf(" %d", n_encoding);
22877            printf(" %d", n_format);
22878            printf("\n");
22879        }
22880    }
22881    }
22882    }
22883    }
22884    function_tests++;
22885#endif
22886
22887    return(test_ret);
22888}
22889
22890
22891static int
22892test_xmlSearchNs(void) {
22893    int test_ret = 0;
22894
22895    int mem_base;
22896    xmlNsPtr ret_val;
22897    xmlDocPtr doc; /* the document */
22898    int n_doc;
22899    xmlNodePtr node; /* the current node */
22900    int n_node;
22901    xmlChar * nameSpace; /* the namespace prefix */
22902    int n_nameSpace;
22903
22904    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22905    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22906    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22907        mem_base = xmlMemBlocks();
22908        doc = gen_xmlDocPtr(n_doc, 0);
22909        node = gen_xmlNodePtr(n_node, 1);
22910        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22911
22912        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
22913        desret_xmlNsPtr(ret_val);
22914        call_tests++;
22915        des_xmlDocPtr(n_doc, doc, 0);
22916        des_xmlNodePtr(n_node, node, 1);
22917        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
22918        xmlResetLastError();
22919        if (mem_base != xmlMemBlocks()) {
22920            printf("Leak of %d blocks found in xmlSearchNs",
22921	           xmlMemBlocks() - mem_base);
22922	    test_ret++;
22923            printf(" %d", n_doc);
22924            printf(" %d", n_node);
22925            printf(" %d", n_nameSpace);
22926            printf("\n");
22927        }
22928    }
22929    }
22930    }
22931    function_tests++;
22932
22933    return(test_ret);
22934}
22935
22936
22937static int
22938test_xmlSearchNsByHref(void) {
22939    int test_ret = 0;
22940
22941    int mem_base;
22942    xmlNsPtr ret_val;
22943    xmlDocPtr doc; /* the document */
22944    int n_doc;
22945    xmlNodePtr node; /* the current node */
22946    int n_node;
22947    xmlChar * href; /* the namespace value */
22948    int n_href;
22949
22950    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22951    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22952    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22953        mem_base = xmlMemBlocks();
22954        doc = gen_xmlDocPtr(n_doc, 0);
22955        node = gen_xmlNodePtr(n_node, 1);
22956        href = gen_const_xmlChar_ptr(n_href, 2);
22957
22958        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
22959        desret_xmlNsPtr(ret_val);
22960        call_tests++;
22961        des_xmlDocPtr(n_doc, doc, 0);
22962        des_xmlNodePtr(n_node, node, 1);
22963        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
22964        xmlResetLastError();
22965        if (mem_base != xmlMemBlocks()) {
22966            printf("Leak of %d blocks found in xmlSearchNsByHref",
22967	           xmlMemBlocks() - mem_base);
22968	    test_ret++;
22969            printf(" %d", n_doc);
22970            printf(" %d", n_node);
22971            printf(" %d", n_href);
22972            printf("\n");
22973        }
22974    }
22975    }
22976    }
22977    function_tests++;
22978
22979    return(test_ret);
22980}
22981
22982
22983static int
22984test_xmlSetBufferAllocationScheme(void) {
22985    int test_ret = 0;
22986
22987    int mem_base;
22988    xmlBufferAllocationScheme scheme; /* allocation method to use */
22989    int n_scheme;
22990
22991    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
22992        mem_base = xmlMemBlocks();
22993        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
22994
22995        xmlSetBufferAllocationScheme(scheme);
22996        call_tests++;
22997        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
22998        xmlResetLastError();
22999        if (mem_base != xmlMemBlocks()) {
23000            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23001	           xmlMemBlocks() - mem_base);
23002	    test_ret++;
23003            printf(" %d", n_scheme);
23004            printf("\n");
23005        }
23006    }
23007    function_tests++;
23008
23009    return(test_ret);
23010}
23011
23012
23013static int
23014test_xmlSetCompressMode(void) {
23015    int test_ret = 0;
23016
23017    int mem_base;
23018    int mode; /* the compression ratio */
23019    int n_mode;
23020
23021    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23022        mem_base = xmlMemBlocks();
23023        mode = gen_int(n_mode, 0);
23024
23025        xmlSetCompressMode(mode);
23026        call_tests++;
23027        des_int(n_mode, mode, 0);
23028        xmlResetLastError();
23029        if (mem_base != xmlMemBlocks()) {
23030            printf("Leak of %d blocks found in xmlSetCompressMode",
23031	           xmlMemBlocks() - mem_base);
23032	    test_ret++;
23033            printf(" %d", n_mode);
23034            printf("\n");
23035        }
23036    }
23037    function_tests++;
23038
23039    return(test_ret);
23040}
23041
23042
23043static int
23044test_xmlSetDocCompressMode(void) {
23045    int test_ret = 0;
23046
23047    int mem_base;
23048    xmlDocPtr doc; /* the document */
23049    int n_doc;
23050    int mode; /* the compression ratio */
23051    int n_mode;
23052
23053    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23054    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23055        mem_base = xmlMemBlocks();
23056        doc = gen_xmlDocPtr(n_doc, 0);
23057        mode = gen_int(n_mode, 1);
23058
23059        xmlSetDocCompressMode(doc, mode);
23060        call_tests++;
23061        des_xmlDocPtr(n_doc, doc, 0);
23062        des_int(n_mode, mode, 1);
23063        xmlResetLastError();
23064        if (mem_base != xmlMemBlocks()) {
23065            printf("Leak of %d blocks found in xmlSetDocCompressMode",
23066	           xmlMemBlocks() - mem_base);
23067	    test_ret++;
23068            printf(" %d", n_doc);
23069            printf(" %d", n_mode);
23070            printf("\n");
23071        }
23072    }
23073    }
23074    function_tests++;
23075
23076    return(test_ret);
23077}
23078
23079
23080static int
23081test_xmlSetNs(void) {
23082    int test_ret = 0;
23083
23084    int mem_base;
23085    xmlNodePtr node; /* a node in the document */
23086    int n_node;
23087    xmlNsPtr ns; /* a namespace pointer */
23088    int n_ns;
23089
23090    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23091    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23092        mem_base = xmlMemBlocks();
23093        node = gen_xmlNodePtr(n_node, 0);
23094        ns = gen_xmlNsPtr(n_ns, 1);
23095
23096        xmlSetNs(node, ns);
23097        call_tests++;
23098        des_xmlNodePtr(n_node, node, 0);
23099        des_xmlNsPtr(n_ns, ns, 1);
23100        xmlResetLastError();
23101        if (mem_base != xmlMemBlocks()) {
23102            printf("Leak of %d blocks found in xmlSetNs",
23103	           xmlMemBlocks() - mem_base);
23104	    test_ret++;
23105            printf(" %d", n_node);
23106            printf(" %d", n_ns);
23107            printf("\n");
23108        }
23109    }
23110    }
23111    function_tests++;
23112
23113    return(test_ret);
23114}
23115
23116
23117static int
23118test_xmlSetNsProp(void) {
23119    int test_ret = 0;
23120
23121#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23122    int mem_base;
23123    xmlAttrPtr ret_val;
23124    xmlNodePtr node; /* the node */
23125    int n_node;
23126    xmlNsPtr ns; /* the namespace definition */
23127    int n_ns;
23128    xmlChar * name; /* the attribute name */
23129    int n_name;
23130    xmlChar * value; /* the attribute value */
23131    int n_value;
23132
23133    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23134    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23135    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23136    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23137        mem_base = xmlMemBlocks();
23138        node = gen_xmlNodePtr(n_node, 0);
23139        ns = gen_xmlNsPtr(n_ns, 1);
23140        name = gen_const_xmlChar_ptr(n_name, 2);
23141        value = gen_const_xmlChar_ptr(n_value, 3);
23142
23143        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23144        desret_xmlAttrPtr(ret_val);
23145        call_tests++;
23146        des_xmlNodePtr(n_node, node, 0);
23147        des_xmlNsPtr(n_ns, ns, 1);
23148        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23149        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23150        xmlResetLastError();
23151        if (mem_base != xmlMemBlocks()) {
23152            printf("Leak of %d blocks found in xmlSetNsProp",
23153	           xmlMemBlocks() - mem_base);
23154	    test_ret++;
23155            printf(" %d", n_node);
23156            printf(" %d", n_ns);
23157            printf(" %d", n_name);
23158            printf(" %d", n_value);
23159            printf("\n");
23160        }
23161    }
23162    }
23163    }
23164    }
23165    function_tests++;
23166#endif
23167
23168    return(test_ret);
23169}
23170
23171
23172static int
23173test_xmlSetProp(void) {
23174    int test_ret = 0;
23175
23176#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23177    int mem_base;
23178    xmlAttrPtr ret_val;
23179    xmlNodePtr node; /* the node */
23180    int n_node;
23181    xmlChar * name; /* the attribute name (a QName) */
23182    int n_name;
23183    xmlChar * value; /* the attribute value */
23184    int n_value;
23185
23186    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23187    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23188    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23189        mem_base = xmlMemBlocks();
23190        node = gen_xmlNodePtr(n_node, 0);
23191        name = gen_const_xmlChar_ptr(n_name, 1);
23192        value = gen_const_xmlChar_ptr(n_value, 2);
23193
23194        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23195        desret_xmlAttrPtr(ret_val);
23196        call_tests++;
23197        des_xmlNodePtr(n_node, node, 0);
23198        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23199        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23200        xmlResetLastError();
23201        if (mem_base != xmlMemBlocks()) {
23202            printf("Leak of %d blocks found in xmlSetProp",
23203	           xmlMemBlocks() - mem_base);
23204	    test_ret++;
23205            printf(" %d", n_node);
23206            printf(" %d", n_name);
23207            printf(" %d", n_value);
23208            printf("\n");
23209        }
23210    }
23211    }
23212    }
23213    function_tests++;
23214#endif
23215
23216    return(test_ret);
23217}
23218
23219
23220static int
23221test_xmlSplitQName2(void) {
23222    int test_ret = 0;
23223
23224    int mem_base;
23225    xmlChar * ret_val;
23226    xmlChar * name; /* the full QName */
23227    int n_name;
23228    xmlChar ** prefix; /* a xmlChar ** */
23229    int n_prefix;
23230
23231    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23232    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23233        mem_base = xmlMemBlocks();
23234        name = gen_const_xmlChar_ptr(n_name, 0);
23235        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23236
23237        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23238        desret_xmlChar_ptr(ret_val);
23239        call_tests++;
23240        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23241        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23242        xmlResetLastError();
23243        if (mem_base != xmlMemBlocks()) {
23244            printf("Leak of %d blocks found in xmlSplitQName2",
23245	           xmlMemBlocks() - mem_base);
23246	    test_ret++;
23247            printf(" %d", n_name);
23248            printf(" %d", n_prefix);
23249            printf("\n");
23250        }
23251    }
23252    }
23253    function_tests++;
23254
23255    return(test_ret);
23256}
23257
23258
23259static int
23260test_xmlSplitQName3(void) {
23261    int test_ret = 0;
23262
23263    int mem_base;
23264    const xmlChar * ret_val;
23265    xmlChar * name; /* the full QName */
23266    int n_name;
23267    int * len; /* an int * */
23268    int n_len;
23269
23270    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23271    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23272        mem_base = xmlMemBlocks();
23273        name = gen_const_xmlChar_ptr(n_name, 0);
23274        len = gen_int_ptr(n_len, 1);
23275
23276        ret_val = xmlSplitQName3((const xmlChar *)name, len);
23277        desret_const_xmlChar_ptr(ret_val);
23278        call_tests++;
23279        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23280        des_int_ptr(n_len, len, 1);
23281        xmlResetLastError();
23282        if (mem_base != xmlMemBlocks()) {
23283            printf("Leak of %d blocks found in xmlSplitQName3",
23284	           xmlMemBlocks() - mem_base);
23285	    test_ret++;
23286            printf(" %d", n_name);
23287            printf(" %d", n_len);
23288            printf("\n");
23289        }
23290    }
23291    }
23292    function_tests++;
23293
23294    return(test_ret);
23295}
23296
23297
23298static int
23299test_xmlStringGetNodeList(void) {
23300    int test_ret = 0;
23301
23302    int mem_base;
23303    xmlNodePtr ret_val;
23304    xmlDocPtr doc; /* the document */
23305    int n_doc;
23306    xmlChar * value; /* the value of the attribute */
23307    int n_value;
23308
23309    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23310    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23311        mem_base = xmlMemBlocks();
23312        doc = gen_xmlDocPtr(n_doc, 0);
23313        value = gen_const_xmlChar_ptr(n_value, 1);
23314
23315        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23316        desret_xmlNodePtr(ret_val);
23317        call_tests++;
23318        des_xmlDocPtr(n_doc, doc, 0);
23319        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23320        xmlResetLastError();
23321        if (mem_base != xmlMemBlocks()) {
23322            printf("Leak of %d blocks found in xmlStringGetNodeList",
23323	           xmlMemBlocks() - mem_base);
23324	    test_ret++;
23325            printf(" %d", n_doc);
23326            printf(" %d", n_value);
23327            printf("\n");
23328        }
23329    }
23330    }
23331    function_tests++;
23332
23333    return(test_ret);
23334}
23335
23336
23337static int
23338test_xmlStringLenGetNodeList(void) {
23339    int test_ret = 0;
23340
23341    int mem_base;
23342    xmlNodePtr ret_val;
23343    xmlDocPtr doc; /* the document */
23344    int n_doc;
23345    xmlChar * value; /* the value of the text */
23346    int n_value;
23347    int len; /* the length of the string value */
23348    int n_len;
23349
23350    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23351    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23352    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23353        mem_base = xmlMemBlocks();
23354        doc = gen_xmlDocPtr(n_doc, 0);
23355        value = gen_const_xmlChar_ptr(n_value, 1);
23356        len = gen_int(n_len, 2);
23357
23358        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23359        desret_xmlNodePtr(ret_val);
23360        call_tests++;
23361        des_xmlDocPtr(n_doc, doc, 0);
23362        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23363        des_int(n_len, len, 2);
23364        xmlResetLastError();
23365        if (mem_base != xmlMemBlocks()) {
23366            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23367	           xmlMemBlocks() - mem_base);
23368	    test_ret++;
23369            printf(" %d", n_doc);
23370            printf(" %d", n_value);
23371            printf(" %d", n_len);
23372            printf("\n");
23373        }
23374    }
23375    }
23376    }
23377    function_tests++;
23378
23379    return(test_ret);
23380}
23381
23382
23383static int
23384test_xmlTextConcat(void) {
23385    int test_ret = 0;
23386
23387    int mem_base;
23388    int ret_val;
23389    xmlNodePtr node; /* the node */
23390    int n_node;
23391    xmlChar * content; /* the content */
23392    int n_content;
23393    int len; /* @content length */
23394    int n_len;
23395
23396    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23397    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23398    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23399        mem_base = xmlMemBlocks();
23400        node = gen_xmlNodePtr(n_node, 0);
23401        content = gen_const_xmlChar_ptr(n_content, 1);
23402        len = gen_int(n_len, 2);
23403
23404        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23405        desret_int(ret_val);
23406        call_tests++;
23407        des_xmlNodePtr(n_node, node, 0);
23408        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23409        des_int(n_len, len, 2);
23410        xmlResetLastError();
23411        if (mem_base != xmlMemBlocks()) {
23412            printf("Leak of %d blocks found in xmlTextConcat",
23413	           xmlMemBlocks() - mem_base);
23414	    test_ret++;
23415            printf(" %d", n_node);
23416            printf(" %d", n_content);
23417            printf(" %d", n_len);
23418            printf("\n");
23419        }
23420    }
23421    }
23422    }
23423    function_tests++;
23424
23425    return(test_ret);
23426}
23427
23428
23429static int
23430test_xmlTextMerge(void) {
23431    int test_ret = 0;
23432
23433    int mem_base;
23434    xmlNodePtr ret_val;
23435    xmlNodePtr first; /* the first text node */
23436    int n_first;
23437    xmlNodePtr second; /* the second text node being merged */
23438    int n_second;
23439
23440    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23441    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23442        mem_base = xmlMemBlocks();
23443        first = gen_xmlNodePtr_in(n_first, 0);
23444        second = gen_xmlNodePtr_in(n_second, 1);
23445
23446        ret_val = xmlTextMerge(first, second);
23447        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23448              xmlUnlinkNode(second);
23449              xmlFreeNode(second) ; second = NULL ; }
23450        desret_xmlNodePtr(ret_val);
23451        call_tests++;
23452        des_xmlNodePtr_in(n_first, first, 0);
23453        des_xmlNodePtr_in(n_second, second, 1);
23454        xmlResetLastError();
23455        if (mem_base != xmlMemBlocks()) {
23456            printf("Leak of %d blocks found in xmlTextMerge",
23457	           xmlMemBlocks() - mem_base);
23458	    test_ret++;
23459            printf(" %d", n_first);
23460            printf(" %d", n_second);
23461            printf("\n");
23462        }
23463    }
23464    }
23465    function_tests++;
23466
23467    return(test_ret);
23468}
23469
23470
23471static int
23472test_xmlUnsetNsProp(void) {
23473    int test_ret = 0;
23474
23475#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23476    int mem_base;
23477    int ret_val;
23478    xmlNodePtr node; /* the node */
23479    int n_node;
23480    xmlNsPtr ns; /* the namespace definition */
23481    int n_ns;
23482    xmlChar * name; /* the attribute name */
23483    int n_name;
23484
23485    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23486    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23487    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23488        mem_base = xmlMemBlocks();
23489        node = gen_xmlNodePtr(n_node, 0);
23490        ns = gen_xmlNsPtr(n_ns, 1);
23491        name = gen_const_xmlChar_ptr(n_name, 2);
23492
23493        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23494        desret_int(ret_val);
23495        call_tests++;
23496        des_xmlNodePtr(n_node, node, 0);
23497        des_xmlNsPtr(n_ns, ns, 1);
23498        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23499        xmlResetLastError();
23500        if (mem_base != xmlMemBlocks()) {
23501            printf("Leak of %d blocks found in xmlUnsetNsProp",
23502	           xmlMemBlocks() - mem_base);
23503	    test_ret++;
23504            printf(" %d", n_node);
23505            printf(" %d", n_ns);
23506            printf(" %d", n_name);
23507            printf("\n");
23508        }
23509    }
23510    }
23511    }
23512    function_tests++;
23513#endif
23514
23515    return(test_ret);
23516}
23517
23518
23519static int
23520test_xmlUnsetProp(void) {
23521    int test_ret = 0;
23522
23523#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23524    int mem_base;
23525    int ret_val;
23526    xmlNodePtr node; /* the node */
23527    int n_node;
23528    xmlChar * name; /* the attribute name */
23529    int n_name;
23530
23531    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23532    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23533        mem_base = xmlMemBlocks();
23534        node = gen_xmlNodePtr(n_node, 0);
23535        name = gen_const_xmlChar_ptr(n_name, 1);
23536
23537        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23538        desret_int(ret_val);
23539        call_tests++;
23540        des_xmlNodePtr(n_node, node, 0);
23541        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23542        xmlResetLastError();
23543        if (mem_base != xmlMemBlocks()) {
23544            printf("Leak of %d blocks found in xmlUnsetProp",
23545	           xmlMemBlocks() - mem_base);
23546	    test_ret++;
23547            printf(" %d", n_node);
23548            printf(" %d", n_name);
23549            printf("\n");
23550        }
23551    }
23552    }
23553    function_tests++;
23554#endif
23555
23556    return(test_ret);
23557}
23558
23559
23560static int
23561test_xmlValidateNCName(void) {
23562    int test_ret = 0;
23563
23564#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED)
23565#ifdef LIBXML_TREE_ENABLED
23566    int mem_base;
23567    int ret_val;
23568    xmlChar * value; /* the value to check */
23569    int n_value;
23570    int space; /* allow spaces in front and end of the string */
23571    int n_space;
23572
23573    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23574    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23575        mem_base = xmlMemBlocks();
23576        value = gen_const_xmlChar_ptr(n_value, 0);
23577        space = gen_int(n_space, 1);
23578
23579        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23580        desret_int(ret_val);
23581        call_tests++;
23582        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23583        des_int(n_space, space, 1);
23584        xmlResetLastError();
23585        if (mem_base != xmlMemBlocks()) {
23586            printf("Leak of %d blocks found in xmlValidateNCName",
23587	           xmlMemBlocks() - mem_base);
23588	    test_ret++;
23589            printf(" %d", n_value);
23590            printf(" %d", n_space);
23591            printf("\n");
23592        }
23593    }
23594    }
23595    function_tests++;
23596#endif
23597#endif
23598
23599    return(test_ret);
23600}
23601
23602
23603static int
23604test_xmlValidateNMToken(void) {
23605    int test_ret = 0;
23606
23607#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23608#ifdef LIBXML_TREE_ENABLED
23609    int mem_base;
23610    int ret_val;
23611    xmlChar * value; /* the value to check */
23612    int n_value;
23613    int space; /* allow spaces in front and end of the string */
23614    int n_space;
23615
23616    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23617    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23618        mem_base = xmlMemBlocks();
23619        value = gen_const_xmlChar_ptr(n_value, 0);
23620        space = gen_int(n_space, 1);
23621
23622        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23623        desret_int(ret_val);
23624        call_tests++;
23625        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23626        des_int(n_space, space, 1);
23627        xmlResetLastError();
23628        if (mem_base != xmlMemBlocks()) {
23629            printf("Leak of %d blocks found in xmlValidateNMToken",
23630	           xmlMemBlocks() - mem_base);
23631	    test_ret++;
23632            printf(" %d", n_value);
23633            printf(" %d", n_space);
23634            printf("\n");
23635        }
23636    }
23637    }
23638    function_tests++;
23639#endif
23640#endif
23641
23642    return(test_ret);
23643}
23644
23645
23646static int
23647test_xmlValidateName(void) {
23648    int test_ret = 0;
23649
23650#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23651#ifdef LIBXML_TREE_ENABLED
23652    int mem_base;
23653    int ret_val;
23654    xmlChar * value; /* the value to check */
23655    int n_value;
23656    int space; /* allow spaces in front and end of the string */
23657    int n_space;
23658
23659    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23660    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23661        mem_base = xmlMemBlocks();
23662        value = gen_const_xmlChar_ptr(n_value, 0);
23663        space = gen_int(n_space, 1);
23664
23665        ret_val = xmlValidateName((const xmlChar *)value, space);
23666        desret_int(ret_val);
23667        call_tests++;
23668        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23669        des_int(n_space, space, 1);
23670        xmlResetLastError();
23671        if (mem_base != xmlMemBlocks()) {
23672            printf("Leak of %d blocks found in xmlValidateName",
23673	           xmlMemBlocks() - mem_base);
23674	    test_ret++;
23675            printf(" %d", n_value);
23676            printf(" %d", n_space);
23677            printf("\n");
23678        }
23679    }
23680    }
23681    function_tests++;
23682#endif
23683#endif
23684
23685    return(test_ret);
23686}
23687
23688
23689static int
23690test_xmlValidateQName(void) {
23691    int test_ret = 0;
23692
23693#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23694#ifdef LIBXML_TREE_ENABLED
23695    int mem_base;
23696    int ret_val;
23697    xmlChar * value; /* the value to check */
23698    int n_value;
23699    int space; /* allow spaces in front and end of the string */
23700    int n_space;
23701
23702    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23703    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23704        mem_base = xmlMemBlocks();
23705        value = gen_const_xmlChar_ptr(n_value, 0);
23706        space = gen_int(n_space, 1);
23707
23708        ret_val = xmlValidateQName((const xmlChar *)value, space);
23709        desret_int(ret_val);
23710        call_tests++;
23711        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23712        des_int(n_space, space, 1);
23713        xmlResetLastError();
23714        if (mem_base != xmlMemBlocks()) {
23715            printf("Leak of %d blocks found in xmlValidateQName",
23716	           xmlMemBlocks() - mem_base);
23717	    test_ret++;
23718            printf(" %d", n_value);
23719            printf(" %d", n_space);
23720            printf("\n");
23721        }
23722    }
23723    }
23724    function_tests++;
23725#endif
23726#endif
23727
23728    return(test_ret);
23729}
23730
23731static int
23732test_tree(void) {
23733    int test_ret = 0;
23734
23735    if (quiet == 0) printf("Testing tree : 133 of 152 functions ...\n");
23736    test_ret += test_xmlAddChild();
23737    test_ret += test_xmlAddChildList();
23738    test_ret += test_xmlAddNextSibling();
23739    test_ret += test_xmlAddPrevSibling();
23740    test_ret += test_xmlAddSibling();
23741    test_ret += test_xmlAttrSerializeTxtContent();
23742    test_ret += test_xmlBufferAdd();
23743    test_ret += test_xmlBufferAddHead();
23744    test_ret += test_xmlBufferCCat();
23745    test_ret += test_xmlBufferCat();
23746    test_ret += test_xmlBufferContent();
23747    test_ret += test_xmlBufferCreate();
23748    test_ret += test_xmlBufferCreateSize();
23749    test_ret += test_xmlBufferCreateStatic();
23750    test_ret += test_xmlBufferEmpty();
23751    test_ret += test_xmlBufferGrow();
23752    test_ret += test_xmlBufferLength();
23753    test_ret += test_xmlBufferResize();
23754    test_ret += test_xmlBufferSetAllocationScheme();
23755    test_ret += test_xmlBufferShrink();
23756    test_ret += test_xmlBufferWriteCHAR();
23757    test_ret += test_xmlBufferWriteChar();
23758    test_ret += test_xmlBufferWriteQuotedString();
23759    test_ret += test_xmlBuildQName();
23760    test_ret += test_xmlCopyDoc();
23761    test_ret += test_xmlCopyDtd();
23762    test_ret += test_xmlCopyNamespace();
23763    test_ret += test_xmlCopyNamespaceList();
23764    test_ret += test_xmlCopyNode();
23765    test_ret += test_xmlCopyNodeList();
23766    test_ret += test_xmlCopyProp();
23767    test_ret += test_xmlCopyPropList();
23768    test_ret += test_xmlCreateIntSubset();
23769    test_ret += test_xmlDOMWrapAdoptNode();
23770    test_ret += test_xmlDOMWrapCloneNode();
23771    test_ret += test_xmlDOMWrapNewCtxt();
23772    test_ret += test_xmlDOMWrapReconcileNamespaces();
23773    test_ret += test_xmlDOMWrapRemoveNode();
23774    test_ret += test_xmlDocCopyNode();
23775    test_ret += test_xmlDocCopyNodeList();
23776    test_ret += test_xmlDocDump();
23777    test_ret += test_xmlDocDumpFormatMemory();
23778    test_ret += test_xmlDocDumpFormatMemoryEnc();
23779    test_ret += test_xmlDocDumpMemory();
23780    test_ret += test_xmlDocDumpMemoryEnc();
23781    test_ret += test_xmlDocFormatDump();
23782    test_ret += test_xmlDocGetRootElement();
23783    test_ret += test_xmlDocSetRootElement();
23784    test_ret += test_xmlElemDump();
23785    test_ret += test_xmlGetBufferAllocationScheme();
23786    test_ret += test_xmlGetCompressMode();
23787    test_ret += test_xmlGetDocCompressMode();
23788    test_ret += test_xmlGetIntSubset();
23789    test_ret += test_xmlGetLastChild();
23790    test_ret += test_xmlGetLineNo();
23791    test_ret += test_xmlGetNoNsProp();
23792    test_ret += test_xmlGetNodePath();
23793    test_ret += test_xmlGetNsList();
23794    test_ret += test_xmlGetNsProp();
23795    test_ret += test_xmlGetProp();
23796    test_ret += test_xmlHasNsProp();
23797    test_ret += test_xmlHasProp();
23798    test_ret += test_xmlIsBlankNode();
23799    test_ret += test_xmlIsXHTML();
23800    test_ret += test_xmlNewCDataBlock();
23801    test_ret += test_xmlNewCharRef();
23802    test_ret += test_xmlNewChild();
23803    test_ret += test_xmlNewComment();
23804    test_ret += test_xmlNewDoc();
23805    test_ret += test_xmlNewDocComment();
23806    test_ret += test_xmlNewDocFragment();
23807    test_ret += test_xmlNewDocNode();
23808    test_ret += test_xmlNewDocNodeEatName();
23809    test_ret += test_xmlNewDocPI();
23810    test_ret += test_xmlNewDocProp();
23811    test_ret += test_xmlNewDocRawNode();
23812    test_ret += test_xmlNewDocText();
23813    test_ret += test_xmlNewDocTextLen();
23814    test_ret += test_xmlNewDtd();
23815    test_ret += test_xmlNewNode();
23816    test_ret += test_xmlNewNodeEatName();
23817    test_ret += test_xmlNewNs();
23818    test_ret += test_xmlNewNsProp();
23819    test_ret += test_xmlNewNsPropEatName();
23820    test_ret += test_xmlNewPI();
23821    test_ret += test_xmlNewProp();
23822    test_ret += test_xmlNewReference();
23823    test_ret += test_xmlNewText();
23824    test_ret += test_xmlNewTextChild();
23825    test_ret += test_xmlNewTextLen();
23826    test_ret += test_xmlNodeAddContent();
23827    test_ret += test_xmlNodeAddContentLen();
23828    test_ret += test_xmlNodeBufGetContent();
23829    test_ret += test_xmlNodeDump();
23830    test_ret += test_xmlNodeDumpOutput();
23831    test_ret += test_xmlNodeGetBase();
23832    test_ret += test_xmlNodeGetContent();
23833    test_ret += test_xmlNodeGetLang();
23834    test_ret += test_xmlNodeGetSpacePreserve();
23835    test_ret += test_xmlNodeIsText();
23836    test_ret += test_xmlNodeListGetRawString();
23837    test_ret += test_xmlNodeListGetString();
23838    test_ret += test_xmlNodeSetBase();
23839    test_ret += test_xmlNodeSetContent();
23840    test_ret += test_xmlNodeSetContentLen();
23841    test_ret += test_xmlNodeSetLang();
23842    test_ret += test_xmlNodeSetName();
23843    test_ret += test_xmlNodeSetSpacePreserve();
23844    test_ret += test_xmlReconciliateNs();
23845    test_ret += test_xmlRemoveProp();
23846    test_ret += test_xmlReplaceNode();
23847    test_ret += test_xmlSaveFile();
23848    test_ret += test_xmlSaveFileEnc();
23849    test_ret += test_xmlSaveFileTo();
23850    test_ret += test_xmlSaveFormatFile();
23851    test_ret += test_xmlSaveFormatFileEnc();
23852    test_ret += test_xmlSaveFormatFileTo();
23853    test_ret += test_xmlSearchNs();
23854    test_ret += test_xmlSearchNsByHref();
23855    test_ret += test_xmlSetBufferAllocationScheme();
23856    test_ret += test_xmlSetCompressMode();
23857    test_ret += test_xmlSetDocCompressMode();
23858    test_ret += test_xmlSetNs();
23859    test_ret += test_xmlSetNsProp();
23860    test_ret += test_xmlSetProp();
23861    test_ret += test_xmlSplitQName2();
23862    test_ret += test_xmlSplitQName3();
23863    test_ret += test_xmlStringGetNodeList();
23864    test_ret += test_xmlStringLenGetNodeList();
23865    test_ret += test_xmlTextConcat();
23866    test_ret += test_xmlTextMerge();
23867    test_ret += test_xmlUnsetNsProp();
23868    test_ret += test_xmlUnsetProp();
23869    test_ret += test_xmlValidateNCName();
23870    test_ret += test_xmlValidateNMToken();
23871    test_ret += test_xmlValidateName();
23872    test_ret += test_xmlValidateQName();
23873
23874    if (test_ret != 0)
23875	printf("Module tree: %d errors\n", test_ret);
23876    return(test_ret);
23877}
23878
23879static int
23880test_xmlBuildRelativeURI(void) {
23881    int test_ret = 0;
23882
23883    int mem_base;
23884    xmlChar * ret_val;
23885    xmlChar * URI; /* the URI reference under consideration */
23886    int n_URI;
23887    xmlChar * base; /* the base value */
23888    int n_base;
23889
23890    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23891    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23892        mem_base = xmlMemBlocks();
23893        URI = gen_const_xmlChar_ptr(n_URI, 0);
23894        base = gen_const_xmlChar_ptr(n_base, 1);
23895
23896        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
23897        desret_xmlChar_ptr(ret_val);
23898        call_tests++;
23899        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23900        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23901        xmlResetLastError();
23902        if (mem_base != xmlMemBlocks()) {
23903            printf("Leak of %d blocks found in xmlBuildRelativeURI",
23904	           xmlMemBlocks() - mem_base);
23905	    test_ret++;
23906            printf(" %d", n_URI);
23907            printf(" %d", n_base);
23908            printf("\n");
23909        }
23910    }
23911    }
23912    function_tests++;
23913
23914    return(test_ret);
23915}
23916
23917
23918static int
23919test_xmlBuildURI(void) {
23920    int test_ret = 0;
23921
23922    int mem_base;
23923    xmlChar * ret_val;
23924    xmlChar * URI; /* the URI instance found in the document */
23925    int n_URI;
23926    xmlChar * base; /* the base value */
23927    int n_base;
23928
23929    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23930    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23931        mem_base = xmlMemBlocks();
23932        URI = gen_const_xmlChar_ptr(n_URI, 0);
23933        base = gen_const_xmlChar_ptr(n_base, 1);
23934
23935        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
23936        desret_xmlChar_ptr(ret_val);
23937        call_tests++;
23938        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23939        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23940        xmlResetLastError();
23941        if (mem_base != xmlMemBlocks()) {
23942            printf("Leak of %d blocks found in xmlBuildURI",
23943	           xmlMemBlocks() - mem_base);
23944	    test_ret++;
23945            printf(" %d", n_URI);
23946            printf(" %d", n_base);
23947            printf("\n");
23948        }
23949    }
23950    }
23951    function_tests++;
23952
23953    return(test_ret);
23954}
23955
23956
23957static int
23958test_xmlCanonicPath(void) {
23959    int test_ret = 0;
23960
23961    int mem_base;
23962    xmlChar * ret_val;
23963    xmlChar * path; /* the resource locator in a filesystem notation */
23964    int n_path;
23965
23966    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
23967        mem_base = xmlMemBlocks();
23968        path = gen_const_xmlChar_ptr(n_path, 0);
23969
23970        ret_val = xmlCanonicPath((const xmlChar *)path);
23971        desret_xmlChar_ptr(ret_val);
23972        call_tests++;
23973        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
23974        xmlResetLastError();
23975        if (mem_base != xmlMemBlocks()) {
23976            printf("Leak of %d blocks found in xmlCanonicPath",
23977	           xmlMemBlocks() - mem_base);
23978	    test_ret++;
23979            printf(" %d", n_path);
23980            printf("\n");
23981        }
23982    }
23983    function_tests++;
23984
23985    return(test_ret);
23986}
23987
23988
23989static int
23990test_xmlCreateURI(void) {
23991    int test_ret = 0;
23992
23993
23994    /* missing type support */
23995    return(test_ret);
23996}
23997
23998
23999static int
24000test_xmlNormalizeURIPath(void) {
24001    int test_ret = 0;
24002
24003    int mem_base;
24004    int ret_val;
24005    char * path; /* pointer to the path string */
24006    int n_path;
24007
24008    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24009        mem_base = xmlMemBlocks();
24010        path = gen_char_ptr(n_path, 0);
24011
24012        ret_val = xmlNormalizeURIPath(path);
24013        desret_int(ret_val);
24014        call_tests++;
24015        des_char_ptr(n_path, path, 0);
24016        xmlResetLastError();
24017        if (mem_base != xmlMemBlocks()) {
24018            printf("Leak of %d blocks found in xmlNormalizeURIPath",
24019	           xmlMemBlocks() - mem_base);
24020	    test_ret++;
24021            printf(" %d", n_path);
24022            printf("\n");
24023        }
24024    }
24025    function_tests++;
24026
24027    return(test_ret);
24028}
24029
24030
24031static int
24032test_xmlParseURI(void) {
24033    int test_ret = 0;
24034
24035
24036    /* missing type support */
24037    return(test_ret);
24038}
24039
24040
24041static int
24042test_xmlParseURIRaw(void) {
24043    int test_ret = 0;
24044
24045
24046    /* missing type support */
24047    return(test_ret);
24048}
24049
24050
24051#define gen_nb_xmlURIPtr 1
24052static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24053    return(NULL);
24054}
24055static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24056}
24057
24058static int
24059test_xmlParseURIReference(void) {
24060    int test_ret = 0;
24061
24062    int mem_base;
24063    int ret_val;
24064    xmlURIPtr uri; /* pointer to an URI structure */
24065    int n_uri;
24066    char * str; /* the string to analyze */
24067    int n_str;
24068
24069    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24070    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24071        mem_base = xmlMemBlocks();
24072        uri = gen_xmlURIPtr(n_uri, 0);
24073        str = gen_const_char_ptr(n_str, 1);
24074
24075        ret_val = xmlParseURIReference(uri, (const char *)str);
24076        desret_int(ret_val);
24077        call_tests++;
24078        des_xmlURIPtr(n_uri, uri, 0);
24079        des_const_char_ptr(n_str, (const char *)str, 1);
24080        xmlResetLastError();
24081        if (mem_base != xmlMemBlocks()) {
24082            printf("Leak of %d blocks found in xmlParseURIReference",
24083	           xmlMemBlocks() - mem_base);
24084	    test_ret++;
24085            printf(" %d", n_uri);
24086            printf(" %d", n_str);
24087            printf("\n");
24088        }
24089    }
24090    }
24091    function_tests++;
24092
24093    return(test_ret);
24094}
24095
24096
24097static int
24098test_xmlPrintURI(void) {
24099    int test_ret = 0;
24100
24101    int mem_base;
24102    FILE * stream; /* a FILE* for the output */
24103    int n_stream;
24104    xmlURIPtr uri; /* pointer to an xmlURI */
24105    int n_uri;
24106
24107    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24108    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24109        mem_base = xmlMemBlocks();
24110        stream = gen_FILE_ptr(n_stream, 0);
24111        uri = gen_xmlURIPtr(n_uri, 1);
24112
24113        xmlPrintURI(stream, uri);
24114        call_tests++;
24115        des_FILE_ptr(n_stream, stream, 0);
24116        des_xmlURIPtr(n_uri, uri, 1);
24117        xmlResetLastError();
24118        if (mem_base != xmlMemBlocks()) {
24119            printf("Leak of %d blocks found in xmlPrintURI",
24120	           xmlMemBlocks() - mem_base);
24121	    test_ret++;
24122            printf(" %d", n_stream);
24123            printf(" %d", n_uri);
24124            printf("\n");
24125        }
24126    }
24127    }
24128    function_tests++;
24129
24130    return(test_ret);
24131}
24132
24133
24134static int
24135test_xmlSaveUri(void) {
24136    int test_ret = 0;
24137
24138    int mem_base;
24139    xmlChar * ret_val;
24140    xmlURIPtr uri; /* pointer to an xmlURI */
24141    int n_uri;
24142
24143    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24144        mem_base = xmlMemBlocks();
24145        uri = gen_xmlURIPtr(n_uri, 0);
24146
24147        ret_val = xmlSaveUri(uri);
24148        desret_xmlChar_ptr(ret_val);
24149        call_tests++;
24150        des_xmlURIPtr(n_uri, uri, 0);
24151        xmlResetLastError();
24152        if (mem_base != xmlMemBlocks()) {
24153            printf("Leak of %d blocks found in xmlSaveUri",
24154	           xmlMemBlocks() - mem_base);
24155	    test_ret++;
24156            printf(" %d", n_uri);
24157            printf("\n");
24158        }
24159    }
24160    function_tests++;
24161
24162    return(test_ret);
24163}
24164
24165
24166static int
24167test_xmlURIEscape(void) {
24168    int test_ret = 0;
24169
24170    int mem_base;
24171    xmlChar * ret_val;
24172    xmlChar * str; /* the string of the URI to escape */
24173    int n_str;
24174
24175    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24176        mem_base = xmlMemBlocks();
24177        str = gen_const_xmlChar_ptr(n_str, 0);
24178
24179        ret_val = xmlURIEscape((const xmlChar *)str);
24180        desret_xmlChar_ptr(ret_val);
24181        call_tests++;
24182        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24183        xmlResetLastError();
24184        if (mem_base != xmlMemBlocks()) {
24185            printf("Leak of %d blocks found in xmlURIEscape",
24186	           xmlMemBlocks() - mem_base);
24187	    test_ret++;
24188            printf(" %d", n_str);
24189            printf("\n");
24190        }
24191    }
24192    function_tests++;
24193
24194    return(test_ret);
24195}
24196
24197
24198static int
24199test_xmlURIEscapeStr(void) {
24200    int test_ret = 0;
24201
24202    int mem_base;
24203    xmlChar * ret_val;
24204    xmlChar * str; /* string to escape */
24205    int n_str;
24206    xmlChar * list; /* exception list string of chars not to escape */
24207    int n_list;
24208
24209    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24210    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24211        mem_base = xmlMemBlocks();
24212        str = gen_const_xmlChar_ptr(n_str, 0);
24213        list = gen_const_xmlChar_ptr(n_list, 1);
24214
24215        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24216        desret_xmlChar_ptr(ret_val);
24217        call_tests++;
24218        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24219        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24220        xmlResetLastError();
24221        if (mem_base != xmlMemBlocks()) {
24222            printf("Leak of %d blocks found in xmlURIEscapeStr",
24223	           xmlMemBlocks() - mem_base);
24224	    test_ret++;
24225            printf(" %d", n_str);
24226            printf(" %d", n_list);
24227            printf("\n");
24228        }
24229    }
24230    }
24231    function_tests++;
24232
24233    return(test_ret);
24234}
24235
24236
24237static int
24238test_xmlURIUnescapeString(void) {
24239    int test_ret = 0;
24240
24241
24242    /* missing type support */
24243    return(test_ret);
24244}
24245
24246static int
24247test_uri(void) {
24248    int test_ret = 0;
24249
24250    if (quiet == 0) printf("Testing uri : 9 of 14 functions ...\n");
24251    test_ret += test_xmlBuildRelativeURI();
24252    test_ret += test_xmlBuildURI();
24253    test_ret += test_xmlCanonicPath();
24254    test_ret += test_xmlCreateURI();
24255    test_ret += test_xmlNormalizeURIPath();
24256    test_ret += test_xmlParseURI();
24257    test_ret += test_xmlParseURIRaw();
24258    test_ret += test_xmlParseURIReference();
24259    test_ret += test_xmlPrintURI();
24260    test_ret += test_xmlSaveUri();
24261    test_ret += test_xmlURIEscape();
24262    test_ret += test_xmlURIEscapeStr();
24263    test_ret += test_xmlURIUnescapeString();
24264
24265    if (test_ret != 0)
24266	printf("Module uri: %d errors\n", test_ret);
24267    return(test_ret);
24268}
24269
24270static int
24271test_xmlAddAttributeDecl(void) {
24272    int test_ret = 0;
24273
24274    int mem_base;
24275    xmlAttributePtr ret_val;
24276    xmlValidCtxtPtr ctxt; /* the validation context */
24277    int n_ctxt;
24278    xmlDtdPtr dtd; /* pointer to the DTD */
24279    int n_dtd;
24280    xmlChar * elem; /* the element name */
24281    int n_elem;
24282    xmlChar * name; /* the attribute name */
24283    int n_name;
24284    xmlChar * ns; /* the attribute namespace prefix */
24285    int n_ns;
24286    xmlAttributeType type; /* the attribute type */
24287    int n_type;
24288    xmlAttributeDefault def; /* the attribute default type */
24289    int n_def;
24290    xmlChar * defaultValue; /* the attribute default value */
24291    int n_defaultValue;
24292    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24293    int n_tree;
24294
24295    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24296    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24297    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24298    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24299    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24300    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24301    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24302    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24303    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24304        mem_base = xmlMemBlocks();
24305        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24306        dtd = gen_xmlDtdPtr(n_dtd, 1);
24307        elem = gen_const_xmlChar_ptr(n_elem, 2);
24308        name = gen_const_xmlChar_ptr(n_name, 3);
24309        ns = gen_const_xmlChar_ptr(n_ns, 4);
24310        type = gen_xmlAttributeType(n_type, 5);
24311        def = gen_xmlAttributeDefault(n_def, 6);
24312        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24313        tree = gen_xmlEnumerationPtr(n_tree, 8);
24314
24315        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24316        desret_xmlAttributePtr(ret_val);
24317        call_tests++;
24318        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24319        des_xmlDtdPtr(n_dtd, dtd, 1);
24320        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24321        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24322        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24323        des_xmlAttributeType(n_type, type, 5);
24324        des_xmlAttributeDefault(n_def, def, 6);
24325        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24326        des_xmlEnumerationPtr(n_tree, tree, 8);
24327        xmlResetLastError();
24328        if (mem_base != xmlMemBlocks()) {
24329            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24330	           xmlMemBlocks() - mem_base);
24331	    test_ret++;
24332            printf(" %d", n_ctxt);
24333            printf(" %d", n_dtd);
24334            printf(" %d", n_elem);
24335            printf(" %d", n_name);
24336            printf(" %d", n_ns);
24337            printf(" %d", n_type);
24338            printf(" %d", n_def);
24339            printf(" %d", n_defaultValue);
24340            printf(" %d", n_tree);
24341            printf("\n");
24342        }
24343    }
24344    }
24345    }
24346    }
24347    }
24348    }
24349    }
24350    }
24351    }
24352    function_tests++;
24353
24354    return(test_ret);
24355}
24356
24357
24358static int
24359test_xmlAddElementDecl(void) {
24360    int test_ret = 0;
24361
24362    int mem_base;
24363    xmlElementPtr ret_val;
24364    xmlValidCtxtPtr ctxt; /* the validation context */
24365    int n_ctxt;
24366    xmlDtdPtr dtd; /* pointer to the DTD */
24367    int n_dtd;
24368    xmlChar * name; /* the entity name */
24369    int n_name;
24370    xmlElementTypeVal type; /* the element type */
24371    int n_type;
24372    xmlElementContentPtr content; /* the element content tree or NULL */
24373    int n_content;
24374
24375    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24376    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24377    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24378    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24379    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24380        mem_base = xmlMemBlocks();
24381        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24382        dtd = gen_xmlDtdPtr(n_dtd, 1);
24383        name = gen_const_xmlChar_ptr(n_name, 2);
24384        type = gen_xmlElementTypeVal(n_type, 3);
24385        content = gen_xmlElementContentPtr(n_content, 4);
24386
24387        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24388        desret_xmlElementPtr(ret_val);
24389        call_tests++;
24390        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24391        des_xmlDtdPtr(n_dtd, dtd, 1);
24392        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24393        des_xmlElementTypeVal(n_type, type, 3);
24394        des_xmlElementContentPtr(n_content, content, 4);
24395        xmlResetLastError();
24396        if (mem_base != xmlMemBlocks()) {
24397            printf("Leak of %d blocks found in xmlAddElementDecl",
24398	           xmlMemBlocks() - mem_base);
24399	    test_ret++;
24400            printf(" %d", n_ctxt);
24401            printf(" %d", n_dtd);
24402            printf(" %d", n_name);
24403            printf(" %d", n_type);
24404            printf(" %d", n_content);
24405            printf("\n");
24406        }
24407    }
24408    }
24409    }
24410    }
24411    }
24412    function_tests++;
24413
24414    return(test_ret);
24415}
24416
24417
24418static int
24419test_xmlAddID(void) {
24420    int test_ret = 0;
24421
24422
24423    /* missing type support */
24424    return(test_ret);
24425}
24426
24427
24428static int
24429test_xmlAddNotationDecl(void) {
24430    int test_ret = 0;
24431
24432
24433    /* missing type support */
24434    return(test_ret);
24435}
24436
24437
24438static int
24439test_xmlAddRef(void) {
24440    int test_ret = 0;
24441
24442
24443    /* missing type support */
24444    return(test_ret);
24445}
24446
24447
24448#define gen_nb_xmlAttributeTablePtr 1
24449static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24450    return(NULL);
24451}
24452static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24453}
24454
24455static int
24456test_xmlCopyAttributeTable(void) {
24457    int test_ret = 0;
24458
24459
24460    /* missing type support */
24461    return(test_ret);
24462}
24463
24464
24465static int
24466test_xmlCopyDocElementContent(void) {
24467    int test_ret = 0;
24468
24469    int mem_base;
24470    xmlElementContentPtr ret_val;
24471    xmlDocPtr doc; /* the document owning the element declaration */
24472    int n_doc;
24473    xmlElementContentPtr cur; /* An element content pointer. */
24474    int n_cur;
24475
24476    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24477    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24478        mem_base = xmlMemBlocks();
24479        doc = gen_xmlDocPtr(n_doc, 0);
24480        cur = gen_xmlElementContentPtr(n_cur, 1);
24481
24482        ret_val = xmlCopyDocElementContent(doc, cur);
24483        desret_xmlElementContentPtr(ret_val);
24484        call_tests++;
24485        des_xmlDocPtr(n_doc, doc, 0);
24486        des_xmlElementContentPtr(n_cur, cur, 1);
24487        xmlResetLastError();
24488        if (mem_base != xmlMemBlocks()) {
24489            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24490	           xmlMemBlocks() - mem_base);
24491	    test_ret++;
24492            printf(" %d", n_doc);
24493            printf(" %d", n_cur);
24494            printf("\n");
24495        }
24496    }
24497    }
24498    function_tests++;
24499
24500    return(test_ret);
24501}
24502
24503
24504static int
24505test_xmlCopyElementContent(void) {
24506    int test_ret = 0;
24507
24508    int mem_base;
24509    xmlElementContentPtr ret_val;
24510    xmlElementContentPtr cur; /* An element content pointer. */
24511    int n_cur;
24512
24513    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24514        mem_base = xmlMemBlocks();
24515        cur = gen_xmlElementContentPtr(n_cur, 0);
24516
24517        ret_val = xmlCopyElementContent(cur);
24518        desret_xmlElementContentPtr(ret_val);
24519        call_tests++;
24520        des_xmlElementContentPtr(n_cur, cur, 0);
24521        xmlResetLastError();
24522        if (mem_base != xmlMemBlocks()) {
24523            printf("Leak of %d blocks found in xmlCopyElementContent",
24524	           xmlMemBlocks() - mem_base);
24525	    test_ret++;
24526            printf(" %d", n_cur);
24527            printf("\n");
24528        }
24529    }
24530    function_tests++;
24531
24532    return(test_ret);
24533}
24534
24535
24536#define gen_nb_xmlElementTablePtr 1
24537static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24538    return(NULL);
24539}
24540static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24541}
24542
24543static int
24544test_xmlCopyElementTable(void) {
24545    int test_ret = 0;
24546
24547
24548    /* missing type support */
24549    return(test_ret);
24550}
24551
24552
24553static int
24554test_xmlCopyEnumeration(void) {
24555    int test_ret = 0;
24556
24557
24558    /* missing type support */
24559    return(test_ret);
24560}
24561
24562
24563#define gen_nb_xmlNotationTablePtr 1
24564static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24565    return(NULL);
24566}
24567static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24568}
24569
24570static int
24571test_xmlCopyNotationTable(void) {
24572    int test_ret = 0;
24573
24574
24575    /* missing type support */
24576    return(test_ret);
24577}
24578
24579
24580static int
24581test_xmlCreateEnumeration(void) {
24582    int test_ret = 0;
24583
24584
24585    /* missing type support */
24586    return(test_ret);
24587}
24588
24589
24590#define gen_nb_xmlAttributePtr 1
24591static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24592    return(NULL);
24593}
24594static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24595}
24596
24597static int
24598test_xmlDumpAttributeDecl(void) {
24599    int test_ret = 0;
24600
24601#if defined(LIBXML_OUTPUT_ENABLED)
24602    int mem_base;
24603    xmlBufferPtr buf; /* the XML buffer output */
24604    int n_buf;
24605    xmlAttributePtr attr; /* An attribute declaration */
24606    int n_attr;
24607
24608    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24609    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24610        mem_base = xmlMemBlocks();
24611        buf = gen_xmlBufferPtr(n_buf, 0);
24612        attr = gen_xmlAttributePtr(n_attr, 1);
24613
24614        xmlDumpAttributeDecl(buf, attr);
24615        call_tests++;
24616        des_xmlBufferPtr(n_buf, buf, 0);
24617        des_xmlAttributePtr(n_attr, attr, 1);
24618        xmlResetLastError();
24619        if (mem_base != xmlMemBlocks()) {
24620            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24621	           xmlMemBlocks() - mem_base);
24622	    test_ret++;
24623            printf(" %d", n_buf);
24624            printf(" %d", n_attr);
24625            printf("\n");
24626        }
24627    }
24628    }
24629    function_tests++;
24630#endif
24631
24632    return(test_ret);
24633}
24634
24635
24636static int
24637test_xmlDumpAttributeTable(void) {
24638    int test_ret = 0;
24639
24640#if defined(LIBXML_OUTPUT_ENABLED)
24641    int mem_base;
24642    xmlBufferPtr buf; /* the XML buffer output */
24643    int n_buf;
24644    xmlAttributeTablePtr table; /* An attribute table */
24645    int n_table;
24646
24647    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24648    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24649        mem_base = xmlMemBlocks();
24650        buf = gen_xmlBufferPtr(n_buf, 0);
24651        table = gen_xmlAttributeTablePtr(n_table, 1);
24652
24653        xmlDumpAttributeTable(buf, table);
24654        call_tests++;
24655        des_xmlBufferPtr(n_buf, buf, 0);
24656        des_xmlAttributeTablePtr(n_table, table, 1);
24657        xmlResetLastError();
24658        if (mem_base != xmlMemBlocks()) {
24659            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24660	           xmlMemBlocks() - mem_base);
24661	    test_ret++;
24662            printf(" %d", n_buf);
24663            printf(" %d", n_table);
24664            printf("\n");
24665        }
24666    }
24667    }
24668    function_tests++;
24669#endif
24670
24671    return(test_ret);
24672}
24673
24674
24675#define gen_nb_xmlElementPtr 1
24676static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24677    return(NULL);
24678}
24679static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24680}
24681
24682static int
24683test_xmlDumpElementDecl(void) {
24684    int test_ret = 0;
24685
24686#if defined(LIBXML_OUTPUT_ENABLED)
24687    int mem_base;
24688    xmlBufferPtr buf; /* the XML buffer output */
24689    int n_buf;
24690    xmlElementPtr elem; /* An element table */
24691    int n_elem;
24692
24693    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24694    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24695        mem_base = xmlMemBlocks();
24696        buf = gen_xmlBufferPtr(n_buf, 0);
24697        elem = gen_xmlElementPtr(n_elem, 1);
24698
24699        xmlDumpElementDecl(buf, elem);
24700        call_tests++;
24701        des_xmlBufferPtr(n_buf, buf, 0);
24702        des_xmlElementPtr(n_elem, elem, 1);
24703        xmlResetLastError();
24704        if (mem_base != xmlMemBlocks()) {
24705            printf("Leak of %d blocks found in xmlDumpElementDecl",
24706	           xmlMemBlocks() - mem_base);
24707	    test_ret++;
24708            printf(" %d", n_buf);
24709            printf(" %d", n_elem);
24710            printf("\n");
24711        }
24712    }
24713    }
24714    function_tests++;
24715#endif
24716
24717    return(test_ret);
24718}
24719
24720
24721static int
24722test_xmlDumpElementTable(void) {
24723    int test_ret = 0;
24724
24725#if defined(LIBXML_OUTPUT_ENABLED)
24726    int mem_base;
24727    xmlBufferPtr buf; /* the XML buffer output */
24728    int n_buf;
24729    xmlElementTablePtr table; /* An element table */
24730    int n_table;
24731
24732    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24733    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24734        mem_base = xmlMemBlocks();
24735        buf = gen_xmlBufferPtr(n_buf, 0);
24736        table = gen_xmlElementTablePtr(n_table, 1);
24737
24738        xmlDumpElementTable(buf, table);
24739        call_tests++;
24740        des_xmlBufferPtr(n_buf, buf, 0);
24741        des_xmlElementTablePtr(n_table, table, 1);
24742        xmlResetLastError();
24743        if (mem_base != xmlMemBlocks()) {
24744            printf("Leak of %d blocks found in xmlDumpElementTable",
24745	           xmlMemBlocks() - mem_base);
24746	    test_ret++;
24747            printf(" %d", n_buf);
24748            printf(" %d", n_table);
24749            printf("\n");
24750        }
24751    }
24752    }
24753    function_tests++;
24754#endif
24755
24756    return(test_ret);
24757}
24758
24759
24760#define gen_nb_xmlNotationPtr 1
24761static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24762    return(NULL);
24763}
24764static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24765}
24766
24767static int
24768test_xmlDumpNotationDecl(void) {
24769    int test_ret = 0;
24770
24771#if defined(LIBXML_OUTPUT_ENABLED)
24772    int mem_base;
24773    xmlBufferPtr buf; /* the XML buffer output */
24774    int n_buf;
24775    xmlNotationPtr nota; /* A notation declaration */
24776    int n_nota;
24777
24778    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24779    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24780        mem_base = xmlMemBlocks();
24781        buf = gen_xmlBufferPtr(n_buf, 0);
24782        nota = gen_xmlNotationPtr(n_nota, 1);
24783
24784        xmlDumpNotationDecl(buf, nota);
24785        call_tests++;
24786        des_xmlBufferPtr(n_buf, buf, 0);
24787        des_xmlNotationPtr(n_nota, nota, 1);
24788        xmlResetLastError();
24789        if (mem_base != xmlMemBlocks()) {
24790            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24791	           xmlMemBlocks() - mem_base);
24792	    test_ret++;
24793            printf(" %d", n_buf);
24794            printf(" %d", n_nota);
24795            printf("\n");
24796        }
24797    }
24798    }
24799    function_tests++;
24800#endif
24801
24802    return(test_ret);
24803}
24804
24805
24806static int
24807test_xmlDumpNotationTable(void) {
24808    int test_ret = 0;
24809
24810#if defined(LIBXML_OUTPUT_ENABLED)
24811    int mem_base;
24812    xmlBufferPtr buf; /* the XML buffer output */
24813    int n_buf;
24814    xmlNotationTablePtr table; /* A notation table */
24815    int n_table;
24816
24817    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24818    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24819        mem_base = xmlMemBlocks();
24820        buf = gen_xmlBufferPtr(n_buf, 0);
24821        table = gen_xmlNotationTablePtr(n_table, 1);
24822
24823        xmlDumpNotationTable(buf, table);
24824        call_tests++;
24825        des_xmlBufferPtr(n_buf, buf, 0);
24826        des_xmlNotationTablePtr(n_table, table, 1);
24827        xmlResetLastError();
24828        if (mem_base != xmlMemBlocks()) {
24829            printf("Leak of %d blocks found in xmlDumpNotationTable",
24830	           xmlMemBlocks() - mem_base);
24831	    test_ret++;
24832            printf(" %d", n_buf);
24833            printf(" %d", n_table);
24834            printf("\n");
24835        }
24836    }
24837    }
24838    function_tests++;
24839#endif
24840
24841    return(test_ret);
24842}
24843
24844
24845static int
24846test_xmlGetDtdAttrDesc(void) {
24847    int test_ret = 0;
24848
24849    int mem_base;
24850    xmlAttributePtr ret_val;
24851    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24852    int n_dtd;
24853    xmlChar * elem; /* the element name */
24854    int n_elem;
24855    xmlChar * name; /* the attribute name */
24856    int n_name;
24857
24858    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24859    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24860    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24861        mem_base = xmlMemBlocks();
24862        dtd = gen_xmlDtdPtr(n_dtd, 0);
24863        elem = gen_const_xmlChar_ptr(n_elem, 1);
24864        name = gen_const_xmlChar_ptr(n_name, 2);
24865
24866        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
24867        desret_xmlAttributePtr(ret_val);
24868        call_tests++;
24869        des_xmlDtdPtr(n_dtd, dtd, 0);
24870        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24871        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24872        xmlResetLastError();
24873        if (mem_base != xmlMemBlocks()) {
24874            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
24875	           xmlMemBlocks() - mem_base);
24876	    test_ret++;
24877            printf(" %d", n_dtd);
24878            printf(" %d", n_elem);
24879            printf(" %d", n_name);
24880            printf("\n");
24881        }
24882    }
24883    }
24884    }
24885    function_tests++;
24886
24887    return(test_ret);
24888}
24889
24890
24891static int
24892test_xmlGetDtdElementDesc(void) {
24893    int test_ret = 0;
24894
24895    int mem_base;
24896    xmlElementPtr ret_val;
24897    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24898    int n_dtd;
24899    xmlChar * name; /* the element name */
24900    int n_name;
24901
24902    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24903    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24904        mem_base = xmlMemBlocks();
24905        dtd = gen_xmlDtdPtr(n_dtd, 0);
24906        name = gen_const_xmlChar_ptr(n_name, 1);
24907
24908        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
24909        desret_xmlElementPtr(ret_val);
24910        call_tests++;
24911        des_xmlDtdPtr(n_dtd, dtd, 0);
24912        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24913        xmlResetLastError();
24914        if (mem_base != xmlMemBlocks()) {
24915            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
24916	           xmlMemBlocks() - mem_base);
24917	    test_ret++;
24918            printf(" %d", n_dtd);
24919            printf(" %d", n_name);
24920            printf("\n");
24921        }
24922    }
24923    }
24924    function_tests++;
24925
24926    return(test_ret);
24927}
24928
24929
24930static int
24931test_xmlGetDtdNotationDesc(void) {
24932    int test_ret = 0;
24933
24934
24935    /* missing type support */
24936    return(test_ret);
24937}
24938
24939
24940static int
24941test_xmlGetDtdQAttrDesc(void) {
24942    int test_ret = 0;
24943
24944    int mem_base;
24945    xmlAttributePtr ret_val;
24946    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24947    int n_dtd;
24948    xmlChar * elem; /* the element name */
24949    int n_elem;
24950    xmlChar * name; /* the attribute name */
24951    int n_name;
24952    xmlChar * prefix; /* the attribute namespace prefix */
24953    int n_prefix;
24954
24955    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24956    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24957    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24958    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24959        mem_base = xmlMemBlocks();
24960        dtd = gen_xmlDtdPtr(n_dtd, 0);
24961        elem = gen_const_xmlChar_ptr(n_elem, 1);
24962        name = gen_const_xmlChar_ptr(n_name, 2);
24963        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
24964
24965        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
24966        desret_xmlAttributePtr(ret_val);
24967        call_tests++;
24968        des_xmlDtdPtr(n_dtd, dtd, 0);
24969        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24970        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24971        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
24972        xmlResetLastError();
24973        if (mem_base != xmlMemBlocks()) {
24974            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
24975	           xmlMemBlocks() - mem_base);
24976	    test_ret++;
24977            printf(" %d", n_dtd);
24978            printf(" %d", n_elem);
24979            printf(" %d", n_name);
24980            printf(" %d", n_prefix);
24981            printf("\n");
24982        }
24983    }
24984    }
24985    }
24986    }
24987    function_tests++;
24988
24989    return(test_ret);
24990}
24991
24992
24993static int
24994test_xmlGetDtdQElementDesc(void) {
24995    int test_ret = 0;
24996
24997    int mem_base;
24998    xmlElementPtr ret_val;
24999    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25000    int n_dtd;
25001    xmlChar * name; /* the element name */
25002    int n_name;
25003    xmlChar * prefix; /* the element namespace prefix */
25004    int n_prefix;
25005
25006    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25007    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25008    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25009        mem_base = xmlMemBlocks();
25010        dtd = gen_xmlDtdPtr(n_dtd, 0);
25011        name = gen_const_xmlChar_ptr(n_name, 1);
25012        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25013
25014        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25015        desret_xmlElementPtr(ret_val);
25016        call_tests++;
25017        des_xmlDtdPtr(n_dtd, dtd, 0);
25018        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25019        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25020        xmlResetLastError();
25021        if (mem_base != xmlMemBlocks()) {
25022            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25023	           xmlMemBlocks() - mem_base);
25024	    test_ret++;
25025            printf(" %d", n_dtd);
25026            printf(" %d", n_name);
25027            printf(" %d", n_prefix);
25028            printf("\n");
25029        }
25030    }
25031    }
25032    }
25033    function_tests++;
25034
25035    return(test_ret);
25036}
25037
25038
25039static int
25040test_xmlGetID(void) {
25041    int test_ret = 0;
25042
25043    int mem_base;
25044    xmlAttrPtr ret_val;
25045    xmlDocPtr doc; /* pointer to the document */
25046    int n_doc;
25047    xmlChar * ID; /* the ID value */
25048    int n_ID;
25049
25050    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25051    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25052        mem_base = xmlMemBlocks();
25053        doc = gen_xmlDocPtr(n_doc, 0);
25054        ID = gen_const_xmlChar_ptr(n_ID, 1);
25055
25056        ret_val = xmlGetID(doc, (const xmlChar *)ID);
25057        desret_xmlAttrPtr(ret_val);
25058        call_tests++;
25059        des_xmlDocPtr(n_doc, doc, 0);
25060        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25061        xmlResetLastError();
25062        if (mem_base != xmlMemBlocks()) {
25063            printf("Leak of %d blocks found in xmlGetID",
25064	           xmlMemBlocks() - mem_base);
25065	    test_ret++;
25066            printf(" %d", n_doc);
25067            printf(" %d", n_ID);
25068            printf("\n");
25069        }
25070    }
25071    }
25072    function_tests++;
25073
25074    return(test_ret);
25075}
25076
25077
25078static int
25079test_xmlGetRefs(void) {
25080    int test_ret = 0;
25081
25082
25083    /* missing type support */
25084    return(test_ret);
25085}
25086
25087
25088static int
25089test_xmlIsID(void) {
25090    int test_ret = 0;
25091
25092    int mem_base;
25093    int ret_val;
25094    xmlDocPtr doc; /* the document */
25095    int n_doc;
25096    xmlNodePtr elem; /* the element carrying the attribute */
25097    int n_elem;
25098    xmlAttrPtr attr; /* the attribute */
25099    int n_attr;
25100
25101    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25102    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25103    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25104        mem_base = xmlMemBlocks();
25105        doc = gen_xmlDocPtr(n_doc, 0);
25106        elem = gen_xmlNodePtr(n_elem, 1);
25107        attr = gen_xmlAttrPtr(n_attr, 2);
25108
25109        ret_val = xmlIsID(doc, elem, attr);
25110        desret_int(ret_val);
25111        call_tests++;
25112        des_xmlDocPtr(n_doc, doc, 0);
25113        des_xmlNodePtr(n_elem, elem, 1);
25114        des_xmlAttrPtr(n_attr, attr, 2);
25115        xmlResetLastError();
25116        if (mem_base != xmlMemBlocks()) {
25117            printf("Leak of %d blocks found in xmlIsID",
25118	           xmlMemBlocks() - mem_base);
25119	    test_ret++;
25120            printf(" %d", n_doc);
25121            printf(" %d", n_elem);
25122            printf(" %d", n_attr);
25123            printf("\n");
25124        }
25125    }
25126    }
25127    }
25128    function_tests++;
25129
25130    return(test_ret);
25131}
25132
25133
25134static int
25135test_xmlIsMixedElement(void) {
25136    int test_ret = 0;
25137
25138    int mem_base;
25139    int ret_val;
25140    xmlDocPtr doc; /* the document */
25141    int n_doc;
25142    xmlChar * name; /* the element name */
25143    int n_name;
25144
25145    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25146    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25147        mem_base = xmlMemBlocks();
25148        doc = gen_xmlDocPtr(n_doc, 0);
25149        name = gen_const_xmlChar_ptr(n_name, 1);
25150
25151        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25152        desret_int(ret_val);
25153        call_tests++;
25154        des_xmlDocPtr(n_doc, doc, 0);
25155        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25156        xmlResetLastError();
25157        if (mem_base != xmlMemBlocks()) {
25158            printf("Leak of %d blocks found in xmlIsMixedElement",
25159	           xmlMemBlocks() - mem_base);
25160	    test_ret++;
25161            printf(" %d", n_doc);
25162            printf(" %d", n_name);
25163            printf("\n");
25164        }
25165    }
25166    }
25167    function_tests++;
25168
25169    return(test_ret);
25170}
25171
25172
25173static int
25174test_xmlIsRef(void) {
25175    int test_ret = 0;
25176
25177    int mem_base;
25178    int ret_val;
25179    xmlDocPtr doc; /* the document */
25180    int n_doc;
25181    xmlNodePtr elem; /* the element carrying the attribute */
25182    int n_elem;
25183    xmlAttrPtr attr; /* the attribute */
25184    int n_attr;
25185
25186    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25187    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25188    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25189        mem_base = xmlMemBlocks();
25190        doc = gen_xmlDocPtr(n_doc, 0);
25191        elem = gen_xmlNodePtr(n_elem, 1);
25192        attr = gen_xmlAttrPtr(n_attr, 2);
25193
25194        ret_val = xmlIsRef(doc, elem, attr);
25195        desret_int(ret_val);
25196        call_tests++;
25197        des_xmlDocPtr(n_doc, doc, 0);
25198        des_xmlNodePtr(n_elem, elem, 1);
25199        des_xmlAttrPtr(n_attr, attr, 2);
25200        xmlResetLastError();
25201        if (mem_base != xmlMemBlocks()) {
25202            printf("Leak of %d blocks found in xmlIsRef",
25203	           xmlMemBlocks() - mem_base);
25204	    test_ret++;
25205            printf(" %d", n_doc);
25206            printf(" %d", n_elem);
25207            printf(" %d", n_attr);
25208            printf("\n");
25209        }
25210    }
25211    }
25212    }
25213    function_tests++;
25214
25215    return(test_ret);
25216}
25217
25218
25219static int
25220test_xmlNewDocElementContent(void) {
25221    int test_ret = 0;
25222
25223    int mem_base;
25224    xmlElementContentPtr ret_val;
25225    xmlDocPtr doc; /* the document */
25226    int n_doc;
25227    xmlChar * name; /* the subelement name or NULL */
25228    int n_name;
25229    xmlElementContentType type; /* the type of element content decl */
25230    int n_type;
25231
25232    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25233    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25234    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25235        mem_base = xmlMemBlocks();
25236        doc = gen_xmlDocPtr(n_doc, 0);
25237        name = gen_const_xmlChar_ptr(n_name, 1);
25238        type = gen_xmlElementContentType(n_type, 2);
25239
25240        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25241        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25242        desret_xmlElementContentPtr(ret_val);
25243        call_tests++;
25244        des_xmlDocPtr(n_doc, doc, 0);
25245        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25246        des_xmlElementContentType(n_type, type, 2);
25247        xmlResetLastError();
25248        if (mem_base != xmlMemBlocks()) {
25249            printf("Leak of %d blocks found in xmlNewDocElementContent",
25250	           xmlMemBlocks() - mem_base);
25251	    test_ret++;
25252            printf(" %d", n_doc);
25253            printf(" %d", n_name);
25254            printf(" %d", n_type);
25255            printf("\n");
25256        }
25257    }
25258    }
25259    }
25260    function_tests++;
25261
25262    return(test_ret);
25263}
25264
25265
25266static int
25267test_xmlNewElementContent(void) {
25268    int test_ret = 0;
25269
25270    int mem_base;
25271    xmlElementContentPtr ret_val;
25272    xmlChar * name; /* the subelement name or NULL */
25273    int n_name;
25274    xmlElementContentType type; /* the type of element content decl */
25275    int n_type;
25276
25277    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25278    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25279        mem_base = xmlMemBlocks();
25280        name = gen_const_xmlChar_ptr(n_name, 0);
25281        type = gen_xmlElementContentType(n_type, 1);
25282
25283        ret_val = xmlNewElementContent((const xmlChar *)name, type);
25284        desret_xmlElementContentPtr(ret_val);
25285        call_tests++;
25286        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25287        des_xmlElementContentType(n_type, type, 1);
25288        xmlResetLastError();
25289        if (mem_base != xmlMemBlocks()) {
25290            printf("Leak of %d blocks found in xmlNewElementContent",
25291	           xmlMemBlocks() - mem_base);
25292	    test_ret++;
25293            printf(" %d", n_name);
25294            printf(" %d", n_type);
25295            printf("\n");
25296        }
25297    }
25298    }
25299    function_tests++;
25300
25301    return(test_ret);
25302}
25303
25304
25305static int
25306test_xmlNewValidCtxt(void) {
25307    int test_ret = 0;
25308
25309
25310    /* missing type support */
25311    return(test_ret);
25312}
25313
25314
25315static int
25316test_xmlRemoveID(void) {
25317    int test_ret = 0;
25318
25319    int mem_base;
25320    int ret_val;
25321    xmlDocPtr doc; /* the document */
25322    int n_doc;
25323    xmlAttrPtr attr; /* the attribute */
25324    int n_attr;
25325
25326    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25327    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25328        mem_base = xmlMemBlocks();
25329        doc = gen_xmlDocPtr(n_doc, 0);
25330        attr = gen_xmlAttrPtr(n_attr, 1);
25331
25332        ret_val = xmlRemoveID(doc, attr);
25333        desret_int(ret_val);
25334        call_tests++;
25335        des_xmlDocPtr(n_doc, doc, 0);
25336        des_xmlAttrPtr(n_attr, attr, 1);
25337        xmlResetLastError();
25338        if (mem_base != xmlMemBlocks()) {
25339            printf("Leak of %d blocks found in xmlRemoveID",
25340	           xmlMemBlocks() - mem_base);
25341	    test_ret++;
25342            printf(" %d", n_doc);
25343            printf(" %d", n_attr);
25344            printf("\n");
25345        }
25346    }
25347    }
25348    function_tests++;
25349
25350    return(test_ret);
25351}
25352
25353
25354static int
25355test_xmlRemoveRef(void) {
25356    int test_ret = 0;
25357
25358    int mem_base;
25359    int ret_val;
25360    xmlDocPtr doc; /* the document */
25361    int n_doc;
25362    xmlAttrPtr attr; /* the attribute */
25363    int n_attr;
25364
25365    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25366    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25367        mem_base = xmlMemBlocks();
25368        doc = gen_xmlDocPtr(n_doc, 0);
25369        attr = gen_xmlAttrPtr(n_attr, 1);
25370
25371        ret_val = xmlRemoveRef(doc, attr);
25372        desret_int(ret_val);
25373        call_tests++;
25374        des_xmlDocPtr(n_doc, doc, 0);
25375        des_xmlAttrPtr(n_attr, attr, 1);
25376        xmlResetLastError();
25377        if (mem_base != xmlMemBlocks()) {
25378            printf("Leak of %d blocks found in xmlRemoveRef",
25379	           xmlMemBlocks() - mem_base);
25380	    test_ret++;
25381            printf(" %d", n_doc);
25382            printf(" %d", n_attr);
25383            printf("\n");
25384        }
25385    }
25386    }
25387    function_tests++;
25388
25389    return(test_ret);
25390}
25391
25392
25393static int
25394test_xmlSnprintfElementContent(void) {
25395    int test_ret = 0;
25396
25397    int mem_base;
25398    char * buf; /* an output buffer */
25399    int n_buf;
25400    int size; /* the buffer size */
25401    int n_size;
25402    xmlElementContentPtr content; /* An element table */
25403    int n_content;
25404    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25405    int n_englob;
25406
25407    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25408    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25409    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25410    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25411        mem_base = xmlMemBlocks();
25412        buf = gen_char_ptr(n_buf, 0);
25413        size = gen_int(n_size, 1);
25414        content = gen_xmlElementContentPtr(n_content, 2);
25415        englob = gen_int(n_englob, 3);
25416
25417        xmlSnprintfElementContent(buf, size, content, englob);
25418        call_tests++;
25419        des_char_ptr(n_buf, buf, 0);
25420        des_int(n_size, size, 1);
25421        des_xmlElementContentPtr(n_content, content, 2);
25422        des_int(n_englob, englob, 3);
25423        xmlResetLastError();
25424        if (mem_base != xmlMemBlocks()) {
25425            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25426	           xmlMemBlocks() - mem_base);
25427	    test_ret++;
25428            printf(" %d", n_buf);
25429            printf(" %d", n_size);
25430            printf(" %d", n_content);
25431            printf(" %d", n_englob);
25432            printf("\n");
25433        }
25434    }
25435    }
25436    }
25437    }
25438    function_tests++;
25439
25440    return(test_ret);
25441}
25442
25443
25444static int
25445test_xmlSprintfElementContent(void) {
25446    int test_ret = 0;
25447
25448#if defined(LIBXML_OUTPUT_ENABLED)
25449#ifdef LIBXML_OUTPUT_ENABLED
25450    int mem_base;
25451    char * buf; /* an output buffer */
25452    int n_buf;
25453    xmlElementContentPtr content; /* An element table */
25454    int n_content;
25455    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25456    int n_englob;
25457
25458    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25459    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25460    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25461        mem_base = xmlMemBlocks();
25462        buf = gen_char_ptr(n_buf, 0);
25463        content = gen_xmlElementContentPtr(n_content, 1);
25464        englob = gen_int(n_englob, 2);
25465
25466        xmlSprintfElementContent(buf, content, englob);
25467        call_tests++;
25468        des_char_ptr(n_buf, buf, 0);
25469        des_xmlElementContentPtr(n_content, content, 1);
25470        des_int(n_englob, englob, 2);
25471        xmlResetLastError();
25472        if (mem_base != xmlMemBlocks()) {
25473            printf("Leak of %d blocks found in xmlSprintfElementContent",
25474	           xmlMemBlocks() - mem_base);
25475	    test_ret++;
25476            printf(" %d", n_buf);
25477            printf(" %d", n_content);
25478            printf(" %d", n_englob);
25479            printf("\n");
25480        }
25481    }
25482    }
25483    }
25484    function_tests++;
25485#endif
25486#endif
25487
25488    return(test_ret);
25489}
25490
25491
25492static int
25493test_xmlValidBuildContentModel(void) {
25494    int test_ret = 0;
25495
25496#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25497    int mem_base;
25498    int ret_val;
25499    xmlValidCtxtPtr ctxt; /* a validation context */
25500    int n_ctxt;
25501    xmlElementPtr elem; /* an element declaration node */
25502    int n_elem;
25503
25504    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25505    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25506        mem_base = xmlMemBlocks();
25507        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25508        elem = gen_xmlElementPtr(n_elem, 1);
25509
25510        ret_val = xmlValidBuildContentModel(ctxt, elem);
25511        desret_int(ret_val);
25512        call_tests++;
25513        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25514        des_xmlElementPtr(n_elem, elem, 1);
25515        xmlResetLastError();
25516        if (mem_base != xmlMemBlocks()) {
25517            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25518	           xmlMemBlocks() - mem_base);
25519	    test_ret++;
25520            printf(" %d", n_ctxt);
25521            printf(" %d", n_elem);
25522            printf("\n");
25523        }
25524    }
25525    }
25526    function_tests++;
25527#endif
25528
25529    return(test_ret);
25530}
25531
25532
25533static int
25534test_xmlValidCtxtNormalizeAttributeValue(void) {
25535    int test_ret = 0;
25536
25537#if defined(LIBXML_VALID_ENABLED)
25538    int mem_base;
25539    xmlChar * ret_val;
25540    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25541    int n_ctxt;
25542    xmlDocPtr doc; /* the document */
25543    int n_doc;
25544    xmlNodePtr elem; /* the parent */
25545    int n_elem;
25546    xmlChar * name; /* the attribute name */
25547    int n_name;
25548    xmlChar * value; /* the attribute value */
25549    int n_value;
25550
25551    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25552    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25553    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25554    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25555    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25556        mem_base = xmlMemBlocks();
25557        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25558        doc = gen_xmlDocPtr(n_doc, 1);
25559        elem = gen_xmlNodePtr(n_elem, 2);
25560        name = gen_const_xmlChar_ptr(n_name, 3);
25561        value = gen_const_xmlChar_ptr(n_value, 4);
25562
25563        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25564        desret_xmlChar_ptr(ret_val);
25565        call_tests++;
25566        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25567        des_xmlDocPtr(n_doc, doc, 1);
25568        des_xmlNodePtr(n_elem, elem, 2);
25569        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25570        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25571        xmlResetLastError();
25572        if (mem_base != xmlMemBlocks()) {
25573            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25574	           xmlMemBlocks() - mem_base);
25575	    test_ret++;
25576            printf(" %d", n_ctxt);
25577            printf(" %d", n_doc);
25578            printf(" %d", n_elem);
25579            printf(" %d", n_name);
25580            printf(" %d", n_value);
25581            printf("\n");
25582        }
25583    }
25584    }
25585    }
25586    }
25587    }
25588    function_tests++;
25589#endif
25590
25591    return(test_ret);
25592}
25593
25594
25595#define gen_nb_xmlElementContent_ptr 1
25596static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25597    return(NULL);
25598}
25599static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25600}
25601
25602static int
25603test_xmlValidGetPotentialChildren(void) {
25604    int test_ret = 0;
25605
25606#if defined(LIBXML_VALID_ENABLED)
25607#ifdef LIBXML_VALID_ENABLED
25608    int mem_base;
25609    int ret_val;
25610    xmlElementContent * ctree; /* an element content tree */
25611    int n_ctree;
25612    xmlChar ** names; /* an array to store the list of child names */
25613    int n_names;
25614    int * len; /* a pointer to the number of element in the list */
25615    int n_len;
25616    int max; /* the size of the array */
25617    int n_max;
25618
25619    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25620    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25621    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25622    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25623        mem_base = xmlMemBlocks();
25624        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25625        names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25626        len = gen_int_ptr(n_len, 2);
25627        max = gen_int(n_max, 3);
25628
25629        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25630        desret_int(ret_val);
25631        call_tests++;
25632        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25633        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25634        des_int_ptr(n_len, len, 2);
25635        des_int(n_max, max, 3);
25636        xmlResetLastError();
25637        if (mem_base != xmlMemBlocks()) {
25638            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25639	           xmlMemBlocks() - mem_base);
25640	    test_ret++;
25641            printf(" %d", n_ctree);
25642            printf(" %d", n_names);
25643            printf(" %d", n_len);
25644            printf(" %d", n_max);
25645            printf("\n");
25646        }
25647    }
25648    }
25649    }
25650    }
25651    function_tests++;
25652#endif
25653#endif
25654
25655    return(test_ret);
25656}
25657
25658
25659static int
25660test_xmlValidGetValidElements(void) {
25661    int test_ret = 0;
25662
25663#if defined(LIBXML_VALID_ENABLED)
25664#ifdef LIBXML_VALID_ENABLED
25665    int mem_base;
25666    int ret_val;
25667    xmlNode * prev; /* an element to insert after */
25668    int n_prev;
25669    xmlNode * next; /* an element to insert next */
25670    int n_next;
25671    xmlChar ** names; /* an array to store the list of child names */
25672    int n_names;
25673    int max; /* the size of the array */
25674    int n_max;
25675
25676    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25677    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25678    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25679    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25680        mem_base = xmlMemBlocks();
25681        prev = gen_xmlNodePtr(n_prev, 0);
25682        next = gen_xmlNodePtr(n_next, 1);
25683        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25684        max = gen_int(n_max, 3);
25685
25686        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25687        desret_int(ret_val);
25688        call_tests++;
25689        des_xmlNodePtr(n_prev, prev, 0);
25690        des_xmlNodePtr(n_next, next, 1);
25691        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25692        des_int(n_max, max, 3);
25693        xmlResetLastError();
25694        if (mem_base != xmlMemBlocks()) {
25695            printf("Leak of %d blocks found in xmlValidGetValidElements",
25696	           xmlMemBlocks() - mem_base);
25697	    test_ret++;
25698            printf(" %d", n_prev);
25699            printf(" %d", n_next);
25700            printf(" %d", n_names);
25701            printf(" %d", n_max);
25702            printf("\n");
25703        }
25704    }
25705    }
25706    }
25707    }
25708    function_tests++;
25709#endif
25710#endif
25711
25712    return(test_ret);
25713}
25714
25715
25716static int
25717test_xmlValidNormalizeAttributeValue(void) {
25718    int test_ret = 0;
25719
25720#if defined(LIBXML_VALID_ENABLED)
25721    int mem_base;
25722    xmlChar * ret_val;
25723    xmlDocPtr doc; /* the document */
25724    int n_doc;
25725    xmlNodePtr elem; /* the parent */
25726    int n_elem;
25727    xmlChar * name; /* the attribute name */
25728    int n_name;
25729    xmlChar * value; /* the attribute value */
25730    int n_value;
25731
25732    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25733    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25734    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25735    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25736        mem_base = xmlMemBlocks();
25737        doc = gen_xmlDocPtr(n_doc, 0);
25738        elem = gen_xmlNodePtr(n_elem, 1);
25739        name = gen_const_xmlChar_ptr(n_name, 2);
25740        value = gen_const_xmlChar_ptr(n_value, 3);
25741
25742        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25743        desret_xmlChar_ptr(ret_val);
25744        call_tests++;
25745        des_xmlDocPtr(n_doc, doc, 0);
25746        des_xmlNodePtr(n_elem, elem, 1);
25747        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25748        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25749        xmlResetLastError();
25750        if (mem_base != xmlMemBlocks()) {
25751            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25752	           xmlMemBlocks() - mem_base);
25753	    test_ret++;
25754            printf(" %d", n_doc);
25755            printf(" %d", n_elem);
25756            printf(" %d", n_name);
25757            printf(" %d", n_value);
25758            printf("\n");
25759        }
25760    }
25761    }
25762    }
25763    }
25764    function_tests++;
25765#endif
25766
25767    return(test_ret);
25768}
25769
25770
25771static int
25772test_xmlValidateAttributeDecl(void) {
25773    int test_ret = 0;
25774
25775#if defined(LIBXML_VALID_ENABLED)
25776    int mem_base;
25777    int ret_val;
25778    xmlValidCtxtPtr ctxt; /* the validation context */
25779    int n_ctxt;
25780    xmlDocPtr doc; /* a document instance */
25781    int n_doc;
25782    xmlAttributePtr attr; /* an attribute definition */
25783    int n_attr;
25784
25785    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25786    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25787    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25788        mem_base = xmlMemBlocks();
25789        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25790        doc = gen_xmlDocPtr(n_doc, 1);
25791        attr = gen_xmlAttributePtr(n_attr, 2);
25792
25793        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25794        desret_int(ret_val);
25795        call_tests++;
25796        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25797        des_xmlDocPtr(n_doc, doc, 1);
25798        des_xmlAttributePtr(n_attr, attr, 2);
25799        xmlResetLastError();
25800        if (mem_base != xmlMemBlocks()) {
25801            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25802	           xmlMemBlocks() - mem_base);
25803	    test_ret++;
25804            printf(" %d", n_ctxt);
25805            printf(" %d", n_doc);
25806            printf(" %d", n_attr);
25807            printf("\n");
25808        }
25809    }
25810    }
25811    }
25812    function_tests++;
25813#endif
25814
25815    return(test_ret);
25816}
25817
25818
25819static int
25820test_xmlValidateAttributeValue(void) {
25821    int test_ret = 0;
25822
25823#if defined(LIBXML_VALID_ENABLED)
25824    int mem_base;
25825    int ret_val;
25826    xmlAttributeType type; /* an attribute type */
25827    int n_type;
25828    xmlChar * value; /* an attribute value */
25829    int n_value;
25830
25831    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25832    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25833        mem_base = xmlMemBlocks();
25834        type = gen_xmlAttributeType(n_type, 0);
25835        value = gen_const_xmlChar_ptr(n_value, 1);
25836
25837        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25838        desret_int(ret_val);
25839        call_tests++;
25840        des_xmlAttributeType(n_type, type, 0);
25841        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25842        xmlResetLastError();
25843        if (mem_base != xmlMemBlocks()) {
25844            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25845	           xmlMemBlocks() - mem_base);
25846	    test_ret++;
25847            printf(" %d", n_type);
25848            printf(" %d", n_value);
25849            printf("\n");
25850        }
25851    }
25852    }
25853    function_tests++;
25854#endif
25855
25856    return(test_ret);
25857}
25858
25859
25860static int
25861test_xmlValidateDocument(void) {
25862    int test_ret = 0;
25863
25864#if defined(LIBXML_VALID_ENABLED)
25865    int mem_base;
25866    int ret_val;
25867    xmlValidCtxtPtr ctxt; /* the validation context */
25868    int n_ctxt;
25869    xmlDocPtr doc; /* a document instance */
25870    int n_doc;
25871
25872    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25873    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25874        mem_base = xmlMemBlocks();
25875        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25876        doc = gen_xmlDocPtr(n_doc, 1);
25877
25878        ret_val = xmlValidateDocument(ctxt, doc);
25879        desret_int(ret_val);
25880        call_tests++;
25881        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25882        des_xmlDocPtr(n_doc, doc, 1);
25883        xmlResetLastError();
25884        if (mem_base != xmlMemBlocks()) {
25885            printf("Leak of %d blocks found in xmlValidateDocument",
25886	           xmlMemBlocks() - mem_base);
25887	    test_ret++;
25888            printf(" %d", n_ctxt);
25889            printf(" %d", n_doc);
25890            printf("\n");
25891        }
25892    }
25893    }
25894    function_tests++;
25895#endif
25896
25897    return(test_ret);
25898}
25899
25900
25901static int
25902test_xmlValidateDocumentFinal(void) {
25903    int test_ret = 0;
25904
25905#if defined(LIBXML_VALID_ENABLED)
25906    int mem_base;
25907    int ret_val;
25908    xmlValidCtxtPtr ctxt; /* the validation context */
25909    int n_ctxt;
25910    xmlDocPtr doc; /* a document instance */
25911    int n_doc;
25912
25913    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25914    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25915        mem_base = xmlMemBlocks();
25916        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25917        doc = gen_xmlDocPtr(n_doc, 1);
25918
25919        ret_val = xmlValidateDocumentFinal(ctxt, doc);
25920        desret_int(ret_val);
25921        call_tests++;
25922        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25923        des_xmlDocPtr(n_doc, doc, 1);
25924        xmlResetLastError();
25925        if (mem_base != xmlMemBlocks()) {
25926            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
25927	           xmlMemBlocks() - mem_base);
25928	    test_ret++;
25929            printf(" %d", n_ctxt);
25930            printf(" %d", n_doc);
25931            printf("\n");
25932        }
25933    }
25934    }
25935    function_tests++;
25936#endif
25937
25938    return(test_ret);
25939}
25940
25941
25942static int
25943test_xmlValidateDtd(void) {
25944    int test_ret = 0;
25945
25946#if defined(LIBXML_VALID_ENABLED)
25947    int mem_base;
25948    int ret_val;
25949    xmlValidCtxtPtr ctxt; /* the validation context */
25950    int n_ctxt;
25951    xmlDocPtr doc; /* a document instance */
25952    int n_doc;
25953    xmlDtdPtr dtd; /* a dtd instance */
25954    int n_dtd;
25955
25956    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25957    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25958    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25959        mem_base = xmlMemBlocks();
25960        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25961        doc = gen_xmlDocPtr(n_doc, 1);
25962        dtd = gen_xmlDtdPtr(n_dtd, 2);
25963
25964        ret_val = xmlValidateDtd(ctxt, doc, dtd);
25965        desret_int(ret_val);
25966        call_tests++;
25967        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25968        des_xmlDocPtr(n_doc, doc, 1);
25969        des_xmlDtdPtr(n_dtd, dtd, 2);
25970        xmlResetLastError();
25971        if (mem_base != xmlMemBlocks()) {
25972            printf("Leak of %d blocks found in xmlValidateDtd",
25973	           xmlMemBlocks() - mem_base);
25974	    test_ret++;
25975            printf(" %d", n_ctxt);
25976            printf(" %d", n_doc);
25977            printf(" %d", n_dtd);
25978            printf("\n");
25979        }
25980    }
25981    }
25982    }
25983    function_tests++;
25984#endif
25985
25986    return(test_ret);
25987}
25988
25989
25990static int
25991test_xmlValidateDtdFinal(void) {
25992    int test_ret = 0;
25993
25994#if defined(LIBXML_VALID_ENABLED)
25995    int mem_base;
25996    int ret_val;
25997    xmlValidCtxtPtr ctxt; /* the validation context */
25998    int n_ctxt;
25999    xmlDocPtr doc; /* a document instance */
26000    int n_doc;
26001
26002    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26003    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26004        mem_base = xmlMemBlocks();
26005        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26006        doc = gen_xmlDocPtr(n_doc, 1);
26007
26008        ret_val = xmlValidateDtdFinal(ctxt, doc);
26009        desret_int(ret_val);
26010        call_tests++;
26011        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26012        des_xmlDocPtr(n_doc, doc, 1);
26013        xmlResetLastError();
26014        if (mem_base != xmlMemBlocks()) {
26015            printf("Leak of %d blocks found in xmlValidateDtdFinal",
26016	           xmlMemBlocks() - mem_base);
26017	    test_ret++;
26018            printf(" %d", n_ctxt);
26019            printf(" %d", n_doc);
26020            printf("\n");
26021        }
26022    }
26023    }
26024    function_tests++;
26025#endif
26026
26027    return(test_ret);
26028}
26029
26030
26031static int
26032test_xmlValidateElement(void) {
26033    int test_ret = 0;
26034
26035#if defined(LIBXML_VALID_ENABLED)
26036    int mem_base;
26037    int ret_val;
26038    xmlValidCtxtPtr ctxt; /* the validation context */
26039    int n_ctxt;
26040    xmlDocPtr doc; /* a document instance */
26041    int n_doc;
26042    xmlNodePtr elem; /* an element instance */
26043    int n_elem;
26044
26045    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26046    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26047    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26048        mem_base = xmlMemBlocks();
26049        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26050        doc = gen_xmlDocPtr(n_doc, 1);
26051        elem = gen_xmlNodePtr(n_elem, 2);
26052
26053        ret_val = xmlValidateElement(ctxt, doc, elem);
26054        desret_int(ret_val);
26055        call_tests++;
26056        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26057        des_xmlDocPtr(n_doc, doc, 1);
26058        des_xmlNodePtr(n_elem, elem, 2);
26059        xmlResetLastError();
26060        if (mem_base != xmlMemBlocks()) {
26061            printf("Leak of %d blocks found in xmlValidateElement",
26062	           xmlMemBlocks() - mem_base);
26063	    test_ret++;
26064            printf(" %d", n_ctxt);
26065            printf(" %d", n_doc);
26066            printf(" %d", n_elem);
26067            printf("\n");
26068        }
26069    }
26070    }
26071    }
26072    function_tests++;
26073#endif
26074
26075    return(test_ret);
26076}
26077
26078
26079static int
26080test_xmlValidateElementDecl(void) {
26081    int test_ret = 0;
26082
26083#if defined(LIBXML_VALID_ENABLED)
26084    int mem_base;
26085    int ret_val;
26086    xmlValidCtxtPtr ctxt; /* the validation context */
26087    int n_ctxt;
26088    xmlDocPtr doc; /* a document instance */
26089    int n_doc;
26090    xmlElementPtr elem; /* an element definition */
26091    int n_elem;
26092
26093    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26094    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26095    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26096        mem_base = xmlMemBlocks();
26097        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26098        doc = gen_xmlDocPtr(n_doc, 1);
26099        elem = gen_xmlElementPtr(n_elem, 2);
26100
26101        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26102        desret_int(ret_val);
26103        call_tests++;
26104        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26105        des_xmlDocPtr(n_doc, doc, 1);
26106        des_xmlElementPtr(n_elem, elem, 2);
26107        xmlResetLastError();
26108        if (mem_base != xmlMemBlocks()) {
26109            printf("Leak of %d blocks found in xmlValidateElementDecl",
26110	           xmlMemBlocks() - mem_base);
26111	    test_ret++;
26112            printf(" %d", n_ctxt);
26113            printf(" %d", n_doc);
26114            printf(" %d", n_elem);
26115            printf("\n");
26116        }
26117    }
26118    }
26119    }
26120    function_tests++;
26121#endif
26122
26123    return(test_ret);
26124}
26125
26126
26127static int
26128test_xmlValidateNameValue(void) {
26129    int test_ret = 0;
26130
26131#if defined(LIBXML_VALID_ENABLED)
26132    int mem_base;
26133    int ret_val;
26134    xmlChar * value; /* an Name value */
26135    int n_value;
26136
26137    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26138        mem_base = xmlMemBlocks();
26139        value = gen_const_xmlChar_ptr(n_value, 0);
26140
26141        ret_val = xmlValidateNameValue((const xmlChar *)value);
26142        desret_int(ret_val);
26143        call_tests++;
26144        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26145        xmlResetLastError();
26146        if (mem_base != xmlMemBlocks()) {
26147            printf("Leak of %d blocks found in xmlValidateNameValue",
26148	           xmlMemBlocks() - mem_base);
26149	    test_ret++;
26150            printf(" %d", n_value);
26151            printf("\n");
26152        }
26153    }
26154    function_tests++;
26155#endif
26156
26157    return(test_ret);
26158}
26159
26160
26161static int
26162test_xmlValidateNamesValue(void) {
26163    int test_ret = 0;
26164
26165#if defined(LIBXML_VALID_ENABLED)
26166    int mem_base;
26167    int ret_val;
26168    xmlChar * value; /* an Names value */
26169    int n_value;
26170
26171    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26172        mem_base = xmlMemBlocks();
26173        value = gen_const_xmlChar_ptr(n_value, 0);
26174
26175        ret_val = xmlValidateNamesValue((const xmlChar *)value);
26176        desret_int(ret_val);
26177        call_tests++;
26178        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26179        xmlResetLastError();
26180        if (mem_base != xmlMemBlocks()) {
26181            printf("Leak of %d blocks found in xmlValidateNamesValue",
26182	           xmlMemBlocks() - mem_base);
26183	    test_ret++;
26184            printf(" %d", n_value);
26185            printf("\n");
26186        }
26187    }
26188    function_tests++;
26189#endif
26190
26191    return(test_ret);
26192}
26193
26194
26195static int
26196test_xmlValidateNmtokenValue(void) {
26197    int test_ret = 0;
26198
26199#if defined(LIBXML_VALID_ENABLED)
26200    int mem_base;
26201    int ret_val;
26202    xmlChar * value; /* an Nmtoken value */
26203    int n_value;
26204
26205    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26206        mem_base = xmlMemBlocks();
26207        value = gen_const_xmlChar_ptr(n_value, 0);
26208
26209        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26210        desret_int(ret_val);
26211        call_tests++;
26212        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26213        xmlResetLastError();
26214        if (mem_base != xmlMemBlocks()) {
26215            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26216	           xmlMemBlocks() - mem_base);
26217	    test_ret++;
26218            printf(" %d", n_value);
26219            printf("\n");
26220        }
26221    }
26222    function_tests++;
26223#endif
26224
26225    return(test_ret);
26226}
26227
26228
26229static int
26230test_xmlValidateNmtokensValue(void) {
26231    int test_ret = 0;
26232
26233#if defined(LIBXML_VALID_ENABLED)
26234    int mem_base;
26235    int ret_val;
26236    xmlChar * value; /* an Nmtokens value */
26237    int n_value;
26238
26239    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26240        mem_base = xmlMemBlocks();
26241        value = gen_const_xmlChar_ptr(n_value, 0);
26242
26243        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26244        desret_int(ret_val);
26245        call_tests++;
26246        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26247        xmlResetLastError();
26248        if (mem_base != xmlMemBlocks()) {
26249            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26250	           xmlMemBlocks() - mem_base);
26251	    test_ret++;
26252            printf(" %d", n_value);
26253            printf("\n");
26254        }
26255    }
26256    function_tests++;
26257#endif
26258
26259    return(test_ret);
26260}
26261
26262
26263static int
26264test_xmlValidateNotationDecl(void) {
26265    int test_ret = 0;
26266
26267#if defined(LIBXML_VALID_ENABLED)
26268    int mem_base;
26269    int ret_val;
26270    xmlValidCtxtPtr ctxt; /* the validation context */
26271    int n_ctxt;
26272    xmlDocPtr doc; /* a document instance */
26273    int n_doc;
26274    xmlNotationPtr nota; /* a notation definition */
26275    int n_nota;
26276
26277    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26278    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26279    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26280        mem_base = xmlMemBlocks();
26281        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26282        doc = gen_xmlDocPtr(n_doc, 1);
26283        nota = gen_xmlNotationPtr(n_nota, 2);
26284
26285        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26286        desret_int(ret_val);
26287        call_tests++;
26288        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26289        des_xmlDocPtr(n_doc, doc, 1);
26290        des_xmlNotationPtr(n_nota, nota, 2);
26291        xmlResetLastError();
26292        if (mem_base != xmlMemBlocks()) {
26293            printf("Leak of %d blocks found in xmlValidateNotationDecl",
26294	           xmlMemBlocks() - mem_base);
26295	    test_ret++;
26296            printf(" %d", n_ctxt);
26297            printf(" %d", n_doc);
26298            printf(" %d", n_nota);
26299            printf("\n");
26300        }
26301    }
26302    }
26303    }
26304    function_tests++;
26305#endif
26306
26307    return(test_ret);
26308}
26309
26310
26311static int
26312test_xmlValidateNotationUse(void) {
26313    int test_ret = 0;
26314
26315#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26316    int mem_base;
26317    int ret_val;
26318    xmlValidCtxtPtr ctxt; /* the validation context */
26319    int n_ctxt;
26320    xmlDocPtr doc; /* the document */
26321    int n_doc;
26322    xmlChar * notationName; /* the notation name to check */
26323    int n_notationName;
26324
26325    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26326    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26327    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26328        mem_base = xmlMemBlocks();
26329        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26330        doc = gen_xmlDocPtr(n_doc, 1);
26331        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26332
26333        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26334        desret_int(ret_val);
26335        call_tests++;
26336        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26337        des_xmlDocPtr(n_doc, doc, 1);
26338        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26339        xmlResetLastError();
26340        if (mem_base != xmlMemBlocks()) {
26341            printf("Leak of %d blocks found in xmlValidateNotationUse",
26342	           xmlMemBlocks() - mem_base);
26343	    test_ret++;
26344            printf(" %d", n_ctxt);
26345            printf(" %d", n_doc);
26346            printf(" %d", n_notationName);
26347            printf("\n");
26348        }
26349    }
26350    }
26351    }
26352    function_tests++;
26353#endif
26354
26355    return(test_ret);
26356}
26357
26358
26359static int
26360test_xmlValidateOneAttribute(void) {
26361    int test_ret = 0;
26362
26363#if defined(LIBXML_VALID_ENABLED)
26364    int mem_base;
26365    int ret_val;
26366    xmlValidCtxtPtr ctxt; /* the validation context */
26367    int n_ctxt;
26368    xmlDocPtr doc; /* a document instance */
26369    int n_doc;
26370    xmlNodePtr elem; /* an element instance */
26371    int n_elem;
26372    xmlAttrPtr attr; /* an attribute instance */
26373    int n_attr;
26374    xmlChar * value; /* the attribute value (without entities processing) */
26375    int n_value;
26376
26377    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26378    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26379    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26380    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26381    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26382        mem_base = xmlMemBlocks();
26383        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26384        doc = gen_xmlDocPtr(n_doc, 1);
26385        elem = gen_xmlNodePtr(n_elem, 2);
26386        attr = gen_xmlAttrPtr(n_attr, 3);
26387        value = gen_const_xmlChar_ptr(n_value, 4);
26388
26389        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26390        desret_int(ret_val);
26391        call_tests++;
26392        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26393        des_xmlDocPtr(n_doc, doc, 1);
26394        des_xmlNodePtr(n_elem, elem, 2);
26395        des_xmlAttrPtr(n_attr, attr, 3);
26396        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26397        xmlResetLastError();
26398        if (mem_base != xmlMemBlocks()) {
26399            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26400	           xmlMemBlocks() - mem_base);
26401	    test_ret++;
26402            printf(" %d", n_ctxt);
26403            printf(" %d", n_doc);
26404            printf(" %d", n_elem);
26405            printf(" %d", n_attr);
26406            printf(" %d", n_value);
26407            printf("\n");
26408        }
26409    }
26410    }
26411    }
26412    }
26413    }
26414    function_tests++;
26415#endif
26416
26417    return(test_ret);
26418}
26419
26420
26421static int
26422test_xmlValidateOneElement(void) {
26423    int test_ret = 0;
26424
26425#if defined(LIBXML_VALID_ENABLED)
26426    int mem_base;
26427    int ret_val;
26428    xmlValidCtxtPtr ctxt; /* the validation context */
26429    int n_ctxt;
26430    xmlDocPtr doc; /* a document instance */
26431    int n_doc;
26432    xmlNodePtr elem; /* an element instance */
26433    int n_elem;
26434
26435    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26436    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26437    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26438        mem_base = xmlMemBlocks();
26439        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26440        doc = gen_xmlDocPtr(n_doc, 1);
26441        elem = gen_xmlNodePtr(n_elem, 2);
26442
26443        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26444        desret_int(ret_val);
26445        call_tests++;
26446        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26447        des_xmlDocPtr(n_doc, doc, 1);
26448        des_xmlNodePtr(n_elem, elem, 2);
26449        xmlResetLastError();
26450        if (mem_base != xmlMemBlocks()) {
26451            printf("Leak of %d blocks found in xmlValidateOneElement",
26452	           xmlMemBlocks() - mem_base);
26453	    test_ret++;
26454            printf(" %d", n_ctxt);
26455            printf(" %d", n_doc);
26456            printf(" %d", n_elem);
26457            printf("\n");
26458        }
26459    }
26460    }
26461    }
26462    function_tests++;
26463#endif
26464
26465    return(test_ret);
26466}
26467
26468
26469static int
26470test_xmlValidateOneNamespace(void) {
26471    int test_ret = 0;
26472
26473#if defined(LIBXML_VALID_ENABLED)
26474    int mem_base;
26475    int ret_val;
26476    xmlValidCtxtPtr ctxt; /* the validation context */
26477    int n_ctxt;
26478    xmlDocPtr doc; /* a document instance */
26479    int n_doc;
26480    xmlNodePtr elem; /* an element instance */
26481    int n_elem;
26482    xmlChar * prefix; /* the namespace prefix */
26483    int n_prefix;
26484    xmlNsPtr ns; /* an namespace declaration instance */
26485    int n_ns;
26486    xmlChar * value; /* the attribute value (without entities processing) */
26487    int n_value;
26488
26489    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26490    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26491    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26492    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26493    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26494    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26495        mem_base = xmlMemBlocks();
26496        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26497        doc = gen_xmlDocPtr(n_doc, 1);
26498        elem = gen_xmlNodePtr(n_elem, 2);
26499        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26500        ns = gen_xmlNsPtr(n_ns, 4);
26501        value = gen_const_xmlChar_ptr(n_value, 5);
26502
26503        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26504        desret_int(ret_val);
26505        call_tests++;
26506        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26507        des_xmlDocPtr(n_doc, doc, 1);
26508        des_xmlNodePtr(n_elem, elem, 2);
26509        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26510        des_xmlNsPtr(n_ns, ns, 4);
26511        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26512        xmlResetLastError();
26513        if (mem_base != xmlMemBlocks()) {
26514            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26515	           xmlMemBlocks() - mem_base);
26516	    test_ret++;
26517            printf(" %d", n_ctxt);
26518            printf(" %d", n_doc);
26519            printf(" %d", n_elem);
26520            printf(" %d", n_prefix);
26521            printf(" %d", n_ns);
26522            printf(" %d", n_value);
26523            printf("\n");
26524        }
26525    }
26526    }
26527    }
26528    }
26529    }
26530    }
26531    function_tests++;
26532#endif
26533
26534    return(test_ret);
26535}
26536
26537
26538static int
26539test_xmlValidatePopElement(void) {
26540    int test_ret = 0;
26541
26542#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26543    int mem_base;
26544    int ret_val;
26545    xmlValidCtxtPtr ctxt; /* the validation context */
26546    int n_ctxt;
26547    xmlDocPtr doc; /* a document instance */
26548    int n_doc;
26549    xmlNodePtr elem; /* an element instance */
26550    int n_elem;
26551    xmlChar * qname; /* the qualified name as appearing in the serialization */
26552    int n_qname;
26553
26554    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26555    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26556    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26557    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26558        mem_base = xmlMemBlocks();
26559        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26560        doc = gen_xmlDocPtr(n_doc, 1);
26561        elem = gen_xmlNodePtr(n_elem, 2);
26562        qname = gen_const_xmlChar_ptr(n_qname, 3);
26563
26564        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26565        desret_int(ret_val);
26566        call_tests++;
26567        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26568        des_xmlDocPtr(n_doc, doc, 1);
26569        des_xmlNodePtr(n_elem, elem, 2);
26570        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26571        xmlResetLastError();
26572        if (mem_base != xmlMemBlocks()) {
26573            printf("Leak of %d blocks found in xmlValidatePopElement",
26574	           xmlMemBlocks() - mem_base);
26575	    test_ret++;
26576            printf(" %d", n_ctxt);
26577            printf(" %d", n_doc);
26578            printf(" %d", n_elem);
26579            printf(" %d", n_qname);
26580            printf("\n");
26581        }
26582    }
26583    }
26584    }
26585    }
26586    function_tests++;
26587#endif
26588
26589    return(test_ret);
26590}
26591
26592
26593static int
26594test_xmlValidatePushCData(void) {
26595    int test_ret = 0;
26596
26597#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26598    int mem_base;
26599    int ret_val;
26600    xmlValidCtxtPtr ctxt; /* the validation context */
26601    int n_ctxt;
26602    xmlChar * data; /* some character data read */
26603    int n_data;
26604    int len; /* the lenght of the data */
26605    int n_len;
26606
26607    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26608    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26609    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26610        mem_base = xmlMemBlocks();
26611        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26612        data = gen_const_xmlChar_ptr(n_data, 1);
26613        len = gen_int(n_len, 2);
26614
26615        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26616        desret_int(ret_val);
26617        call_tests++;
26618        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26619        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26620        des_int(n_len, len, 2);
26621        xmlResetLastError();
26622        if (mem_base != xmlMemBlocks()) {
26623            printf("Leak of %d blocks found in xmlValidatePushCData",
26624	           xmlMemBlocks() - mem_base);
26625	    test_ret++;
26626            printf(" %d", n_ctxt);
26627            printf(" %d", n_data);
26628            printf(" %d", n_len);
26629            printf("\n");
26630        }
26631    }
26632    }
26633    }
26634    function_tests++;
26635#endif
26636
26637    return(test_ret);
26638}
26639
26640
26641static int
26642test_xmlValidatePushElement(void) {
26643    int test_ret = 0;
26644
26645#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26646    int mem_base;
26647    int ret_val;
26648    xmlValidCtxtPtr ctxt; /* the validation context */
26649    int n_ctxt;
26650    xmlDocPtr doc; /* a document instance */
26651    int n_doc;
26652    xmlNodePtr elem; /* an element instance */
26653    int n_elem;
26654    xmlChar * qname; /* the qualified name as appearing in the serialization */
26655    int n_qname;
26656
26657    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26658    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26659    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26660    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26661        mem_base = xmlMemBlocks();
26662        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26663        doc = gen_xmlDocPtr(n_doc, 1);
26664        elem = gen_xmlNodePtr(n_elem, 2);
26665        qname = gen_const_xmlChar_ptr(n_qname, 3);
26666
26667        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26668        desret_int(ret_val);
26669        call_tests++;
26670        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26671        des_xmlDocPtr(n_doc, doc, 1);
26672        des_xmlNodePtr(n_elem, elem, 2);
26673        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26674        xmlResetLastError();
26675        if (mem_base != xmlMemBlocks()) {
26676            printf("Leak of %d blocks found in xmlValidatePushElement",
26677	           xmlMemBlocks() - mem_base);
26678	    test_ret++;
26679            printf(" %d", n_ctxt);
26680            printf(" %d", n_doc);
26681            printf(" %d", n_elem);
26682            printf(" %d", n_qname);
26683            printf("\n");
26684        }
26685    }
26686    }
26687    }
26688    }
26689    function_tests++;
26690#endif
26691
26692    return(test_ret);
26693}
26694
26695
26696static int
26697test_xmlValidateRoot(void) {
26698    int test_ret = 0;
26699
26700#if defined(LIBXML_VALID_ENABLED)
26701    int mem_base;
26702    int ret_val;
26703    xmlValidCtxtPtr ctxt; /* the validation context */
26704    int n_ctxt;
26705    xmlDocPtr doc; /* a document instance */
26706    int n_doc;
26707
26708    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26709    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26710        mem_base = xmlMemBlocks();
26711        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26712        doc = gen_xmlDocPtr(n_doc, 1);
26713
26714        ret_val = xmlValidateRoot(ctxt, doc);
26715        desret_int(ret_val);
26716        call_tests++;
26717        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26718        des_xmlDocPtr(n_doc, doc, 1);
26719        xmlResetLastError();
26720        if (mem_base != xmlMemBlocks()) {
26721            printf("Leak of %d blocks found in xmlValidateRoot",
26722	           xmlMemBlocks() - mem_base);
26723	    test_ret++;
26724            printf(" %d", n_ctxt);
26725            printf(" %d", n_doc);
26726            printf("\n");
26727        }
26728    }
26729    }
26730    function_tests++;
26731#endif
26732
26733    return(test_ret);
26734}
26735
26736static int
26737test_valid(void) {
26738    int test_ret = 0;
26739
26740    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26741    test_ret += test_xmlAddAttributeDecl();
26742    test_ret += test_xmlAddElementDecl();
26743    test_ret += test_xmlAddID();
26744    test_ret += test_xmlAddNotationDecl();
26745    test_ret += test_xmlAddRef();
26746    test_ret += test_xmlCopyAttributeTable();
26747    test_ret += test_xmlCopyDocElementContent();
26748    test_ret += test_xmlCopyElementContent();
26749    test_ret += test_xmlCopyElementTable();
26750    test_ret += test_xmlCopyEnumeration();
26751    test_ret += test_xmlCopyNotationTable();
26752    test_ret += test_xmlCreateEnumeration();
26753    test_ret += test_xmlDumpAttributeDecl();
26754    test_ret += test_xmlDumpAttributeTable();
26755    test_ret += test_xmlDumpElementDecl();
26756    test_ret += test_xmlDumpElementTable();
26757    test_ret += test_xmlDumpNotationDecl();
26758    test_ret += test_xmlDumpNotationTable();
26759    test_ret += test_xmlGetDtdAttrDesc();
26760    test_ret += test_xmlGetDtdElementDesc();
26761    test_ret += test_xmlGetDtdNotationDesc();
26762    test_ret += test_xmlGetDtdQAttrDesc();
26763    test_ret += test_xmlGetDtdQElementDesc();
26764    test_ret += test_xmlGetID();
26765    test_ret += test_xmlGetRefs();
26766    test_ret += test_xmlIsID();
26767    test_ret += test_xmlIsMixedElement();
26768    test_ret += test_xmlIsRef();
26769    test_ret += test_xmlNewDocElementContent();
26770    test_ret += test_xmlNewElementContent();
26771    test_ret += test_xmlNewValidCtxt();
26772    test_ret += test_xmlRemoveID();
26773    test_ret += test_xmlRemoveRef();
26774    test_ret += test_xmlSnprintfElementContent();
26775    test_ret += test_xmlSprintfElementContent();
26776    test_ret += test_xmlValidBuildContentModel();
26777    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26778    test_ret += test_xmlValidGetPotentialChildren();
26779    test_ret += test_xmlValidGetValidElements();
26780    test_ret += test_xmlValidNormalizeAttributeValue();
26781    test_ret += test_xmlValidateAttributeDecl();
26782    test_ret += test_xmlValidateAttributeValue();
26783    test_ret += test_xmlValidateDocument();
26784    test_ret += test_xmlValidateDocumentFinal();
26785    test_ret += test_xmlValidateDtd();
26786    test_ret += test_xmlValidateDtdFinal();
26787    test_ret += test_xmlValidateElement();
26788    test_ret += test_xmlValidateElementDecl();
26789    test_ret += test_xmlValidateNameValue();
26790    test_ret += test_xmlValidateNamesValue();
26791    test_ret += test_xmlValidateNmtokenValue();
26792    test_ret += test_xmlValidateNmtokensValue();
26793    test_ret += test_xmlValidateNotationDecl();
26794    test_ret += test_xmlValidateNotationUse();
26795    test_ret += test_xmlValidateOneAttribute();
26796    test_ret += test_xmlValidateOneElement();
26797    test_ret += test_xmlValidateOneNamespace();
26798    test_ret += test_xmlValidatePopElement();
26799    test_ret += test_xmlValidatePushCData();
26800    test_ret += test_xmlValidatePushElement();
26801    test_ret += test_xmlValidateRoot();
26802
26803    if (test_ret != 0)
26804	printf("Module valid: %d errors\n", test_ret);
26805    return(test_ret);
26806}
26807
26808static int
26809test_xmlXIncludeNewContext(void) {
26810    int test_ret = 0;
26811
26812
26813    /* missing type support */
26814    return(test_ret);
26815}
26816
26817
26818static int
26819test_xmlXIncludeProcess(void) {
26820    int test_ret = 0;
26821
26822#if defined(LIBXML_XINCLUDE_ENABLED)
26823    int mem_base;
26824    int ret_val;
26825    xmlDocPtr doc; /* an XML document */
26826    int n_doc;
26827
26828    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26829        mem_base = xmlMemBlocks();
26830        doc = gen_xmlDocPtr(n_doc, 0);
26831
26832        ret_val = xmlXIncludeProcess(doc);
26833        desret_int(ret_val);
26834        call_tests++;
26835        des_xmlDocPtr(n_doc, doc, 0);
26836        xmlResetLastError();
26837        if (mem_base != xmlMemBlocks()) {
26838            printf("Leak of %d blocks found in xmlXIncludeProcess",
26839	           xmlMemBlocks() - mem_base);
26840	    test_ret++;
26841            printf(" %d", n_doc);
26842            printf("\n");
26843        }
26844    }
26845    function_tests++;
26846#endif
26847
26848    return(test_ret);
26849}
26850
26851
26852static int
26853test_xmlXIncludeProcessFlags(void) {
26854    int test_ret = 0;
26855
26856#if defined(LIBXML_XINCLUDE_ENABLED)
26857    int mem_base;
26858    int ret_val;
26859    xmlDocPtr doc; /* an XML document */
26860    int n_doc;
26861    int flags; /* a set of xmlParserOption used for parsing XML includes */
26862    int n_flags;
26863
26864    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26865    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26866        mem_base = xmlMemBlocks();
26867        doc = gen_xmlDocPtr(n_doc, 0);
26868        flags = gen_int(n_flags, 1);
26869
26870        ret_val = xmlXIncludeProcessFlags(doc, flags);
26871        desret_int(ret_val);
26872        call_tests++;
26873        des_xmlDocPtr(n_doc, doc, 0);
26874        des_int(n_flags, flags, 1);
26875        xmlResetLastError();
26876        if (mem_base != xmlMemBlocks()) {
26877            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
26878	           xmlMemBlocks() - mem_base);
26879	    test_ret++;
26880            printf(" %d", n_doc);
26881            printf(" %d", n_flags);
26882            printf("\n");
26883        }
26884    }
26885    }
26886    function_tests++;
26887#endif
26888
26889    return(test_ret);
26890}
26891
26892#ifdef LIBXML_XINCLUDE_ENABLED
26893
26894#define gen_nb_xmlXIncludeCtxtPtr 1
26895static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26896    return(NULL);
26897}
26898static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26899}
26900#endif
26901
26902
26903static int
26904test_xmlXIncludeProcessNode(void) {
26905    int test_ret = 0;
26906
26907#if defined(LIBXML_XINCLUDE_ENABLED)
26908    int mem_base;
26909    int ret_val;
26910    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
26911    int n_ctxt;
26912    xmlNodePtr node; /* a node in an XML document */
26913    int n_node;
26914
26915    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26916    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
26917        mem_base = xmlMemBlocks();
26918        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26919        node = gen_xmlNodePtr(n_node, 1);
26920
26921        ret_val = xmlXIncludeProcessNode(ctxt, node);
26922        desret_int(ret_val);
26923        call_tests++;
26924        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26925        des_xmlNodePtr(n_node, node, 1);
26926        xmlResetLastError();
26927        if (mem_base != xmlMemBlocks()) {
26928            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
26929	           xmlMemBlocks() - mem_base);
26930	    test_ret++;
26931            printf(" %d", n_ctxt);
26932            printf(" %d", n_node);
26933            printf("\n");
26934        }
26935    }
26936    }
26937    function_tests++;
26938#endif
26939
26940    return(test_ret);
26941}
26942
26943
26944static int
26945test_xmlXIncludeProcessTree(void) {
26946    int test_ret = 0;
26947
26948#if defined(LIBXML_XINCLUDE_ENABLED)
26949    int mem_base;
26950    int ret_val;
26951    xmlNodePtr tree; /* a node in an XML document */
26952    int n_tree;
26953
26954    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26955        mem_base = xmlMemBlocks();
26956        tree = gen_xmlNodePtr(n_tree, 0);
26957
26958        ret_val = xmlXIncludeProcessTree(tree);
26959        desret_int(ret_val);
26960        call_tests++;
26961        des_xmlNodePtr(n_tree, tree, 0);
26962        xmlResetLastError();
26963        if (mem_base != xmlMemBlocks()) {
26964            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
26965	           xmlMemBlocks() - mem_base);
26966	    test_ret++;
26967            printf(" %d", n_tree);
26968            printf("\n");
26969        }
26970    }
26971    function_tests++;
26972#endif
26973
26974    return(test_ret);
26975}
26976
26977
26978static int
26979test_xmlXIncludeProcessTreeFlags(void) {
26980    int test_ret = 0;
26981
26982#if defined(LIBXML_XINCLUDE_ENABLED)
26983    int mem_base;
26984    int ret_val;
26985    xmlNodePtr tree; /* a node in an XML document */
26986    int n_tree;
26987    int flags; /* a set of xmlParserOption used for parsing XML includes */
26988    int n_flags;
26989
26990    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26991    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26992        mem_base = xmlMemBlocks();
26993        tree = gen_xmlNodePtr(n_tree, 0);
26994        flags = gen_int(n_flags, 1);
26995
26996        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
26997        desret_int(ret_val);
26998        call_tests++;
26999        des_xmlNodePtr(n_tree, tree, 0);
27000        des_int(n_flags, flags, 1);
27001        xmlResetLastError();
27002        if (mem_base != xmlMemBlocks()) {
27003            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27004	           xmlMemBlocks() - mem_base);
27005	    test_ret++;
27006            printf(" %d", n_tree);
27007            printf(" %d", n_flags);
27008            printf("\n");
27009        }
27010    }
27011    }
27012    function_tests++;
27013#endif
27014
27015    return(test_ret);
27016}
27017
27018
27019static int
27020test_xmlXIncludeSetFlags(void) {
27021    int test_ret = 0;
27022
27023#if defined(LIBXML_XINCLUDE_ENABLED)
27024    int mem_base;
27025    int ret_val;
27026    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27027    int n_ctxt;
27028    int flags; /* a set of xmlParserOption used for parsing XML includes */
27029    int n_flags;
27030
27031    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27032    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27033        mem_base = xmlMemBlocks();
27034        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27035        flags = gen_int(n_flags, 1);
27036
27037        ret_val = xmlXIncludeSetFlags(ctxt, flags);
27038        desret_int(ret_val);
27039        call_tests++;
27040        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27041        des_int(n_flags, flags, 1);
27042        xmlResetLastError();
27043        if (mem_base != xmlMemBlocks()) {
27044            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27045	           xmlMemBlocks() - mem_base);
27046	    test_ret++;
27047            printf(" %d", n_ctxt);
27048            printf(" %d", n_flags);
27049            printf("\n");
27050        }
27051    }
27052    }
27053    function_tests++;
27054#endif
27055
27056    return(test_ret);
27057}
27058
27059static int
27060test_xinclude(void) {
27061    int test_ret = 0;
27062
27063    if (quiet == 0) printf("Testing xinclude : 6 of 8 functions ...\n");
27064    test_ret += test_xmlXIncludeNewContext();
27065    test_ret += test_xmlXIncludeProcess();
27066    test_ret += test_xmlXIncludeProcessFlags();
27067    test_ret += test_xmlXIncludeProcessNode();
27068    test_ret += test_xmlXIncludeProcessTree();
27069    test_ret += test_xmlXIncludeProcessTreeFlags();
27070    test_ret += test_xmlXIncludeSetFlags();
27071
27072    if (test_ret != 0)
27073	printf("Module xinclude: %d errors\n", test_ret);
27074    return(test_ret);
27075}
27076
27077static int
27078test_xmlAllocOutputBuffer(void) {
27079    int test_ret = 0;
27080
27081#if defined(LIBXML_OUTPUT_ENABLED)
27082    int mem_base;
27083    xmlOutputBufferPtr ret_val;
27084    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27085    int n_encoder;
27086
27087    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27088        mem_base = xmlMemBlocks();
27089        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27090
27091        ret_val = xmlAllocOutputBuffer(encoder);
27092        desret_xmlOutputBufferPtr(ret_val);
27093        call_tests++;
27094        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27095        xmlResetLastError();
27096        if (mem_base != xmlMemBlocks()) {
27097            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27098	           xmlMemBlocks() - mem_base);
27099	    test_ret++;
27100            printf(" %d", n_encoder);
27101            printf("\n");
27102        }
27103    }
27104    function_tests++;
27105#endif
27106
27107    return(test_ret);
27108}
27109
27110
27111static int
27112test_xmlAllocParserInputBuffer(void) {
27113    int test_ret = 0;
27114
27115    int mem_base;
27116    xmlParserInputBufferPtr ret_val;
27117    xmlCharEncoding enc; /* the charset encoding if known */
27118    int n_enc;
27119
27120    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27121        mem_base = xmlMemBlocks();
27122        enc = gen_xmlCharEncoding(n_enc, 0);
27123
27124        ret_val = xmlAllocParserInputBuffer(enc);
27125        desret_xmlParserInputBufferPtr(ret_val);
27126        call_tests++;
27127        des_xmlCharEncoding(n_enc, enc, 0);
27128        xmlResetLastError();
27129        if (mem_base != xmlMemBlocks()) {
27130            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27131	           xmlMemBlocks() - mem_base);
27132	    test_ret++;
27133            printf(" %d", n_enc);
27134            printf("\n");
27135        }
27136    }
27137    function_tests++;
27138
27139    return(test_ret);
27140}
27141
27142
27143static int
27144test_xmlCheckFilename(void) {
27145    int test_ret = 0;
27146
27147    int mem_base;
27148    int ret_val;
27149    char * path; /* the path to check */
27150    int n_path;
27151
27152    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27153        mem_base = xmlMemBlocks();
27154        path = gen_const_char_ptr(n_path, 0);
27155
27156        ret_val = xmlCheckFilename((const char *)path);
27157        desret_int(ret_val);
27158        call_tests++;
27159        des_const_char_ptr(n_path, (const char *)path, 0);
27160        xmlResetLastError();
27161        if (mem_base != xmlMemBlocks()) {
27162            printf("Leak of %d blocks found in xmlCheckFilename",
27163	           xmlMemBlocks() - mem_base);
27164	    test_ret++;
27165            printf(" %d", n_path);
27166            printf("\n");
27167        }
27168    }
27169    function_tests++;
27170
27171    return(test_ret);
27172}
27173
27174
27175static int
27176test_xmlCheckHTTPInput(void) {
27177    int test_ret = 0;
27178
27179    int mem_base;
27180    xmlParserInputPtr ret_val;
27181    xmlParserCtxtPtr ctxt; /* an XML parser context */
27182    int n_ctxt;
27183    xmlParserInputPtr ret; /* an XML parser input */
27184    int n_ret;
27185
27186    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27187    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27188        mem_base = xmlMemBlocks();
27189        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27190        ret = gen_xmlParserInputPtr(n_ret, 1);
27191
27192        ret_val = xmlCheckHTTPInput(ctxt, ret);
27193        desret_xmlParserInputPtr(ret_val);
27194        call_tests++;
27195        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27196        des_xmlParserInputPtr(n_ret, ret, 1);
27197        xmlResetLastError();
27198        if (mem_base != xmlMemBlocks()) {
27199            printf("Leak of %d blocks found in xmlCheckHTTPInput",
27200	           xmlMemBlocks() - mem_base);
27201	    test_ret++;
27202            printf(" %d", n_ctxt);
27203            printf(" %d", n_ret);
27204            printf("\n");
27205        }
27206    }
27207    }
27208    function_tests++;
27209
27210    return(test_ret);
27211}
27212
27213
27214static int
27215test_xmlCleanupInputCallbacks(void) {
27216    int test_ret = 0;
27217
27218    int mem_base;
27219
27220        mem_base = xmlMemBlocks();
27221
27222        xmlCleanupInputCallbacks();
27223        call_tests++;
27224        xmlResetLastError();
27225        if (mem_base != xmlMemBlocks()) {
27226            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27227	           xmlMemBlocks() - mem_base);
27228	    test_ret++;
27229            printf("\n");
27230        }
27231    function_tests++;
27232
27233    return(test_ret);
27234}
27235
27236
27237static int
27238test_xmlCleanupOutputCallbacks(void) {
27239    int test_ret = 0;
27240
27241#if defined(LIBXML_OUTPUT_ENABLED)
27242    int mem_base;
27243
27244        mem_base = xmlMemBlocks();
27245
27246        xmlCleanupOutputCallbacks();
27247        call_tests++;
27248        xmlResetLastError();
27249        if (mem_base != xmlMemBlocks()) {
27250            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27251	           xmlMemBlocks() - mem_base);
27252	    test_ret++;
27253            printf("\n");
27254        }
27255    function_tests++;
27256#endif
27257
27258    return(test_ret);
27259}
27260
27261
27262static int
27263test_xmlFileClose(void) {
27264    int test_ret = 0;
27265
27266    int mem_base;
27267    int ret_val;
27268    void * context; /* the I/O context */
27269    int n_context;
27270
27271    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27272        mem_base = xmlMemBlocks();
27273        context = gen_void_ptr(n_context, 0);
27274
27275        ret_val = xmlFileClose(context);
27276        desret_int(ret_val);
27277        call_tests++;
27278        des_void_ptr(n_context, context, 0);
27279        xmlResetLastError();
27280        if (mem_base != xmlMemBlocks()) {
27281            printf("Leak of %d blocks found in xmlFileClose",
27282	           xmlMemBlocks() - mem_base);
27283	    test_ret++;
27284            printf(" %d", n_context);
27285            printf("\n");
27286        }
27287    }
27288    function_tests++;
27289
27290    return(test_ret);
27291}
27292
27293
27294static int
27295test_xmlFileMatch(void) {
27296    int test_ret = 0;
27297
27298    int mem_base;
27299    int ret_val;
27300    const char * filename; /* the URI for matching */
27301    int n_filename;
27302
27303    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27304        mem_base = xmlMemBlocks();
27305        filename = gen_filepath(n_filename, 0);
27306
27307        ret_val = xmlFileMatch(filename);
27308        desret_int(ret_val);
27309        call_tests++;
27310        des_filepath(n_filename, filename, 0);
27311        xmlResetLastError();
27312        if (mem_base != xmlMemBlocks()) {
27313            printf("Leak of %d blocks found in xmlFileMatch",
27314	           xmlMemBlocks() - mem_base);
27315	    test_ret++;
27316            printf(" %d", n_filename);
27317            printf("\n");
27318        }
27319    }
27320    function_tests++;
27321
27322    return(test_ret);
27323}
27324
27325
27326static int
27327test_xmlFileOpen(void) {
27328    int test_ret = 0;
27329
27330    int mem_base;
27331    void * ret_val;
27332    const char * filename; /* the URI for matching */
27333    int n_filename;
27334
27335    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27336        mem_base = xmlMemBlocks();
27337        filename = gen_filepath(n_filename, 0);
27338
27339        ret_val = xmlFileOpen(filename);
27340        desret_void_ptr(ret_val);
27341        call_tests++;
27342        des_filepath(n_filename, filename, 0);
27343        xmlResetLastError();
27344        if (mem_base != xmlMemBlocks()) {
27345            printf("Leak of %d blocks found in xmlFileOpen",
27346	           xmlMemBlocks() - mem_base);
27347	    test_ret++;
27348            printf(" %d", n_filename);
27349            printf("\n");
27350        }
27351    }
27352    function_tests++;
27353
27354    return(test_ret);
27355}
27356
27357
27358static int
27359test_xmlFileRead(void) {
27360    int test_ret = 0;
27361
27362    int mem_base;
27363    int ret_val;
27364    void * context; /* the I/O context */
27365    int n_context;
27366    char * buffer; /* where to drop data */
27367    int n_buffer;
27368    int len; /* number of bytes to write */
27369    int n_len;
27370
27371    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27372    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27373    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27374        mem_base = xmlMemBlocks();
27375        context = gen_void_ptr(n_context, 0);
27376        buffer = gen_char_ptr(n_buffer, 1);
27377        len = gen_int(n_len, 2);
27378
27379        ret_val = xmlFileRead(context, buffer, len);
27380        desret_int(ret_val);
27381        call_tests++;
27382        des_void_ptr(n_context, context, 0);
27383        des_char_ptr(n_buffer, buffer, 1);
27384        des_int(n_len, len, 2);
27385        xmlResetLastError();
27386        if (mem_base != xmlMemBlocks()) {
27387            printf("Leak of %d blocks found in xmlFileRead",
27388	           xmlMemBlocks() - mem_base);
27389	    test_ret++;
27390            printf(" %d", n_context);
27391            printf(" %d", n_buffer);
27392            printf(" %d", n_len);
27393            printf("\n");
27394        }
27395    }
27396    }
27397    }
27398    function_tests++;
27399
27400    return(test_ret);
27401}
27402
27403
27404static int
27405test_xmlIOFTPClose(void) {
27406    int test_ret = 0;
27407
27408#if defined(LIBXML_FTP_ENABLED)
27409    int mem_base;
27410    int ret_val;
27411    void * context; /* the I/O context */
27412    int n_context;
27413
27414    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27415        mem_base = xmlMemBlocks();
27416        context = gen_void_ptr(n_context, 0);
27417
27418        ret_val = xmlIOFTPClose(context);
27419        desret_int(ret_val);
27420        call_tests++;
27421        des_void_ptr(n_context, context, 0);
27422        xmlResetLastError();
27423        if (mem_base != xmlMemBlocks()) {
27424            printf("Leak of %d blocks found in xmlIOFTPClose",
27425	           xmlMemBlocks() - mem_base);
27426	    test_ret++;
27427            printf(" %d", n_context);
27428            printf("\n");
27429        }
27430    }
27431    function_tests++;
27432#endif
27433
27434    return(test_ret);
27435}
27436
27437
27438static int
27439test_xmlIOFTPMatch(void) {
27440    int test_ret = 0;
27441
27442#if defined(LIBXML_FTP_ENABLED)
27443    int mem_base;
27444    int ret_val;
27445    const char * filename; /* the URI for matching */
27446    int n_filename;
27447
27448    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27449        mem_base = xmlMemBlocks();
27450        filename = gen_filepath(n_filename, 0);
27451
27452        ret_val = xmlIOFTPMatch(filename);
27453        desret_int(ret_val);
27454        call_tests++;
27455        des_filepath(n_filename, filename, 0);
27456        xmlResetLastError();
27457        if (mem_base != xmlMemBlocks()) {
27458            printf("Leak of %d blocks found in xmlIOFTPMatch",
27459	           xmlMemBlocks() - mem_base);
27460	    test_ret++;
27461            printf(" %d", n_filename);
27462            printf("\n");
27463        }
27464    }
27465    function_tests++;
27466#endif
27467
27468    return(test_ret);
27469}
27470
27471
27472static int
27473test_xmlIOFTPOpen(void) {
27474    int test_ret = 0;
27475
27476#if defined(LIBXML_FTP_ENABLED)
27477    int mem_base;
27478    void * ret_val;
27479    const char * filename; /* the URI for matching */
27480    int n_filename;
27481
27482    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27483        mem_base = xmlMemBlocks();
27484        filename = gen_filepath(n_filename, 0);
27485
27486        ret_val = xmlIOFTPOpen(filename);
27487        desret_void_ptr(ret_val);
27488        call_tests++;
27489        des_filepath(n_filename, filename, 0);
27490        xmlResetLastError();
27491        if (mem_base != xmlMemBlocks()) {
27492            printf("Leak of %d blocks found in xmlIOFTPOpen",
27493	           xmlMemBlocks() - mem_base);
27494	    test_ret++;
27495            printf(" %d", n_filename);
27496            printf("\n");
27497        }
27498    }
27499    function_tests++;
27500#endif
27501
27502    return(test_ret);
27503}
27504
27505
27506static int
27507test_xmlIOFTPRead(void) {
27508    int test_ret = 0;
27509
27510#if defined(LIBXML_FTP_ENABLED)
27511    int mem_base;
27512    int ret_val;
27513    void * context; /* the I/O context */
27514    int n_context;
27515    char * buffer; /* where to drop data */
27516    int n_buffer;
27517    int len; /* number of bytes to write */
27518    int n_len;
27519
27520    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27521    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27522    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27523        mem_base = xmlMemBlocks();
27524        context = gen_void_ptr(n_context, 0);
27525        buffer = gen_char_ptr(n_buffer, 1);
27526        len = gen_int(n_len, 2);
27527
27528        ret_val = xmlIOFTPRead(context, buffer, len);
27529        desret_int(ret_val);
27530        call_tests++;
27531        des_void_ptr(n_context, context, 0);
27532        des_char_ptr(n_buffer, buffer, 1);
27533        des_int(n_len, len, 2);
27534        xmlResetLastError();
27535        if (mem_base != xmlMemBlocks()) {
27536            printf("Leak of %d blocks found in xmlIOFTPRead",
27537	           xmlMemBlocks() - mem_base);
27538	    test_ret++;
27539            printf(" %d", n_context);
27540            printf(" %d", n_buffer);
27541            printf(" %d", n_len);
27542            printf("\n");
27543        }
27544    }
27545    }
27546    }
27547    function_tests++;
27548#endif
27549
27550    return(test_ret);
27551}
27552
27553
27554static int
27555test_xmlIOHTTPClose(void) {
27556    int test_ret = 0;
27557
27558#if defined(LIBXML_HTTP_ENABLED)
27559    int mem_base;
27560    int ret_val;
27561    void * context; /* the I/O context */
27562    int n_context;
27563
27564    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27565        mem_base = xmlMemBlocks();
27566        context = gen_void_ptr(n_context, 0);
27567
27568        ret_val = xmlIOHTTPClose(context);
27569        desret_int(ret_val);
27570        call_tests++;
27571        des_void_ptr(n_context, context, 0);
27572        xmlResetLastError();
27573        if (mem_base != xmlMemBlocks()) {
27574            printf("Leak of %d blocks found in xmlIOHTTPClose",
27575	           xmlMemBlocks() - mem_base);
27576	    test_ret++;
27577            printf(" %d", n_context);
27578            printf("\n");
27579        }
27580    }
27581    function_tests++;
27582#endif
27583
27584    return(test_ret);
27585}
27586
27587
27588static int
27589test_xmlIOHTTPMatch(void) {
27590    int test_ret = 0;
27591
27592#if defined(LIBXML_HTTP_ENABLED)
27593    int mem_base;
27594    int ret_val;
27595    const char * filename; /* the URI for matching */
27596    int n_filename;
27597
27598    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27599        mem_base = xmlMemBlocks();
27600        filename = gen_filepath(n_filename, 0);
27601
27602        ret_val = xmlIOHTTPMatch(filename);
27603        desret_int(ret_val);
27604        call_tests++;
27605        des_filepath(n_filename, filename, 0);
27606        xmlResetLastError();
27607        if (mem_base != xmlMemBlocks()) {
27608            printf("Leak of %d blocks found in xmlIOHTTPMatch",
27609	           xmlMemBlocks() - mem_base);
27610	    test_ret++;
27611            printf(" %d", n_filename);
27612            printf("\n");
27613        }
27614    }
27615    function_tests++;
27616#endif
27617
27618    return(test_ret);
27619}
27620
27621
27622static int
27623test_xmlIOHTTPOpen(void) {
27624    int test_ret = 0;
27625
27626#if defined(LIBXML_HTTP_ENABLED)
27627    int mem_base;
27628    void * ret_val;
27629    const char * filename; /* the URI for matching */
27630    int n_filename;
27631
27632    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27633        mem_base = xmlMemBlocks();
27634        filename = gen_filepath(n_filename, 0);
27635
27636        ret_val = xmlIOHTTPOpen(filename);
27637        desret_xmlNanoHTTPCtxtPtr(ret_val);
27638        call_tests++;
27639        des_filepath(n_filename, filename, 0);
27640        xmlResetLastError();
27641        if (mem_base != xmlMemBlocks()) {
27642            printf("Leak of %d blocks found in xmlIOHTTPOpen",
27643	           xmlMemBlocks() - mem_base);
27644	    test_ret++;
27645            printf(" %d", n_filename);
27646            printf("\n");
27647        }
27648    }
27649    function_tests++;
27650#endif
27651
27652    return(test_ret);
27653}
27654
27655
27656static int
27657test_xmlIOHTTPRead(void) {
27658    int test_ret = 0;
27659
27660#if defined(LIBXML_HTTP_ENABLED)
27661    int mem_base;
27662    int ret_val;
27663    void * context; /* the I/O context */
27664    int n_context;
27665    char * buffer; /* where to drop data */
27666    int n_buffer;
27667    int len; /* number of bytes to write */
27668    int n_len;
27669
27670    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27671    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27672    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27673        mem_base = xmlMemBlocks();
27674        context = gen_void_ptr(n_context, 0);
27675        buffer = gen_char_ptr(n_buffer, 1);
27676        len = gen_int(n_len, 2);
27677
27678        ret_val = xmlIOHTTPRead(context, buffer, len);
27679        desret_int(ret_val);
27680        call_tests++;
27681        des_void_ptr(n_context, context, 0);
27682        des_char_ptr(n_buffer, buffer, 1);
27683        des_int(n_len, len, 2);
27684        xmlResetLastError();
27685        if (mem_base != xmlMemBlocks()) {
27686            printf("Leak of %d blocks found in xmlIOHTTPRead",
27687	           xmlMemBlocks() - mem_base);
27688	    test_ret++;
27689            printf(" %d", n_context);
27690            printf(" %d", n_buffer);
27691            printf(" %d", n_len);
27692            printf("\n");
27693        }
27694    }
27695    }
27696    }
27697    function_tests++;
27698#endif
27699
27700    return(test_ret);
27701}
27702
27703
27704static int
27705test_xmlNoNetExternalEntityLoader(void) {
27706    int test_ret = 0;
27707
27708    int mem_base;
27709    xmlParserInputPtr ret_val;
27710    const char * URL; /* the URL for the entity to load */
27711    int n_URL;
27712    char * ID; /* the System ID for the entity to load */
27713    int n_ID;
27714    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27715    int n_ctxt;
27716
27717    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27718    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27719    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27720        mem_base = xmlMemBlocks();
27721        URL = gen_filepath(n_URL, 0);
27722        ID = gen_const_char_ptr(n_ID, 1);
27723        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27724
27725        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27726        desret_xmlParserInputPtr(ret_val);
27727        call_tests++;
27728        des_filepath(n_URL, URL, 0);
27729        des_const_char_ptr(n_ID, (const char *)ID, 1);
27730        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27731        xmlResetLastError();
27732        if (mem_base != xmlMemBlocks()) {
27733            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27734	           xmlMemBlocks() - mem_base);
27735	    test_ret++;
27736            printf(" %d", n_URL);
27737            printf(" %d", n_ID);
27738            printf(" %d", n_ctxt);
27739            printf("\n");
27740        }
27741    }
27742    }
27743    }
27744    function_tests++;
27745
27746    return(test_ret);
27747}
27748
27749
27750static int
27751test_xmlNormalizeWindowsPath(void) {
27752    int test_ret = 0;
27753
27754    int mem_base;
27755    xmlChar * ret_val;
27756    xmlChar * path; /* the input file path */
27757    int n_path;
27758
27759    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27760        mem_base = xmlMemBlocks();
27761        path = gen_const_xmlChar_ptr(n_path, 0);
27762
27763        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27764        desret_xmlChar_ptr(ret_val);
27765        call_tests++;
27766        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27767        xmlResetLastError();
27768        if (mem_base != xmlMemBlocks()) {
27769            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27770	           xmlMemBlocks() - mem_base);
27771	    test_ret++;
27772            printf(" %d", n_path);
27773            printf("\n");
27774        }
27775    }
27776    function_tests++;
27777
27778    return(test_ret);
27779}
27780
27781
27782static int
27783test_xmlOutputBufferCreateBuffer(void) {
27784    int test_ret = 0;
27785
27786#if defined(LIBXML_OUTPUT_ENABLED)
27787    int mem_base;
27788    xmlOutputBufferPtr ret_val;
27789    xmlBufferPtr buffer; /* a xmlBufferPtr */
27790    int n_buffer;
27791    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27792    int n_encoder;
27793
27794    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
27795    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27796        mem_base = xmlMemBlocks();
27797        buffer = gen_xmlBufferPtr(n_buffer, 0);
27798        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27799
27800        ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
27801        desret_xmlOutputBufferPtr(ret_val);
27802        call_tests++;
27803        des_xmlBufferPtr(n_buffer, buffer, 0);
27804        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27805        xmlResetLastError();
27806        if (mem_base != xmlMemBlocks()) {
27807            printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
27808	           xmlMemBlocks() - mem_base);
27809	    test_ret++;
27810            printf(" %d", n_buffer);
27811            printf(" %d", n_encoder);
27812            printf("\n");
27813        }
27814    }
27815    }
27816    function_tests++;
27817#endif
27818
27819    return(test_ret);
27820}
27821
27822
27823static int
27824test_xmlOutputBufferCreateFd(void) {
27825    int test_ret = 0;
27826
27827#if defined(LIBXML_OUTPUT_ENABLED)
27828    int mem_base;
27829    xmlOutputBufferPtr ret_val;
27830    int fd; /* a file descriptor number */
27831    int n_fd;
27832    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27833    int n_encoder;
27834
27835    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27836    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27837        mem_base = xmlMemBlocks();
27838        fd = gen_int(n_fd, 0);
27839        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27840
27841        ret_val = xmlOutputBufferCreateFd(fd, encoder);
27842        desret_xmlOutputBufferPtr(ret_val);
27843        call_tests++;
27844        des_int(n_fd, fd, 0);
27845        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27846        xmlResetLastError();
27847        if (mem_base != xmlMemBlocks()) {
27848            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
27849	           xmlMemBlocks() - mem_base);
27850	    test_ret++;
27851            printf(" %d", n_fd);
27852            printf(" %d", n_encoder);
27853            printf("\n");
27854        }
27855    }
27856    }
27857    function_tests++;
27858#endif
27859
27860    return(test_ret);
27861}
27862
27863
27864static int
27865test_xmlOutputBufferCreateFile(void) {
27866    int test_ret = 0;
27867
27868#if defined(LIBXML_OUTPUT_ENABLED)
27869    int mem_base;
27870    xmlOutputBufferPtr ret_val;
27871    FILE * file; /* a FILE* */
27872    int n_file;
27873    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27874    int n_encoder;
27875
27876    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27877    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27878        mem_base = xmlMemBlocks();
27879        file = gen_FILE_ptr(n_file, 0);
27880        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27881
27882        ret_val = xmlOutputBufferCreateFile(file, encoder);
27883        desret_xmlOutputBufferPtr(ret_val);
27884        call_tests++;
27885        des_FILE_ptr(n_file, file, 0);
27886        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27887        xmlResetLastError();
27888        if (mem_base != xmlMemBlocks()) {
27889            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
27890	           xmlMemBlocks() - mem_base);
27891	    test_ret++;
27892            printf(" %d", n_file);
27893            printf(" %d", n_encoder);
27894            printf("\n");
27895        }
27896    }
27897    }
27898    function_tests++;
27899#endif
27900
27901    return(test_ret);
27902}
27903
27904
27905static int
27906test_xmlOutputBufferCreateFilename(void) {
27907    int test_ret = 0;
27908
27909#if defined(LIBXML_OUTPUT_ENABLED)
27910    int mem_base;
27911    xmlOutputBufferPtr ret_val;
27912    const char * URI; /* a C string containing the URI or filename */
27913    int n_URI;
27914    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27915    int n_encoder;
27916    int compression; /* the compression ration (0 none, 9 max). */
27917    int n_compression;
27918
27919    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27920    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27921    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
27922        mem_base = xmlMemBlocks();
27923        URI = gen_fileoutput(n_URI, 0);
27924        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27925        compression = gen_int(n_compression, 2);
27926
27927        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
27928        desret_xmlOutputBufferPtr(ret_val);
27929        call_tests++;
27930        des_fileoutput(n_URI, URI, 0);
27931        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27932        des_int(n_compression, compression, 2);
27933        xmlResetLastError();
27934        if (mem_base != xmlMemBlocks()) {
27935            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
27936	           xmlMemBlocks() - mem_base);
27937	    test_ret++;
27938            printf(" %d", n_URI);
27939            printf(" %d", n_encoder);
27940            printf(" %d", n_compression);
27941            printf("\n");
27942        }
27943    }
27944    }
27945    }
27946    function_tests++;
27947#endif
27948
27949    return(test_ret);
27950}
27951
27952
27953static int
27954test_xmlOutputBufferFlush(void) {
27955    int test_ret = 0;
27956
27957#if defined(LIBXML_OUTPUT_ENABLED)
27958    int mem_base;
27959    int ret_val;
27960    xmlOutputBufferPtr out; /* a buffered output */
27961    int n_out;
27962
27963    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27964        mem_base = xmlMemBlocks();
27965        out = gen_xmlOutputBufferPtr(n_out, 0);
27966
27967        ret_val = xmlOutputBufferFlush(out);
27968        desret_int(ret_val);
27969        call_tests++;
27970        des_xmlOutputBufferPtr(n_out, out, 0);
27971        xmlResetLastError();
27972        if (mem_base != xmlMemBlocks()) {
27973            printf("Leak of %d blocks found in xmlOutputBufferFlush",
27974	           xmlMemBlocks() - mem_base);
27975	    test_ret++;
27976            printf(" %d", n_out);
27977            printf("\n");
27978        }
27979    }
27980    function_tests++;
27981#endif
27982
27983    return(test_ret);
27984}
27985
27986
27987static int
27988test_xmlOutputBufferWrite(void) {
27989    int test_ret = 0;
27990
27991#if defined(LIBXML_OUTPUT_ENABLED)
27992    int mem_base;
27993    int ret_val;
27994    xmlOutputBufferPtr out; /* a buffered parser output */
27995    int n_out;
27996    int len; /* the size in bytes of the array. */
27997    int n_len;
27998    char * buf; /* an char array */
27999    int n_buf;
28000
28001    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28002    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28003    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28004        mem_base = xmlMemBlocks();
28005        out = gen_xmlOutputBufferPtr(n_out, 0);
28006        len = gen_int(n_len, 1);
28007        buf = gen_const_char_ptr(n_buf, 2);
28008
28009        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28010        desret_int(ret_val);
28011        call_tests++;
28012        des_xmlOutputBufferPtr(n_out, out, 0);
28013        des_int(n_len, len, 1);
28014        des_const_char_ptr(n_buf, (const char *)buf, 2);
28015        xmlResetLastError();
28016        if (mem_base != xmlMemBlocks()) {
28017            printf("Leak of %d blocks found in xmlOutputBufferWrite",
28018	           xmlMemBlocks() - mem_base);
28019	    test_ret++;
28020            printf(" %d", n_out);
28021            printf(" %d", n_len);
28022            printf(" %d", n_buf);
28023            printf("\n");
28024        }
28025    }
28026    }
28027    }
28028    function_tests++;
28029#endif
28030
28031    return(test_ret);
28032}
28033
28034
28035static int
28036test_xmlOutputBufferWriteEscape(void) {
28037    int test_ret = 0;
28038
28039
28040    /* missing type support */
28041    return(test_ret);
28042}
28043
28044
28045static int
28046test_xmlOutputBufferWriteString(void) {
28047    int test_ret = 0;
28048
28049#if defined(LIBXML_OUTPUT_ENABLED)
28050    int mem_base;
28051    int ret_val;
28052    xmlOutputBufferPtr out; /* a buffered parser output */
28053    int n_out;
28054    char * str; /* a zero terminated C string */
28055    int n_str;
28056
28057    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28058    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28059        mem_base = xmlMemBlocks();
28060        out = gen_xmlOutputBufferPtr(n_out, 0);
28061        str = gen_const_char_ptr(n_str, 1);
28062
28063        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28064        desret_int(ret_val);
28065        call_tests++;
28066        des_xmlOutputBufferPtr(n_out, out, 0);
28067        des_const_char_ptr(n_str, (const char *)str, 1);
28068        xmlResetLastError();
28069        if (mem_base != xmlMemBlocks()) {
28070            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28071	           xmlMemBlocks() - mem_base);
28072	    test_ret++;
28073            printf(" %d", n_out);
28074            printf(" %d", n_str);
28075            printf("\n");
28076        }
28077    }
28078    }
28079    function_tests++;
28080#endif
28081
28082    return(test_ret);
28083}
28084
28085
28086static int
28087test_xmlParserGetDirectory(void) {
28088    int test_ret = 0;
28089
28090
28091    /* missing type support */
28092    return(test_ret);
28093}
28094
28095
28096static int
28097test_xmlParserInputBufferCreateFd(void) {
28098    int test_ret = 0;
28099
28100    int mem_base;
28101    xmlParserInputBufferPtr ret_val;
28102    int fd; /* a file descriptor number */
28103    int n_fd;
28104    xmlCharEncoding enc; /* the charset encoding if known */
28105    int n_enc;
28106
28107    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28108    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28109        mem_base = xmlMemBlocks();
28110        fd = gen_int(n_fd, 0);
28111        enc = gen_xmlCharEncoding(n_enc, 1);
28112        if (fd >= 0) fd = -1;
28113
28114        ret_val = xmlParserInputBufferCreateFd(fd, enc);
28115        desret_xmlParserInputBufferPtr(ret_val);
28116        call_tests++;
28117        des_int(n_fd, fd, 0);
28118        des_xmlCharEncoding(n_enc, enc, 1);
28119        xmlResetLastError();
28120        if (mem_base != xmlMemBlocks()) {
28121            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28122	           xmlMemBlocks() - mem_base);
28123	    test_ret++;
28124            printf(" %d", n_fd);
28125            printf(" %d", n_enc);
28126            printf("\n");
28127        }
28128    }
28129    }
28130    function_tests++;
28131
28132    return(test_ret);
28133}
28134
28135
28136static int
28137test_xmlParserInputBufferCreateFile(void) {
28138    int test_ret = 0;
28139
28140    int mem_base;
28141    xmlParserInputBufferPtr ret_val;
28142    FILE * file; /* a FILE* */
28143    int n_file;
28144    xmlCharEncoding enc; /* the charset encoding if known */
28145    int n_enc;
28146
28147    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28148    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28149        mem_base = xmlMemBlocks();
28150        file = gen_FILE_ptr(n_file, 0);
28151        enc = gen_xmlCharEncoding(n_enc, 1);
28152
28153        ret_val = xmlParserInputBufferCreateFile(file, enc);
28154        desret_xmlParserInputBufferPtr(ret_val);
28155        call_tests++;
28156        des_FILE_ptr(n_file, file, 0);
28157        des_xmlCharEncoding(n_enc, enc, 1);
28158        xmlResetLastError();
28159        if (mem_base != xmlMemBlocks()) {
28160            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28161	           xmlMemBlocks() - mem_base);
28162	    test_ret++;
28163            printf(" %d", n_file);
28164            printf(" %d", n_enc);
28165            printf("\n");
28166        }
28167    }
28168    }
28169    function_tests++;
28170
28171    return(test_ret);
28172}
28173
28174
28175static int
28176test_xmlParserInputBufferCreateFilename(void) {
28177    int test_ret = 0;
28178
28179    int mem_base;
28180    xmlParserInputBufferPtr ret_val;
28181    const char * URI; /* a C string containing the URI or filename */
28182    int n_URI;
28183    xmlCharEncoding enc; /* the charset encoding if known */
28184    int n_enc;
28185
28186    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28187    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28188        mem_base = xmlMemBlocks();
28189        URI = gen_fileoutput(n_URI, 0);
28190        enc = gen_xmlCharEncoding(n_enc, 1);
28191
28192        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28193        desret_xmlParserInputBufferPtr(ret_val);
28194        call_tests++;
28195        des_fileoutput(n_URI, URI, 0);
28196        des_xmlCharEncoding(n_enc, enc, 1);
28197        xmlResetLastError();
28198        if (mem_base != xmlMemBlocks()) {
28199            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28200	           xmlMemBlocks() - mem_base);
28201	    test_ret++;
28202            printf(" %d", n_URI);
28203            printf(" %d", n_enc);
28204            printf("\n");
28205        }
28206    }
28207    }
28208    function_tests++;
28209
28210    return(test_ret);
28211}
28212
28213
28214static int
28215test_xmlParserInputBufferCreateMem(void) {
28216    int test_ret = 0;
28217
28218    int mem_base;
28219    xmlParserInputBufferPtr ret_val;
28220    char * mem; /* the memory input */
28221    int n_mem;
28222    int size; /* the length of the memory block */
28223    int n_size;
28224    xmlCharEncoding enc; /* the charset encoding if known */
28225    int n_enc;
28226
28227    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28228    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28229    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28230        mem_base = xmlMemBlocks();
28231        mem = gen_const_char_ptr(n_mem, 0);
28232        size = gen_int(n_size, 1);
28233        enc = gen_xmlCharEncoding(n_enc, 2);
28234
28235        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28236        desret_xmlParserInputBufferPtr(ret_val);
28237        call_tests++;
28238        des_const_char_ptr(n_mem, (const char *)mem, 0);
28239        des_int(n_size, size, 1);
28240        des_xmlCharEncoding(n_enc, enc, 2);
28241        xmlResetLastError();
28242        if (mem_base != xmlMemBlocks()) {
28243            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28244	           xmlMemBlocks() - mem_base);
28245	    test_ret++;
28246            printf(" %d", n_mem);
28247            printf(" %d", n_size);
28248            printf(" %d", n_enc);
28249            printf("\n");
28250        }
28251    }
28252    }
28253    }
28254    function_tests++;
28255
28256    return(test_ret);
28257}
28258
28259
28260static int
28261test_xmlParserInputBufferCreateStatic(void) {
28262    int test_ret = 0;
28263
28264    int mem_base;
28265    xmlParserInputBufferPtr ret_val;
28266    char * mem; /* the memory input */
28267    int n_mem;
28268    int size; /* the length of the memory block */
28269    int n_size;
28270    xmlCharEncoding enc; /* the charset encoding if known */
28271    int n_enc;
28272
28273    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28274    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28275    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28276        mem_base = xmlMemBlocks();
28277        mem = gen_const_char_ptr(n_mem, 0);
28278        size = gen_int(n_size, 1);
28279        enc = gen_xmlCharEncoding(n_enc, 2);
28280
28281        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28282        desret_xmlParserInputBufferPtr(ret_val);
28283        call_tests++;
28284        des_const_char_ptr(n_mem, (const char *)mem, 0);
28285        des_int(n_size, size, 1);
28286        des_xmlCharEncoding(n_enc, enc, 2);
28287        xmlResetLastError();
28288        if (mem_base != xmlMemBlocks()) {
28289            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28290	           xmlMemBlocks() - mem_base);
28291	    test_ret++;
28292            printf(" %d", n_mem);
28293            printf(" %d", n_size);
28294            printf(" %d", n_enc);
28295            printf("\n");
28296        }
28297    }
28298    }
28299    }
28300    function_tests++;
28301
28302    return(test_ret);
28303}
28304
28305
28306static int
28307test_xmlParserInputBufferGrow(void) {
28308    int test_ret = 0;
28309
28310    int mem_base;
28311    int ret_val;
28312    xmlParserInputBufferPtr in; /* a buffered parser input */
28313    int n_in;
28314    int len; /* indicative value of the amount of chars to read */
28315    int n_len;
28316
28317    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28318    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28319        mem_base = xmlMemBlocks();
28320        in = gen_xmlParserInputBufferPtr(n_in, 0);
28321        len = gen_int(n_len, 1);
28322
28323        ret_val = xmlParserInputBufferGrow(in, len);
28324        desret_int(ret_val);
28325        call_tests++;
28326        des_xmlParserInputBufferPtr(n_in, in, 0);
28327        des_int(n_len, len, 1);
28328        xmlResetLastError();
28329        if (mem_base != xmlMemBlocks()) {
28330            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28331	           xmlMemBlocks() - mem_base);
28332	    test_ret++;
28333            printf(" %d", n_in);
28334            printf(" %d", n_len);
28335            printf("\n");
28336        }
28337    }
28338    }
28339    function_tests++;
28340
28341    return(test_ret);
28342}
28343
28344
28345static int
28346test_xmlParserInputBufferPush(void) {
28347    int test_ret = 0;
28348
28349    int mem_base;
28350    int ret_val;
28351    xmlParserInputBufferPtr in; /* a buffered parser input */
28352    int n_in;
28353    int len; /* the size in bytes of the array. */
28354    int n_len;
28355    char * buf; /* an char array */
28356    int n_buf;
28357
28358    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28359    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28360    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28361        mem_base = xmlMemBlocks();
28362        in = gen_xmlParserInputBufferPtr(n_in, 0);
28363        len = gen_int(n_len, 1);
28364        buf = gen_const_char_ptr(n_buf, 2);
28365
28366        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28367        desret_int(ret_val);
28368        call_tests++;
28369        des_xmlParserInputBufferPtr(n_in, in, 0);
28370        des_int(n_len, len, 1);
28371        des_const_char_ptr(n_buf, (const char *)buf, 2);
28372        xmlResetLastError();
28373        if (mem_base != xmlMemBlocks()) {
28374            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28375	           xmlMemBlocks() - mem_base);
28376	    test_ret++;
28377            printf(" %d", n_in);
28378            printf(" %d", n_len);
28379            printf(" %d", n_buf);
28380            printf("\n");
28381        }
28382    }
28383    }
28384    }
28385    function_tests++;
28386
28387    return(test_ret);
28388}
28389
28390
28391static int
28392test_xmlParserInputBufferRead(void) {
28393    int test_ret = 0;
28394
28395    int mem_base;
28396    int ret_val;
28397    xmlParserInputBufferPtr in; /* a buffered parser input */
28398    int n_in;
28399    int len; /* indicative value of the amount of chars to read */
28400    int n_len;
28401
28402    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28403    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28404        mem_base = xmlMemBlocks();
28405        in = gen_xmlParserInputBufferPtr(n_in, 0);
28406        len = gen_int(n_len, 1);
28407
28408        ret_val = xmlParserInputBufferRead(in, len);
28409        desret_int(ret_val);
28410        call_tests++;
28411        des_xmlParserInputBufferPtr(n_in, in, 0);
28412        des_int(n_len, len, 1);
28413        xmlResetLastError();
28414        if (mem_base != xmlMemBlocks()) {
28415            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28416	           xmlMemBlocks() - mem_base);
28417	    test_ret++;
28418            printf(" %d", n_in);
28419            printf(" %d", n_len);
28420            printf("\n");
28421        }
28422    }
28423    }
28424    function_tests++;
28425
28426    return(test_ret);
28427}
28428
28429
28430static int
28431test_xmlPopInputCallbacks(void) {
28432    int test_ret = 0;
28433
28434    int mem_base;
28435    int ret_val;
28436
28437        mem_base = xmlMemBlocks();
28438
28439        ret_val = xmlPopInputCallbacks();
28440        desret_int(ret_val);
28441        call_tests++;
28442        xmlResetLastError();
28443        if (mem_base != xmlMemBlocks()) {
28444            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28445	           xmlMemBlocks() - mem_base);
28446	    test_ret++;
28447            printf("\n");
28448        }
28449    function_tests++;
28450
28451    return(test_ret);
28452}
28453
28454
28455static int
28456test_xmlRegisterDefaultInputCallbacks(void) {
28457    int test_ret = 0;
28458
28459    int mem_base;
28460
28461        mem_base = xmlMemBlocks();
28462
28463        xmlRegisterDefaultInputCallbacks();
28464        call_tests++;
28465        xmlResetLastError();
28466        if (mem_base != xmlMemBlocks()) {
28467            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28468	           xmlMemBlocks() - mem_base);
28469	    test_ret++;
28470            printf("\n");
28471        }
28472    function_tests++;
28473
28474    return(test_ret);
28475}
28476
28477
28478static int
28479test_xmlRegisterDefaultOutputCallbacks(void) {
28480    int test_ret = 0;
28481
28482#if defined(LIBXML_OUTPUT_ENABLED)
28483    int mem_base;
28484
28485        mem_base = xmlMemBlocks();
28486
28487        xmlRegisterDefaultOutputCallbacks();
28488        call_tests++;
28489        xmlResetLastError();
28490        if (mem_base != xmlMemBlocks()) {
28491            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28492	           xmlMemBlocks() - mem_base);
28493	    test_ret++;
28494            printf("\n");
28495        }
28496    function_tests++;
28497#endif
28498
28499    return(test_ret);
28500}
28501
28502
28503static int
28504test_xmlRegisterHTTPPostCallbacks(void) {
28505    int test_ret = 0;
28506
28507#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28508    int mem_base;
28509
28510        mem_base = xmlMemBlocks();
28511
28512        xmlRegisterHTTPPostCallbacks();
28513        call_tests++;
28514        xmlResetLastError();
28515        if (mem_base != xmlMemBlocks()) {
28516            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28517	           xmlMemBlocks() - mem_base);
28518	    test_ret++;
28519            printf("\n");
28520        }
28521    function_tests++;
28522#endif
28523
28524    return(test_ret);
28525}
28526
28527static int
28528test_xmlIO(void) {
28529    int test_ret = 0;
28530
28531    if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28532    test_ret += test_xmlAllocOutputBuffer();
28533    test_ret += test_xmlAllocParserInputBuffer();
28534    test_ret += test_xmlCheckFilename();
28535    test_ret += test_xmlCheckHTTPInput();
28536    test_ret += test_xmlCleanupInputCallbacks();
28537    test_ret += test_xmlCleanupOutputCallbacks();
28538    test_ret += test_xmlFileClose();
28539    test_ret += test_xmlFileMatch();
28540    test_ret += test_xmlFileOpen();
28541    test_ret += test_xmlFileRead();
28542    test_ret += test_xmlIOFTPClose();
28543    test_ret += test_xmlIOFTPMatch();
28544    test_ret += test_xmlIOFTPOpen();
28545    test_ret += test_xmlIOFTPRead();
28546    test_ret += test_xmlIOHTTPClose();
28547    test_ret += test_xmlIOHTTPMatch();
28548    test_ret += test_xmlIOHTTPOpen();
28549    test_ret += test_xmlIOHTTPRead();
28550    test_ret += test_xmlNoNetExternalEntityLoader();
28551    test_ret += test_xmlNormalizeWindowsPath();
28552    test_ret += test_xmlOutputBufferCreateBuffer();
28553    test_ret += test_xmlOutputBufferCreateFd();
28554    test_ret += test_xmlOutputBufferCreateFile();
28555    test_ret += test_xmlOutputBufferCreateFilename();
28556    test_ret += test_xmlOutputBufferFlush();
28557    test_ret += test_xmlOutputBufferWrite();
28558    test_ret += test_xmlOutputBufferWriteEscape();
28559    test_ret += test_xmlOutputBufferWriteString();
28560    test_ret += test_xmlParserGetDirectory();
28561    test_ret += test_xmlParserInputBufferCreateFd();
28562    test_ret += test_xmlParserInputBufferCreateFile();
28563    test_ret += test_xmlParserInputBufferCreateFilename();
28564    test_ret += test_xmlParserInputBufferCreateMem();
28565    test_ret += test_xmlParserInputBufferCreateStatic();
28566    test_ret += test_xmlParserInputBufferGrow();
28567    test_ret += test_xmlParserInputBufferPush();
28568    test_ret += test_xmlParserInputBufferRead();
28569    test_ret += test_xmlPopInputCallbacks();
28570    test_ret += test_xmlRegisterDefaultInputCallbacks();
28571    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28572    test_ret += test_xmlRegisterHTTPPostCallbacks();
28573
28574    if (test_ret != 0)
28575	printf("Module xmlIO: %d errors\n", test_ret);
28576    return(test_ret);
28577}
28578#ifdef LIBXML_AUTOMATA_ENABLED
28579
28580#define gen_nb_xmlAutomataPtr 1
28581static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28582    return(NULL);
28583}
28584static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28585}
28586#endif
28587
28588
28589static int
28590test_xmlAutomataCompile(void) {
28591    int test_ret = 0;
28592
28593
28594    /* missing type support */
28595    return(test_ret);
28596}
28597
28598
28599static int
28600test_xmlAutomataGetInitState(void) {
28601    int test_ret = 0;
28602
28603
28604    /* missing type support */
28605    return(test_ret);
28606}
28607
28608
28609static int
28610test_xmlAutomataIsDeterminist(void) {
28611    int test_ret = 0;
28612
28613#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28614    int mem_base;
28615    int ret_val;
28616    xmlAutomataPtr am; /* an automata */
28617    int n_am;
28618
28619    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28620        mem_base = xmlMemBlocks();
28621        am = gen_xmlAutomataPtr(n_am, 0);
28622
28623        ret_val = xmlAutomataIsDeterminist(am);
28624        desret_int(ret_val);
28625        call_tests++;
28626        des_xmlAutomataPtr(n_am, am, 0);
28627        xmlResetLastError();
28628        if (mem_base != xmlMemBlocks()) {
28629            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28630	           xmlMemBlocks() - mem_base);
28631	    test_ret++;
28632            printf(" %d", n_am);
28633            printf("\n");
28634        }
28635    }
28636    function_tests++;
28637#endif
28638
28639    return(test_ret);
28640}
28641
28642#ifdef LIBXML_AUTOMATA_ENABLED
28643
28644#define gen_nb_xmlAutomataStatePtr 1
28645static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28646    return(NULL);
28647}
28648static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28649}
28650#endif
28651
28652
28653static int
28654test_xmlAutomataNewAllTrans(void) {
28655    int test_ret = 0;
28656
28657
28658    /* missing type support */
28659    return(test_ret);
28660}
28661
28662
28663static int
28664test_xmlAutomataNewCountTrans(void) {
28665    int test_ret = 0;
28666
28667
28668    /* missing type support */
28669    return(test_ret);
28670}
28671
28672
28673static int
28674test_xmlAutomataNewCountTrans2(void) {
28675    int test_ret = 0;
28676
28677
28678    /* missing type support */
28679    return(test_ret);
28680}
28681
28682
28683static int
28684test_xmlAutomataNewCountedTrans(void) {
28685    int test_ret = 0;
28686
28687
28688    /* missing type support */
28689    return(test_ret);
28690}
28691
28692
28693static int
28694test_xmlAutomataNewCounter(void) {
28695    int test_ret = 0;
28696
28697#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28698    int mem_base;
28699    int ret_val;
28700    xmlAutomataPtr am; /* an automata */
28701    int n_am;
28702    int min; /* the minimal value on the counter */
28703    int n_min;
28704    int max; /* the maximal value on the counter */
28705    int n_max;
28706
28707    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28708    for (n_min = 0;n_min < gen_nb_int;n_min++) {
28709    for (n_max = 0;n_max < gen_nb_int;n_max++) {
28710        mem_base = xmlMemBlocks();
28711        am = gen_xmlAutomataPtr(n_am, 0);
28712        min = gen_int(n_min, 1);
28713        max = gen_int(n_max, 2);
28714
28715        ret_val = xmlAutomataNewCounter(am, min, max);
28716        desret_int(ret_val);
28717        call_tests++;
28718        des_xmlAutomataPtr(n_am, am, 0);
28719        des_int(n_min, min, 1);
28720        des_int(n_max, max, 2);
28721        xmlResetLastError();
28722        if (mem_base != xmlMemBlocks()) {
28723            printf("Leak of %d blocks found in xmlAutomataNewCounter",
28724	           xmlMemBlocks() - mem_base);
28725	    test_ret++;
28726            printf(" %d", n_am);
28727            printf(" %d", n_min);
28728            printf(" %d", n_max);
28729            printf("\n");
28730        }
28731    }
28732    }
28733    }
28734    function_tests++;
28735#endif
28736
28737    return(test_ret);
28738}
28739
28740
28741static int
28742test_xmlAutomataNewCounterTrans(void) {
28743    int test_ret = 0;
28744
28745
28746    /* missing type support */
28747    return(test_ret);
28748}
28749
28750
28751static int
28752test_xmlAutomataNewEpsilon(void) {
28753    int test_ret = 0;
28754
28755
28756    /* missing type support */
28757    return(test_ret);
28758}
28759
28760
28761static int
28762test_xmlAutomataNewNegTrans(void) {
28763    int test_ret = 0;
28764
28765
28766    /* missing type support */
28767    return(test_ret);
28768}
28769
28770
28771static int
28772test_xmlAutomataNewOnceTrans(void) {
28773    int test_ret = 0;
28774
28775
28776    /* missing type support */
28777    return(test_ret);
28778}
28779
28780
28781static int
28782test_xmlAutomataNewOnceTrans2(void) {
28783    int test_ret = 0;
28784
28785
28786    /* missing type support */
28787    return(test_ret);
28788}
28789
28790
28791static int
28792test_xmlAutomataNewState(void) {
28793    int test_ret = 0;
28794
28795
28796    /* missing type support */
28797    return(test_ret);
28798}
28799
28800
28801static int
28802test_xmlAutomataNewTransition(void) {
28803    int test_ret = 0;
28804
28805
28806    /* missing type support */
28807    return(test_ret);
28808}
28809
28810
28811static int
28812test_xmlAutomataNewTransition2(void) {
28813    int test_ret = 0;
28814
28815
28816    /* missing type support */
28817    return(test_ret);
28818}
28819
28820
28821static int
28822test_xmlAutomataSetFinalState(void) {
28823    int test_ret = 0;
28824
28825#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28826    int mem_base;
28827    int ret_val;
28828    xmlAutomataPtr am; /* an automata */
28829    int n_am;
28830    xmlAutomataStatePtr state; /* a state in this automata */
28831    int n_state;
28832
28833    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28834    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
28835        mem_base = xmlMemBlocks();
28836        am = gen_xmlAutomataPtr(n_am, 0);
28837        state = gen_xmlAutomataStatePtr(n_state, 1);
28838
28839        ret_val = xmlAutomataSetFinalState(am, state);
28840        desret_int(ret_val);
28841        call_tests++;
28842        des_xmlAutomataPtr(n_am, am, 0);
28843        des_xmlAutomataStatePtr(n_state, state, 1);
28844        xmlResetLastError();
28845        if (mem_base != xmlMemBlocks()) {
28846            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
28847	           xmlMemBlocks() - mem_base);
28848	    test_ret++;
28849            printf(" %d", n_am);
28850            printf(" %d", n_state);
28851            printf("\n");
28852        }
28853    }
28854    }
28855    function_tests++;
28856#endif
28857
28858    return(test_ret);
28859}
28860
28861
28862static int
28863test_xmlNewAutomata(void) {
28864    int test_ret = 0;
28865
28866
28867    /* missing type support */
28868    return(test_ret);
28869}
28870
28871static int
28872test_xmlautomata(void) {
28873    int test_ret = 0;
28874
28875    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
28876    test_ret += test_xmlAutomataCompile();
28877    test_ret += test_xmlAutomataGetInitState();
28878    test_ret += test_xmlAutomataIsDeterminist();
28879    test_ret += test_xmlAutomataNewAllTrans();
28880    test_ret += test_xmlAutomataNewCountTrans();
28881    test_ret += test_xmlAutomataNewCountTrans2();
28882    test_ret += test_xmlAutomataNewCountedTrans();
28883    test_ret += test_xmlAutomataNewCounter();
28884    test_ret += test_xmlAutomataNewCounterTrans();
28885    test_ret += test_xmlAutomataNewEpsilon();
28886    test_ret += test_xmlAutomataNewNegTrans();
28887    test_ret += test_xmlAutomataNewOnceTrans();
28888    test_ret += test_xmlAutomataNewOnceTrans2();
28889    test_ret += test_xmlAutomataNewState();
28890    test_ret += test_xmlAutomataNewTransition();
28891    test_ret += test_xmlAutomataNewTransition2();
28892    test_ret += test_xmlAutomataSetFinalState();
28893    test_ret += test_xmlNewAutomata();
28894
28895    if (test_ret != 0)
28896	printf("Module xmlautomata: %d errors\n", test_ret);
28897    return(test_ret);
28898}
28899
28900#define gen_nb_xmlGenericErrorFunc_ptr 1
28901static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28902    return(NULL);
28903}
28904static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28905}
28906
28907static int
28908test_initGenericErrorDefaultFunc(void) {
28909    int test_ret = 0;
28910
28911    int mem_base;
28912    xmlGenericErrorFunc * handler; /* the handler */
28913    int n_handler;
28914
28915    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
28916        mem_base = xmlMemBlocks();
28917        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
28918
28919        initGenericErrorDefaultFunc(handler);
28920        call_tests++;
28921        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
28922        xmlResetLastError();
28923        if (mem_base != xmlMemBlocks()) {
28924            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
28925	           xmlMemBlocks() - mem_base);
28926	    test_ret++;
28927            printf(" %d", n_handler);
28928            printf("\n");
28929        }
28930    }
28931    function_tests++;
28932
28933    return(test_ret);
28934}
28935
28936
28937#define gen_nb_xmlErrorPtr 1
28938static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28939    return(NULL);
28940}
28941static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28942}
28943
28944static int
28945test_xmlCopyError(void) {
28946    int test_ret = 0;
28947
28948    int mem_base;
28949    int ret_val;
28950    xmlErrorPtr from; /* a source error */
28951    int n_from;
28952    xmlErrorPtr to; /* a target error */
28953    int n_to;
28954
28955    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
28956    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
28957        mem_base = xmlMemBlocks();
28958        from = gen_xmlErrorPtr(n_from, 0);
28959        to = gen_xmlErrorPtr(n_to, 1);
28960
28961        ret_val = xmlCopyError(from, to);
28962        desret_int(ret_val);
28963        call_tests++;
28964        des_xmlErrorPtr(n_from, from, 0);
28965        des_xmlErrorPtr(n_to, to, 1);
28966        xmlResetLastError();
28967        if (mem_base != xmlMemBlocks()) {
28968            printf("Leak of %d blocks found in xmlCopyError",
28969	           xmlMemBlocks() - mem_base);
28970	    test_ret++;
28971            printf(" %d", n_from);
28972            printf(" %d", n_to);
28973            printf("\n");
28974        }
28975    }
28976    }
28977    function_tests++;
28978
28979    return(test_ret);
28980}
28981
28982
28983static int
28984test_xmlCtxtGetLastError(void) {
28985    int test_ret = 0;
28986
28987
28988    /* missing type support */
28989    return(test_ret);
28990}
28991
28992
28993static int
28994test_xmlCtxtResetLastError(void) {
28995    int test_ret = 0;
28996
28997    int mem_base;
28998    void * ctx; /* an XML parser context */
28999    int n_ctx;
29000
29001    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29002        mem_base = xmlMemBlocks();
29003        ctx = gen_void_ptr(n_ctx, 0);
29004
29005        xmlCtxtResetLastError(ctx);
29006        call_tests++;
29007        des_void_ptr(n_ctx, ctx, 0);
29008        xmlResetLastError();
29009        if (mem_base != xmlMemBlocks()) {
29010            printf("Leak of %d blocks found in xmlCtxtResetLastError",
29011	           xmlMemBlocks() - mem_base);
29012	    test_ret++;
29013            printf(" %d", n_ctx);
29014            printf("\n");
29015        }
29016    }
29017    function_tests++;
29018
29019    return(test_ret);
29020}
29021
29022
29023static int
29024test_xmlGetLastError(void) {
29025    int test_ret = 0;
29026
29027
29028    /* missing type support */
29029    return(test_ret);
29030}
29031
29032
29033static int
29034test_xmlParserError(void) {
29035    int test_ret = 0;
29036
29037
29038    /* missing type support */
29039    return(test_ret);
29040}
29041
29042
29043static int
29044test_xmlParserPrintFileContext(void) {
29045    int test_ret = 0;
29046
29047    int mem_base;
29048    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29049    int n_input;
29050
29051    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29052        mem_base = xmlMemBlocks();
29053        input = gen_xmlParserInputPtr(n_input, 0);
29054
29055        xmlParserPrintFileContext(input);
29056        call_tests++;
29057        des_xmlParserInputPtr(n_input, input, 0);
29058        xmlResetLastError();
29059        if (mem_base != xmlMemBlocks()) {
29060            printf("Leak of %d blocks found in xmlParserPrintFileContext",
29061	           xmlMemBlocks() - mem_base);
29062	    test_ret++;
29063            printf(" %d", n_input);
29064            printf("\n");
29065        }
29066    }
29067    function_tests++;
29068
29069    return(test_ret);
29070}
29071
29072
29073static int
29074test_xmlParserPrintFileInfo(void) {
29075    int test_ret = 0;
29076
29077    int mem_base;
29078    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29079    int n_input;
29080
29081    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29082        mem_base = xmlMemBlocks();
29083        input = gen_xmlParserInputPtr(n_input, 0);
29084
29085        xmlParserPrintFileInfo(input);
29086        call_tests++;
29087        des_xmlParserInputPtr(n_input, input, 0);
29088        xmlResetLastError();
29089        if (mem_base != xmlMemBlocks()) {
29090            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29091	           xmlMemBlocks() - mem_base);
29092	    test_ret++;
29093            printf(" %d", n_input);
29094            printf("\n");
29095        }
29096    }
29097    function_tests++;
29098
29099    return(test_ret);
29100}
29101
29102
29103static int
29104test_xmlParserValidityError(void) {
29105    int test_ret = 0;
29106
29107
29108    /* missing type support */
29109    return(test_ret);
29110}
29111
29112
29113static int
29114test_xmlParserValidityWarning(void) {
29115    int test_ret = 0;
29116
29117
29118    /* missing type support */
29119    return(test_ret);
29120}
29121
29122
29123static int
29124test_xmlParserWarning(void) {
29125    int test_ret = 0;
29126
29127
29128    /* missing type support */
29129    return(test_ret);
29130}
29131
29132
29133static int
29134test_xmlResetError(void) {
29135    int test_ret = 0;
29136
29137    int mem_base;
29138    xmlErrorPtr err; /* pointer to the error. */
29139    int n_err;
29140
29141    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29142        mem_base = xmlMemBlocks();
29143        err = gen_xmlErrorPtr(n_err, 0);
29144
29145        xmlResetError(err);
29146        call_tests++;
29147        des_xmlErrorPtr(n_err, err, 0);
29148        xmlResetLastError();
29149        if (mem_base != xmlMemBlocks()) {
29150            printf("Leak of %d blocks found in xmlResetError",
29151	           xmlMemBlocks() - mem_base);
29152	    test_ret++;
29153            printf(" %d", n_err);
29154            printf("\n");
29155        }
29156    }
29157    function_tests++;
29158
29159    return(test_ret);
29160}
29161
29162
29163static int
29164test_xmlResetLastError(void) {
29165    int test_ret = 0;
29166
29167
29168
29169        xmlResetLastError();
29170        call_tests++;
29171        xmlResetLastError();
29172    function_tests++;
29173
29174    return(test_ret);
29175}
29176
29177
29178static int
29179test_xmlSetGenericErrorFunc(void) {
29180    int test_ret = 0;
29181
29182
29183    /* missing type support */
29184    return(test_ret);
29185}
29186
29187
29188static int
29189test_xmlSetStructuredErrorFunc(void) {
29190    int test_ret = 0;
29191
29192
29193    /* missing type support */
29194    return(test_ret);
29195}
29196
29197static int
29198test_xmlerror(void) {
29199    int test_ret = 0;
29200
29201    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29202    test_ret += test_initGenericErrorDefaultFunc();
29203    test_ret += test_xmlCopyError();
29204    test_ret += test_xmlCtxtGetLastError();
29205    test_ret += test_xmlCtxtResetLastError();
29206    test_ret += test_xmlGetLastError();
29207    test_ret += test_xmlParserError();
29208    test_ret += test_xmlParserPrintFileContext();
29209    test_ret += test_xmlParserPrintFileInfo();
29210    test_ret += test_xmlParserValidityError();
29211    test_ret += test_xmlParserValidityWarning();
29212    test_ret += test_xmlParserWarning();
29213    test_ret += test_xmlResetError();
29214    test_ret += test_xmlResetLastError();
29215    test_ret += test_xmlSetGenericErrorFunc();
29216    test_ret += test_xmlSetStructuredErrorFunc();
29217
29218    if (test_ret != 0)
29219	printf("Module xmlerror: %d errors\n", test_ret);
29220    return(test_ret);
29221}
29222#ifdef LIBXML_MODULES_ENABLED
29223
29224#define gen_nb_xmlModulePtr 1
29225static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29226    return(NULL);
29227}
29228static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29229}
29230#endif
29231
29232
29233static int
29234test_xmlModuleClose(void) {
29235    int test_ret = 0;
29236
29237#if defined(LIBXML_MODULES_ENABLED)
29238    int mem_base;
29239    int ret_val;
29240    xmlModulePtr module; /* the module handle */
29241    int n_module;
29242
29243    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29244        mem_base = xmlMemBlocks();
29245        module = gen_xmlModulePtr(n_module, 0);
29246
29247        ret_val = xmlModuleClose(module);
29248        desret_int(ret_val);
29249        call_tests++;
29250        des_xmlModulePtr(n_module, module, 0);
29251        xmlResetLastError();
29252        if (mem_base != xmlMemBlocks()) {
29253            printf("Leak of %d blocks found in xmlModuleClose",
29254	           xmlMemBlocks() - mem_base);
29255	    test_ret++;
29256            printf(" %d", n_module);
29257            printf("\n");
29258        }
29259    }
29260    function_tests++;
29261#endif
29262
29263    return(test_ret);
29264}
29265
29266
29267static int
29268test_xmlModuleOpen(void) {
29269    int test_ret = 0;
29270
29271
29272    /* missing type support */
29273    return(test_ret);
29274}
29275
29276
29277static int
29278test_xmlModuleSymbol(void) {
29279    int test_ret = 0;
29280
29281#if defined(LIBXML_MODULES_ENABLED)
29282    int mem_base;
29283    int ret_val;
29284    xmlModulePtr module; /* the module */
29285    int n_module;
29286    char * name; /* the name of the symbol */
29287    int n_name;
29288    void ** symbol; /* the resulting symbol address */
29289    int n_symbol;
29290
29291    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29292    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29293    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29294        mem_base = xmlMemBlocks();
29295        module = gen_xmlModulePtr(n_module, 0);
29296        name = gen_const_char_ptr(n_name, 1);
29297        symbol = gen_void_ptr_ptr(n_symbol, 2);
29298
29299        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29300        desret_int(ret_val);
29301        call_tests++;
29302        des_xmlModulePtr(n_module, module, 0);
29303        des_const_char_ptr(n_name, (const char *)name, 1);
29304        des_void_ptr_ptr(n_symbol, symbol, 2);
29305        xmlResetLastError();
29306        if (mem_base != xmlMemBlocks()) {
29307            printf("Leak of %d blocks found in xmlModuleSymbol",
29308	           xmlMemBlocks() - mem_base);
29309	    test_ret++;
29310            printf(" %d", n_module);
29311            printf(" %d", n_name);
29312            printf(" %d", n_symbol);
29313            printf("\n");
29314        }
29315    }
29316    }
29317    }
29318    function_tests++;
29319#endif
29320
29321    return(test_ret);
29322}
29323
29324static int
29325test_xmlmodule(void) {
29326    int test_ret = 0;
29327
29328    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29329    test_ret += test_xmlModuleClose();
29330    test_ret += test_xmlModuleOpen();
29331    test_ret += test_xmlModuleSymbol();
29332
29333    if (test_ret != 0)
29334	printf("Module xmlmodule: %d errors\n", test_ret);
29335    return(test_ret);
29336}
29337
29338static int
29339test_xmlNewTextReader(void) {
29340    int test_ret = 0;
29341
29342#if defined(LIBXML_READER_ENABLED)
29343    int mem_base;
29344    xmlTextReaderPtr ret_val;
29345    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29346    int n_input;
29347    const char * URI; /* the URI information for the source if available */
29348    int n_URI;
29349
29350    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29351    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29352        mem_base = xmlMemBlocks();
29353        input = gen_xmlParserInputBufferPtr(n_input, 0);
29354        URI = gen_filepath(n_URI, 1);
29355
29356        ret_val = xmlNewTextReader(input, URI);
29357        desret_xmlTextReaderPtr(ret_val);
29358        call_tests++;
29359        des_xmlParserInputBufferPtr(n_input, input, 0);
29360        des_filepath(n_URI, URI, 1);
29361        xmlResetLastError();
29362        if (mem_base != xmlMemBlocks()) {
29363            printf("Leak of %d blocks found in xmlNewTextReader",
29364	           xmlMemBlocks() - mem_base);
29365	    test_ret++;
29366            printf(" %d", n_input);
29367            printf(" %d", n_URI);
29368            printf("\n");
29369        }
29370    }
29371    }
29372    function_tests++;
29373#endif
29374
29375    return(test_ret);
29376}
29377
29378
29379static int
29380test_xmlNewTextReaderFilename(void) {
29381    int test_ret = 0;
29382
29383#if defined(LIBXML_READER_ENABLED)
29384    int mem_base;
29385    xmlTextReaderPtr ret_val;
29386    const char * URI; /* the URI of the resource to process */
29387    int n_URI;
29388
29389    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29390        mem_base = xmlMemBlocks();
29391        URI = gen_filepath(n_URI, 0);
29392
29393        ret_val = xmlNewTextReaderFilename(URI);
29394        desret_xmlTextReaderPtr(ret_val);
29395        call_tests++;
29396        des_filepath(n_URI, URI, 0);
29397        xmlResetLastError();
29398        if (mem_base != xmlMemBlocks()) {
29399            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29400	           xmlMemBlocks() - mem_base);
29401	    test_ret++;
29402            printf(" %d", n_URI);
29403            printf("\n");
29404        }
29405    }
29406    function_tests++;
29407#endif
29408
29409    return(test_ret);
29410}
29411
29412
29413static int
29414test_xmlReaderForDoc(void) {
29415    int test_ret = 0;
29416
29417#if defined(LIBXML_READER_ENABLED)
29418    int mem_base;
29419    xmlTextReaderPtr ret_val;
29420    xmlChar * cur; /* a pointer to a zero terminated string */
29421    int n_cur;
29422    const char * URL; /* the base URL to use for the document */
29423    int n_URL;
29424    char * encoding; /* the document encoding, or NULL */
29425    int n_encoding;
29426    int options; /* a combination of xmlParserOption */
29427    int n_options;
29428
29429    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29430    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29431    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29432    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29433        mem_base = xmlMemBlocks();
29434        cur = gen_const_xmlChar_ptr(n_cur, 0);
29435        URL = gen_filepath(n_URL, 1);
29436        encoding = gen_const_char_ptr(n_encoding, 2);
29437        options = gen_parseroptions(n_options, 3);
29438
29439        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29440        desret_xmlTextReaderPtr(ret_val);
29441        call_tests++;
29442        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29443        des_filepath(n_URL, URL, 1);
29444        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29445        des_parseroptions(n_options, options, 3);
29446        xmlResetLastError();
29447        if (mem_base != xmlMemBlocks()) {
29448            printf("Leak of %d blocks found in xmlReaderForDoc",
29449	           xmlMemBlocks() - mem_base);
29450	    test_ret++;
29451            printf(" %d", n_cur);
29452            printf(" %d", n_URL);
29453            printf(" %d", n_encoding);
29454            printf(" %d", n_options);
29455            printf("\n");
29456        }
29457    }
29458    }
29459    }
29460    }
29461    function_tests++;
29462#endif
29463
29464    return(test_ret);
29465}
29466
29467
29468static int
29469test_xmlReaderForFile(void) {
29470    int test_ret = 0;
29471
29472#if defined(LIBXML_READER_ENABLED)
29473    int mem_base;
29474    xmlTextReaderPtr ret_val;
29475    const char * filename; /* a file or URL */
29476    int n_filename;
29477    char * encoding; /* the document encoding, or NULL */
29478    int n_encoding;
29479    int options; /* a combination of xmlParserOption */
29480    int n_options;
29481
29482    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29483    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29484    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29485        mem_base = xmlMemBlocks();
29486        filename = gen_filepath(n_filename, 0);
29487        encoding = gen_const_char_ptr(n_encoding, 1);
29488        options = gen_parseroptions(n_options, 2);
29489
29490        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29491        desret_xmlTextReaderPtr(ret_val);
29492        call_tests++;
29493        des_filepath(n_filename, filename, 0);
29494        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29495        des_parseroptions(n_options, options, 2);
29496        xmlResetLastError();
29497        if (mem_base != xmlMemBlocks()) {
29498            printf("Leak of %d blocks found in xmlReaderForFile",
29499	           xmlMemBlocks() - mem_base);
29500	    test_ret++;
29501            printf(" %d", n_filename);
29502            printf(" %d", n_encoding);
29503            printf(" %d", n_options);
29504            printf("\n");
29505        }
29506    }
29507    }
29508    }
29509    function_tests++;
29510#endif
29511
29512    return(test_ret);
29513}
29514
29515
29516static int
29517test_xmlReaderForMemory(void) {
29518    int test_ret = 0;
29519
29520#if defined(LIBXML_READER_ENABLED)
29521    int mem_base;
29522    xmlTextReaderPtr ret_val;
29523    char * buffer; /* a pointer to a char array */
29524    int n_buffer;
29525    int size; /* the size of the array */
29526    int n_size;
29527    const char * URL; /* the base URL to use for the document */
29528    int n_URL;
29529    char * encoding; /* the document encoding, or NULL */
29530    int n_encoding;
29531    int options; /* a combination of xmlParserOption */
29532    int n_options;
29533
29534    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29535    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29536    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29537    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29538    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29539        mem_base = xmlMemBlocks();
29540        buffer = gen_const_char_ptr(n_buffer, 0);
29541        size = gen_int(n_size, 1);
29542        URL = gen_filepath(n_URL, 2);
29543        encoding = gen_const_char_ptr(n_encoding, 3);
29544        options = gen_parseroptions(n_options, 4);
29545
29546        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29547        desret_xmlTextReaderPtr(ret_val);
29548        call_tests++;
29549        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29550        des_int(n_size, size, 1);
29551        des_filepath(n_URL, URL, 2);
29552        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29553        des_parseroptions(n_options, options, 4);
29554        xmlResetLastError();
29555        if (mem_base != xmlMemBlocks()) {
29556            printf("Leak of %d blocks found in xmlReaderForMemory",
29557	           xmlMemBlocks() - mem_base);
29558	    test_ret++;
29559            printf(" %d", n_buffer);
29560            printf(" %d", n_size);
29561            printf(" %d", n_URL);
29562            printf(" %d", n_encoding);
29563            printf(" %d", n_options);
29564            printf("\n");
29565        }
29566    }
29567    }
29568    }
29569    }
29570    }
29571    function_tests++;
29572#endif
29573
29574    return(test_ret);
29575}
29576
29577
29578static int
29579test_xmlReaderNewDoc(void) {
29580    int test_ret = 0;
29581
29582#if defined(LIBXML_READER_ENABLED)
29583    int mem_base;
29584    int ret_val;
29585    xmlTextReaderPtr reader; /* an XML reader */
29586    int n_reader;
29587    xmlChar * cur; /* a pointer to a zero terminated string */
29588    int n_cur;
29589    const char * URL; /* the base URL to use for the document */
29590    int n_URL;
29591    char * encoding; /* the document encoding, or NULL */
29592    int n_encoding;
29593    int options; /* a combination of xmlParserOption */
29594    int n_options;
29595
29596    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29597    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29598    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29599    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29600    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29601        mem_base = xmlMemBlocks();
29602        reader = gen_xmlTextReaderPtr(n_reader, 0);
29603        cur = gen_const_xmlChar_ptr(n_cur, 1);
29604        URL = gen_filepath(n_URL, 2);
29605        encoding = gen_const_char_ptr(n_encoding, 3);
29606        options = gen_parseroptions(n_options, 4);
29607
29608        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29609        desret_int(ret_val);
29610        call_tests++;
29611        des_xmlTextReaderPtr(n_reader, reader, 0);
29612        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29613        des_filepath(n_URL, URL, 2);
29614        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29615        des_parseroptions(n_options, options, 4);
29616        xmlResetLastError();
29617        if (mem_base != xmlMemBlocks()) {
29618            printf("Leak of %d blocks found in xmlReaderNewDoc",
29619	           xmlMemBlocks() - mem_base);
29620	    test_ret++;
29621            printf(" %d", n_reader);
29622            printf(" %d", n_cur);
29623            printf(" %d", n_URL);
29624            printf(" %d", n_encoding);
29625            printf(" %d", n_options);
29626            printf("\n");
29627        }
29628    }
29629    }
29630    }
29631    }
29632    }
29633    function_tests++;
29634#endif
29635
29636    return(test_ret);
29637}
29638
29639
29640static int
29641test_xmlReaderNewFile(void) {
29642    int test_ret = 0;
29643
29644#if defined(LIBXML_READER_ENABLED)
29645    int mem_base;
29646    int ret_val;
29647    xmlTextReaderPtr reader; /* an XML reader */
29648    int n_reader;
29649    const char * filename; /* a file or URL */
29650    int n_filename;
29651    char * encoding; /* the document encoding, or NULL */
29652    int n_encoding;
29653    int options; /* a combination of xmlParserOption */
29654    int n_options;
29655
29656    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29657    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29658    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29659    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29660        mem_base = xmlMemBlocks();
29661        reader = gen_xmlTextReaderPtr(n_reader, 0);
29662        filename = gen_filepath(n_filename, 1);
29663        encoding = gen_const_char_ptr(n_encoding, 2);
29664        options = gen_parseroptions(n_options, 3);
29665
29666        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29667        desret_int(ret_val);
29668        call_tests++;
29669        des_xmlTextReaderPtr(n_reader, reader, 0);
29670        des_filepath(n_filename, filename, 1);
29671        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29672        des_parseroptions(n_options, options, 3);
29673        xmlResetLastError();
29674        if (mem_base != xmlMemBlocks()) {
29675            printf("Leak of %d blocks found in xmlReaderNewFile",
29676	           xmlMemBlocks() - mem_base);
29677	    test_ret++;
29678            printf(" %d", n_reader);
29679            printf(" %d", n_filename);
29680            printf(" %d", n_encoding);
29681            printf(" %d", n_options);
29682            printf("\n");
29683        }
29684    }
29685    }
29686    }
29687    }
29688    function_tests++;
29689#endif
29690
29691    return(test_ret);
29692}
29693
29694
29695static int
29696test_xmlReaderNewMemory(void) {
29697    int test_ret = 0;
29698
29699#if defined(LIBXML_READER_ENABLED)
29700    int mem_base;
29701    int ret_val;
29702    xmlTextReaderPtr reader; /* an XML reader */
29703    int n_reader;
29704    char * buffer; /* a pointer to a char array */
29705    int n_buffer;
29706    int size; /* the size of the array */
29707    int n_size;
29708    const char * URL; /* the base URL to use for the document */
29709    int n_URL;
29710    char * encoding; /* the document encoding, or NULL */
29711    int n_encoding;
29712    int options; /* a combination of xmlParserOption */
29713    int n_options;
29714
29715    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29716    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29717    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29718    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29719    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29720    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29721        mem_base = xmlMemBlocks();
29722        reader = gen_xmlTextReaderPtr(n_reader, 0);
29723        buffer = gen_const_char_ptr(n_buffer, 1);
29724        size = gen_int(n_size, 2);
29725        URL = gen_filepath(n_URL, 3);
29726        encoding = gen_const_char_ptr(n_encoding, 4);
29727        options = gen_parseroptions(n_options, 5);
29728
29729        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29730        desret_int(ret_val);
29731        call_tests++;
29732        des_xmlTextReaderPtr(n_reader, reader, 0);
29733        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29734        des_int(n_size, size, 2);
29735        des_filepath(n_URL, URL, 3);
29736        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29737        des_parseroptions(n_options, options, 5);
29738        xmlResetLastError();
29739        if (mem_base != xmlMemBlocks()) {
29740            printf("Leak of %d blocks found in xmlReaderNewMemory",
29741	           xmlMemBlocks() - mem_base);
29742	    test_ret++;
29743            printf(" %d", n_reader);
29744            printf(" %d", n_buffer);
29745            printf(" %d", n_size);
29746            printf(" %d", n_URL);
29747            printf(" %d", n_encoding);
29748            printf(" %d", n_options);
29749            printf("\n");
29750        }
29751    }
29752    }
29753    }
29754    }
29755    }
29756    }
29757    function_tests++;
29758#endif
29759
29760    return(test_ret);
29761}
29762
29763
29764static int
29765test_xmlReaderNewWalker(void) {
29766    int test_ret = 0;
29767
29768#if defined(LIBXML_READER_ENABLED)
29769    int mem_base;
29770    int ret_val;
29771    xmlTextReaderPtr reader; /* an XML reader */
29772    int n_reader;
29773    xmlDocPtr doc; /* a preparsed document */
29774    int n_doc;
29775
29776    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29777    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29778        mem_base = xmlMemBlocks();
29779        reader = gen_xmlTextReaderPtr(n_reader, 0);
29780        doc = gen_xmlDocPtr(n_doc, 1);
29781
29782        ret_val = xmlReaderNewWalker(reader, doc);
29783        desret_int(ret_val);
29784        call_tests++;
29785        des_xmlTextReaderPtr(n_reader, reader, 0);
29786        des_xmlDocPtr(n_doc, doc, 1);
29787        xmlResetLastError();
29788        if (mem_base != xmlMemBlocks()) {
29789            printf("Leak of %d blocks found in xmlReaderNewWalker",
29790	           xmlMemBlocks() - mem_base);
29791	    test_ret++;
29792            printf(" %d", n_reader);
29793            printf(" %d", n_doc);
29794            printf("\n");
29795        }
29796    }
29797    }
29798    function_tests++;
29799#endif
29800
29801    return(test_ret);
29802}
29803
29804
29805static int
29806test_xmlReaderWalker(void) {
29807    int test_ret = 0;
29808
29809#if defined(LIBXML_READER_ENABLED)
29810    int mem_base;
29811    xmlTextReaderPtr ret_val;
29812    xmlDocPtr doc; /* a preparsed document */
29813    int n_doc;
29814
29815    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29816        mem_base = xmlMemBlocks();
29817        doc = gen_xmlDocPtr(n_doc, 0);
29818
29819        ret_val = xmlReaderWalker(doc);
29820        desret_xmlTextReaderPtr(ret_val);
29821        call_tests++;
29822        des_xmlDocPtr(n_doc, doc, 0);
29823        xmlResetLastError();
29824        if (mem_base != xmlMemBlocks()) {
29825            printf("Leak of %d blocks found in xmlReaderWalker",
29826	           xmlMemBlocks() - mem_base);
29827	    test_ret++;
29828            printf(" %d", n_doc);
29829            printf("\n");
29830        }
29831    }
29832    function_tests++;
29833#endif
29834
29835    return(test_ret);
29836}
29837
29838
29839static int
29840test_xmlTextReaderAttributeCount(void) {
29841    int test_ret = 0;
29842
29843#if defined(LIBXML_READER_ENABLED)
29844    int mem_base;
29845    int ret_val;
29846    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29847    int n_reader;
29848
29849    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29850        mem_base = xmlMemBlocks();
29851        reader = gen_xmlTextReaderPtr(n_reader, 0);
29852
29853        ret_val = xmlTextReaderAttributeCount(reader);
29854        desret_int(ret_val);
29855        call_tests++;
29856        des_xmlTextReaderPtr(n_reader, reader, 0);
29857        xmlResetLastError();
29858        if (mem_base != xmlMemBlocks()) {
29859            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
29860	           xmlMemBlocks() - mem_base);
29861	    test_ret++;
29862            printf(" %d", n_reader);
29863            printf("\n");
29864        }
29865    }
29866    function_tests++;
29867#endif
29868
29869    return(test_ret);
29870}
29871
29872
29873static int
29874test_xmlTextReaderBaseUri(void) {
29875    int test_ret = 0;
29876
29877#if defined(LIBXML_READER_ENABLED)
29878    int mem_base;
29879    xmlChar * ret_val;
29880    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29881    int n_reader;
29882
29883    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29884        mem_base = xmlMemBlocks();
29885        reader = gen_xmlTextReaderPtr(n_reader, 0);
29886
29887        ret_val = xmlTextReaderBaseUri(reader);
29888        desret_xmlChar_ptr(ret_val);
29889        call_tests++;
29890        des_xmlTextReaderPtr(n_reader, reader, 0);
29891        xmlResetLastError();
29892        if (mem_base != xmlMemBlocks()) {
29893            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
29894	           xmlMemBlocks() - mem_base);
29895	    test_ret++;
29896            printf(" %d", n_reader);
29897            printf("\n");
29898        }
29899    }
29900    function_tests++;
29901#endif
29902
29903    return(test_ret);
29904}
29905
29906
29907static int
29908test_xmlTextReaderByteConsumed(void) {
29909    int test_ret = 0;
29910
29911#if defined(LIBXML_READER_ENABLED)
29912    int mem_base;
29913    long ret_val;
29914    xmlTextReaderPtr reader; /* an XML reader */
29915    int n_reader;
29916
29917    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29918        mem_base = xmlMemBlocks();
29919        reader = gen_xmlTextReaderPtr(n_reader, 0);
29920
29921        ret_val = xmlTextReaderByteConsumed(reader);
29922        desret_long(ret_val);
29923        call_tests++;
29924        des_xmlTextReaderPtr(n_reader, reader, 0);
29925        xmlResetLastError();
29926        if (mem_base != xmlMemBlocks()) {
29927            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
29928	           xmlMemBlocks() - mem_base);
29929	    test_ret++;
29930            printf(" %d", n_reader);
29931            printf("\n");
29932        }
29933    }
29934    function_tests++;
29935#endif
29936
29937    return(test_ret);
29938}
29939
29940
29941static int
29942test_xmlTextReaderClose(void) {
29943    int test_ret = 0;
29944
29945#if defined(LIBXML_READER_ENABLED)
29946    int mem_base;
29947    int ret_val;
29948    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29949    int n_reader;
29950
29951    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29952        mem_base = xmlMemBlocks();
29953        reader = gen_xmlTextReaderPtr(n_reader, 0);
29954
29955        ret_val = xmlTextReaderClose(reader);
29956        desret_int(ret_val);
29957        call_tests++;
29958        des_xmlTextReaderPtr(n_reader, reader, 0);
29959        xmlResetLastError();
29960        if (mem_base != xmlMemBlocks()) {
29961            printf("Leak of %d blocks found in xmlTextReaderClose",
29962	           xmlMemBlocks() - mem_base);
29963	    test_ret++;
29964            printf(" %d", n_reader);
29965            printf("\n");
29966        }
29967    }
29968    function_tests++;
29969#endif
29970
29971    return(test_ret);
29972}
29973
29974
29975static int
29976test_xmlTextReaderConstBaseUri(void) {
29977    int test_ret = 0;
29978
29979#if defined(LIBXML_READER_ENABLED)
29980    int mem_base;
29981    const xmlChar * ret_val;
29982    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29983    int n_reader;
29984
29985    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29986        mem_base = xmlMemBlocks();
29987        reader = gen_xmlTextReaderPtr(n_reader, 0);
29988
29989        ret_val = xmlTextReaderConstBaseUri(reader);
29990        desret_const_xmlChar_ptr(ret_val);
29991        call_tests++;
29992        des_xmlTextReaderPtr(n_reader, reader, 0);
29993        xmlResetLastError();
29994        if (mem_base != xmlMemBlocks()) {
29995            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
29996	           xmlMemBlocks() - mem_base);
29997	    test_ret++;
29998            printf(" %d", n_reader);
29999            printf("\n");
30000        }
30001    }
30002    function_tests++;
30003#endif
30004
30005    return(test_ret);
30006}
30007
30008
30009static int
30010test_xmlTextReaderConstEncoding(void) {
30011    int test_ret = 0;
30012
30013#if defined(LIBXML_READER_ENABLED)
30014    int mem_base;
30015    const xmlChar * ret_val;
30016    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30017    int n_reader;
30018
30019    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30020        mem_base = xmlMemBlocks();
30021        reader = gen_xmlTextReaderPtr(n_reader, 0);
30022
30023        ret_val = xmlTextReaderConstEncoding(reader);
30024        desret_const_xmlChar_ptr(ret_val);
30025        call_tests++;
30026        des_xmlTextReaderPtr(n_reader, reader, 0);
30027        xmlResetLastError();
30028        if (mem_base != xmlMemBlocks()) {
30029            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30030	           xmlMemBlocks() - mem_base);
30031	    test_ret++;
30032            printf(" %d", n_reader);
30033            printf("\n");
30034        }
30035    }
30036    function_tests++;
30037#endif
30038
30039    return(test_ret);
30040}
30041
30042
30043static int
30044test_xmlTextReaderConstLocalName(void) {
30045    int test_ret = 0;
30046
30047#if defined(LIBXML_READER_ENABLED)
30048    int mem_base;
30049    const xmlChar * ret_val;
30050    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30051    int n_reader;
30052
30053    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30054        mem_base = xmlMemBlocks();
30055        reader = gen_xmlTextReaderPtr(n_reader, 0);
30056
30057        ret_val = xmlTextReaderConstLocalName(reader);
30058        desret_const_xmlChar_ptr(ret_val);
30059        call_tests++;
30060        des_xmlTextReaderPtr(n_reader, reader, 0);
30061        xmlResetLastError();
30062        if (mem_base != xmlMemBlocks()) {
30063            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30064	           xmlMemBlocks() - mem_base);
30065	    test_ret++;
30066            printf(" %d", n_reader);
30067            printf("\n");
30068        }
30069    }
30070    function_tests++;
30071#endif
30072
30073    return(test_ret);
30074}
30075
30076
30077static int
30078test_xmlTextReaderConstName(void) {
30079    int test_ret = 0;
30080
30081#if defined(LIBXML_READER_ENABLED)
30082    int mem_base;
30083    const xmlChar * ret_val;
30084    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30085    int n_reader;
30086
30087    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30088        mem_base = xmlMemBlocks();
30089        reader = gen_xmlTextReaderPtr(n_reader, 0);
30090
30091        ret_val = xmlTextReaderConstName(reader);
30092        desret_const_xmlChar_ptr(ret_val);
30093        call_tests++;
30094        des_xmlTextReaderPtr(n_reader, reader, 0);
30095        xmlResetLastError();
30096        if (mem_base != xmlMemBlocks()) {
30097            printf("Leak of %d blocks found in xmlTextReaderConstName",
30098	           xmlMemBlocks() - mem_base);
30099	    test_ret++;
30100            printf(" %d", n_reader);
30101            printf("\n");
30102        }
30103    }
30104    function_tests++;
30105#endif
30106
30107    return(test_ret);
30108}
30109
30110
30111static int
30112test_xmlTextReaderConstNamespaceUri(void) {
30113    int test_ret = 0;
30114
30115#if defined(LIBXML_READER_ENABLED)
30116    int mem_base;
30117    const xmlChar * ret_val;
30118    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30119    int n_reader;
30120
30121    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30122        mem_base = xmlMemBlocks();
30123        reader = gen_xmlTextReaderPtr(n_reader, 0);
30124
30125        ret_val = xmlTextReaderConstNamespaceUri(reader);
30126        desret_const_xmlChar_ptr(ret_val);
30127        call_tests++;
30128        des_xmlTextReaderPtr(n_reader, reader, 0);
30129        xmlResetLastError();
30130        if (mem_base != xmlMemBlocks()) {
30131            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30132	           xmlMemBlocks() - mem_base);
30133	    test_ret++;
30134            printf(" %d", n_reader);
30135            printf("\n");
30136        }
30137    }
30138    function_tests++;
30139#endif
30140
30141    return(test_ret);
30142}
30143
30144
30145static int
30146test_xmlTextReaderConstPrefix(void) {
30147    int test_ret = 0;
30148
30149#if defined(LIBXML_READER_ENABLED)
30150    int mem_base;
30151    const xmlChar * ret_val;
30152    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30153    int n_reader;
30154
30155    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30156        mem_base = xmlMemBlocks();
30157        reader = gen_xmlTextReaderPtr(n_reader, 0);
30158
30159        ret_val = xmlTextReaderConstPrefix(reader);
30160        desret_const_xmlChar_ptr(ret_val);
30161        call_tests++;
30162        des_xmlTextReaderPtr(n_reader, reader, 0);
30163        xmlResetLastError();
30164        if (mem_base != xmlMemBlocks()) {
30165            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30166	           xmlMemBlocks() - mem_base);
30167	    test_ret++;
30168            printf(" %d", n_reader);
30169            printf("\n");
30170        }
30171    }
30172    function_tests++;
30173#endif
30174
30175    return(test_ret);
30176}
30177
30178
30179static int
30180test_xmlTextReaderConstString(void) {
30181    int test_ret = 0;
30182
30183#if defined(LIBXML_READER_ENABLED)
30184    int mem_base;
30185    const xmlChar * ret_val;
30186    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30187    int n_reader;
30188    xmlChar * str; /* the string to intern. */
30189    int n_str;
30190
30191    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30192    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30193        mem_base = xmlMemBlocks();
30194        reader = gen_xmlTextReaderPtr(n_reader, 0);
30195        str = gen_const_xmlChar_ptr(n_str, 1);
30196
30197        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30198        desret_const_xmlChar_ptr(ret_val);
30199        call_tests++;
30200        des_xmlTextReaderPtr(n_reader, reader, 0);
30201        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30202        xmlResetLastError();
30203        if (mem_base != xmlMemBlocks()) {
30204            printf("Leak of %d blocks found in xmlTextReaderConstString",
30205	           xmlMemBlocks() - mem_base);
30206	    test_ret++;
30207            printf(" %d", n_reader);
30208            printf(" %d", n_str);
30209            printf("\n");
30210        }
30211    }
30212    }
30213    function_tests++;
30214#endif
30215
30216    return(test_ret);
30217}
30218
30219
30220static int
30221test_xmlTextReaderConstValue(void) {
30222    int test_ret = 0;
30223
30224#if defined(LIBXML_READER_ENABLED)
30225    int mem_base;
30226    const xmlChar * ret_val;
30227    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30228    int n_reader;
30229
30230    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30231        mem_base = xmlMemBlocks();
30232        reader = gen_xmlTextReaderPtr(n_reader, 0);
30233
30234        ret_val = xmlTextReaderConstValue(reader);
30235        desret_const_xmlChar_ptr(ret_val);
30236        call_tests++;
30237        des_xmlTextReaderPtr(n_reader, reader, 0);
30238        xmlResetLastError();
30239        if (mem_base != xmlMemBlocks()) {
30240            printf("Leak of %d blocks found in xmlTextReaderConstValue",
30241	           xmlMemBlocks() - mem_base);
30242	    test_ret++;
30243            printf(" %d", n_reader);
30244            printf("\n");
30245        }
30246    }
30247    function_tests++;
30248#endif
30249
30250    return(test_ret);
30251}
30252
30253
30254static int
30255test_xmlTextReaderConstXmlLang(void) {
30256    int test_ret = 0;
30257
30258#if defined(LIBXML_READER_ENABLED)
30259    int mem_base;
30260    const xmlChar * ret_val;
30261    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30262    int n_reader;
30263
30264    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30265        mem_base = xmlMemBlocks();
30266        reader = gen_xmlTextReaderPtr(n_reader, 0);
30267
30268        ret_val = xmlTextReaderConstXmlLang(reader);
30269        desret_const_xmlChar_ptr(ret_val);
30270        call_tests++;
30271        des_xmlTextReaderPtr(n_reader, reader, 0);
30272        xmlResetLastError();
30273        if (mem_base != xmlMemBlocks()) {
30274            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30275	           xmlMemBlocks() - mem_base);
30276	    test_ret++;
30277            printf(" %d", n_reader);
30278            printf("\n");
30279        }
30280    }
30281    function_tests++;
30282#endif
30283
30284    return(test_ret);
30285}
30286
30287
30288static int
30289test_xmlTextReaderConstXmlVersion(void) {
30290    int test_ret = 0;
30291
30292#if defined(LIBXML_READER_ENABLED)
30293    int mem_base;
30294    const xmlChar * ret_val;
30295    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30296    int n_reader;
30297
30298    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30299        mem_base = xmlMemBlocks();
30300        reader = gen_xmlTextReaderPtr(n_reader, 0);
30301
30302        ret_val = xmlTextReaderConstXmlVersion(reader);
30303        desret_const_xmlChar_ptr(ret_val);
30304        call_tests++;
30305        des_xmlTextReaderPtr(n_reader, reader, 0);
30306        xmlResetLastError();
30307        if (mem_base != xmlMemBlocks()) {
30308            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30309	           xmlMemBlocks() - mem_base);
30310	    test_ret++;
30311            printf(" %d", n_reader);
30312            printf("\n");
30313        }
30314    }
30315    function_tests++;
30316#endif
30317
30318    return(test_ret);
30319}
30320
30321
30322static int
30323test_xmlTextReaderCurrentDoc(void) {
30324    int test_ret = 0;
30325
30326#if defined(LIBXML_READER_ENABLED)
30327    int mem_base;
30328    xmlDocPtr ret_val;
30329    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30330    int n_reader;
30331
30332    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30333        mem_base = xmlMemBlocks();
30334        reader = gen_xmlTextReaderPtr(n_reader, 0);
30335
30336        ret_val = xmlTextReaderCurrentDoc(reader);
30337        desret_xmlDocPtr(ret_val);
30338        call_tests++;
30339        des_xmlTextReaderPtr(n_reader, reader, 0);
30340        xmlResetLastError();
30341        if (mem_base != xmlMemBlocks()) {
30342            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30343	           xmlMemBlocks() - mem_base);
30344	    test_ret++;
30345            printf(" %d", n_reader);
30346            printf("\n");
30347        }
30348    }
30349    function_tests++;
30350#endif
30351
30352    return(test_ret);
30353}
30354
30355
30356static int
30357test_xmlTextReaderCurrentNode(void) {
30358    int test_ret = 0;
30359
30360#if defined(LIBXML_READER_ENABLED)
30361    int mem_base;
30362    xmlNodePtr ret_val;
30363    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30364    int n_reader;
30365
30366    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30367        mem_base = xmlMemBlocks();
30368        reader = gen_xmlTextReaderPtr(n_reader, 0);
30369
30370        ret_val = xmlTextReaderCurrentNode(reader);
30371        desret_xmlNodePtr(ret_val);
30372        call_tests++;
30373        des_xmlTextReaderPtr(n_reader, reader, 0);
30374        xmlResetLastError();
30375        if (mem_base != xmlMemBlocks()) {
30376            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30377	           xmlMemBlocks() - mem_base);
30378	    test_ret++;
30379            printf(" %d", n_reader);
30380            printf("\n");
30381        }
30382    }
30383    function_tests++;
30384#endif
30385
30386    return(test_ret);
30387}
30388
30389
30390static int
30391test_xmlTextReaderDepth(void) {
30392    int test_ret = 0;
30393
30394#if defined(LIBXML_READER_ENABLED)
30395    int mem_base;
30396    int ret_val;
30397    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30398    int n_reader;
30399
30400    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30401        mem_base = xmlMemBlocks();
30402        reader = gen_xmlTextReaderPtr(n_reader, 0);
30403
30404        ret_val = xmlTextReaderDepth(reader);
30405        desret_int(ret_val);
30406        call_tests++;
30407        des_xmlTextReaderPtr(n_reader, reader, 0);
30408        xmlResetLastError();
30409        if (mem_base != xmlMemBlocks()) {
30410            printf("Leak of %d blocks found in xmlTextReaderDepth",
30411	           xmlMemBlocks() - mem_base);
30412	    test_ret++;
30413            printf(" %d", n_reader);
30414            printf("\n");
30415        }
30416    }
30417    function_tests++;
30418#endif
30419
30420    return(test_ret);
30421}
30422
30423
30424static int
30425test_xmlTextReaderExpand(void) {
30426    int test_ret = 0;
30427
30428#if defined(LIBXML_READER_ENABLED)
30429    int mem_base;
30430    xmlNodePtr ret_val;
30431    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30432    int n_reader;
30433
30434    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30435        mem_base = xmlMemBlocks();
30436        reader = gen_xmlTextReaderPtr(n_reader, 0);
30437
30438        ret_val = xmlTextReaderExpand(reader);
30439        desret_xmlNodePtr(ret_val);
30440        call_tests++;
30441        des_xmlTextReaderPtr(n_reader, reader, 0);
30442        xmlResetLastError();
30443        if (mem_base != xmlMemBlocks()) {
30444            printf("Leak of %d blocks found in xmlTextReaderExpand",
30445	           xmlMemBlocks() - mem_base);
30446	    test_ret++;
30447            printf(" %d", n_reader);
30448            printf("\n");
30449        }
30450    }
30451    function_tests++;
30452#endif
30453
30454    return(test_ret);
30455}
30456
30457
30458static int
30459test_xmlTextReaderGetAttribute(void) {
30460    int test_ret = 0;
30461
30462#if defined(LIBXML_READER_ENABLED)
30463    int mem_base;
30464    xmlChar * ret_val;
30465    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30466    int n_reader;
30467    xmlChar * name; /* the qualified name of the attribute. */
30468    int n_name;
30469
30470    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30471    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30472        mem_base = xmlMemBlocks();
30473        reader = gen_xmlTextReaderPtr(n_reader, 0);
30474        name = gen_const_xmlChar_ptr(n_name, 1);
30475
30476        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30477        desret_xmlChar_ptr(ret_val);
30478        call_tests++;
30479        des_xmlTextReaderPtr(n_reader, reader, 0);
30480        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30481        xmlResetLastError();
30482        if (mem_base != xmlMemBlocks()) {
30483            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30484	           xmlMemBlocks() - mem_base);
30485	    test_ret++;
30486            printf(" %d", n_reader);
30487            printf(" %d", n_name);
30488            printf("\n");
30489        }
30490    }
30491    }
30492    function_tests++;
30493#endif
30494
30495    return(test_ret);
30496}
30497
30498
30499static int
30500test_xmlTextReaderGetAttributeNo(void) {
30501    int test_ret = 0;
30502
30503#if defined(LIBXML_READER_ENABLED)
30504    int mem_base;
30505    xmlChar * ret_val;
30506    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30507    int n_reader;
30508    int no; /* the zero-based index of the attribute relative to the containing element */
30509    int n_no;
30510
30511    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30512    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30513        mem_base = xmlMemBlocks();
30514        reader = gen_xmlTextReaderPtr(n_reader, 0);
30515        no = gen_int(n_no, 1);
30516
30517        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30518        desret_xmlChar_ptr(ret_val);
30519        call_tests++;
30520        des_xmlTextReaderPtr(n_reader, reader, 0);
30521        des_int(n_no, no, 1);
30522        xmlResetLastError();
30523        if (mem_base != xmlMemBlocks()) {
30524            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30525	           xmlMemBlocks() - mem_base);
30526	    test_ret++;
30527            printf(" %d", n_reader);
30528            printf(" %d", n_no);
30529            printf("\n");
30530        }
30531    }
30532    }
30533    function_tests++;
30534#endif
30535
30536    return(test_ret);
30537}
30538
30539
30540static int
30541test_xmlTextReaderGetAttributeNs(void) {
30542    int test_ret = 0;
30543
30544#if defined(LIBXML_READER_ENABLED)
30545    int mem_base;
30546    xmlChar * ret_val;
30547    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30548    int n_reader;
30549    xmlChar * localName; /* the local name of the attribute. */
30550    int n_localName;
30551    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30552    int n_namespaceURI;
30553
30554    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30555    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30556    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30557        mem_base = xmlMemBlocks();
30558        reader = gen_xmlTextReaderPtr(n_reader, 0);
30559        localName = gen_const_xmlChar_ptr(n_localName, 1);
30560        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30561
30562        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30563        desret_xmlChar_ptr(ret_val);
30564        call_tests++;
30565        des_xmlTextReaderPtr(n_reader, reader, 0);
30566        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30567        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30568        xmlResetLastError();
30569        if (mem_base != xmlMemBlocks()) {
30570            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30571	           xmlMemBlocks() - mem_base);
30572	    test_ret++;
30573            printf(" %d", n_reader);
30574            printf(" %d", n_localName);
30575            printf(" %d", n_namespaceURI);
30576            printf("\n");
30577        }
30578    }
30579    }
30580    }
30581    function_tests++;
30582#endif
30583
30584    return(test_ret);
30585}
30586
30587#ifdef LIBXML_READER_ENABLED
30588
30589#define gen_nb_xmlTextReaderErrorFunc_ptr 1
30590static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30591    return(NULL);
30592}
30593static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30594}
30595#endif
30596
30597
30598static int
30599test_xmlTextReaderGetErrorHandler(void) {
30600    int test_ret = 0;
30601
30602#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
30603    int mem_base;
30604    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30605    int n_reader;
30606    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30607    int n_f;
30608    void ** arg; /* a user argument */
30609    int n_arg;
30610
30611    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30612    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30613    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30614        mem_base = xmlMemBlocks();
30615        reader = gen_xmlTextReaderPtr(n_reader, 0);
30616        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30617        arg = gen_void_ptr_ptr(n_arg, 2);
30618
30619        xmlTextReaderGetErrorHandler(reader, f, arg);
30620        call_tests++;
30621        des_xmlTextReaderPtr(n_reader, reader, 0);
30622        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30623        des_void_ptr_ptr(n_arg, arg, 2);
30624        xmlResetLastError();
30625        if (mem_base != xmlMemBlocks()) {
30626            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30627	           xmlMemBlocks() - mem_base);
30628	    test_ret++;
30629            printf(" %d", n_reader);
30630            printf(" %d", n_f);
30631            printf(" %d", n_arg);
30632            printf("\n");
30633        }
30634    }
30635    }
30636    }
30637    function_tests++;
30638#endif
30639
30640    return(test_ret);
30641}
30642
30643
30644static int
30645test_xmlTextReaderGetParserColumnNumber(void) {
30646    int test_ret = 0;
30647
30648#if defined(LIBXML_READER_ENABLED)
30649    int mem_base;
30650    int ret_val;
30651    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30652    int n_reader;
30653
30654    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30655        mem_base = xmlMemBlocks();
30656        reader = gen_xmlTextReaderPtr(n_reader, 0);
30657
30658        ret_val = xmlTextReaderGetParserColumnNumber(reader);
30659        desret_int(ret_val);
30660        call_tests++;
30661        des_xmlTextReaderPtr(n_reader, reader, 0);
30662        xmlResetLastError();
30663        if (mem_base != xmlMemBlocks()) {
30664            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30665	           xmlMemBlocks() - mem_base);
30666	    test_ret++;
30667            printf(" %d", n_reader);
30668            printf("\n");
30669        }
30670    }
30671    function_tests++;
30672#endif
30673
30674    return(test_ret);
30675}
30676
30677
30678static int
30679test_xmlTextReaderGetParserLineNumber(void) {
30680    int test_ret = 0;
30681
30682#if defined(LIBXML_READER_ENABLED)
30683    int mem_base;
30684    int ret_val;
30685    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30686    int n_reader;
30687
30688    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30689        mem_base = xmlMemBlocks();
30690        reader = gen_xmlTextReaderPtr(n_reader, 0);
30691
30692        ret_val = xmlTextReaderGetParserLineNumber(reader);
30693        desret_int(ret_val);
30694        call_tests++;
30695        des_xmlTextReaderPtr(n_reader, reader, 0);
30696        xmlResetLastError();
30697        if (mem_base != xmlMemBlocks()) {
30698            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30699	           xmlMemBlocks() - mem_base);
30700	    test_ret++;
30701            printf(" %d", n_reader);
30702            printf("\n");
30703        }
30704    }
30705    function_tests++;
30706#endif
30707
30708    return(test_ret);
30709}
30710
30711
30712static int
30713test_xmlTextReaderGetParserProp(void) {
30714    int test_ret = 0;
30715
30716#if defined(LIBXML_READER_ENABLED)
30717    int mem_base;
30718    int ret_val;
30719    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30720    int n_reader;
30721    int prop; /* the xmlParserProperties to get */
30722    int n_prop;
30723
30724    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30725    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30726        mem_base = xmlMemBlocks();
30727        reader = gen_xmlTextReaderPtr(n_reader, 0);
30728        prop = gen_int(n_prop, 1);
30729
30730        ret_val = xmlTextReaderGetParserProp(reader, prop);
30731        desret_int(ret_val);
30732        call_tests++;
30733        des_xmlTextReaderPtr(n_reader, reader, 0);
30734        des_int(n_prop, prop, 1);
30735        xmlResetLastError();
30736        if (mem_base != xmlMemBlocks()) {
30737            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30738	           xmlMemBlocks() - mem_base);
30739	    test_ret++;
30740            printf(" %d", n_reader);
30741            printf(" %d", n_prop);
30742            printf("\n");
30743        }
30744    }
30745    }
30746    function_tests++;
30747#endif
30748
30749    return(test_ret);
30750}
30751
30752
30753static int
30754test_xmlTextReaderGetRemainder(void) {
30755    int test_ret = 0;
30756
30757#if defined(LIBXML_READER_ENABLED)
30758    int mem_base;
30759    xmlParserInputBufferPtr ret_val;
30760    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30761    int n_reader;
30762
30763    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30764        mem_base = xmlMemBlocks();
30765        reader = gen_xmlTextReaderPtr(n_reader, 0);
30766
30767        ret_val = xmlTextReaderGetRemainder(reader);
30768        desret_xmlParserInputBufferPtr(ret_val);
30769        call_tests++;
30770        des_xmlTextReaderPtr(n_reader, reader, 0);
30771        xmlResetLastError();
30772        if (mem_base != xmlMemBlocks()) {
30773            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30774	           xmlMemBlocks() - mem_base);
30775	    test_ret++;
30776            printf(" %d", n_reader);
30777            printf("\n");
30778        }
30779    }
30780    function_tests++;
30781#endif
30782
30783    return(test_ret);
30784}
30785
30786
30787static int
30788test_xmlTextReaderHasAttributes(void) {
30789    int test_ret = 0;
30790
30791#if defined(LIBXML_READER_ENABLED)
30792    int mem_base;
30793    int ret_val;
30794    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30795    int n_reader;
30796
30797    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30798        mem_base = xmlMemBlocks();
30799        reader = gen_xmlTextReaderPtr(n_reader, 0);
30800
30801        ret_val = xmlTextReaderHasAttributes(reader);
30802        desret_int(ret_val);
30803        call_tests++;
30804        des_xmlTextReaderPtr(n_reader, reader, 0);
30805        xmlResetLastError();
30806        if (mem_base != xmlMemBlocks()) {
30807            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
30808	           xmlMemBlocks() - mem_base);
30809	    test_ret++;
30810            printf(" %d", n_reader);
30811            printf("\n");
30812        }
30813    }
30814    function_tests++;
30815#endif
30816
30817    return(test_ret);
30818}
30819
30820
30821static int
30822test_xmlTextReaderHasValue(void) {
30823    int test_ret = 0;
30824
30825#if defined(LIBXML_READER_ENABLED)
30826    int mem_base;
30827    int ret_val;
30828    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30829    int n_reader;
30830
30831    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30832        mem_base = xmlMemBlocks();
30833        reader = gen_xmlTextReaderPtr(n_reader, 0);
30834
30835        ret_val = xmlTextReaderHasValue(reader);
30836        desret_int(ret_val);
30837        call_tests++;
30838        des_xmlTextReaderPtr(n_reader, reader, 0);
30839        xmlResetLastError();
30840        if (mem_base != xmlMemBlocks()) {
30841            printf("Leak of %d blocks found in xmlTextReaderHasValue",
30842	           xmlMemBlocks() - mem_base);
30843	    test_ret++;
30844            printf(" %d", n_reader);
30845            printf("\n");
30846        }
30847    }
30848    function_tests++;
30849#endif
30850
30851    return(test_ret);
30852}
30853
30854
30855static int
30856test_xmlTextReaderIsDefault(void) {
30857    int test_ret = 0;
30858
30859#if defined(LIBXML_READER_ENABLED)
30860    int mem_base;
30861    int ret_val;
30862    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30863    int n_reader;
30864
30865    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30866        mem_base = xmlMemBlocks();
30867        reader = gen_xmlTextReaderPtr(n_reader, 0);
30868
30869        ret_val = xmlTextReaderIsDefault(reader);
30870        desret_int(ret_val);
30871        call_tests++;
30872        des_xmlTextReaderPtr(n_reader, reader, 0);
30873        xmlResetLastError();
30874        if (mem_base != xmlMemBlocks()) {
30875            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
30876	           xmlMemBlocks() - mem_base);
30877	    test_ret++;
30878            printf(" %d", n_reader);
30879            printf("\n");
30880        }
30881    }
30882    function_tests++;
30883#endif
30884
30885    return(test_ret);
30886}
30887
30888
30889static int
30890test_xmlTextReaderIsEmptyElement(void) {
30891    int test_ret = 0;
30892
30893#if defined(LIBXML_READER_ENABLED)
30894    int mem_base;
30895    int ret_val;
30896    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30897    int n_reader;
30898
30899    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30900        mem_base = xmlMemBlocks();
30901        reader = gen_xmlTextReaderPtr(n_reader, 0);
30902
30903        ret_val = xmlTextReaderIsEmptyElement(reader);
30904        desret_int(ret_val);
30905        call_tests++;
30906        des_xmlTextReaderPtr(n_reader, reader, 0);
30907        xmlResetLastError();
30908        if (mem_base != xmlMemBlocks()) {
30909            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
30910	           xmlMemBlocks() - mem_base);
30911	    test_ret++;
30912            printf(" %d", n_reader);
30913            printf("\n");
30914        }
30915    }
30916    function_tests++;
30917#endif
30918
30919    return(test_ret);
30920}
30921
30922
30923static int
30924test_xmlTextReaderIsNamespaceDecl(void) {
30925    int test_ret = 0;
30926
30927#if defined(LIBXML_READER_ENABLED)
30928    int mem_base;
30929    int ret_val;
30930    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30931    int n_reader;
30932
30933    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30934        mem_base = xmlMemBlocks();
30935        reader = gen_xmlTextReaderPtr(n_reader, 0);
30936
30937        ret_val = xmlTextReaderIsNamespaceDecl(reader);
30938        desret_int(ret_val);
30939        call_tests++;
30940        des_xmlTextReaderPtr(n_reader, reader, 0);
30941        xmlResetLastError();
30942        if (mem_base != xmlMemBlocks()) {
30943            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
30944	           xmlMemBlocks() - mem_base);
30945	    test_ret++;
30946            printf(" %d", n_reader);
30947            printf("\n");
30948        }
30949    }
30950    function_tests++;
30951#endif
30952
30953    return(test_ret);
30954}
30955
30956
30957static int
30958test_xmlTextReaderIsValid(void) {
30959    int test_ret = 0;
30960
30961#if defined(LIBXML_READER_ENABLED)
30962    int mem_base;
30963    int ret_val;
30964    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30965    int n_reader;
30966
30967    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30968        mem_base = xmlMemBlocks();
30969        reader = gen_xmlTextReaderPtr(n_reader, 0);
30970
30971        ret_val = xmlTextReaderIsValid(reader);
30972        desret_int(ret_val);
30973        call_tests++;
30974        des_xmlTextReaderPtr(n_reader, reader, 0);
30975        xmlResetLastError();
30976        if (mem_base != xmlMemBlocks()) {
30977            printf("Leak of %d blocks found in xmlTextReaderIsValid",
30978	           xmlMemBlocks() - mem_base);
30979	    test_ret++;
30980            printf(" %d", n_reader);
30981            printf("\n");
30982        }
30983    }
30984    function_tests++;
30985#endif
30986
30987    return(test_ret);
30988}
30989
30990
30991static int
30992test_xmlTextReaderLocalName(void) {
30993    int test_ret = 0;
30994
30995#if defined(LIBXML_READER_ENABLED)
30996    int mem_base;
30997    xmlChar * ret_val;
30998    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30999    int n_reader;
31000
31001    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31002        mem_base = xmlMemBlocks();
31003        reader = gen_xmlTextReaderPtr(n_reader, 0);
31004
31005        ret_val = xmlTextReaderLocalName(reader);
31006        desret_xmlChar_ptr(ret_val);
31007        call_tests++;
31008        des_xmlTextReaderPtr(n_reader, reader, 0);
31009        xmlResetLastError();
31010        if (mem_base != xmlMemBlocks()) {
31011            printf("Leak of %d blocks found in xmlTextReaderLocalName",
31012	           xmlMemBlocks() - mem_base);
31013	    test_ret++;
31014            printf(" %d", n_reader);
31015            printf("\n");
31016        }
31017    }
31018    function_tests++;
31019#endif
31020
31021    return(test_ret);
31022}
31023
31024#ifdef LIBXML_READER_ENABLED
31025
31026#define gen_nb_xmlTextReaderLocatorPtr 1
31027static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31028    return(NULL);
31029}
31030static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31031}
31032#endif
31033
31034
31035static int
31036test_xmlTextReaderLocatorBaseURI(void) {
31037    int test_ret = 0;
31038
31039#if defined(LIBXML_READER_ENABLED)
31040    int mem_base;
31041    xmlChar * ret_val;
31042    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31043    int n_locator;
31044
31045    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31046        mem_base = xmlMemBlocks();
31047        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31048
31049        ret_val = xmlTextReaderLocatorBaseURI(locator);
31050        desret_xmlChar_ptr(ret_val);
31051        call_tests++;
31052        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31053        xmlResetLastError();
31054        if (mem_base != xmlMemBlocks()) {
31055            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31056	           xmlMemBlocks() - mem_base);
31057	    test_ret++;
31058            printf(" %d", n_locator);
31059            printf("\n");
31060        }
31061    }
31062    function_tests++;
31063#endif
31064
31065    return(test_ret);
31066}
31067
31068
31069static int
31070test_xmlTextReaderLocatorLineNumber(void) {
31071    int test_ret = 0;
31072
31073#if defined(LIBXML_READER_ENABLED)
31074    int mem_base;
31075    int ret_val;
31076    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31077    int n_locator;
31078
31079    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31080        mem_base = xmlMemBlocks();
31081        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31082
31083        ret_val = xmlTextReaderLocatorLineNumber(locator);
31084        desret_int(ret_val);
31085        call_tests++;
31086        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31087        xmlResetLastError();
31088        if (mem_base != xmlMemBlocks()) {
31089            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31090	           xmlMemBlocks() - mem_base);
31091	    test_ret++;
31092            printf(" %d", n_locator);
31093            printf("\n");
31094        }
31095    }
31096    function_tests++;
31097#endif
31098
31099    return(test_ret);
31100}
31101
31102
31103static int
31104test_xmlTextReaderLookupNamespace(void) {
31105    int test_ret = 0;
31106
31107#if defined(LIBXML_READER_ENABLED)
31108    int mem_base;
31109    xmlChar * ret_val;
31110    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31111    int n_reader;
31112    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31113    int n_prefix;
31114
31115    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31116    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31117        mem_base = xmlMemBlocks();
31118        reader = gen_xmlTextReaderPtr(n_reader, 0);
31119        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31120
31121        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31122        desret_xmlChar_ptr(ret_val);
31123        call_tests++;
31124        des_xmlTextReaderPtr(n_reader, reader, 0);
31125        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31126        xmlResetLastError();
31127        if (mem_base != xmlMemBlocks()) {
31128            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31129	           xmlMemBlocks() - mem_base);
31130	    test_ret++;
31131            printf(" %d", n_reader);
31132            printf(" %d", n_prefix);
31133            printf("\n");
31134        }
31135    }
31136    }
31137    function_tests++;
31138#endif
31139
31140    return(test_ret);
31141}
31142
31143
31144static int
31145test_xmlTextReaderMoveToAttribute(void) {
31146    int test_ret = 0;
31147
31148#if defined(LIBXML_READER_ENABLED)
31149    int mem_base;
31150    int ret_val;
31151    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31152    int n_reader;
31153    xmlChar * name; /* the qualified name of the attribute. */
31154    int n_name;
31155
31156    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31157    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31158        mem_base = xmlMemBlocks();
31159        reader = gen_xmlTextReaderPtr(n_reader, 0);
31160        name = gen_const_xmlChar_ptr(n_name, 1);
31161
31162        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31163        desret_int(ret_val);
31164        call_tests++;
31165        des_xmlTextReaderPtr(n_reader, reader, 0);
31166        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31167        xmlResetLastError();
31168        if (mem_base != xmlMemBlocks()) {
31169            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31170	           xmlMemBlocks() - mem_base);
31171	    test_ret++;
31172            printf(" %d", n_reader);
31173            printf(" %d", n_name);
31174            printf("\n");
31175        }
31176    }
31177    }
31178    function_tests++;
31179#endif
31180
31181    return(test_ret);
31182}
31183
31184
31185static int
31186test_xmlTextReaderMoveToAttributeNo(void) {
31187    int test_ret = 0;
31188
31189#if defined(LIBXML_READER_ENABLED)
31190    int mem_base;
31191    int ret_val;
31192    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31193    int n_reader;
31194    int no; /* the zero-based index of the attribute relative to the containing element. */
31195    int n_no;
31196
31197    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31198    for (n_no = 0;n_no < gen_nb_int;n_no++) {
31199        mem_base = xmlMemBlocks();
31200        reader = gen_xmlTextReaderPtr(n_reader, 0);
31201        no = gen_int(n_no, 1);
31202
31203        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31204        desret_int(ret_val);
31205        call_tests++;
31206        des_xmlTextReaderPtr(n_reader, reader, 0);
31207        des_int(n_no, no, 1);
31208        xmlResetLastError();
31209        if (mem_base != xmlMemBlocks()) {
31210            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31211	           xmlMemBlocks() - mem_base);
31212	    test_ret++;
31213            printf(" %d", n_reader);
31214            printf(" %d", n_no);
31215            printf("\n");
31216        }
31217    }
31218    }
31219    function_tests++;
31220#endif
31221
31222    return(test_ret);
31223}
31224
31225
31226static int
31227test_xmlTextReaderMoveToAttributeNs(void) {
31228    int test_ret = 0;
31229
31230#if defined(LIBXML_READER_ENABLED)
31231    int mem_base;
31232    int ret_val;
31233    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31234    int n_reader;
31235    xmlChar * localName; /* the local name of the attribute. */
31236    int n_localName;
31237    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31238    int n_namespaceURI;
31239
31240    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31241    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31242    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31243        mem_base = xmlMemBlocks();
31244        reader = gen_xmlTextReaderPtr(n_reader, 0);
31245        localName = gen_const_xmlChar_ptr(n_localName, 1);
31246        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31247
31248        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31249        desret_int(ret_val);
31250        call_tests++;
31251        des_xmlTextReaderPtr(n_reader, reader, 0);
31252        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31253        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31254        xmlResetLastError();
31255        if (mem_base != xmlMemBlocks()) {
31256            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31257	           xmlMemBlocks() - mem_base);
31258	    test_ret++;
31259            printf(" %d", n_reader);
31260            printf(" %d", n_localName);
31261            printf(" %d", n_namespaceURI);
31262            printf("\n");
31263        }
31264    }
31265    }
31266    }
31267    function_tests++;
31268#endif
31269
31270    return(test_ret);
31271}
31272
31273
31274static int
31275test_xmlTextReaderMoveToElement(void) {
31276    int test_ret = 0;
31277
31278#if defined(LIBXML_READER_ENABLED)
31279    int mem_base;
31280    int ret_val;
31281    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31282    int n_reader;
31283
31284    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31285        mem_base = xmlMemBlocks();
31286        reader = gen_xmlTextReaderPtr(n_reader, 0);
31287
31288        ret_val = xmlTextReaderMoveToElement(reader);
31289        desret_int(ret_val);
31290        call_tests++;
31291        des_xmlTextReaderPtr(n_reader, reader, 0);
31292        xmlResetLastError();
31293        if (mem_base != xmlMemBlocks()) {
31294            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31295	           xmlMemBlocks() - mem_base);
31296	    test_ret++;
31297            printf(" %d", n_reader);
31298            printf("\n");
31299        }
31300    }
31301    function_tests++;
31302#endif
31303
31304    return(test_ret);
31305}
31306
31307
31308static int
31309test_xmlTextReaderMoveToFirstAttribute(void) {
31310    int test_ret = 0;
31311
31312#if defined(LIBXML_READER_ENABLED)
31313    int mem_base;
31314    int ret_val;
31315    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31316    int n_reader;
31317
31318    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31319        mem_base = xmlMemBlocks();
31320        reader = gen_xmlTextReaderPtr(n_reader, 0);
31321
31322        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31323        desret_int(ret_val);
31324        call_tests++;
31325        des_xmlTextReaderPtr(n_reader, reader, 0);
31326        xmlResetLastError();
31327        if (mem_base != xmlMemBlocks()) {
31328            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31329	           xmlMemBlocks() - mem_base);
31330	    test_ret++;
31331            printf(" %d", n_reader);
31332            printf("\n");
31333        }
31334    }
31335    function_tests++;
31336#endif
31337
31338    return(test_ret);
31339}
31340
31341
31342static int
31343test_xmlTextReaderMoveToNextAttribute(void) {
31344    int test_ret = 0;
31345
31346#if defined(LIBXML_READER_ENABLED)
31347    int mem_base;
31348    int ret_val;
31349    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31350    int n_reader;
31351
31352    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31353        mem_base = xmlMemBlocks();
31354        reader = gen_xmlTextReaderPtr(n_reader, 0);
31355
31356        ret_val = xmlTextReaderMoveToNextAttribute(reader);
31357        desret_int(ret_val);
31358        call_tests++;
31359        des_xmlTextReaderPtr(n_reader, reader, 0);
31360        xmlResetLastError();
31361        if (mem_base != xmlMemBlocks()) {
31362            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31363	           xmlMemBlocks() - mem_base);
31364	    test_ret++;
31365            printf(" %d", n_reader);
31366            printf("\n");
31367        }
31368    }
31369    function_tests++;
31370#endif
31371
31372    return(test_ret);
31373}
31374
31375
31376static int
31377test_xmlTextReaderName(void) {
31378    int test_ret = 0;
31379
31380#if defined(LIBXML_READER_ENABLED)
31381    int mem_base;
31382    xmlChar * ret_val;
31383    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31384    int n_reader;
31385
31386    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31387        mem_base = xmlMemBlocks();
31388        reader = gen_xmlTextReaderPtr(n_reader, 0);
31389
31390        ret_val = xmlTextReaderName(reader);
31391        desret_xmlChar_ptr(ret_val);
31392        call_tests++;
31393        des_xmlTextReaderPtr(n_reader, reader, 0);
31394        xmlResetLastError();
31395        if (mem_base != xmlMemBlocks()) {
31396            printf("Leak of %d blocks found in xmlTextReaderName",
31397	           xmlMemBlocks() - mem_base);
31398	    test_ret++;
31399            printf(" %d", n_reader);
31400            printf("\n");
31401        }
31402    }
31403    function_tests++;
31404#endif
31405
31406    return(test_ret);
31407}
31408
31409
31410static int
31411test_xmlTextReaderNamespaceUri(void) {
31412    int test_ret = 0;
31413
31414#if defined(LIBXML_READER_ENABLED)
31415    int mem_base;
31416    xmlChar * ret_val;
31417    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31418    int n_reader;
31419
31420    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31421        mem_base = xmlMemBlocks();
31422        reader = gen_xmlTextReaderPtr(n_reader, 0);
31423
31424        ret_val = xmlTextReaderNamespaceUri(reader);
31425        desret_xmlChar_ptr(ret_val);
31426        call_tests++;
31427        des_xmlTextReaderPtr(n_reader, reader, 0);
31428        xmlResetLastError();
31429        if (mem_base != xmlMemBlocks()) {
31430            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31431	           xmlMemBlocks() - mem_base);
31432	    test_ret++;
31433            printf(" %d", n_reader);
31434            printf("\n");
31435        }
31436    }
31437    function_tests++;
31438#endif
31439
31440    return(test_ret);
31441}
31442
31443
31444static int
31445test_xmlTextReaderNext(void) {
31446    int test_ret = 0;
31447
31448#if defined(LIBXML_READER_ENABLED)
31449    int mem_base;
31450    int ret_val;
31451    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31452    int n_reader;
31453
31454    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31455        mem_base = xmlMemBlocks();
31456        reader = gen_xmlTextReaderPtr(n_reader, 0);
31457
31458        ret_val = xmlTextReaderNext(reader);
31459        desret_int(ret_val);
31460        call_tests++;
31461        des_xmlTextReaderPtr(n_reader, reader, 0);
31462        xmlResetLastError();
31463        if (mem_base != xmlMemBlocks()) {
31464            printf("Leak of %d blocks found in xmlTextReaderNext",
31465	           xmlMemBlocks() - mem_base);
31466	    test_ret++;
31467            printf(" %d", n_reader);
31468            printf("\n");
31469        }
31470    }
31471    function_tests++;
31472#endif
31473
31474    return(test_ret);
31475}
31476
31477
31478static int
31479test_xmlTextReaderNextSibling(void) {
31480    int test_ret = 0;
31481
31482#if defined(LIBXML_READER_ENABLED)
31483    int mem_base;
31484    int ret_val;
31485    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31486    int n_reader;
31487
31488    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31489        mem_base = xmlMemBlocks();
31490        reader = gen_xmlTextReaderPtr(n_reader, 0);
31491
31492        ret_val = xmlTextReaderNextSibling(reader);
31493        desret_int(ret_val);
31494        call_tests++;
31495        des_xmlTextReaderPtr(n_reader, reader, 0);
31496        xmlResetLastError();
31497        if (mem_base != xmlMemBlocks()) {
31498            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31499	           xmlMemBlocks() - mem_base);
31500	    test_ret++;
31501            printf(" %d", n_reader);
31502            printf("\n");
31503        }
31504    }
31505    function_tests++;
31506#endif
31507
31508    return(test_ret);
31509}
31510
31511
31512static int
31513test_xmlTextReaderNodeType(void) {
31514    int test_ret = 0;
31515
31516#if defined(LIBXML_READER_ENABLED)
31517    int mem_base;
31518    int ret_val;
31519    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31520    int n_reader;
31521
31522    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31523        mem_base = xmlMemBlocks();
31524        reader = gen_xmlTextReaderPtr(n_reader, 0);
31525
31526        ret_val = xmlTextReaderNodeType(reader);
31527        desret_int(ret_val);
31528        call_tests++;
31529        des_xmlTextReaderPtr(n_reader, reader, 0);
31530        xmlResetLastError();
31531        if (mem_base != xmlMemBlocks()) {
31532            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31533	           xmlMemBlocks() - mem_base);
31534	    test_ret++;
31535            printf(" %d", n_reader);
31536            printf("\n");
31537        }
31538    }
31539    function_tests++;
31540#endif
31541
31542    return(test_ret);
31543}
31544
31545
31546static int
31547test_xmlTextReaderNormalization(void) {
31548    int test_ret = 0;
31549
31550#if defined(LIBXML_READER_ENABLED)
31551    int mem_base;
31552    int ret_val;
31553    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31554    int n_reader;
31555
31556    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31557        mem_base = xmlMemBlocks();
31558        reader = gen_xmlTextReaderPtr(n_reader, 0);
31559
31560        ret_val = xmlTextReaderNormalization(reader);
31561        desret_int(ret_val);
31562        call_tests++;
31563        des_xmlTextReaderPtr(n_reader, reader, 0);
31564        xmlResetLastError();
31565        if (mem_base != xmlMemBlocks()) {
31566            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31567	           xmlMemBlocks() - mem_base);
31568	    test_ret++;
31569            printf(" %d", n_reader);
31570            printf("\n");
31571        }
31572    }
31573    function_tests++;
31574#endif
31575
31576    return(test_ret);
31577}
31578
31579
31580static int
31581test_xmlTextReaderPrefix(void) {
31582    int test_ret = 0;
31583
31584#if defined(LIBXML_READER_ENABLED)
31585    int mem_base;
31586    xmlChar * ret_val;
31587    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31588    int n_reader;
31589
31590    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31591        mem_base = xmlMemBlocks();
31592        reader = gen_xmlTextReaderPtr(n_reader, 0);
31593
31594        ret_val = xmlTextReaderPrefix(reader);
31595        desret_xmlChar_ptr(ret_val);
31596        call_tests++;
31597        des_xmlTextReaderPtr(n_reader, reader, 0);
31598        xmlResetLastError();
31599        if (mem_base != xmlMemBlocks()) {
31600            printf("Leak of %d blocks found in xmlTextReaderPrefix",
31601	           xmlMemBlocks() - mem_base);
31602	    test_ret++;
31603            printf(" %d", n_reader);
31604            printf("\n");
31605        }
31606    }
31607    function_tests++;
31608#endif
31609
31610    return(test_ret);
31611}
31612
31613
31614static int
31615test_xmlTextReaderPreserve(void) {
31616    int test_ret = 0;
31617
31618#if defined(LIBXML_READER_ENABLED)
31619    int mem_base;
31620    xmlNodePtr ret_val;
31621    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31622    int n_reader;
31623
31624    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31625        mem_base = xmlMemBlocks();
31626        reader = gen_xmlTextReaderPtr(n_reader, 0);
31627
31628        ret_val = xmlTextReaderPreserve(reader);
31629        desret_xmlNodePtr(ret_val);
31630        call_tests++;
31631        des_xmlTextReaderPtr(n_reader, reader, 0);
31632        xmlResetLastError();
31633        if (mem_base != xmlMemBlocks()) {
31634            printf("Leak of %d blocks found in xmlTextReaderPreserve",
31635	           xmlMemBlocks() - mem_base);
31636	    test_ret++;
31637            printf(" %d", n_reader);
31638            printf("\n");
31639        }
31640    }
31641    function_tests++;
31642#endif
31643
31644    return(test_ret);
31645}
31646
31647
31648static int
31649test_xmlTextReaderPreservePattern(void) {
31650    int test_ret = 0;
31651
31652#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31653#ifdef LIBXML_PATTERN_ENABLED
31654    int mem_base;
31655    int ret_val;
31656    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31657    int n_reader;
31658    xmlChar * pattern; /* an XPath subset pattern */
31659    int n_pattern;
31660    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31661    int n_namespaces;
31662
31663    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31664    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31665    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31666        mem_base = xmlMemBlocks();
31667        reader = gen_xmlTextReaderPtr(n_reader, 0);
31668        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31669        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31670
31671        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31672        desret_int(ret_val);
31673        call_tests++;
31674        des_xmlTextReaderPtr(n_reader, reader, 0);
31675        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31676        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31677        xmlResetLastError();
31678        if (mem_base != xmlMemBlocks()) {
31679            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31680	           xmlMemBlocks() - mem_base);
31681	    test_ret++;
31682            printf(" %d", n_reader);
31683            printf(" %d", n_pattern);
31684            printf(" %d", n_namespaces);
31685            printf("\n");
31686        }
31687    }
31688    }
31689    }
31690    function_tests++;
31691#endif
31692#endif
31693
31694    return(test_ret);
31695}
31696
31697
31698static int
31699test_xmlTextReaderQuoteChar(void) {
31700    int test_ret = 0;
31701
31702#if defined(LIBXML_READER_ENABLED)
31703    int mem_base;
31704    int ret_val;
31705    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31706    int n_reader;
31707
31708    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31709        mem_base = xmlMemBlocks();
31710        reader = gen_xmlTextReaderPtr(n_reader, 0);
31711
31712        ret_val = xmlTextReaderQuoteChar(reader);
31713        desret_int(ret_val);
31714        call_tests++;
31715        des_xmlTextReaderPtr(n_reader, reader, 0);
31716        xmlResetLastError();
31717        if (mem_base != xmlMemBlocks()) {
31718            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31719	           xmlMemBlocks() - mem_base);
31720	    test_ret++;
31721            printf(" %d", n_reader);
31722            printf("\n");
31723        }
31724    }
31725    function_tests++;
31726#endif
31727
31728    return(test_ret);
31729}
31730
31731
31732static int
31733test_xmlTextReaderRead(void) {
31734    int test_ret = 0;
31735
31736#if defined(LIBXML_READER_ENABLED)
31737    int mem_base;
31738    int ret_val;
31739    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31740    int n_reader;
31741
31742    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31743        mem_base = xmlMemBlocks();
31744        reader = gen_xmlTextReaderPtr(n_reader, 0);
31745
31746        ret_val = xmlTextReaderRead(reader);
31747        desret_int(ret_val);
31748        call_tests++;
31749        des_xmlTextReaderPtr(n_reader, reader, 0);
31750        xmlResetLastError();
31751        if (mem_base != xmlMemBlocks()) {
31752            printf("Leak of %d blocks found in xmlTextReaderRead",
31753	           xmlMemBlocks() - mem_base);
31754	    test_ret++;
31755            printf(" %d", n_reader);
31756            printf("\n");
31757        }
31758    }
31759    function_tests++;
31760#endif
31761
31762    return(test_ret);
31763}
31764
31765
31766static int
31767test_xmlTextReaderReadAttributeValue(void) {
31768    int test_ret = 0;
31769
31770#if defined(LIBXML_READER_ENABLED)
31771    int mem_base;
31772    int ret_val;
31773    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31774    int n_reader;
31775
31776    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31777        mem_base = xmlMemBlocks();
31778        reader = gen_xmlTextReaderPtr(n_reader, 0);
31779
31780        ret_val = xmlTextReaderReadAttributeValue(reader);
31781        desret_int(ret_val);
31782        call_tests++;
31783        des_xmlTextReaderPtr(n_reader, reader, 0);
31784        xmlResetLastError();
31785        if (mem_base != xmlMemBlocks()) {
31786            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31787	           xmlMemBlocks() - mem_base);
31788	    test_ret++;
31789            printf(" %d", n_reader);
31790            printf("\n");
31791        }
31792    }
31793    function_tests++;
31794#endif
31795
31796    return(test_ret);
31797}
31798
31799
31800static int
31801test_xmlTextReaderReadState(void) {
31802    int test_ret = 0;
31803
31804#if defined(LIBXML_READER_ENABLED)
31805    int mem_base;
31806    int ret_val;
31807    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31808    int n_reader;
31809
31810    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31811        mem_base = xmlMemBlocks();
31812        reader = gen_xmlTextReaderPtr(n_reader, 0);
31813
31814        ret_val = xmlTextReaderReadState(reader);
31815        desret_int(ret_val);
31816        call_tests++;
31817        des_xmlTextReaderPtr(n_reader, reader, 0);
31818        xmlResetLastError();
31819        if (mem_base != xmlMemBlocks()) {
31820            printf("Leak of %d blocks found in xmlTextReaderReadState",
31821	           xmlMemBlocks() - mem_base);
31822	    test_ret++;
31823            printf(" %d", n_reader);
31824            printf("\n");
31825        }
31826    }
31827    function_tests++;
31828#endif
31829
31830    return(test_ret);
31831}
31832
31833
31834static int
31835test_xmlTextReaderRelaxNGSetSchema(void) {
31836    int test_ret = 0;
31837
31838#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31839    int mem_base;
31840    int ret_val;
31841    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31842    int n_reader;
31843    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
31844    int n_schema;
31845
31846    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31847    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
31848        mem_base = xmlMemBlocks();
31849        reader = gen_xmlTextReaderPtr(n_reader, 0);
31850        schema = gen_xmlRelaxNGPtr(n_schema, 1);
31851
31852        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
31853        desret_int(ret_val);
31854        call_tests++;
31855        des_xmlTextReaderPtr(n_reader, reader, 0);
31856        des_xmlRelaxNGPtr(n_schema, schema, 1);
31857        xmlResetLastError();
31858        if (mem_base != xmlMemBlocks()) {
31859            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
31860	           xmlMemBlocks() - mem_base);
31861	    test_ret++;
31862            printf(" %d", n_reader);
31863            printf(" %d", n_schema);
31864            printf("\n");
31865        }
31866    }
31867    }
31868    function_tests++;
31869#endif
31870
31871    return(test_ret);
31872}
31873
31874
31875static int
31876test_xmlTextReaderRelaxNGValidate(void) {
31877    int test_ret = 0;
31878
31879#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31880    int mem_base;
31881    int ret_val;
31882    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31883    int n_reader;
31884    char * rng; /* the path to a RelaxNG schema or NULL */
31885    int n_rng;
31886
31887    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31888    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
31889        mem_base = xmlMemBlocks();
31890        reader = gen_xmlTextReaderPtr(n_reader, 0);
31891        rng = gen_const_char_ptr(n_rng, 1);
31892
31893        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
31894        desret_int(ret_val);
31895        call_tests++;
31896        des_xmlTextReaderPtr(n_reader, reader, 0);
31897        des_const_char_ptr(n_rng, (const char *)rng, 1);
31898        xmlResetLastError();
31899        if (mem_base != xmlMemBlocks()) {
31900            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
31901	           xmlMemBlocks() - mem_base);
31902	    test_ret++;
31903            printf(" %d", n_reader);
31904            printf(" %d", n_rng);
31905            printf("\n");
31906        }
31907    }
31908    }
31909    function_tests++;
31910#endif
31911
31912    return(test_ret);
31913}
31914
31915
31916static int
31917test_xmlTextReaderSchemaValidate(void) {
31918    int test_ret = 0;
31919
31920#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31921    int ret_val;
31922    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31923    int n_reader;
31924    char * xsd; /* the path to a W3C XSD schema or NULL */
31925    int n_xsd;
31926
31927    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31928    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
31929        reader = gen_xmlTextReaderPtr(n_reader, 0);
31930        xsd = gen_const_char_ptr(n_xsd, 1);
31931
31932        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
31933        desret_int(ret_val);
31934        call_tests++;
31935        des_xmlTextReaderPtr(n_reader, reader, 0);
31936        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
31937        xmlResetLastError();
31938    }
31939    }
31940    function_tests++;
31941#endif
31942
31943    return(test_ret);
31944}
31945
31946#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31947
31948#define gen_nb_xmlSchemaValidCtxtPtr 1
31949static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31950    return(NULL);
31951}
31952static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31953}
31954#endif
31955
31956
31957static int
31958test_xmlTextReaderSchemaValidateCtxt(void) {
31959    int test_ret = 0;
31960
31961#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31962    int mem_base;
31963    int ret_val;
31964    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31965    int n_reader;
31966    xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
31967    int n_ctxt;
31968    int options; /* options (not used yet) */
31969    int n_options;
31970
31971    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31972    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31973    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31974        mem_base = xmlMemBlocks();
31975        reader = gen_xmlTextReaderPtr(n_reader, 0);
31976        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
31977        options = gen_parseroptions(n_options, 2);
31978
31979        ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
31980        desret_int(ret_val);
31981        call_tests++;
31982        des_xmlTextReaderPtr(n_reader, reader, 0);
31983        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
31984        des_parseroptions(n_options, options, 2);
31985        xmlResetLastError();
31986        if (mem_base != xmlMemBlocks()) {
31987            printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
31988	           xmlMemBlocks() - mem_base);
31989	    test_ret++;
31990            printf(" %d", n_reader);
31991            printf(" %d", n_ctxt);
31992            printf(" %d", n_options);
31993            printf("\n");
31994        }
31995    }
31996    }
31997    }
31998    function_tests++;
31999#endif
32000
32001    return(test_ret);
32002}
32003
32004
32005static int
32006test_xmlTextReaderSetErrorHandler(void) {
32007    int test_ret = 0;
32008
32009
32010    /* missing type support */
32011    return(test_ret);
32012}
32013
32014
32015static int
32016test_xmlTextReaderSetParserProp(void) {
32017    int test_ret = 0;
32018
32019#if defined(LIBXML_READER_ENABLED)
32020    int mem_base;
32021    int ret_val;
32022    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32023    int n_reader;
32024    int prop; /* the xmlParserProperties to set */
32025    int n_prop;
32026    int value; /* usually 0 or 1 to (de)activate it */
32027    int n_value;
32028
32029    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32030    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32031    for (n_value = 0;n_value < gen_nb_int;n_value++) {
32032        mem_base = xmlMemBlocks();
32033        reader = gen_xmlTextReaderPtr(n_reader, 0);
32034        prop = gen_int(n_prop, 1);
32035        value = gen_int(n_value, 2);
32036
32037        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32038        desret_int(ret_val);
32039        call_tests++;
32040        des_xmlTextReaderPtr(n_reader, reader, 0);
32041        des_int(n_prop, prop, 1);
32042        des_int(n_value, value, 2);
32043        xmlResetLastError();
32044        if (mem_base != xmlMemBlocks()) {
32045            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32046	           xmlMemBlocks() - mem_base);
32047	    test_ret++;
32048            printf(" %d", n_reader);
32049            printf(" %d", n_prop);
32050            printf(" %d", n_value);
32051            printf("\n");
32052        }
32053    }
32054    }
32055    }
32056    function_tests++;
32057#endif
32058
32059    return(test_ret);
32060}
32061
32062#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32063
32064#define gen_nb_xmlSchemaPtr 1
32065static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32066    return(NULL);
32067}
32068static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32069}
32070#endif
32071
32072
32073static int
32074test_xmlTextReaderSetSchema(void) {
32075    int test_ret = 0;
32076
32077#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32078    int mem_base;
32079    int ret_val;
32080    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32081    int n_reader;
32082    xmlSchemaPtr schema; /* a precompiled Schema schema */
32083    int n_schema;
32084
32085    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32086    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32087        mem_base = xmlMemBlocks();
32088        reader = gen_xmlTextReaderPtr(n_reader, 0);
32089        schema = gen_xmlSchemaPtr(n_schema, 1);
32090
32091        ret_val = xmlTextReaderSetSchema(reader, schema);
32092        desret_int(ret_val);
32093        call_tests++;
32094        des_xmlTextReaderPtr(n_reader, reader, 0);
32095        des_xmlSchemaPtr(n_schema, schema, 1);
32096        xmlResetLastError();
32097        if (mem_base != xmlMemBlocks()) {
32098            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32099	           xmlMemBlocks() - mem_base);
32100	    test_ret++;
32101            printf(" %d", n_reader);
32102            printf(" %d", n_schema);
32103            printf("\n");
32104        }
32105    }
32106    }
32107    function_tests++;
32108#endif
32109
32110    return(test_ret);
32111}
32112
32113
32114static int
32115test_xmlTextReaderSetStructuredErrorHandler(void) {
32116    int test_ret = 0;
32117
32118
32119    /* missing type support */
32120    return(test_ret);
32121}
32122
32123
32124static int
32125test_xmlTextReaderStandalone(void) {
32126    int test_ret = 0;
32127
32128#if defined(LIBXML_READER_ENABLED)
32129    int mem_base;
32130    int ret_val;
32131    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32132    int n_reader;
32133
32134    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32135        mem_base = xmlMemBlocks();
32136        reader = gen_xmlTextReaderPtr(n_reader, 0);
32137
32138        ret_val = xmlTextReaderStandalone(reader);
32139        desret_int(ret_val);
32140        call_tests++;
32141        des_xmlTextReaderPtr(n_reader, reader, 0);
32142        xmlResetLastError();
32143        if (mem_base != xmlMemBlocks()) {
32144            printf("Leak of %d blocks found in xmlTextReaderStandalone",
32145	           xmlMemBlocks() - mem_base);
32146	    test_ret++;
32147            printf(" %d", n_reader);
32148            printf("\n");
32149        }
32150    }
32151    function_tests++;
32152#endif
32153
32154    return(test_ret);
32155}
32156
32157
32158static int
32159test_xmlTextReaderValue(void) {
32160    int test_ret = 0;
32161
32162#if defined(LIBXML_READER_ENABLED)
32163    int mem_base;
32164    xmlChar * ret_val;
32165    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32166    int n_reader;
32167
32168    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32169        mem_base = xmlMemBlocks();
32170        reader = gen_xmlTextReaderPtr(n_reader, 0);
32171
32172        ret_val = xmlTextReaderValue(reader);
32173        desret_xmlChar_ptr(ret_val);
32174        call_tests++;
32175        des_xmlTextReaderPtr(n_reader, reader, 0);
32176        xmlResetLastError();
32177        if (mem_base != xmlMemBlocks()) {
32178            printf("Leak of %d blocks found in xmlTextReaderValue",
32179	           xmlMemBlocks() - mem_base);
32180	    test_ret++;
32181            printf(" %d", n_reader);
32182            printf("\n");
32183        }
32184    }
32185    function_tests++;
32186#endif
32187
32188    return(test_ret);
32189}
32190
32191
32192static int
32193test_xmlTextReaderXmlLang(void) {
32194    int test_ret = 0;
32195
32196#if defined(LIBXML_READER_ENABLED)
32197    int mem_base;
32198    xmlChar * ret_val;
32199    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32200    int n_reader;
32201
32202    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32203        mem_base = xmlMemBlocks();
32204        reader = gen_xmlTextReaderPtr(n_reader, 0);
32205
32206        ret_val = xmlTextReaderXmlLang(reader);
32207        desret_xmlChar_ptr(ret_val);
32208        call_tests++;
32209        des_xmlTextReaderPtr(n_reader, reader, 0);
32210        xmlResetLastError();
32211        if (mem_base != xmlMemBlocks()) {
32212            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32213	           xmlMemBlocks() - mem_base);
32214	    test_ret++;
32215            printf(" %d", n_reader);
32216            printf("\n");
32217        }
32218    }
32219    function_tests++;
32220#endif
32221
32222    return(test_ret);
32223}
32224
32225static int
32226test_xmlreader(void) {
32227    int test_ret = 0;
32228
32229    if (quiet == 0) printf("Testing xmlreader : 74 of 84 functions ...\n");
32230    test_ret += test_xmlNewTextReader();
32231    test_ret += test_xmlNewTextReaderFilename();
32232    test_ret += test_xmlReaderForDoc();
32233    test_ret += test_xmlReaderForFile();
32234    test_ret += test_xmlReaderForMemory();
32235    test_ret += test_xmlReaderNewDoc();
32236    test_ret += test_xmlReaderNewFile();
32237    test_ret += test_xmlReaderNewMemory();
32238    test_ret += test_xmlReaderNewWalker();
32239    test_ret += test_xmlReaderWalker();
32240    test_ret += test_xmlTextReaderAttributeCount();
32241    test_ret += test_xmlTextReaderBaseUri();
32242    test_ret += test_xmlTextReaderByteConsumed();
32243    test_ret += test_xmlTextReaderClose();
32244    test_ret += test_xmlTextReaderConstBaseUri();
32245    test_ret += test_xmlTextReaderConstEncoding();
32246    test_ret += test_xmlTextReaderConstLocalName();
32247    test_ret += test_xmlTextReaderConstName();
32248    test_ret += test_xmlTextReaderConstNamespaceUri();
32249    test_ret += test_xmlTextReaderConstPrefix();
32250    test_ret += test_xmlTextReaderConstString();
32251    test_ret += test_xmlTextReaderConstValue();
32252    test_ret += test_xmlTextReaderConstXmlLang();
32253    test_ret += test_xmlTextReaderConstXmlVersion();
32254    test_ret += test_xmlTextReaderCurrentDoc();
32255    test_ret += test_xmlTextReaderCurrentNode();
32256    test_ret += test_xmlTextReaderDepth();
32257    test_ret += test_xmlTextReaderExpand();
32258    test_ret += test_xmlTextReaderGetAttribute();
32259    test_ret += test_xmlTextReaderGetAttributeNo();
32260    test_ret += test_xmlTextReaderGetAttributeNs();
32261    test_ret += test_xmlTextReaderGetErrorHandler();
32262    test_ret += test_xmlTextReaderGetParserColumnNumber();
32263    test_ret += test_xmlTextReaderGetParserLineNumber();
32264    test_ret += test_xmlTextReaderGetParserProp();
32265    test_ret += test_xmlTextReaderGetRemainder();
32266    test_ret += test_xmlTextReaderHasAttributes();
32267    test_ret += test_xmlTextReaderHasValue();
32268    test_ret += test_xmlTextReaderIsDefault();
32269    test_ret += test_xmlTextReaderIsEmptyElement();
32270    test_ret += test_xmlTextReaderIsNamespaceDecl();
32271    test_ret += test_xmlTextReaderIsValid();
32272    test_ret += test_xmlTextReaderLocalName();
32273    test_ret += test_xmlTextReaderLocatorBaseURI();
32274    test_ret += test_xmlTextReaderLocatorLineNumber();
32275    test_ret += test_xmlTextReaderLookupNamespace();
32276    test_ret += test_xmlTextReaderMoveToAttribute();
32277    test_ret += test_xmlTextReaderMoveToAttributeNo();
32278    test_ret += test_xmlTextReaderMoveToAttributeNs();
32279    test_ret += test_xmlTextReaderMoveToElement();
32280    test_ret += test_xmlTextReaderMoveToFirstAttribute();
32281    test_ret += test_xmlTextReaderMoveToNextAttribute();
32282    test_ret += test_xmlTextReaderName();
32283    test_ret += test_xmlTextReaderNamespaceUri();
32284    test_ret += test_xmlTextReaderNext();
32285    test_ret += test_xmlTextReaderNextSibling();
32286    test_ret += test_xmlTextReaderNodeType();
32287    test_ret += test_xmlTextReaderNormalization();
32288    test_ret += test_xmlTextReaderPrefix();
32289    test_ret += test_xmlTextReaderPreserve();
32290    test_ret += test_xmlTextReaderPreservePattern();
32291    test_ret += test_xmlTextReaderQuoteChar();
32292    test_ret += test_xmlTextReaderRead();
32293    test_ret += test_xmlTextReaderReadAttributeValue();
32294    test_ret += test_xmlTextReaderReadState();
32295    test_ret += test_xmlTextReaderRelaxNGSetSchema();
32296    test_ret += test_xmlTextReaderRelaxNGValidate();
32297    test_ret += test_xmlTextReaderSchemaValidate();
32298    test_ret += test_xmlTextReaderSchemaValidateCtxt();
32299    test_ret += test_xmlTextReaderSetErrorHandler();
32300    test_ret += test_xmlTextReaderSetParserProp();
32301    test_ret += test_xmlTextReaderSetSchema();
32302    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32303    test_ret += test_xmlTextReaderStandalone();
32304    test_ret += test_xmlTextReaderValue();
32305    test_ret += test_xmlTextReaderXmlLang();
32306
32307    if (test_ret != 0)
32308	printf("Module xmlreader: %d errors\n", test_ret);
32309    return(test_ret);
32310}
32311
32312static int
32313test_xmlExpCtxtNbCons(void) {
32314    int test_ret = 0;
32315
32316#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32317    int mem_base;
32318    int ret_val;
32319    xmlExpCtxtPtr ctxt; /* an expression context */
32320    int n_ctxt;
32321
32322    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32323        mem_base = xmlMemBlocks();
32324        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32325
32326        ret_val = xmlExpCtxtNbCons(ctxt);
32327        desret_int(ret_val);
32328        call_tests++;
32329        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32330        xmlResetLastError();
32331        if (mem_base != xmlMemBlocks()) {
32332            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32333	           xmlMemBlocks() - mem_base);
32334	    test_ret++;
32335            printf(" %d", n_ctxt);
32336            printf("\n");
32337        }
32338    }
32339    function_tests++;
32340#endif
32341
32342    return(test_ret);
32343}
32344
32345
32346static int
32347test_xmlExpCtxtNbNodes(void) {
32348    int test_ret = 0;
32349
32350#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32351    int mem_base;
32352    int ret_val;
32353    xmlExpCtxtPtr ctxt; /* an expression context */
32354    int n_ctxt;
32355
32356    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32357        mem_base = xmlMemBlocks();
32358        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32359
32360        ret_val = xmlExpCtxtNbNodes(ctxt);
32361        desret_int(ret_val);
32362        call_tests++;
32363        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32364        xmlResetLastError();
32365        if (mem_base != xmlMemBlocks()) {
32366            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32367	           xmlMemBlocks() - mem_base);
32368	    test_ret++;
32369            printf(" %d", n_ctxt);
32370            printf("\n");
32371        }
32372    }
32373    function_tests++;
32374#endif
32375
32376    return(test_ret);
32377}
32378
32379
32380static int
32381test_xmlExpDump(void) {
32382    int test_ret = 0;
32383
32384#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32385    int mem_base;
32386    xmlBufferPtr buf; /* a buffer to receive the output */
32387    int n_buf;
32388    xmlExpNodePtr expr; /* the compiled expression */
32389    int n_expr;
32390
32391    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32392    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32393        mem_base = xmlMemBlocks();
32394        buf = gen_xmlBufferPtr(n_buf, 0);
32395        expr = gen_xmlExpNodePtr(n_expr, 1);
32396
32397        xmlExpDump(buf, expr);
32398        call_tests++;
32399        des_xmlBufferPtr(n_buf, buf, 0);
32400        des_xmlExpNodePtr(n_expr, expr, 1);
32401        xmlResetLastError();
32402        if (mem_base != xmlMemBlocks()) {
32403            printf("Leak of %d blocks found in xmlExpDump",
32404	           xmlMemBlocks() - mem_base);
32405	    test_ret++;
32406            printf(" %d", n_buf);
32407            printf(" %d", n_expr);
32408            printf("\n");
32409        }
32410    }
32411    }
32412    function_tests++;
32413#endif
32414
32415    return(test_ret);
32416}
32417
32418
32419static int
32420test_xmlExpExpDerive(void) {
32421    int test_ret = 0;
32422
32423
32424    /* missing type support */
32425    return(test_ret);
32426}
32427
32428
32429static int
32430test_xmlExpGetLanguage(void) {
32431    int test_ret = 0;
32432
32433#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32434    int mem_base;
32435    int ret_val;
32436    xmlExpCtxtPtr ctxt; /* the expression context */
32437    int n_ctxt;
32438    xmlExpNodePtr exp; /* the expression */
32439    int n_exp;
32440    xmlChar ** langList; /* where to store the tokens */
32441    int n_langList;
32442    int len; /* the allocated lenght of @list */
32443    int n_len;
32444
32445    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32446    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32447    for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32448    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32449        mem_base = xmlMemBlocks();
32450        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32451        exp = gen_xmlExpNodePtr(n_exp, 1);
32452        langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32453        len = gen_int(n_len, 3);
32454
32455        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32456        desret_int(ret_val);
32457        call_tests++;
32458        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32459        des_xmlExpNodePtr(n_exp, exp, 1);
32460        des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32461        des_int(n_len, len, 3);
32462        xmlResetLastError();
32463        if (mem_base != xmlMemBlocks()) {
32464            printf("Leak of %d blocks found in xmlExpGetLanguage",
32465	           xmlMemBlocks() - mem_base);
32466	    test_ret++;
32467            printf(" %d", n_ctxt);
32468            printf(" %d", n_exp);
32469            printf(" %d", n_langList);
32470            printf(" %d", n_len);
32471            printf("\n");
32472        }
32473    }
32474    }
32475    }
32476    }
32477    function_tests++;
32478#endif
32479
32480    return(test_ret);
32481}
32482
32483
32484static int
32485test_xmlExpGetStart(void) {
32486    int test_ret = 0;
32487
32488#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32489    int mem_base;
32490    int ret_val;
32491    xmlExpCtxtPtr ctxt; /* the expression context */
32492    int n_ctxt;
32493    xmlExpNodePtr exp; /* the expression */
32494    int n_exp;
32495    xmlChar ** tokList; /* where to store the tokens */
32496    int n_tokList;
32497    int len; /* the allocated lenght of @list */
32498    int n_len;
32499
32500    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32501    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32502    for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32503    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32504        mem_base = xmlMemBlocks();
32505        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32506        exp = gen_xmlExpNodePtr(n_exp, 1);
32507        tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32508        len = gen_int(n_len, 3);
32509
32510        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32511        desret_int(ret_val);
32512        call_tests++;
32513        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32514        des_xmlExpNodePtr(n_exp, exp, 1);
32515        des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32516        des_int(n_len, len, 3);
32517        xmlResetLastError();
32518        if (mem_base != xmlMemBlocks()) {
32519            printf("Leak of %d blocks found in xmlExpGetStart",
32520	           xmlMemBlocks() - mem_base);
32521	    test_ret++;
32522            printf(" %d", n_ctxt);
32523            printf(" %d", n_exp);
32524            printf(" %d", n_tokList);
32525            printf(" %d", n_len);
32526            printf("\n");
32527        }
32528    }
32529    }
32530    }
32531    }
32532    function_tests++;
32533#endif
32534
32535    return(test_ret);
32536}
32537
32538
32539static int
32540test_xmlExpIsNillable(void) {
32541    int test_ret = 0;
32542
32543#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32544    int mem_base;
32545    int ret_val;
32546    xmlExpNodePtr exp; /* the expression */
32547    int n_exp;
32548
32549    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32550        mem_base = xmlMemBlocks();
32551        exp = gen_xmlExpNodePtr(n_exp, 0);
32552
32553        ret_val = xmlExpIsNillable(exp);
32554        desret_int(ret_val);
32555        call_tests++;
32556        des_xmlExpNodePtr(n_exp, exp, 0);
32557        xmlResetLastError();
32558        if (mem_base != xmlMemBlocks()) {
32559            printf("Leak of %d blocks found in xmlExpIsNillable",
32560	           xmlMemBlocks() - mem_base);
32561	    test_ret++;
32562            printf(" %d", n_exp);
32563            printf("\n");
32564        }
32565    }
32566    function_tests++;
32567#endif
32568
32569    return(test_ret);
32570}
32571
32572
32573static int
32574test_xmlExpMaxToken(void) {
32575    int test_ret = 0;
32576
32577#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32578    int mem_base;
32579    int ret_val;
32580    xmlExpNodePtr expr; /* a compiled expression */
32581    int n_expr;
32582
32583    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32584        mem_base = xmlMemBlocks();
32585        expr = gen_xmlExpNodePtr(n_expr, 0);
32586
32587        ret_val = xmlExpMaxToken(expr);
32588        desret_int(ret_val);
32589        call_tests++;
32590        des_xmlExpNodePtr(n_expr, expr, 0);
32591        xmlResetLastError();
32592        if (mem_base != xmlMemBlocks()) {
32593            printf("Leak of %d blocks found in xmlExpMaxToken",
32594	           xmlMemBlocks() - mem_base);
32595	    test_ret++;
32596            printf(" %d", n_expr);
32597            printf("\n");
32598        }
32599    }
32600    function_tests++;
32601#endif
32602
32603    return(test_ret);
32604}
32605
32606
32607static int
32608test_xmlExpNewAtom(void) {
32609    int test_ret = 0;
32610
32611
32612    /* missing type support */
32613    return(test_ret);
32614}
32615
32616
32617static int
32618test_xmlExpNewCtxt(void) {
32619    int test_ret = 0;
32620
32621
32622    /* missing type support */
32623    return(test_ret);
32624}
32625
32626
32627static int
32628test_xmlExpNewOr(void) {
32629    int test_ret = 0;
32630
32631
32632    /* missing type support */
32633    return(test_ret);
32634}
32635
32636
32637static int
32638test_xmlExpNewRange(void) {
32639    int test_ret = 0;
32640
32641
32642    /* missing type support */
32643    return(test_ret);
32644}
32645
32646
32647static int
32648test_xmlExpNewSeq(void) {
32649    int test_ret = 0;
32650
32651
32652    /* missing type support */
32653    return(test_ret);
32654}
32655
32656
32657static int
32658test_xmlExpParse(void) {
32659    int test_ret = 0;
32660
32661
32662    /* missing type support */
32663    return(test_ret);
32664}
32665
32666
32667static int
32668test_xmlExpRef(void) {
32669    int test_ret = 0;
32670
32671#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32672    int mem_base;
32673    xmlExpNodePtr exp; /* the expression */
32674    int n_exp;
32675
32676    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32677        mem_base = xmlMemBlocks();
32678        exp = gen_xmlExpNodePtr(n_exp, 0);
32679
32680        xmlExpRef(exp);
32681        call_tests++;
32682        des_xmlExpNodePtr(n_exp, exp, 0);
32683        xmlResetLastError();
32684        if (mem_base != xmlMemBlocks()) {
32685            printf("Leak of %d blocks found in xmlExpRef",
32686	           xmlMemBlocks() - mem_base);
32687	    test_ret++;
32688            printf(" %d", n_exp);
32689            printf("\n");
32690        }
32691    }
32692    function_tests++;
32693#endif
32694
32695    return(test_ret);
32696}
32697
32698
32699static int
32700test_xmlExpStringDerive(void) {
32701    int test_ret = 0;
32702
32703
32704    /* missing type support */
32705    return(test_ret);
32706}
32707
32708
32709static int
32710test_xmlExpSubsume(void) {
32711    int test_ret = 0;
32712
32713#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32714    int mem_base;
32715    int ret_val;
32716    xmlExpCtxtPtr ctxt; /* the expressions context */
32717    int n_ctxt;
32718    xmlExpNodePtr exp; /* the englobing expression */
32719    int n_exp;
32720    xmlExpNodePtr sub; /* the subexpression */
32721    int n_sub;
32722
32723    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32724    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32725    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32726        mem_base = xmlMemBlocks();
32727        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32728        exp = gen_xmlExpNodePtr(n_exp, 1);
32729        sub = gen_xmlExpNodePtr(n_sub, 2);
32730
32731        ret_val = xmlExpSubsume(ctxt, exp, sub);
32732        desret_int(ret_val);
32733        call_tests++;
32734        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32735        des_xmlExpNodePtr(n_exp, exp, 1);
32736        des_xmlExpNodePtr(n_sub, sub, 2);
32737        xmlResetLastError();
32738        if (mem_base != xmlMemBlocks()) {
32739            printf("Leak of %d blocks found in xmlExpSubsume",
32740	           xmlMemBlocks() - mem_base);
32741	    test_ret++;
32742            printf(" %d", n_ctxt);
32743            printf(" %d", n_exp);
32744            printf(" %d", n_sub);
32745            printf("\n");
32746        }
32747    }
32748    }
32749    }
32750    function_tests++;
32751#endif
32752
32753    return(test_ret);
32754}
32755
32756#ifdef LIBXML_REGEXP_ENABLED
32757
32758#define gen_nb_xmlRegExecCtxtPtr 1
32759static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32760    return(NULL);
32761}
32762static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32763}
32764#endif
32765
32766
32767static int
32768test_xmlRegExecErrInfo(void) {
32769    int test_ret = 0;
32770
32771#if defined(LIBXML_REGEXP_ENABLED)
32772    int mem_base;
32773    int ret_val;
32774    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
32775    int n_exec;
32776    xmlChar ** string; /* return value for the error string */
32777    int n_string;
32778    int * nbval; /* pointer to the number of accepted values IN/OUT */
32779    int n_nbval;
32780    int * nbneg; /* return number of negative transitions */
32781    int n_nbneg;
32782    xmlChar ** values; /* pointer to the array of acceptable values */
32783    int n_values;
32784    int * terminal; /* return value if this was a terminal state */
32785    int n_terminal;
32786
32787    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32788    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
32789    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
32790    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
32791    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
32792    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
32793        mem_base = xmlMemBlocks();
32794        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32795        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
32796        nbval = gen_int_ptr(n_nbval, 2);
32797        nbneg = gen_int_ptr(n_nbneg, 3);
32798        values = gen_xmlChar_ptr_ptr(n_values, 4);
32799        terminal = gen_int_ptr(n_terminal, 5);
32800
32801        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
32802        desret_int(ret_val);
32803        call_tests++;
32804        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32805        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
32806        des_int_ptr(n_nbval, nbval, 2);
32807        des_int_ptr(n_nbneg, nbneg, 3);
32808        des_xmlChar_ptr_ptr(n_values, values, 4);
32809        des_int_ptr(n_terminal, terminal, 5);
32810        xmlResetLastError();
32811        if (mem_base != xmlMemBlocks()) {
32812            printf("Leak of %d blocks found in xmlRegExecErrInfo",
32813	           xmlMemBlocks() - mem_base);
32814	    test_ret++;
32815            printf(" %d", n_exec);
32816            printf(" %d", n_string);
32817            printf(" %d", n_nbval);
32818            printf(" %d", n_nbneg);
32819            printf(" %d", n_values);
32820            printf(" %d", n_terminal);
32821            printf("\n");
32822        }
32823    }
32824    }
32825    }
32826    }
32827    }
32828    }
32829    function_tests++;
32830#endif
32831
32832    return(test_ret);
32833}
32834
32835
32836static int
32837test_xmlRegExecNextValues(void) {
32838    int test_ret = 0;
32839
32840#if defined(LIBXML_REGEXP_ENABLED)
32841    int mem_base;
32842    int ret_val;
32843    xmlRegExecCtxtPtr exec; /* a regexp execution context */
32844    int n_exec;
32845    int * nbval; /* pointer to the number of accepted values IN/OUT */
32846    int n_nbval;
32847    int * nbneg; /* return number of negative transitions */
32848    int n_nbneg;
32849    xmlChar ** values; /* pointer to the array of acceptable values */
32850    int n_values;
32851    int * terminal; /* return value if this was a terminal state */
32852    int n_terminal;
32853
32854    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32855    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
32856    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
32857    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
32858    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
32859        mem_base = xmlMemBlocks();
32860        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32861        nbval = gen_int_ptr(n_nbval, 1);
32862        nbneg = gen_int_ptr(n_nbneg, 2);
32863        values = gen_xmlChar_ptr_ptr(n_values, 3);
32864        terminal = gen_int_ptr(n_terminal, 4);
32865
32866        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
32867        desret_int(ret_val);
32868        call_tests++;
32869        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32870        des_int_ptr(n_nbval, nbval, 1);
32871        des_int_ptr(n_nbneg, nbneg, 2);
32872        des_xmlChar_ptr_ptr(n_values, values, 3);
32873        des_int_ptr(n_terminal, terminal, 4);
32874        xmlResetLastError();
32875        if (mem_base != xmlMemBlocks()) {
32876            printf("Leak of %d blocks found in xmlRegExecNextValues",
32877	           xmlMemBlocks() - mem_base);
32878	    test_ret++;
32879            printf(" %d", n_exec);
32880            printf(" %d", n_nbval);
32881            printf(" %d", n_nbneg);
32882            printf(" %d", n_values);
32883            printf(" %d", n_terminal);
32884            printf("\n");
32885        }
32886    }
32887    }
32888    }
32889    }
32890    }
32891    function_tests++;
32892#endif
32893
32894    return(test_ret);
32895}
32896
32897
32898static int
32899test_xmlRegExecPushString(void) {
32900    int test_ret = 0;
32901
32902#if defined(LIBXML_REGEXP_ENABLED)
32903    int mem_base;
32904    int ret_val;
32905    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
32906    int n_exec;
32907    xmlChar * value; /* a string token input */
32908    int n_value;
32909    void * data; /* data associated to the token to reuse in callbacks */
32910    int n_data;
32911
32912    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32913    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32914    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
32915        mem_base = xmlMemBlocks();
32916        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32917        value = gen_const_xmlChar_ptr(n_value, 1);
32918        data = gen_userdata(n_data, 2);
32919
32920        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
32921        desret_int(ret_val);
32922        call_tests++;
32923        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32924        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32925        des_userdata(n_data, data, 2);
32926        xmlResetLastError();
32927        if (mem_base != xmlMemBlocks()) {
32928            printf("Leak of %d blocks found in xmlRegExecPushString",
32929	           xmlMemBlocks() - mem_base);
32930	    test_ret++;
32931            printf(" %d", n_exec);
32932            printf(" %d", n_value);
32933            printf(" %d", n_data);
32934            printf("\n");
32935        }
32936    }
32937    }
32938    }
32939    function_tests++;
32940#endif
32941
32942    return(test_ret);
32943}
32944
32945
32946static int
32947test_xmlRegExecPushString2(void) {
32948    int test_ret = 0;
32949
32950#if defined(LIBXML_REGEXP_ENABLED)
32951    int mem_base;
32952    int ret_val;
32953    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
32954    int n_exec;
32955    xmlChar * value; /* the first string token input */
32956    int n_value;
32957    xmlChar * value2; /* the second string token input */
32958    int n_value2;
32959    void * data; /* data associated to the token to reuse in callbacks */
32960    int n_data;
32961
32962    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32963    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32964    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
32965    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
32966        mem_base = xmlMemBlocks();
32967        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32968        value = gen_const_xmlChar_ptr(n_value, 1);
32969        value2 = gen_const_xmlChar_ptr(n_value2, 2);
32970        data = gen_userdata(n_data, 3);
32971
32972        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
32973        desret_int(ret_val);
32974        call_tests++;
32975        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32976        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32977        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
32978        des_userdata(n_data, data, 3);
32979        xmlResetLastError();
32980        if (mem_base != xmlMemBlocks()) {
32981            printf("Leak of %d blocks found in xmlRegExecPushString2",
32982	           xmlMemBlocks() - mem_base);
32983	    test_ret++;
32984            printf(" %d", n_exec);
32985            printf(" %d", n_value);
32986            printf(" %d", n_value2);
32987            printf(" %d", n_data);
32988            printf("\n");
32989        }
32990    }
32991    }
32992    }
32993    }
32994    function_tests++;
32995#endif
32996
32997    return(test_ret);
32998}
32999
33000#ifdef LIBXML_REGEXP_ENABLED
33001
33002#define gen_nb_xmlRegexpPtr 1
33003static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33004    return(NULL);
33005}
33006static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33007}
33008#endif
33009
33010
33011static int
33012test_xmlRegNewExecCtxt(void) {
33013    int test_ret = 0;
33014
33015
33016    /* missing type support */
33017    return(test_ret);
33018}
33019
33020
33021static int
33022test_xmlRegexpCompile(void) {
33023    int test_ret = 0;
33024
33025
33026    /* missing type support */
33027    return(test_ret);
33028}
33029
33030
33031static int
33032test_xmlRegexpExec(void) {
33033    int test_ret = 0;
33034
33035#if defined(LIBXML_REGEXP_ENABLED)
33036    int mem_base;
33037    int ret_val;
33038    xmlRegexpPtr comp; /* the compiled regular expression */
33039    int n_comp;
33040    xmlChar * content; /* the value to check against the regular expression */
33041    int n_content;
33042
33043    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33044    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33045        mem_base = xmlMemBlocks();
33046        comp = gen_xmlRegexpPtr(n_comp, 0);
33047        content = gen_const_xmlChar_ptr(n_content, 1);
33048
33049        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33050        desret_int(ret_val);
33051        call_tests++;
33052        des_xmlRegexpPtr(n_comp, comp, 0);
33053        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33054        xmlResetLastError();
33055        if (mem_base != xmlMemBlocks()) {
33056            printf("Leak of %d blocks found in xmlRegexpExec",
33057	           xmlMemBlocks() - mem_base);
33058	    test_ret++;
33059            printf(" %d", n_comp);
33060            printf(" %d", n_content);
33061            printf("\n");
33062        }
33063    }
33064    }
33065    function_tests++;
33066#endif
33067
33068    return(test_ret);
33069}
33070
33071
33072static int
33073test_xmlRegexpIsDeterminist(void) {
33074    int test_ret = 0;
33075
33076#if defined(LIBXML_REGEXP_ENABLED)
33077    int mem_base;
33078    int ret_val;
33079    xmlRegexpPtr comp; /* the compiled regular expression */
33080    int n_comp;
33081
33082    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33083        mem_base = xmlMemBlocks();
33084        comp = gen_xmlRegexpPtr(n_comp, 0);
33085
33086        ret_val = xmlRegexpIsDeterminist(comp);
33087        desret_int(ret_val);
33088        call_tests++;
33089        des_xmlRegexpPtr(n_comp, comp, 0);
33090        xmlResetLastError();
33091        if (mem_base != xmlMemBlocks()) {
33092            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33093	           xmlMemBlocks() - mem_base);
33094	    test_ret++;
33095            printf(" %d", n_comp);
33096            printf("\n");
33097        }
33098    }
33099    function_tests++;
33100#endif
33101
33102    return(test_ret);
33103}
33104
33105
33106static int
33107test_xmlRegexpPrint(void) {
33108    int test_ret = 0;
33109
33110#if defined(LIBXML_REGEXP_ENABLED)
33111    int mem_base;
33112    FILE * output; /* the file for the output debug */
33113    int n_output;
33114    xmlRegexpPtr regexp; /* the compiled regexp */
33115    int n_regexp;
33116
33117    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33118    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33119        mem_base = xmlMemBlocks();
33120        output = gen_FILE_ptr(n_output, 0);
33121        regexp = gen_xmlRegexpPtr(n_regexp, 1);
33122
33123        xmlRegexpPrint(output, regexp);
33124        call_tests++;
33125        des_FILE_ptr(n_output, output, 0);
33126        des_xmlRegexpPtr(n_regexp, regexp, 1);
33127        xmlResetLastError();
33128        if (mem_base != xmlMemBlocks()) {
33129            printf("Leak of %d blocks found in xmlRegexpPrint",
33130	           xmlMemBlocks() - mem_base);
33131	    test_ret++;
33132            printf(" %d", n_output);
33133            printf(" %d", n_regexp);
33134            printf("\n");
33135        }
33136    }
33137    }
33138    function_tests++;
33139#endif
33140
33141    return(test_ret);
33142}
33143
33144static int
33145test_xmlregexp(void) {
33146    int test_ret = 0;
33147
33148    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33149    test_ret += test_xmlExpCtxtNbCons();
33150    test_ret += test_xmlExpCtxtNbNodes();
33151    test_ret += test_xmlExpDump();
33152    test_ret += test_xmlExpExpDerive();
33153    test_ret += test_xmlExpGetLanguage();
33154    test_ret += test_xmlExpGetStart();
33155    test_ret += test_xmlExpIsNillable();
33156    test_ret += test_xmlExpMaxToken();
33157    test_ret += test_xmlExpNewAtom();
33158    test_ret += test_xmlExpNewCtxt();
33159    test_ret += test_xmlExpNewOr();
33160    test_ret += test_xmlExpNewRange();
33161    test_ret += test_xmlExpNewSeq();
33162    test_ret += test_xmlExpParse();
33163    test_ret += test_xmlExpRef();
33164    test_ret += test_xmlExpStringDerive();
33165    test_ret += test_xmlExpSubsume();
33166    test_ret += test_xmlRegExecErrInfo();
33167    test_ret += test_xmlRegExecNextValues();
33168    test_ret += test_xmlRegExecPushString();
33169    test_ret += test_xmlRegExecPushString2();
33170    test_ret += test_xmlRegNewExecCtxt();
33171    test_ret += test_xmlRegexpCompile();
33172    test_ret += test_xmlRegexpExec();
33173    test_ret += test_xmlRegexpIsDeterminist();
33174    test_ret += test_xmlRegexpPrint();
33175
33176    if (test_ret != 0)
33177	printf("Module xmlregexp: %d errors\n", test_ret);
33178    return(test_ret);
33179}
33180#ifdef LIBXML_OUTPUT_ENABLED
33181
33182#define gen_nb_xmlSaveCtxtPtr 1
33183static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33184    return(NULL);
33185}
33186static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33187}
33188#endif
33189
33190
33191static int
33192test_xmlSaveClose(void) {
33193    int test_ret = 0;
33194
33195#if defined(LIBXML_OUTPUT_ENABLED)
33196    int mem_base;
33197    int ret_val;
33198    xmlSaveCtxtPtr ctxt; /* a document saving context */
33199    int n_ctxt;
33200
33201    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33202        mem_base = xmlMemBlocks();
33203        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33204
33205        ret_val = xmlSaveClose(ctxt);
33206        desret_int(ret_val);
33207        call_tests++;
33208        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33209        xmlResetLastError();
33210        if (mem_base != xmlMemBlocks()) {
33211            printf("Leak of %d blocks found in xmlSaveClose",
33212	           xmlMemBlocks() - mem_base);
33213	    test_ret++;
33214            printf(" %d", n_ctxt);
33215            printf("\n");
33216        }
33217    }
33218    function_tests++;
33219#endif
33220
33221    return(test_ret);
33222}
33223
33224
33225static int
33226test_xmlSaveDoc(void) {
33227    int test_ret = 0;
33228
33229#if defined(LIBXML_OUTPUT_ENABLED)
33230    int mem_base;
33231    long ret_val;
33232    xmlSaveCtxtPtr ctxt; /* a document saving context */
33233    int n_ctxt;
33234    xmlDocPtr doc; /* a document */
33235    int n_doc;
33236
33237    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33238    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33239        mem_base = xmlMemBlocks();
33240        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33241        doc = gen_xmlDocPtr(n_doc, 1);
33242
33243        ret_val = xmlSaveDoc(ctxt, doc);
33244        desret_long(ret_val);
33245        call_tests++;
33246        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33247        des_xmlDocPtr(n_doc, doc, 1);
33248        xmlResetLastError();
33249        if (mem_base != xmlMemBlocks()) {
33250            printf("Leak of %d blocks found in xmlSaveDoc",
33251	           xmlMemBlocks() - mem_base);
33252	    test_ret++;
33253            printf(" %d", n_ctxt);
33254            printf(" %d", n_doc);
33255            printf("\n");
33256        }
33257    }
33258    }
33259    function_tests++;
33260#endif
33261
33262    return(test_ret);
33263}
33264
33265
33266static int
33267test_xmlSaveFlush(void) {
33268    int test_ret = 0;
33269
33270#if defined(LIBXML_OUTPUT_ENABLED)
33271    int mem_base;
33272    int ret_val;
33273    xmlSaveCtxtPtr ctxt; /* a document saving context */
33274    int n_ctxt;
33275
33276    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33277        mem_base = xmlMemBlocks();
33278        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33279
33280        ret_val = xmlSaveFlush(ctxt);
33281        desret_int(ret_val);
33282        call_tests++;
33283        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33284        xmlResetLastError();
33285        if (mem_base != xmlMemBlocks()) {
33286            printf("Leak of %d blocks found in xmlSaveFlush",
33287	           xmlMemBlocks() - mem_base);
33288	    test_ret++;
33289            printf(" %d", n_ctxt);
33290            printf("\n");
33291        }
33292    }
33293    function_tests++;
33294#endif
33295
33296    return(test_ret);
33297}
33298
33299
33300static int
33301test_xmlSaveSetAttrEscape(void) {
33302    int test_ret = 0;
33303
33304
33305    /* missing type support */
33306    return(test_ret);
33307}
33308
33309
33310static int
33311test_xmlSaveSetEscape(void) {
33312    int test_ret = 0;
33313
33314
33315    /* missing type support */
33316    return(test_ret);
33317}
33318
33319
33320static int
33321test_xmlSaveToBuffer(void) {
33322    int test_ret = 0;
33323
33324
33325    /* missing type support */
33326    return(test_ret);
33327}
33328
33329
33330static int
33331test_xmlSaveToFd(void) {
33332    int test_ret = 0;
33333
33334
33335    /* missing type support */
33336    return(test_ret);
33337}
33338
33339
33340static int
33341test_xmlSaveToFilename(void) {
33342    int test_ret = 0;
33343
33344
33345    /* missing type support */
33346    return(test_ret);
33347}
33348
33349
33350static int
33351test_xmlSaveTree(void) {
33352    int test_ret = 0;
33353
33354#if defined(LIBXML_OUTPUT_ENABLED)
33355    int mem_base;
33356    long ret_val;
33357    xmlSaveCtxtPtr ctxt; /* a document saving context */
33358    int n_ctxt;
33359    xmlNodePtr node; /* a document */
33360    int n_node;
33361
33362    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33363    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33364        mem_base = xmlMemBlocks();
33365        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33366        node = gen_xmlNodePtr(n_node, 1);
33367
33368        ret_val = xmlSaveTree(ctxt, node);
33369        desret_long(ret_val);
33370        call_tests++;
33371        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33372        des_xmlNodePtr(n_node, node, 1);
33373        xmlResetLastError();
33374        if (mem_base != xmlMemBlocks()) {
33375            printf("Leak of %d blocks found in xmlSaveTree",
33376	           xmlMemBlocks() - mem_base);
33377	    test_ret++;
33378            printf(" %d", n_ctxt);
33379            printf(" %d", n_node);
33380            printf("\n");
33381        }
33382    }
33383    }
33384    function_tests++;
33385#endif
33386
33387    return(test_ret);
33388}
33389
33390static int
33391test_xmlsave(void) {
33392    int test_ret = 0;
33393
33394    if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33395    test_ret += test_xmlSaveClose();
33396    test_ret += test_xmlSaveDoc();
33397    test_ret += test_xmlSaveFlush();
33398    test_ret += test_xmlSaveSetAttrEscape();
33399    test_ret += test_xmlSaveSetEscape();
33400    test_ret += test_xmlSaveToBuffer();
33401    test_ret += test_xmlSaveToFd();
33402    test_ret += test_xmlSaveToFilename();
33403    test_ret += test_xmlSaveTree();
33404
33405    if (test_ret != 0)
33406	printf("Module xmlsave: %d errors\n", test_ret);
33407    return(test_ret);
33408}
33409
33410static int
33411test_xmlSchemaDump(void) {
33412    int test_ret = 0;
33413
33414#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33415    int mem_base;
33416    FILE * output; /* the file output */
33417    int n_output;
33418    xmlSchemaPtr schema; /* a schema structure */
33419    int n_schema;
33420
33421    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33422    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33423        mem_base = xmlMemBlocks();
33424        output = gen_FILE_ptr(n_output, 0);
33425        schema = gen_xmlSchemaPtr(n_schema, 1);
33426
33427        xmlSchemaDump(output, schema);
33428        call_tests++;
33429        des_FILE_ptr(n_output, output, 0);
33430        des_xmlSchemaPtr(n_schema, schema, 1);
33431        xmlResetLastError();
33432        if (mem_base != xmlMemBlocks()) {
33433            printf("Leak of %d blocks found in xmlSchemaDump",
33434	           xmlMemBlocks() - mem_base);
33435	    test_ret++;
33436            printf(" %d", n_output);
33437            printf(" %d", n_schema);
33438            printf("\n");
33439        }
33440    }
33441    }
33442    function_tests++;
33443#endif
33444
33445    return(test_ret);
33446}
33447
33448#ifdef LIBXML_SCHEMAS_ENABLED
33449
33450#define gen_nb_xmlSchemaParserCtxtPtr 1
33451static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33452    return(NULL);
33453}
33454static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33455}
33456#endif
33457
33458#ifdef LIBXML_SCHEMAS_ENABLED
33459
33460#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33461static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33462    return(NULL);
33463}
33464static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33465}
33466#endif
33467
33468#ifdef LIBXML_SCHEMAS_ENABLED
33469
33470#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33471static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33472    return(NULL);
33473}
33474static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33475}
33476#endif
33477
33478
33479static int
33480test_xmlSchemaGetParserErrors(void) {
33481    int test_ret = 0;
33482
33483#if defined(LIBXML_SCHEMAS_ENABLED)
33484    int mem_base;
33485    int ret_val;
33486    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33487    int n_ctxt;
33488    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33489    int n_err;
33490    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33491    int n_warn;
33492    void ** ctx; /* contextual data for the callbacks result */
33493    int n_ctx;
33494
33495    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33496    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33497    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33498    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33499        mem_base = xmlMemBlocks();
33500        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33501        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33502        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33503        ctx = gen_void_ptr_ptr(n_ctx, 3);
33504
33505        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33506        desret_int(ret_val);
33507        call_tests++;
33508        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33509        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33510        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33511        des_void_ptr_ptr(n_ctx, ctx, 3);
33512        xmlResetLastError();
33513        if (mem_base != xmlMemBlocks()) {
33514            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33515	           xmlMemBlocks() - mem_base);
33516	    test_ret++;
33517            printf(" %d", n_ctxt);
33518            printf(" %d", n_err);
33519            printf(" %d", n_warn);
33520            printf(" %d", n_ctx);
33521            printf("\n");
33522        }
33523    }
33524    }
33525    }
33526    }
33527    function_tests++;
33528#endif
33529
33530    return(test_ret);
33531}
33532
33533
33534static int
33535test_xmlSchemaGetValidErrors(void) {
33536    int test_ret = 0;
33537
33538#if defined(LIBXML_SCHEMAS_ENABLED)
33539    int mem_base;
33540    int ret_val;
33541    xmlSchemaValidCtxtPtr ctxt; /*  */
33542    int n_ctxt;
33543    xmlSchemaValidityErrorFunc * err; /*  */
33544    int n_err;
33545    xmlSchemaValidityWarningFunc * warn; /*  */
33546    int n_warn;
33547    void ** ctx; /*  */
33548    int n_ctx;
33549
33550    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33551    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33552    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33553    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33554        mem_base = xmlMemBlocks();
33555        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33556        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33557        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33558        ctx = gen_void_ptr_ptr(n_ctx, 3);
33559
33560        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33561        desret_int(ret_val);
33562        call_tests++;
33563        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33564        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33565        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33566        des_void_ptr_ptr(n_ctx, ctx, 3);
33567        xmlResetLastError();
33568        if (mem_base != xmlMemBlocks()) {
33569            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33570	           xmlMemBlocks() - mem_base);
33571	    test_ret++;
33572            printf(" %d", n_ctxt);
33573            printf(" %d", n_err);
33574            printf(" %d", n_warn);
33575            printf(" %d", n_ctx);
33576            printf("\n");
33577        }
33578    }
33579    }
33580    }
33581    }
33582    function_tests++;
33583#endif
33584
33585    return(test_ret);
33586}
33587
33588
33589static int
33590test_xmlSchemaIsValid(void) {
33591    int test_ret = 0;
33592
33593#if defined(LIBXML_SCHEMAS_ENABLED)
33594    int mem_base;
33595    int ret_val;
33596    xmlSchemaValidCtxtPtr ctxt; /*  */
33597    int n_ctxt;
33598
33599    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33600        mem_base = xmlMemBlocks();
33601        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33602
33603        ret_val = xmlSchemaIsValid(ctxt);
33604        desret_int(ret_val);
33605        call_tests++;
33606        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33607        xmlResetLastError();
33608        if (mem_base != xmlMemBlocks()) {
33609            printf("Leak of %d blocks found in xmlSchemaIsValid",
33610	           xmlMemBlocks() - mem_base);
33611	    test_ret++;
33612            printf(" %d", n_ctxt);
33613            printf("\n");
33614        }
33615    }
33616    function_tests++;
33617#endif
33618
33619    return(test_ret);
33620}
33621
33622
33623static int
33624test_xmlSchemaNewDocParserCtxt(void) {
33625    int test_ret = 0;
33626
33627#if defined(LIBXML_SCHEMAS_ENABLED)
33628    int mem_base;
33629    xmlSchemaParserCtxtPtr ret_val;
33630    xmlDocPtr doc; /* a preparsed document tree */
33631    int n_doc;
33632
33633    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33634        mem_base = xmlMemBlocks();
33635        doc = gen_xmlDocPtr(n_doc, 0);
33636
33637        ret_val = xmlSchemaNewDocParserCtxt(doc);
33638        desret_xmlSchemaParserCtxtPtr(ret_val);
33639        call_tests++;
33640        des_xmlDocPtr(n_doc, doc, 0);
33641        xmlResetLastError();
33642        if (mem_base != xmlMemBlocks()) {
33643            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33644	           xmlMemBlocks() - mem_base);
33645	    test_ret++;
33646            printf(" %d", n_doc);
33647            printf("\n");
33648        }
33649    }
33650    function_tests++;
33651#endif
33652
33653    return(test_ret);
33654}
33655
33656
33657static int
33658test_xmlSchemaNewMemParserCtxt(void) {
33659    int test_ret = 0;
33660
33661#if defined(LIBXML_SCHEMAS_ENABLED)
33662    int mem_base;
33663    xmlSchemaParserCtxtPtr ret_val;
33664    char * buffer; /* a pointer to a char array containing the schemas */
33665    int n_buffer;
33666    int size; /* the size of the array */
33667    int n_size;
33668
33669    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33670    for (n_size = 0;n_size < gen_nb_int;n_size++) {
33671        mem_base = xmlMemBlocks();
33672        buffer = gen_const_char_ptr(n_buffer, 0);
33673        size = gen_int(n_size, 1);
33674
33675        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33676        desret_xmlSchemaParserCtxtPtr(ret_val);
33677        call_tests++;
33678        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33679        des_int(n_size, size, 1);
33680        xmlResetLastError();
33681        if (mem_base != xmlMemBlocks()) {
33682            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33683	           xmlMemBlocks() - mem_base);
33684	    test_ret++;
33685            printf(" %d", n_buffer);
33686            printf(" %d", n_size);
33687            printf("\n");
33688        }
33689    }
33690    }
33691    function_tests++;
33692#endif
33693
33694    return(test_ret);
33695}
33696
33697
33698static int
33699test_xmlSchemaNewParserCtxt(void) {
33700    int test_ret = 0;
33701
33702#if defined(LIBXML_SCHEMAS_ENABLED)
33703    int mem_base;
33704    xmlSchemaParserCtxtPtr ret_val;
33705    char * URL; /* the location of the schema */
33706    int n_URL;
33707
33708    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33709        mem_base = xmlMemBlocks();
33710        URL = gen_const_char_ptr(n_URL, 0);
33711
33712        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33713        desret_xmlSchemaParserCtxtPtr(ret_val);
33714        call_tests++;
33715        des_const_char_ptr(n_URL, (const char *)URL, 0);
33716        xmlResetLastError();
33717        if (mem_base != xmlMemBlocks()) {
33718            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33719	           xmlMemBlocks() - mem_base);
33720	    test_ret++;
33721            printf(" %d", n_URL);
33722            printf("\n");
33723        }
33724    }
33725    function_tests++;
33726#endif
33727
33728    return(test_ret);
33729}
33730
33731
33732static int
33733test_xmlSchemaNewValidCtxt(void) {
33734    int test_ret = 0;
33735
33736
33737    /* missing type support */
33738    return(test_ret);
33739}
33740
33741
33742static int
33743test_xmlSchemaParse(void) {
33744    int test_ret = 0;
33745
33746
33747    /* missing type support */
33748    return(test_ret);
33749}
33750
33751#ifdef LIBXML_SCHEMAS_ENABLED
33752
33753#define gen_nb_xmlSAXHandlerPtr_ptr 1
33754static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33755    return(NULL);
33756}
33757static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33758}
33759#endif
33760
33761
33762static int
33763test_xmlSchemaSAXPlug(void) {
33764    int test_ret = 0;
33765
33766
33767    /* missing type support */
33768    return(test_ret);
33769}
33770
33771#ifdef LIBXML_SCHEMAS_ENABLED
33772
33773#define gen_nb_xmlSchemaSAXPlugPtr 1
33774static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33775    return(NULL);
33776}
33777static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33778}
33779#endif
33780
33781
33782static int
33783test_xmlSchemaSAXUnplug(void) {
33784    int test_ret = 0;
33785
33786#if defined(LIBXML_SCHEMAS_ENABLED)
33787    int mem_base;
33788    int ret_val;
33789    xmlSchemaSAXPlugPtr plug; /*  */
33790    int n_plug;
33791
33792    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
33793        mem_base = xmlMemBlocks();
33794        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
33795
33796        ret_val = xmlSchemaSAXUnplug(plug);
33797        desret_int(ret_val);
33798        call_tests++;
33799        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
33800        xmlResetLastError();
33801        if (mem_base != xmlMemBlocks()) {
33802            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
33803	           xmlMemBlocks() - mem_base);
33804	    test_ret++;
33805            printf(" %d", n_plug);
33806            printf("\n");
33807        }
33808    }
33809    function_tests++;
33810#endif
33811
33812    return(test_ret);
33813}
33814
33815
33816static int
33817test_xmlSchemaSetParserErrors(void) {
33818    int test_ret = 0;
33819
33820
33821    /* missing type support */
33822    return(test_ret);
33823}
33824
33825
33826static int
33827test_xmlSchemaSetParserStructuredErrors(void) {
33828    int test_ret = 0;
33829
33830
33831    /* missing type support */
33832    return(test_ret);
33833}
33834
33835
33836static int
33837test_xmlSchemaSetValidErrors(void) {
33838    int test_ret = 0;
33839
33840
33841    /* missing type support */
33842    return(test_ret);
33843}
33844
33845
33846static int
33847test_xmlSchemaSetValidOptions(void) {
33848    int test_ret = 0;
33849
33850#if defined(LIBXML_SCHEMAS_ENABLED)
33851    int mem_base;
33852    int ret_val;
33853    xmlSchemaValidCtxtPtr ctxt; /*  */
33854    int n_ctxt;
33855    int options; /*  */
33856    int n_options;
33857
33858    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33859    for (n_options = 0;n_options < gen_nb_int;n_options++) {
33860        mem_base = xmlMemBlocks();
33861        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33862        options = gen_int(n_options, 1);
33863
33864        ret_val = xmlSchemaSetValidOptions(ctxt, options);
33865        desret_int(ret_val);
33866        call_tests++;
33867        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33868        des_int(n_options, options, 1);
33869        xmlResetLastError();
33870        if (mem_base != xmlMemBlocks()) {
33871            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
33872	           xmlMemBlocks() - mem_base);
33873	    test_ret++;
33874            printf(" %d", n_ctxt);
33875            printf(" %d", n_options);
33876            printf("\n");
33877        }
33878    }
33879    }
33880    function_tests++;
33881#endif
33882
33883    return(test_ret);
33884}
33885
33886
33887static int
33888test_xmlSchemaSetValidStructuredErrors(void) {
33889    int test_ret = 0;
33890
33891
33892    /* missing type support */
33893    return(test_ret);
33894}
33895
33896
33897static int
33898test_xmlSchemaValidCtxtGetOptions(void) {
33899    int test_ret = 0;
33900
33901#if defined(LIBXML_SCHEMAS_ENABLED)
33902    int mem_base;
33903    int ret_val;
33904    xmlSchemaValidCtxtPtr ctxt; /*  */
33905    int n_ctxt;
33906
33907    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33908        mem_base = xmlMemBlocks();
33909        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33910
33911        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
33912        desret_int(ret_val);
33913        call_tests++;
33914        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33915        xmlResetLastError();
33916        if (mem_base != xmlMemBlocks()) {
33917            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
33918	           xmlMemBlocks() - mem_base);
33919	    test_ret++;
33920            printf(" %d", n_ctxt);
33921            printf("\n");
33922        }
33923    }
33924    function_tests++;
33925#endif
33926
33927    return(test_ret);
33928}
33929
33930
33931static int
33932test_xmlSchemaValidateDoc(void) {
33933    int test_ret = 0;
33934
33935#if defined(LIBXML_SCHEMAS_ENABLED)
33936    int mem_base;
33937    int ret_val;
33938    xmlSchemaValidCtxtPtr ctxt; /*  */
33939    int n_ctxt;
33940    xmlDocPtr instance; /*  */
33941    int n_instance;
33942
33943    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33944    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
33945        mem_base = xmlMemBlocks();
33946        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33947        instance = gen_xmlDocPtr(n_instance, 1);
33948
33949        ret_val = xmlSchemaValidateDoc(ctxt, instance);
33950        desret_int(ret_val);
33951        call_tests++;
33952        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33953        des_xmlDocPtr(n_instance, instance, 1);
33954        xmlResetLastError();
33955        if (mem_base != xmlMemBlocks()) {
33956            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
33957	           xmlMemBlocks() - mem_base);
33958	    test_ret++;
33959            printf(" %d", n_ctxt);
33960            printf(" %d", n_instance);
33961            printf("\n");
33962        }
33963    }
33964    }
33965    function_tests++;
33966#endif
33967
33968    return(test_ret);
33969}
33970
33971
33972static int
33973test_xmlSchemaValidateFile(void) {
33974    int test_ret = 0;
33975
33976#if defined(LIBXML_SCHEMAS_ENABLED)
33977    int mem_base;
33978    int ret_val;
33979    xmlSchemaValidCtxtPtr ctxt; /*  */
33980    int n_ctxt;
33981    const char * filename; /*  */
33982    int n_filename;
33983    int options; /*  */
33984    int n_options;
33985
33986    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33987    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
33988    for (n_options = 0;n_options < gen_nb_int;n_options++) {
33989        mem_base = xmlMemBlocks();
33990        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33991        filename = gen_filepath(n_filename, 1);
33992        options = gen_int(n_options, 2);
33993
33994        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
33995        desret_int(ret_val);
33996        call_tests++;
33997        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33998        des_filepath(n_filename, filename, 1);
33999        des_int(n_options, options, 2);
34000        xmlResetLastError();
34001        if (mem_base != xmlMemBlocks()) {
34002            printf("Leak of %d blocks found in xmlSchemaValidateFile",
34003	           xmlMemBlocks() - mem_base);
34004	    test_ret++;
34005            printf(" %d", n_ctxt);
34006            printf(" %d", n_filename);
34007            printf(" %d", n_options);
34008            printf("\n");
34009        }
34010    }
34011    }
34012    }
34013    function_tests++;
34014#endif
34015
34016    return(test_ret);
34017}
34018
34019
34020static int
34021test_xmlSchemaValidateOneElement(void) {
34022    int test_ret = 0;
34023
34024#if defined(LIBXML_SCHEMAS_ENABLED)
34025    int mem_base;
34026    int ret_val;
34027    xmlSchemaValidCtxtPtr ctxt; /*  */
34028    int n_ctxt;
34029    xmlNodePtr elem; /*  */
34030    int n_elem;
34031
34032    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34033    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34034        mem_base = xmlMemBlocks();
34035        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34036        elem = gen_xmlNodePtr(n_elem, 1);
34037
34038        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34039        desret_int(ret_val);
34040        call_tests++;
34041        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34042        des_xmlNodePtr(n_elem, elem, 1);
34043        xmlResetLastError();
34044        if (mem_base != xmlMemBlocks()) {
34045            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34046	           xmlMemBlocks() - mem_base);
34047	    test_ret++;
34048            printf(" %d", n_ctxt);
34049            printf(" %d", n_elem);
34050            printf("\n");
34051        }
34052    }
34053    }
34054    function_tests++;
34055#endif
34056
34057    return(test_ret);
34058}
34059
34060
34061static int
34062test_xmlSchemaValidateStream(void) {
34063    int test_ret = 0;
34064
34065#if defined(LIBXML_SCHEMAS_ENABLED)
34066    int mem_base;
34067    int ret_val;
34068    xmlSchemaValidCtxtPtr ctxt; /*  */
34069    int n_ctxt;
34070    xmlParserInputBufferPtr input; /*  */
34071    int n_input;
34072    xmlCharEncoding enc; /*  */
34073    int n_enc;
34074    xmlSAXHandlerPtr sax; /*  */
34075    int n_sax;
34076    void * user_data; /*  */
34077    int n_user_data;
34078
34079    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34080    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34081    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34082    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34083    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34084        mem_base = xmlMemBlocks();
34085        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34086        input = gen_xmlParserInputBufferPtr(n_input, 1);
34087        enc = gen_xmlCharEncoding(n_enc, 2);
34088        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34089        user_data = gen_userdata(n_user_data, 4);
34090
34091        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34092        desret_int(ret_val);
34093        call_tests++;
34094        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34095        des_xmlParserInputBufferPtr(n_input, input, 1);
34096        des_xmlCharEncoding(n_enc, enc, 2);
34097        des_xmlSAXHandlerPtr(n_sax, sax, 3);
34098        des_userdata(n_user_data, user_data, 4);
34099        xmlResetLastError();
34100        if (mem_base != xmlMemBlocks()) {
34101            printf("Leak of %d blocks found in xmlSchemaValidateStream",
34102	           xmlMemBlocks() - mem_base);
34103	    test_ret++;
34104            printf(" %d", n_ctxt);
34105            printf(" %d", n_input);
34106            printf(" %d", n_enc);
34107            printf(" %d", n_sax);
34108            printf(" %d", n_user_data);
34109            printf("\n");
34110        }
34111    }
34112    }
34113    }
34114    }
34115    }
34116    function_tests++;
34117#endif
34118
34119    return(test_ret);
34120}
34121
34122static int
34123test_xmlschemas(void) {
34124    int test_ret = 0;
34125
34126    if (quiet == 0) printf("Testing xmlschemas : 14 of 24 functions ...\n");
34127    test_ret += test_xmlSchemaDump();
34128    test_ret += test_xmlSchemaGetParserErrors();
34129    test_ret += test_xmlSchemaGetValidErrors();
34130    test_ret += test_xmlSchemaIsValid();
34131    test_ret += test_xmlSchemaNewDocParserCtxt();
34132    test_ret += test_xmlSchemaNewMemParserCtxt();
34133    test_ret += test_xmlSchemaNewParserCtxt();
34134    test_ret += test_xmlSchemaNewValidCtxt();
34135    test_ret += test_xmlSchemaParse();
34136    test_ret += test_xmlSchemaSAXPlug();
34137    test_ret += test_xmlSchemaSAXUnplug();
34138    test_ret += test_xmlSchemaSetParserErrors();
34139    test_ret += test_xmlSchemaSetParserStructuredErrors();
34140    test_ret += test_xmlSchemaSetValidErrors();
34141    test_ret += test_xmlSchemaSetValidOptions();
34142    test_ret += test_xmlSchemaSetValidStructuredErrors();
34143    test_ret += test_xmlSchemaValidCtxtGetOptions();
34144    test_ret += test_xmlSchemaValidateDoc();
34145    test_ret += test_xmlSchemaValidateFile();
34146    test_ret += test_xmlSchemaValidateOneElement();
34147    test_ret += test_xmlSchemaValidateStream();
34148
34149    if (test_ret != 0)
34150	printf("Module xmlschemas: %d errors\n", test_ret);
34151    return(test_ret);
34152}
34153#ifdef LIBXML_SCHEMAS_ENABLED
34154
34155#define gen_nb_xmlSchemaFacetPtr 1
34156static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34157    return(NULL);
34158}
34159static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34160}
34161#endif
34162
34163#ifdef LIBXML_SCHEMAS_ENABLED
34164
34165#define gen_nb_xmlSchemaTypePtr 1
34166static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34167    return(NULL);
34168}
34169static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34170}
34171#endif
34172
34173
34174static int
34175test_xmlSchemaCheckFacet(void) {
34176    int test_ret = 0;
34177
34178#if defined(LIBXML_SCHEMAS_ENABLED)
34179    int mem_base;
34180    int ret_val;
34181    xmlSchemaFacetPtr facet; /* the facet */
34182    int n_facet;
34183    xmlSchemaTypePtr typeDecl; /* the schema type definition */
34184    int n_typeDecl;
34185    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34186    int n_pctxt;
34187    xmlChar * name; /* the optional name of the type */
34188    int n_name;
34189
34190    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34191    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34192    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34193    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34194        mem_base = xmlMemBlocks();
34195        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34196        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34197        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34198        name = gen_const_xmlChar_ptr(n_name, 3);
34199
34200        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34201        desret_int(ret_val);
34202        call_tests++;
34203        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34204        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34205        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34206        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34207        xmlResetLastError();
34208        if (mem_base != xmlMemBlocks()) {
34209            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34210	           xmlMemBlocks() - mem_base);
34211	    test_ret++;
34212            printf(" %d", n_facet);
34213            printf(" %d", n_typeDecl);
34214            printf(" %d", n_pctxt);
34215            printf(" %d", n_name);
34216            printf("\n");
34217        }
34218    }
34219    }
34220    }
34221    }
34222    function_tests++;
34223#endif
34224
34225    return(test_ret);
34226}
34227
34228
34229static int
34230test_xmlSchemaCleanupTypes(void) {
34231    int test_ret = 0;
34232
34233#if defined(LIBXML_SCHEMAS_ENABLED)
34234
34235
34236        xmlSchemaCleanupTypes();
34237        call_tests++;
34238        xmlResetLastError();
34239    function_tests++;
34240#endif
34241
34242    return(test_ret);
34243}
34244
34245
34246static int
34247test_xmlSchemaCollapseString(void) {
34248    int test_ret = 0;
34249
34250#if defined(LIBXML_SCHEMAS_ENABLED)
34251    int mem_base;
34252    xmlChar * ret_val;
34253    xmlChar * value; /* a value */
34254    int n_value;
34255
34256    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34257        mem_base = xmlMemBlocks();
34258        value = gen_const_xmlChar_ptr(n_value, 0);
34259
34260        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34261        desret_xmlChar_ptr(ret_val);
34262        call_tests++;
34263        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34264        xmlResetLastError();
34265        if (mem_base != xmlMemBlocks()) {
34266            printf("Leak of %d blocks found in xmlSchemaCollapseString",
34267	           xmlMemBlocks() - mem_base);
34268	    test_ret++;
34269            printf(" %d", n_value);
34270            printf("\n");
34271        }
34272    }
34273    function_tests++;
34274#endif
34275
34276    return(test_ret);
34277}
34278
34279#ifdef LIBXML_SCHEMAS_ENABLED
34280
34281#define gen_nb_xmlSchemaValPtr 1
34282static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34283    return(NULL);
34284}
34285static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34286}
34287#endif
34288
34289
34290static int
34291test_xmlSchemaCompareValues(void) {
34292    int test_ret = 0;
34293
34294#if defined(LIBXML_SCHEMAS_ENABLED)
34295    int mem_base;
34296    int ret_val;
34297    xmlSchemaValPtr x; /* a first value */
34298    int n_x;
34299    xmlSchemaValPtr y; /* a second value */
34300    int n_y;
34301
34302    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34303    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34304        mem_base = xmlMemBlocks();
34305        x = gen_xmlSchemaValPtr(n_x, 0);
34306        y = gen_xmlSchemaValPtr(n_y, 1);
34307
34308        ret_val = xmlSchemaCompareValues(x, y);
34309        desret_int(ret_val);
34310        call_tests++;
34311        des_xmlSchemaValPtr(n_x, x, 0);
34312        des_xmlSchemaValPtr(n_y, y, 1);
34313        xmlResetLastError();
34314        if (mem_base != xmlMemBlocks()) {
34315            printf("Leak of %d blocks found in xmlSchemaCompareValues",
34316	           xmlMemBlocks() - mem_base);
34317	    test_ret++;
34318            printf(" %d", n_x);
34319            printf(" %d", n_y);
34320            printf("\n");
34321        }
34322    }
34323    }
34324    function_tests++;
34325#endif
34326
34327    return(test_ret);
34328}
34329
34330
34331static int
34332test_xmlSchemaCompareValuesWhtsp(void) {
34333    int test_ret = 0;
34334
34335#if defined(LIBXML_SCHEMAS_ENABLED)
34336    int mem_base;
34337    int ret_val;
34338    xmlSchemaValPtr x; /* a first value */
34339    int n_x;
34340    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34341    int n_xws;
34342    xmlSchemaValPtr y; /* a second value */
34343    int n_y;
34344    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34345    int n_yws;
34346
34347    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34348    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34349    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34350    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34351        mem_base = xmlMemBlocks();
34352        x = gen_xmlSchemaValPtr(n_x, 0);
34353        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34354        y = gen_xmlSchemaValPtr(n_y, 2);
34355        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34356
34357        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34358        desret_int(ret_val);
34359        call_tests++;
34360        des_xmlSchemaValPtr(n_x, x, 0);
34361        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34362        des_xmlSchemaValPtr(n_y, y, 2);
34363        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34364        xmlResetLastError();
34365        if (mem_base != xmlMemBlocks()) {
34366            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34367	           xmlMemBlocks() - mem_base);
34368	    test_ret++;
34369            printf(" %d", n_x);
34370            printf(" %d", n_xws);
34371            printf(" %d", n_y);
34372            printf(" %d", n_yws);
34373            printf("\n");
34374        }
34375    }
34376    }
34377    }
34378    }
34379    function_tests++;
34380#endif
34381
34382    return(test_ret);
34383}
34384
34385
34386static int
34387test_xmlSchemaCopyValue(void) {
34388    int test_ret = 0;
34389
34390
34391    /* missing type support */
34392    return(test_ret);
34393}
34394
34395
34396static int
34397test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34398    int test_ret = 0;
34399
34400#if defined(LIBXML_SCHEMAS_ENABLED)
34401    int mem_base;
34402    xmlSchemaTypePtr ret_val;
34403    xmlSchemaTypePtr type; /* the built-in simple type. */
34404    int n_type;
34405
34406    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34407        mem_base = xmlMemBlocks();
34408        type = gen_xmlSchemaTypePtr(n_type, 0);
34409
34410        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34411        desret_xmlSchemaTypePtr(ret_val);
34412        call_tests++;
34413        des_xmlSchemaTypePtr(n_type, type, 0);
34414        xmlResetLastError();
34415        if (mem_base != xmlMemBlocks()) {
34416            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34417	           xmlMemBlocks() - mem_base);
34418	    test_ret++;
34419            printf(" %d", n_type);
34420            printf("\n");
34421        }
34422    }
34423    function_tests++;
34424#endif
34425
34426    return(test_ret);
34427}
34428
34429
34430static int
34431test_xmlSchemaGetBuiltInType(void) {
34432    int test_ret = 0;
34433
34434#if defined(LIBXML_SCHEMAS_ENABLED)
34435    xmlSchemaTypePtr ret_val;
34436    xmlSchemaValType type; /* the type of the built in type */
34437    int n_type;
34438
34439    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34440        type = gen_xmlSchemaValType(n_type, 0);
34441
34442        ret_val = xmlSchemaGetBuiltInType(type);
34443        desret_xmlSchemaTypePtr(ret_val);
34444        call_tests++;
34445        des_xmlSchemaValType(n_type, type, 0);
34446        xmlResetLastError();
34447    }
34448    function_tests++;
34449#endif
34450
34451    return(test_ret);
34452}
34453
34454
34455static int
34456test_xmlSchemaGetCanonValue(void) {
34457    int test_ret = 0;
34458
34459#if defined(LIBXML_SCHEMAS_ENABLED)
34460    int mem_base;
34461    int ret_val;
34462    xmlSchemaValPtr val; /* the precomputed value */
34463    int n_val;
34464    xmlChar ** retValue; /* the returned value */
34465    int n_retValue;
34466
34467    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34468    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34469        mem_base = xmlMemBlocks();
34470        val = gen_xmlSchemaValPtr(n_val, 0);
34471        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34472
34473        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34474        desret_int(ret_val);
34475        call_tests++;
34476        des_xmlSchemaValPtr(n_val, val, 0);
34477        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34478        xmlResetLastError();
34479        if (mem_base != xmlMemBlocks()) {
34480            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34481	           xmlMemBlocks() - mem_base);
34482	    test_ret++;
34483            printf(" %d", n_val);
34484            printf(" %d", n_retValue);
34485            printf("\n");
34486        }
34487    }
34488    }
34489    function_tests++;
34490#endif
34491
34492    return(test_ret);
34493}
34494
34495
34496static int
34497test_xmlSchemaGetCanonValueWhtsp(void) {
34498    int test_ret = 0;
34499
34500#if defined(LIBXML_SCHEMAS_ENABLED)
34501    int mem_base;
34502    int ret_val;
34503    xmlSchemaValPtr val; /* the precomputed value */
34504    int n_val;
34505    xmlChar ** retValue; /* the returned value */
34506    int n_retValue;
34507    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34508    int n_ws;
34509
34510    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34511    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34512    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34513        mem_base = xmlMemBlocks();
34514        val = gen_xmlSchemaValPtr(n_val, 0);
34515        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34516        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34517
34518        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34519        desret_int(ret_val);
34520        call_tests++;
34521        des_xmlSchemaValPtr(n_val, val, 0);
34522        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34523        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34524        xmlResetLastError();
34525        if (mem_base != xmlMemBlocks()) {
34526            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34527	           xmlMemBlocks() - mem_base);
34528	    test_ret++;
34529            printf(" %d", n_val);
34530            printf(" %d", n_retValue);
34531            printf(" %d", n_ws);
34532            printf("\n");
34533        }
34534    }
34535    }
34536    }
34537    function_tests++;
34538#endif
34539
34540    return(test_ret);
34541}
34542
34543
34544static int
34545test_xmlSchemaGetFacetValueAsULong(void) {
34546    int test_ret = 0;
34547
34548#if defined(LIBXML_SCHEMAS_ENABLED)
34549    int mem_base;
34550    unsigned long ret_val;
34551    xmlSchemaFacetPtr facet; /* an schemas type facet */
34552    int n_facet;
34553
34554    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34555        mem_base = xmlMemBlocks();
34556        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34557
34558        ret_val = xmlSchemaGetFacetValueAsULong(facet);
34559        desret_unsigned_long(ret_val);
34560        call_tests++;
34561        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34562        xmlResetLastError();
34563        if (mem_base != xmlMemBlocks()) {
34564            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34565	           xmlMemBlocks() - mem_base);
34566	    test_ret++;
34567            printf(" %d", n_facet);
34568            printf("\n");
34569        }
34570    }
34571    function_tests++;
34572#endif
34573
34574    return(test_ret);
34575}
34576
34577
34578static int
34579test_xmlSchemaGetPredefinedType(void) {
34580    int test_ret = 0;
34581
34582#if defined(LIBXML_SCHEMAS_ENABLED)
34583    int mem_base;
34584    xmlSchemaTypePtr ret_val;
34585    xmlChar * name; /* the type name */
34586    int n_name;
34587    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34588    int n_ns;
34589
34590    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34591    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34592        mem_base = xmlMemBlocks();
34593        name = gen_const_xmlChar_ptr(n_name, 0);
34594        ns = gen_const_xmlChar_ptr(n_ns, 1);
34595
34596        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34597        desret_xmlSchemaTypePtr(ret_val);
34598        call_tests++;
34599        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34600        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34601        xmlResetLastError();
34602        if (mem_base != xmlMemBlocks()) {
34603            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34604	           xmlMemBlocks() - mem_base);
34605	    test_ret++;
34606            printf(" %d", n_name);
34607            printf(" %d", n_ns);
34608            printf("\n");
34609        }
34610    }
34611    }
34612    function_tests++;
34613#endif
34614
34615    return(test_ret);
34616}
34617
34618
34619static int
34620test_xmlSchemaGetValType(void) {
34621    int test_ret = 0;
34622
34623#if defined(LIBXML_SCHEMAS_ENABLED)
34624    int mem_base;
34625    xmlSchemaValType ret_val;
34626    xmlSchemaValPtr val; /* a schemas value */
34627    int n_val;
34628
34629    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34630        mem_base = xmlMemBlocks();
34631        val = gen_xmlSchemaValPtr(n_val, 0);
34632
34633        ret_val = xmlSchemaGetValType(val);
34634        desret_xmlSchemaValType(ret_val);
34635        call_tests++;
34636        des_xmlSchemaValPtr(n_val, val, 0);
34637        xmlResetLastError();
34638        if (mem_base != xmlMemBlocks()) {
34639            printf("Leak of %d blocks found in xmlSchemaGetValType",
34640	           xmlMemBlocks() - mem_base);
34641	    test_ret++;
34642            printf(" %d", n_val);
34643            printf("\n");
34644        }
34645    }
34646    function_tests++;
34647#endif
34648
34649    return(test_ret);
34650}
34651
34652
34653static int
34654test_xmlSchemaInitTypes(void) {
34655    int test_ret = 0;
34656
34657#if defined(LIBXML_SCHEMAS_ENABLED)
34658
34659
34660        xmlSchemaInitTypes();
34661        call_tests++;
34662        xmlResetLastError();
34663    function_tests++;
34664#endif
34665
34666    return(test_ret);
34667}
34668
34669
34670static int
34671test_xmlSchemaIsBuiltInTypeFacet(void) {
34672    int test_ret = 0;
34673
34674#if defined(LIBXML_SCHEMAS_ENABLED)
34675    int mem_base;
34676    int ret_val;
34677    xmlSchemaTypePtr type; /* the built-in type */
34678    int n_type;
34679    int facetType; /* the facet type */
34680    int n_facetType;
34681
34682    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34683    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34684        mem_base = xmlMemBlocks();
34685        type = gen_xmlSchemaTypePtr(n_type, 0);
34686        facetType = gen_int(n_facetType, 1);
34687
34688        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34689        desret_int(ret_val);
34690        call_tests++;
34691        des_xmlSchemaTypePtr(n_type, type, 0);
34692        des_int(n_facetType, facetType, 1);
34693        xmlResetLastError();
34694        if (mem_base != xmlMemBlocks()) {
34695            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34696	           xmlMemBlocks() - mem_base);
34697	    test_ret++;
34698            printf(" %d", n_type);
34699            printf(" %d", n_facetType);
34700            printf("\n");
34701        }
34702    }
34703    }
34704    function_tests++;
34705#endif
34706
34707    return(test_ret);
34708}
34709
34710
34711static int
34712test_xmlSchemaNewFacet(void) {
34713    int test_ret = 0;
34714
34715
34716    /* missing type support */
34717    return(test_ret);
34718}
34719
34720
34721static int
34722test_xmlSchemaNewNOTATIONValue(void) {
34723    int test_ret = 0;
34724
34725
34726    /* missing type support */
34727    return(test_ret);
34728}
34729
34730
34731static int
34732test_xmlSchemaNewQNameValue(void) {
34733    int test_ret = 0;
34734
34735
34736    /* missing type support */
34737    return(test_ret);
34738}
34739
34740
34741static int
34742test_xmlSchemaNewStringValue(void) {
34743    int test_ret = 0;
34744
34745
34746    /* missing type support */
34747    return(test_ret);
34748}
34749
34750#ifdef LIBXML_SCHEMAS_ENABLED
34751
34752#define gen_nb_xmlSchemaValPtr_ptr 1
34753static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34754    return(NULL);
34755}
34756static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34757}
34758#endif
34759
34760
34761static int
34762test_xmlSchemaValPredefTypeNode(void) {
34763    int test_ret = 0;
34764
34765#if defined(LIBXML_SCHEMAS_ENABLED)
34766    int mem_base;
34767    int ret_val;
34768    xmlSchemaTypePtr type; /* the predefined type */
34769    int n_type;
34770    xmlChar * value; /* the value to check */
34771    int n_value;
34772    xmlSchemaValPtr * val; /* the return computed value */
34773    int n_val;
34774    xmlNodePtr node; /* the node containing the value */
34775    int n_node;
34776
34777    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34778    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34779    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34780    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34781        mem_base = xmlMemBlocks();
34782        type = gen_xmlSchemaTypePtr(n_type, 0);
34783        value = gen_const_xmlChar_ptr(n_value, 1);
34784        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34785        node = gen_xmlNodePtr(n_node, 3);
34786
34787        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
34788        desret_int(ret_val);
34789        call_tests++;
34790        des_xmlSchemaTypePtr(n_type, type, 0);
34791        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34792        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34793        des_xmlNodePtr(n_node, node, 3);
34794        xmlResetLastError();
34795        if (mem_base != xmlMemBlocks()) {
34796            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
34797	           xmlMemBlocks() - mem_base);
34798	    test_ret++;
34799            printf(" %d", n_type);
34800            printf(" %d", n_value);
34801            printf(" %d", n_val);
34802            printf(" %d", n_node);
34803            printf("\n");
34804        }
34805    }
34806    }
34807    }
34808    }
34809    function_tests++;
34810#endif
34811
34812    return(test_ret);
34813}
34814
34815
34816static int
34817test_xmlSchemaValPredefTypeNodeNoNorm(void) {
34818    int test_ret = 0;
34819
34820#if defined(LIBXML_SCHEMAS_ENABLED)
34821    int mem_base;
34822    int ret_val;
34823    xmlSchemaTypePtr type; /* the predefined type */
34824    int n_type;
34825    xmlChar * value; /* the value to check */
34826    int n_value;
34827    xmlSchemaValPtr * val; /* the return computed value */
34828    int n_val;
34829    xmlNodePtr node; /* the node containing the value */
34830    int n_node;
34831
34832    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34833    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34834    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34835    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34836        mem_base = xmlMemBlocks();
34837        type = gen_xmlSchemaTypePtr(n_type, 0);
34838        value = gen_const_xmlChar_ptr(n_value, 1);
34839        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34840        node = gen_xmlNodePtr(n_node, 3);
34841
34842        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
34843        desret_int(ret_val);
34844        call_tests++;
34845        des_xmlSchemaTypePtr(n_type, type, 0);
34846        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34847        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34848        des_xmlNodePtr(n_node, node, 3);
34849        xmlResetLastError();
34850        if (mem_base != xmlMemBlocks()) {
34851            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
34852	           xmlMemBlocks() - mem_base);
34853	    test_ret++;
34854            printf(" %d", n_type);
34855            printf(" %d", n_value);
34856            printf(" %d", n_val);
34857            printf(" %d", n_node);
34858            printf("\n");
34859        }
34860    }
34861    }
34862    }
34863    }
34864    function_tests++;
34865#endif
34866
34867    return(test_ret);
34868}
34869
34870
34871static int
34872test_xmlSchemaValidateFacet(void) {
34873    int test_ret = 0;
34874
34875#if defined(LIBXML_SCHEMAS_ENABLED)
34876    int mem_base;
34877    int ret_val;
34878    xmlSchemaTypePtr base; /* the base type */
34879    int n_base;
34880    xmlSchemaFacetPtr facet; /* the facet to check */
34881    int n_facet;
34882    xmlChar * value; /* the lexical repr of the value to validate */
34883    int n_value;
34884    xmlSchemaValPtr val; /* the precomputed value */
34885    int n_val;
34886
34887    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
34888    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34889    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34890    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34891        mem_base = xmlMemBlocks();
34892        base = gen_xmlSchemaTypePtr(n_base, 0);
34893        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
34894        value = gen_const_xmlChar_ptr(n_value, 2);
34895        val = gen_xmlSchemaValPtr(n_val, 3);
34896
34897        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
34898        desret_int(ret_val);
34899        call_tests++;
34900        des_xmlSchemaTypePtr(n_base, base, 0);
34901        des_xmlSchemaFacetPtr(n_facet, facet, 1);
34902        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
34903        des_xmlSchemaValPtr(n_val, val, 3);
34904        xmlResetLastError();
34905        if (mem_base != xmlMemBlocks()) {
34906            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
34907	           xmlMemBlocks() - mem_base);
34908	    test_ret++;
34909            printf(" %d", n_base);
34910            printf(" %d", n_facet);
34911            printf(" %d", n_value);
34912            printf(" %d", n_val);
34913            printf("\n");
34914        }
34915    }
34916    }
34917    }
34918    }
34919    function_tests++;
34920#endif
34921
34922    return(test_ret);
34923}
34924
34925
34926static int
34927test_xmlSchemaValidateFacetWhtsp(void) {
34928    int test_ret = 0;
34929
34930#if defined(LIBXML_SCHEMAS_ENABLED)
34931    int mem_base;
34932    int ret_val;
34933    xmlSchemaFacetPtr facet; /* the facet to check */
34934    int n_facet;
34935    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
34936    int n_fws;
34937    xmlSchemaValType valType; /* the built-in type of the value */
34938    int n_valType;
34939    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
34940    int n_value;
34941    xmlSchemaValPtr val; /* the precomputed value */
34942    int n_val;
34943    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34944    int n_ws;
34945
34946    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34947    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
34948    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
34949    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34950    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34951    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34952        mem_base = xmlMemBlocks();
34953        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34954        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
34955        valType = gen_xmlSchemaValType(n_valType, 2);
34956        value = gen_const_xmlChar_ptr(n_value, 3);
34957        val = gen_xmlSchemaValPtr(n_val, 4);
34958        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
34959
34960        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
34961        desret_int(ret_val);
34962        call_tests++;
34963        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34964        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
34965        des_xmlSchemaValType(n_valType, valType, 2);
34966        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
34967        des_xmlSchemaValPtr(n_val, val, 4);
34968        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
34969        xmlResetLastError();
34970        if (mem_base != xmlMemBlocks()) {
34971            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
34972	           xmlMemBlocks() - mem_base);
34973	    test_ret++;
34974            printf(" %d", n_facet);
34975            printf(" %d", n_fws);
34976            printf(" %d", n_valType);
34977            printf(" %d", n_value);
34978            printf(" %d", n_val);
34979            printf(" %d", n_ws);
34980            printf("\n");
34981        }
34982    }
34983    }
34984    }
34985    }
34986    }
34987    }
34988    function_tests++;
34989#endif
34990
34991    return(test_ret);
34992}
34993
34994
34995static int
34996test_xmlSchemaValidateLengthFacet(void) {
34997    int test_ret = 0;
34998
34999#if defined(LIBXML_SCHEMAS_ENABLED)
35000    int mem_base;
35001    int ret_val;
35002    xmlSchemaTypePtr type; /* the built-in type */
35003    int n_type;
35004    xmlSchemaFacetPtr facet; /* the facet to check */
35005    int n_facet;
35006    xmlChar * value; /* the lexical repr. of the value to be validated */
35007    int n_value;
35008    xmlSchemaValPtr val; /* the precomputed value */
35009    int n_val;
35010    unsigned long * length; /* the actual length of the value */
35011    int n_length;
35012
35013    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35014    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35015    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35016    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35017    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35018        mem_base = xmlMemBlocks();
35019        type = gen_xmlSchemaTypePtr(n_type, 0);
35020        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35021        value = gen_const_xmlChar_ptr(n_value, 2);
35022        val = gen_xmlSchemaValPtr(n_val, 3);
35023        length = gen_unsigned_long_ptr(n_length, 4);
35024
35025        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35026        desret_int(ret_val);
35027        call_tests++;
35028        des_xmlSchemaTypePtr(n_type, type, 0);
35029        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35030        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35031        des_xmlSchemaValPtr(n_val, val, 3);
35032        des_unsigned_long_ptr(n_length, length, 4);
35033        xmlResetLastError();
35034        if (mem_base != xmlMemBlocks()) {
35035            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35036	           xmlMemBlocks() - mem_base);
35037	    test_ret++;
35038            printf(" %d", n_type);
35039            printf(" %d", n_facet);
35040            printf(" %d", n_value);
35041            printf(" %d", n_val);
35042            printf(" %d", n_length);
35043            printf("\n");
35044        }
35045    }
35046    }
35047    }
35048    }
35049    }
35050    function_tests++;
35051#endif
35052
35053    return(test_ret);
35054}
35055
35056
35057static int
35058test_xmlSchemaValidateLengthFacetWhtsp(void) {
35059    int test_ret = 0;
35060
35061#if defined(LIBXML_SCHEMAS_ENABLED)
35062    int mem_base;
35063    int ret_val;
35064    xmlSchemaFacetPtr facet; /* the facet to check */
35065    int n_facet;
35066    xmlSchemaValType valType; /* the built-in type */
35067    int n_valType;
35068    xmlChar * value; /* the lexical repr. of the value to be validated */
35069    int n_value;
35070    xmlSchemaValPtr val; /* the precomputed value */
35071    int n_val;
35072    unsigned long * length; /* the actual length of the value */
35073    int n_length;
35074    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35075    int n_ws;
35076
35077    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35078    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35079    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35080    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35081    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35082    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35083        mem_base = xmlMemBlocks();
35084        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35085        valType = gen_xmlSchemaValType(n_valType, 1);
35086        value = gen_const_xmlChar_ptr(n_value, 2);
35087        val = gen_xmlSchemaValPtr(n_val, 3);
35088        length = gen_unsigned_long_ptr(n_length, 4);
35089        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35090
35091        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35092        desret_int(ret_val);
35093        call_tests++;
35094        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35095        des_xmlSchemaValType(n_valType, valType, 1);
35096        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35097        des_xmlSchemaValPtr(n_val, val, 3);
35098        des_unsigned_long_ptr(n_length, length, 4);
35099        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35100        xmlResetLastError();
35101        if (mem_base != xmlMemBlocks()) {
35102            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35103	           xmlMemBlocks() - mem_base);
35104	    test_ret++;
35105            printf(" %d", n_facet);
35106            printf(" %d", n_valType);
35107            printf(" %d", n_value);
35108            printf(" %d", n_val);
35109            printf(" %d", n_length);
35110            printf(" %d", n_ws);
35111            printf("\n");
35112        }
35113    }
35114    }
35115    }
35116    }
35117    }
35118    }
35119    function_tests++;
35120#endif
35121
35122    return(test_ret);
35123}
35124
35125
35126static int
35127test_xmlSchemaValidateListSimpleTypeFacet(void) {
35128    int test_ret = 0;
35129
35130#if defined(LIBXML_SCHEMAS_ENABLED)
35131    int mem_base;
35132    int ret_val;
35133    xmlSchemaFacetPtr facet; /* the facet to check */
35134    int n_facet;
35135    xmlChar * value; /* the lexical repr of the value to validate */
35136    int n_value;
35137    unsigned long actualLen; /* the number of list items */
35138    int n_actualLen;
35139    unsigned long * expectedLen; /* the resulting expected number of list items */
35140    int n_expectedLen;
35141
35142    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35143    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35144    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35145    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35146        mem_base = xmlMemBlocks();
35147        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35148        value = gen_const_xmlChar_ptr(n_value, 1);
35149        actualLen = gen_unsigned_long(n_actualLen, 2);
35150        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35151
35152        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35153        desret_int(ret_val);
35154        call_tests++;
35155        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35156        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35157        des_unsigned_long(n_actualLen, actualLen, 2);
35158        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35159        xmlResetLastError();
35160        if (mem_base != xmlMemBlocks()) {
35161            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35162	           xmlMemBlocks() - mem_base);
35163	    test_ret++;
35164            printf(" %d", n_facet);
35165            printf(" %d", n_value);
35166            printf(" %d", n_actualLen);
35167            printf(" %d", n_expectedLen);
35168            printf("\n");
35169        }
35170    }
35171    }
35172    }
35173    }
35174    function_tests++;
35175#endif
35176
35177    return(test_ret);
35178}
35179
35180
35181static int
35182test_xmlSchemaValidatePredefinedType(void) {
35183    int test_ret = 0;
35184
35185#if defined(LIBXML_SCHEMAS_ENABLED)
35186    int mem_base;
35187    int ret_val;
35188    xmlSchemaTypePtr type; /* the predefined type */
35189    int n_type;
35190    xmlChar * value; /* the value to check */
35191    int n_value;
35192    xmlSchemaValPtr * val; /* the return computed value */
35193    int n_val;
35194
35195    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35196    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35197    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35198        mem_base = xmlMemBlocks();
35199        type = gen_xmlSchemaTypePtr(n_type, 0);
35200        value = gen_const_xmlChar_ptr(n_value, 1);
35201        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35202
35203        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35204        desret_int(ret_val);
35205        call_tests++;
35206        des_xmlSchemaTypePtr(n_type, type, 0);
35207        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35208        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35209        xmlResetLastError();
35210        if (mem_base != xmlMemBlocks()) {
35211            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35212	           xmlMemBlocks() - mem_base);
35213	    test_ret++;
35214            printf(" %d", n_type);
35215            printf(" %d", n_value);
35216            printf(" %d", n_val);
35217            printf("\n");
35218        }
35219    }
35220    }
35221    }
35222    function_tests++;
35223#endif
35224
35225    return(test_ret);
35226}
35227
35228
35229static int
35230test_xmlSchemaValueAppend(void) {
35231    int test_ret = 0;
35232
35233#if defined(LIBXML_SCHEMAS_ENABLED)
35234    int mem_base;
35235    int ret_val;
35236    xmlSchemaValPtr prev; /* the value */
35237    int n_prev;
35238    xmlSchemaValPtr cur; /* the value to be appended */
35239    int n_cur;
35240
35241    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35242    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35243        mem_base = xmlMemBlocks();
35244        prev = gen_xmlSchemaValPtr(n_prev, 0);
35245        cur = gen_xmlSchemaValPtr(n_cur, 1);
35246
35247        ret_val = xmlSchemaValueAppend(prev, cur);
35248        desret_int(ret_val);
35249        call_tests++;
35250        des_xmlSchemaValPtr(n_prev, prev, 0);
35251        des_xmlSchemaValPtr(n_cur, cur, 1);
35252        xmlResetLastError();
35253        if (mem_base != xmlMemBlocks()) {
35254            printf("Leak of %d blocks found in xmlSchemaValueAppend",
35255	           xmlMemBlocks() - mem_base);
35256	    test_ret++;
35257            printf(" %d", n_prev);
35258            printf(" %d", n_cur);
35259            printf("\n");
35260        }
35261    }
35262    }
35263    function_tests++;
35264#endif
35265
35266    return(test_ret);
35267}
35268
35269
35270static int
35271test_xmlSchemaValueGetAsBoolean(void) {
35272    int test_ret = 0;
35273
35274#if defined(LIBXML_SCHEMAS_ENABLED)
35275    int mem_base;
35276    int ret_val;
35277    xmlSchemaValPtr val; /* the value */
35278    int n_val;
35279
35280    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35281        mem_base = xmlMemBlocks();
35282        val = gen_xmlSchemaValPtr(n_val, 0);
35283
35284        ret_val = xmlSchemaValueGetAsBoolean(val);
35285        desret_int(ret_val);
35286        call_tests++;
35287        des_xmlSchemaValPtr(n_val, val, 0);
35288        xmlResetLastError();
35289        if (mem_base != xmlMemBlocks()) {
35290            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35291	           xmlMemBlocks() - mem_base);
35292	    test_ret++;
35293            printf(" %d", n_val);
35294            printf("\n");
35295        }
35296    }
35297    function_tests++;
35298#endif
35299
35300    return(test_ret);
35301}
35302
35303
35304static int
35305test_xmlSchemaValueGetAsString(void) {
35306    int test_ret = 0;
35307
35308#if defined(LIBXML_SCHEMAS_ENABLED)
35309    int mem_base;
35310    const xmlChar * ret_val;
35311    xmlSchemaValPtr val; /* the value */
35312    int n_val;
35313
35314    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35315        mem_base = xmlMemBlocks();
35316        val = gen_xmlSchemaValPtr(n_val, 0);
35317
35318        ret_val = xmlSchemaValueGetAsString(val);
35319        desret_const_xmlChar_ptr(ret_val);
35320        call_tests++;
35321        des_xmlSchemaValPtr(n_val, val, 0);
35322        xmlResetLastError();
35323        if (mem_base != xmlMemBlocks()) {
35324            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35325	           xmlMemBlocks() - mem_base);
35326	    test_ret++;
35327            printf(" %d", n_val);
35328            printf("\n");
35329        }
35330    }
35331    function_tests++;
35332#endif
35333
35334    return(test_ret);
35335}
35336
35337
35338static int
35339test_xmlSchemaValueGetNext(void) {
35340    int test_ret = 0;
35341
35342
35343    /* missing type support */
35344    return(test_ret);
35345}
35346
35347
35348static int
35349test_xmlSchemaWhiteSpaceReplace(void) {
35350    int test_ret = 0;
35351
35352#if defined(LIBXML_SCHEMAS_ENABLED)
35353    int mem_base;
35354    xmlChar * ret_val;
35355    xmlChar * value; /* a value */
35356    int n_value;
35357
35358    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35359        mem_base = xmlMemBlocks();
35360        value = gen_const_xmlChar_ptr(n_value, 0);
35361
35362        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35363        desret_xmlChar_ptr(ret_val);
35364        call_tests++;
35365        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35366        xmlResetLastError();
35367        if (mem_base != xmlMemBlocks()) {
35368            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35369	           xmlMemBlocks() - mem_base);
35370	    test_ret++;
35371            printf(" %d", n_value);
35372            printf("\n");
35373        }
35374    }
35375    function_tests++;
35376#endif
35377
35378    return(test_ret);
35379}
35380
35381static int
35382test_xmlschemastypes(void) {
35383    int test_ret = 0;
35384
35385    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35386    test_ret += test_xmlSchemaCheckFacet();
35387    test_ret += test_xmlSchemaCleanupTypes();
35388    test_ret += test_xmlSchemaCollapseString();
35389    test_ret += test_xmlSchemaCompareValues();
35390    test_ret += test_xmlSchemaCompareValuesWhtsp();
35391    test_ret += test_xmlSchemaCopyValue();
35392    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35393    test_ret += test_xmlSchemaGetBuiltInType();
35394    test_ret += test_xmlSchemaGetCanonValue();
35395    test_ret += test_xmlSchemaGetCanonValueWhtsp();
35396    test_ret += test_xmlSchemaGetFacetValueAsULong();
35397    test_ret += test_xmlSchemaGetPredefinedType();
35398    test_ret += test_xmlSchemaGetValType();
35399    test_ret += test_xmlSchemaInitTypes();
35400    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35401    test_ret += test_xmlSchemaNewFacet();
35402    test_ret += test_xmlSchemaNewNOTATIONValue();
35403    test_ret += test_xmlSchemaNewQNameValue();
35404    test_ret += test_xmlSchemaNewStringValue();
35405    test_ret += test_xmlSchemaValPredefTypeNode();
35406    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35407    test_ret += test_xmlSchemaValidateFacet();
35408    test_ret += test_xmlSchemaValidateFacetWhtsp();
35409    test_ret += test_xmlSchemaValidateLengthFacet();
35410    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35411    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35412    test_ret += test_xmlSchemaValidatePredefinedType();
35413    test_ret += test_xmlSchemaValueAppend();
35414    test_ret += test_xmlSchemaValueGetAsBoolean();
35415    test_ret += test_xmlSchemaValueGetAsString();
35416    test_ret += test_xmlSchemaValueGetNext();
35417    test_ret += test_xmlSchemaWhiteSpaceReplace();
35418
35419    if (test_ret != 0)
35420	printf("Module xmlschemastypes: %d errors\n", test_ret);
35421    return(test_ret);
35422}
35423
35424static int
35425test_xmlCharStrdup(void) {
35426    int test_ret = 0;
35427
35428    int mem_base;
35429    xmlChar * ret_val;
35430    char * cur; /* the input char * */
35431    int n_cur;
35432
35433    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35434        mem_base = xmlMemBlocks();
35435        cur = gen_const_char_ptr(n_cur, 0);
35436
35437        ret_val = xmlCharStrdup((const char *)cur);
35438        desret_xmlChar_ptr(ret_val);
35439        call_tests++;
35440        des_const_char_ptr(n_cur, (const char *)cur, 0);
35441        xmlResetLastError();
35442        if (mem_base != xmlMemBlocks()) {
35443            printf("Leak of %d blocks found in xmlCharStrdup",
35444	           xmlMemBlocks() - mem_base);
35445	    test_ret++;
35446            printf(" %d", n_cur);
35447            printf("\n");
35448        }
35449    }
35450    function_tests++;
35451
35452    return(test_ret);
35453}
35454
35455
35456static int
35457test_xmlCharStrndup(void) {
35458    int test_ret = 0;
35459
35460    int mem_base;
35461    xmlChar * ret_val;
35462    char * cur; /* the input char * */
35463    int n_cur;
35464    int len; /* the len of @cur */
35465    int n_len;
35466
35467    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35468    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35469        mem_base = xmlMemBlocks();
35470        cur = gen_const_char_ptr(n_cur, 0);
35471        len = gen_int(n_len, 1);
35472
35473        ret_val = xmlCharStrndup((const char *)cur, len);
35474        desret_xmlChar_ptr(ret_val);
35475        call_tests++;
35476        des_const_char_ptr(n_cur, (const char *)cur, 0);
35477        des_int(n_len, len, 1);
35478        xmlResetLastError();
35479        if (mem_base != xmlMemBlocks()) {
35480            printf("Leak of %d blocks found in xmlCharStrndup",
35481	           xmlMemBlocks() - mem_base);
35482	    test_ret++;
35483            printf(" %d", n_cur);
35484            printf(" %d", n_len);
35485            printf("\n");
35486        }
35487    }
35488    }
35489    function_tests++;
35490
35491    return(test_ret);
35492}
35493
35494
35495static int
35496test_xmlCheckUTF8(void) {
35497    int test_ret = 0;
35498
35499    int mem_base;
35500    int ret_val;
35501    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35502    int n_utf;
35503
35504    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35505        mem_base = xmlMemBlocks();
35506        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35507
35508        ret_val = xmlCheckUTF8((const unsigned char *)utf);
35509        desret_int(ret_val);
35510        call_tests++;
35511        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35512        xmlResetLastError();
35513        if (mem_base != xmlMemBlocks()) {
35514            printf("Leak of %d blocks found in xmlCheckUTF8",
35515	           xmlMemBlocks() - mem_base);
35516	    test_ret++;
35517            printf(" %d", n_utf);
35518            printf("\n");
35519        }
35520    }
35521    function_tests++;
35522
35523    return(test_ret);
35524}
35525
35526
35527static int
35528test_xmlGetUTF8Char(void) {
35529    int test_ret = 0;
35530
35531    int mem_base;
35532    int ret_val;
35533    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35534    int n_utf;
35535    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. */
35536    int n_len;
35537
35538    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35539    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35540        mem_base = xmlMemBlocks();
35541        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35542        len = gen_int_ptr(n_len, 1);
35543
35544        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35545        desret_int(ret_val);
35546        call_tests++;
35547        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35548        des_int_ptr(n_len, len, 1);
35549        xmlResetLastError();
35550        if (mem_base != xmlMemBlocks()) {
35551            printf("Leak of %d blocks found in xmlGetUTF8Char",
35552	           xmlMemBlocks() - mem_base);
35553	    test_ret++;
35554            printf(" %d", n_utf);
35555            printf(" %d", n_len);
35556            printf("\n");
35557        }
35558    }
35559    }
35560    function_tests++;
35561
35562    return(test_ret);
35563}
35564
35565
35566static int
35567test_xmlStrEqual(void) {
35568    int test_ret = 0;
35569
35570    int mem_base;
35571    int ret_val;
35572    xmlChar * str1; /* the first xmlChar * */
35573    int n_str1;
35574    xmlChar * str2; /* the second xmlChar * */
35575    int n_str2;
35576
35577    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35578    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35579        mem_base = xmlMemBlocks();
35580        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35581        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35582
35583        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35584        desret_int(ret_val);
35585        call_tests++;
35586        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35587        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35588        xmlResetLastError();
35589        if (mem_base != xmlMemBlocks()) {
35590            printf("Leak of %d blocks found in xmlStrEqual",
35591	           xmlMemBlocks() - mem_base);
35592	    test_ret++;
35593            printf(" %d", n_str1);
35594            printf(" %d", n_str2);
35595            printf("\n");
35596        }
35597    }
35598    }
35599    function_tests++;
35600
35601    return(test_ret);
35602}
35603
35604
35605static int
35606test_xmlStrPrintf(void) {
35607    int test_ret = 0;
35608
35609
35610    /* missing type support */
35611    return(test_ret);
35612}
35613
35614
35615static int
35616test_xmlStrQEqual(void) {
35617    int test_ret = 0;
35618
35619    int mem_base;
35620    int ret_val;
35621    xmlChar * pref; /* the prefix of the QName */
35622    int n_pref;
35623    xmlChar * name; /* the localname of the QName */
35624    int n_name;
35625    xmlChar * str; /* the second xmlChar * */
35626    int n_str;
35627
35628    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35629    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35630    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35631        mem_base = xmlMemBlocks();
35632        pref = gen_const_xmlChar_ptr(n_pref, 0);
35633        name = gen_const_xmlChar_ptr(n_name, 1);
35634        str = gen_const_xmlChar_ptr(n_str, 2);
35635
35636        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35637        desret_int(ret_val);
35638        call_tests++;
35639        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35640        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35641        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35642        xmlResetLastError();
35643        if (mem_base != xmlMemBlocks()) {
35644            printf("Leak of %d blocks found in xmlStrQEqual",
35645	           xmlMemBlocks() - mem_base);
35646	    test_ret++;
35647            printf(" %d", n_pref);
35648            printf(" %d", n_name);
35649            printf(" %d", n_str);
35650            printf("\n");
35651        }
35652    }
35653    }
35654    }
35655    function_tests++;
35656
35657    return(test_ret);
35658}
35659
35660
35661static int
35662test_xmlStrVPrintf(void) {
35663    int test_ret = 0;
35664
35665
35666    /* missing type support */
35667    return(test_ret);
35668}
35669
35670
35671static int
35672test_xmlStrcasecmp(void) {
35673    int test_ret = 0;
35674
35675    int mem_base;
35676    int ret_val;
35677    xmlChar * str1; /* the first xmlChar * */
35678    int n_str1;
35679    xmlChar * str2; /* the second xmlChar * */
35680    int n_str2;
35681
35682    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35683    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35684        mem_base = xmlMemBlocks();
35685        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35686        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35687
35688        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35689        desret_int(ret_val);
35690        call_tests++;
35691        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35692        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35693        xmlResetLastError();
35694        if (mem_base != xmlMemBlocks()) {
35695            printf("Leak of %d blocks found in xmlStrcasecmp",
35696	           xmlMemBlocks() - mem_base);
35697	    test_ret++;
35698            printf(" %d", n_str1);
35699            printf(" %d", n_str2);
35700            printf("\n");
35701        }
35702    }
35703    }
35704    function_tests++;
35705
35706    return(test_ret);
35707}
35708
35709
35710static int
35711test_xmlStrcasestr(void) {
35712    int test_ret = 0;
35713
35714    int mem_base;
35715    const xmlChar * ret_val;
35716    xmlChar * str; /* the xmlChar * array (haystack) */
35717    int n_str;
35718    xmlChar * val; /* the xmlChar to search (needle) */
35719    int n_val;
35720
35721    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35722    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35723        mem_base = xmlMemBlocks();
35724        str = gen_const_xmlChar_ptr(n_str, 0);
35725        val = gen_xmlChar_ptr(n_val, 1);
35726
35727        ret_val = xmlStrcasestr((const xmlChar *)str, val);
35728        desret_const_xmlChar_ptr(ret_val);
35729        call_tests++;
35730        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35731        des_xmlChar_ptr(n_val, val, 1);
35732        xmlResetLastError();
35733        if (mem_base != xmlMemBlocks()) {
35734            printf("Leak of %d blocks found in xmlStrcasestr",
35735	           xmlMemBlocks() - mem_base);
35736	    test_ret++;
35737            printf(" %d", n_str);
35738            printf(" %d", n_val);
35739            printf("\n");
35740        }
35741    }
35742    }
35743    function_tests++;
35744
35745    return(test_ret);
35746}
35747
35748
35749static int
35750test_xmlStrchr(void) {
35751    int test_ret = 0;
35752
35753    int mem_base;
35754    const xmlChar * ret_val;
35755    xmlChar * str; /* the xmlChar * array */
35756    int n_str;
35757    xmlChar val; /* the xmlChar to search */
35758    int n_val;
35759
35760    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35761    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
35762        mem_base = xmlMemBlocks();
35763        str = gen_const_xmlChar_ptr(n_str, 0);
35764        val = gen_xmlChar(n_val, 1);
35765
35766        ret_val = xmlStrchr((const xmlChar *)str, val);
35767        desret_const_xmlChar_ptr(ret_val);
35768        call_tests++;
35769        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35770        des_xmlChar(n_val, val, 1);
35771        xmlResetLastError();
35772        if (mem_base != xmlMemBlocks()) {
35773            printf("Leak of %d blocks found in xmlStrchr",
35774	           xmlMemBlocks() - mem_base);
35775	    test_ret++;
35776            printf(" %d", n_str);
35777            printf(" %d", n_val);
35778            printf("\n");
35779        }
35780    }
35781    }
35782    function_tests++;
35783
35784    return(test_ret);
35785}
35786
35787
35788static int
35789test_xmlStrcmp(void) {
35790    int test_ret = 0;
35791
35792    int mem_base;
35793    int ret_val;
35794    xmlChar * str1; /* the first xmlChar * */
35795    int n_str1;
35796    xmlChar * str2; /* the second xmlChar * */
35797    int n_str2;
35798
35799    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35800    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35801        mem_base = xmlMemBlocks();
35802        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35803        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35804
35805        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
35806        desret_int(ret_val);
35807        call_tests++;
35808        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35809        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35810        xmlResetLastError();
35811        if (mem_base != xmlMemBlocks()) {
35812            printf("Leak of %d blocks found in xmlStrcmp",
35813	           xmlMemBlocks() - mem_base);
35814	    test_ret++;
35815            printf(" %d", n_str1);
35816            printf(" %d", n_str2);
35817            printf("\n");
35818        }
35819    }
35820    }
35821    function_tests++;
35822
35823    return(test_ret);
35824}
35825
35826
35827static int
35828test_xmlStrdup(void) {
35829    int test_ret = 0;
35830
35831    int mem_base;
35832    xmlChar * ret_val;
35833    xmlChar * cur; /* the input xmlChar * */
35834    int n_cur;
35835
35836    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
35837        mem_base = xmlMemBlocks();
35838        cur = gen_const_xmlChar_ptr(n_cur, 0);
35839
35840        ret_val = xmlStrdup((const xmlChar *)cur);
35841        desret_xmlChar_ptr(ret_val);
35842        call_tests++;
35843        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
35844        xmlResetLastError();
35845        if (mem_base != xmlMemBlocks()) {
35846            printf("Leak of %d blocks found in xmlStrdup",
35847	           xmlMemBlocks() - mem_base);
35848	    test_ret++;
35849            printf(" %d", n_cur);
35850            printf("\n");
35851        }
35852    }
35853    function_tests++;
35854
35855    return(test_ret);
35856}
35857
35858
35859static int
35860test_xmlStrlen(void) {
35861    int test_ret = 0;
35862
35863    int mem_base;
35864    int ret_val;
35865    xmlChar * str; /* the xmlChar * array */
35866    int n_str;
35867
35868    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35869        mem_base = xmlMemBlocks();
35870        str = gen_const_xmlChar_ptr(n_str, 0);
35871
35872        ret_val = xmlStrlen((const xmlChar *)str);
35873        desret_int(ret_val);
35874        call_tests++;
35875        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35876        xmlResetLastError();
35877        if (mem_base != xmlMemBlocks()) {
35878            printf("Leak of %d blocks found in xmlStrlen",
35879	           xmlMemBlocks() - mem_base);
35880	    test_ret++;
35881            printf(" %d", n_str);
35882            printf("\n");
35883        }
35884    }
35885    function_tests++;
35886
35887    return(test_ret);
35888}
35889
35890
35891static int
35892test_xmlStrncasecmp(void) {
35893    int test_ret = 0;
35894
35895    int mem_base;
35896    int ret_val;
35897    xmlChar * str1; /* the first xmlChar * */
35898    int n_str1;
35899    xmlChar * str2; /* the second xmlChar * */
35900    int n_str2;
35901    int len; /* the max comparison length */
35902    int n_len;
35903
35904    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35905    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35906    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35907        mem_base = xmlMemBlocks();
35908        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35909        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35910        len = gen_int(n_len, 2);
35911
35912        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
35913        desret_int(ret_val);
35914        call_tests++;
35915        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35916        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35917        des_int(n_len, len, 2);
35918        xmlResetLastError();
35919        if (mem_base != xmlMemBlocks()) {
35920            printf("Leak of %d blocks found in xmlStrncasecmp",
35921	           xmlMemBlocks() - mem_base);
35922	    test_ret++;
35923            printf(" %d", n_str1);
35924            printf(" %d", n_str2);
35925            printf(" %d", n_len);
35926            printf("\n");
35927        }
35928    }
35929    }
35930    }
35931    function_tests++;
35932
35933    return(test_ret);
35934}
35935
35936
35937static int
35938test_xmlStrncatNew(void) {
35939    int test_ret = 0;
35940
35941    int mem_base;
35942    xmlChar * ret_val;
35943    xmlChar * str1; /* first xmlChar string */
35944    int n_str1;
35945    xmlChar * str2; /* second xmlChar string */
35946    int n_str2;
35947    int len; /* the len of @str2 or < 0 */
35948    int n_len;
35949
35950    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35951    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35952    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35953        mem_base = xmlMemBlocks();
35954        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35955        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35956        len = gen_int(n_len, 2);
35957
35958        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
35959        desret_xmlChar_ptr(ret_val);
35960        call_tests++;
35961        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35962        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35963        des_int(n_len, len, 2);
35964        xmlResetLastError();
35965        if (mem_base != xmlMemBlocks()) {
35966            printf("Leak of %d blocks found in xmlStrncatNew",
35967	           xmlMemBlocks() - mem_base);
35968	    test_ret++;
35969            printf(" %d", n_str1);
35970            printf(" %d", n_str2);
35971            printf(" %d", n_len);
35972            printf("\n");
35973        }
35974    }
35975    }
35976    }
35977    function_tests++;
35978
35979    return(test_ret);
35980}
35981
35982
35983static int
35984test_xmlStrncmp(void) {
35985    int test_ret = 0;
35986
35987    int mem_base;
35988    int ret_val;
35989    xmlChar * str1; /* the first xmlChar * */
35990    int n_str1;
35991    xmlChar * str2; /* the second xmlChar * */
35992    int n_str2;
35993    int len; /* the max comparison length */
35994    int n_len;
35995
35996    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35997    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35998    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35999        mem_base = xmlMemBlocks();
36000        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36001        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36002        len = gen_int(n_len, 2);
36003
36004        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36005        desret_int(ret_val);
36006        call_tests++;
36007        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36008        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36009        des_int(n_len, len, 2);
36010        xmlResetLastError();
36011        if (mem_base != xmlMemBlocks()) {
36012            printf("Leak of %d blocks found in xmlStrncmp",
36013	           xmlMemBlocks() - mem_base);
36014	    test_ret++;
36015            printf(" %d", n_str1);
36016            printf(" %d", n_str2);
36017            printf(" %d", n_len);
36018            printf("\n");
36019        }
36020    }
36021    }
36022    }
36023    function_tests++;
36024
36025    return(test_ret);
36026}
36027
36028
36029static int
36030test_xmlStrndup(void) {
36031    int test_ret = 0;
36032
36033    int mem_base;
36034    xmlChar * ret_val;
36035    xmlChar * cur; /* the input xmlChar * */
36036    int n_cur;
36037    int len; /* the len of @cur */
36038    int n_len;
36039
36040    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36041    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36042        mem_base = xmlMemBlocks();
36043        cur = gen_const_xmlChar_ptr(n_cur, 0);
36044        len = gen_int(n_len, 1);
36045
36046        ret_val = xmlStrndup((const xmlChar *)cur, len);
36047        desret_xmlChar_ptr(ret_val);
36048        call_tests++;
36049        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36050        des_int(n_len, len, 1);
36051        xmlResetLastError();
36052        if (mem_base != xmlMemBlocks()) {
36053            printf("Leak of %d blocks found in xmlStrndup",
36054	           xmlMemBlocks() - mem_base);
36055	    test_ret++;
36056            printf(" %d", n_cur);
36057            printf(" %d", n_len);
36058            printf("\n");
36059        }
36060    }
36061    }
36062    function_tests++;
36063
36064    return(test_ret);
36065}
36066
36067
36068static int
36069test_xmlStrstr(void) {
36070    int test_ret = 0;
36071
36072    int mem_base;
36073    const xmlChar * ret_val;
36074    xmlChar * str; /* the xmlChar * array (haystack) */
36075    int n_str;
36076    xmlChar * val; /* the xmlChar to search (needle) */
36077    int n_val;
36078
36079    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36080    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36081        mem_base = xmlMemBlocks();
36082        str = gen_const_xmlChar_ptr(n_str, 0);
36083        val = gen_const_xmlChar_ptr(n_val, 1);
36084
36085        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36086        desret_const_xmlChar_ptr(ret_val);
36087        call_tests++;
36088        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36089        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36090        xmlResetLastError();
36091        if (mem_base != xmlMemBlocks()) {
36092            printf("Leak of %d blocks found in xmlStrstr",
36093	           xmlMemBlocks() - mem_base);
36094	    test_ret++;
36095            printf(" %d", n_str);
36096            printf(" %d", n_val);
36097            printf("\n");
36098        }
36099    }
36100    }
36101    function_tests++;
36102
36103    return(test_ret);
36104}
36105
36106
36107static int
36108test_xmlStrsub(void) {
36109    int test_ret = 0;
36110
36111    int mem_base;
36112    xmlChar * ret_val;
36113    xmlChar * str; /* the xmlChar * array (haystack) */
36114    int n_str;
36115    int start; /* the index of the first char (zero based) */
36116    int n_start;
36117    int len; /* the length of the substring */
36118    int n_len;
36119
36120    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36121    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36122    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36123        mem_base = xmlMemBlocks();
36124        str = gen_const_xmlChar_ptr(n_str, 0);
36125        start = gen_int(n_start, 1);
36126        len = gen_int(n_len, 2);
36127
36128        ret_val = xmlStrsub((const xmlChar *)str, start, len);
36129        desret_xmlChar_ptr(ret_val);
36130        call_tests++;
36131        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36132        des_int(n_start, start, 1);
36133        des_int(n_len, len, 2);
36134        xmlResetLastError();
36135        if (mem_base != xmlMemBlocks()) {
36136            printf("Leak of %d blocks found in xmlStrsub",
36137	           xmlMemBlocks() - mem_base);
36138	    test_ret++;
36139            printf(" %d", n_str);
36140            printf(" %d", n_start);
36141            printf(" %d", n_len);
36142            printf("\n");
36143        }
36144    }
36145    }
36146    }
36147    function_tests++;
36148
36149    return(test_ret);
36150}
36151
36152
36153static int
36154test_xmlUTF8Charcmp(void) {
36155    int test_ret = 0;
36156
36157    int mem_base;
36158    int ret_val;
36159    xmlChar * utf1; /* pointer to first UTF8 char */
36160    int n_utf1;
36161    xmlChar * utf2; /* pointer to second UTF8 char */
36162    int n_utf2;
36163
36164    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36165    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36166        mem_base = xmlMemBlocks();
36167        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36168        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36169
36170        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36171        desret_int(ret_val);
36172        call_tests++;
36173        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36174        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36175        xmlResetLastError();
36176        if (mem_base != xmlMemBlocks()) {
36177            printf("Leak of %d blocks found in xmlUTF8Charcmp",
36178	           xmlMemBlocks() - mem_base);
36179	    test_ret++;
36180            printf(" %d", n_utf1);
36181            printf(" %d", n_utf2);
36182            printf("\n");
36183        }
36184    }
36185    }
36186    function_tests++;
36187
36188    return(test_ret);
36189}
36190
36191
36192static int
36193test_xmlUTF8Size(void) {
36194    int test_ret = 0;
36195
36196    int mem_base;
36197    int ret_val;
36198    xmlChar * utf; /* pointer to the UTF8 character */
36199    int n_utf;
36200
36201    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36202        mem_base = xmlMemBlocks();
36203        utf = gen_const_xmlChar_ptr(n_utf, 0);
36204
36205        ret_val = xmlUTF8Size((const xmlChar *)utf);
36206        desret_int(ret_val);
36207        call_tests++;
36208        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36209        xmlResetLastError();
36210        if (mem_base != xmlMemBlocks()) {
36211            printf("Leak of %d blocks found in xmlUTF8Size",
36212	           xmlMemBlocks() - mem_base);
36213	    test_ret++;
36214            printf(" %d", n_utf);
36215            printf("\n");
36216        }
36217    }
36218    function_tests++;
36219
36220    return(test_ret);
36221}
36222
36223
36224static int
36225test_xmlUTF8Strlen(void) {
36226    int test_ret = 0;
36227
36228    int mem_base;
36229    int ret_val;
36230    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36231    int n_utf;
36232
36233    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36234        mem_base = xmlMemBlocks();
36235        utf = gen_const_xmlChar_ptr(n_utf, 0);
36236
36237        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36238        desret_int(ret_val);
36239        call_tests++;
36240        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36241        xmlResetLastError();
36242        if (mem_base != xmlMemBlocks()) {
36243            printf("Leak of %d blocks found in xmlUTF8Strlen",
36244	           xmlMemBlocks() - mem_base);
36245	    test_ret++;
36246            printf(" %d", n_utf);
36247            printf("\n");
36248        }
36249    }
36250    function_tests++;
36251
36252    return(test_ret);
36253}
36254
36255
36256static int
36257test_xmlUTF8Strloc(void) {
36258    int test_ret = 0;
36259
36260    int mem_base;
36261    int ret_val;
36262    xmlChar * utf; /* the input UTF8 * */
36263    int n_utf;
36264    xmlChar * utfchar; /* the UTF8 character to be found */
36265    int n_utfchar;
36266
36267    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36268    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36269        mem_base = xmlMemBlocks();
36270        utf = gen_const_xmlChar_ptr(n_utf, 0);
36271        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36272
36273        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36274        desret_int(ret_val);
36275        call_tests++;
36276        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36277        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36278        xmlResetLastError();
36279        if (mem_base != xmlMemBlocks()) {
36280            printf("Leak of %d blocks found in xmlUTF8Strloc",
36281	           xmlMemBlocks() - mem_base);
36282	    test_ret++;
36283            printf(" %d", n_utf);
36284            printf(" %d", n_utfchar);
36285            printf("\n");
36286        }
36287    }
36288    }
36289    function_tests++;
36290
36291    return(test_ret);
36292}
36293
36294
36295static int
36296test_xmlUTF8Strndup(void) {
36297    int test_ret = 0;
36298
36299    int mem_base;
36300    xmlChar * ret_val;
36301    xmlChar * utf; /* the input UTF8 * */
36302    int n_utf;
36303    int len; /* the len of @utf (in chars) */
36304    int n_len;
36305
36306    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36307    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36308        mem_base = xmlMemBlocks();
36309        utf = gen_const_xmlChar_ptr(n_utf, 0);
36310        len = gen_int(n_len, 1);
36311
36312        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36313        desret_xmlChar_ptr(ret_val);
36314        call_tests++;
36315        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36316        des_int(n_len, len, 1);
36317        xmlResetLastError();
36318        if (mem_base != xmlMemBlocks()) {
36319            printf("Leak of %d blocks found in xmlUTF8Strndup",
36320	           xmlMemBlocks() - mem_base);
36321	    test_ret++;
36322            printf(" %d", n_utf);
36323            printf(" %d", n_len);
36324            printf("\n");
36325        }
36326    }
36327    }
36328    function_tests++;
36329
36330    return(test_ret);
36331}
36332
36333
36334static int
36335test_xmlUTF8Strpos(void) {
36336    int test_ret = 0;
36337
36338    int mem_base;
36339    const xmlChar * ret_val;
36340    xmlChar * utf; /* the input UTF8 * */
36341    int n_utf;
36342    int pos; /* the position of the desired UTF8 char (in chars) */
36343    int n_pos;
36344
36345    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36346    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36347        mem_base = xmlMemBlocks();
36348        utf = gen_const_xmlChar_ptr(n_utf, 0);
36349        pos = gen_int(n_pos, 1);
36350
36351        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36352        desret_const_xmlChar_ptr(ret_val);
36353        call_tests++;
36354        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36355        des_int(n_pos, pos, 1);
36356        xmlResetLastError();
36357        if (mem_base != xmlMemBlocks()) {
36358            printf("Leak of %d blocks found in xmlUTF8Strpos",
36359	           xmlMemBlocks() - mem_base);
36360	    test_ret++;
36361            printf(" %d", n_utf);
36362            printf(" %d", n_pos);
36363            printf("\n");
36364        }
36365    }
36366    }
36367    function_tests++;
36368
36369    return(test_ret);
36370}
36371
36372
36373static int
36374test_xmlUTF8Strsize(void) {
36375    int test_ret = 0;
36376
36377    int mem_base;
36378    int ret_val;
36379    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36380    int n_utf;
36381    int len; /* the number of characters in the array */
36382    int n_len;
36383
36384    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36385    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36386        mem_base = xmlMemBlocks();
36387        utf = gen_const_xmlChar_ptr(n_utf, 0);
36388        len = gen_int(n_len, 1);
36389
36390        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36391        desret_int(ret_val);
36392        call_tests++;
36393        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36394        des_int(n_len, len, 1);
36395        xmlResetLastError();
36396        if (mem_base != xmlMemBlocks()) {
36397            printf("Leak of %d blocks found in xmlUTF8Strsize",
36398	           xmlMemBlocks() - mem_base);
36399	    test_ret++;
36400            printf(" %d", n_utf);
36401            printf(" %d", n_len);
36402            printf("\n");
36403        }
36404    }
36405    }
36406    function_tests++;
36407
36408    return(test_ret);
36409}
36410
36411
36412static int
36413test_xmlUTF8Strsub(void) {
36414    int test_ret = 0;
36415
36416    int mem_base;
36417    xmlChar * ret_val;
36418    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36419    int n_utf;
36420    int start; /* relative pos of first char */
36421    int n_start;
36422    int len; /* total number to copy */
36423    int n_len;
36424
36425    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36426    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36427    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36428        mem_base = xmlMemBlocks();
36429        utf = gen_const_xmlChar_ptr(n_utf, 0);
36430        start = gen_int(n_start, 1);
36431        len = gen_int(n_len, 2);
36432
36433        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36434        desret_xmlChar_ptr(ret_val);
36435        call_tests++;
36436        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36437        des_int(n_start, start, 1);
36438        des_int(n_len, len, 2);
36439        xmlResetLastError();
36440        if (mem_base != xmlMemBlocks()) {
36441            printf("Leak of %d blocks found in xmlUTF8Strsub",
36442	           xmlMemBlocks() - mem_base);
36443	    test_ret++;
36444            printf(" %d", n_utf);
36445            printf(" %d", n_start);
36446            printf(" %d", n_len);
36447            printf("\n");
36448        }
36449    }
36450    }
36451    }
36452    function_tests++;
36453
36454    return(test_ret);
36455}
36456
36457static int
36458test_xmlstring(void) {
36459    int test_ret = 0;
36460
36461    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36462    test_ret += test_xmlCharStrdup();
36463    test_ret += test_xmlCharStrndup();
36464    test_ret += test_xmlCheckUTF8();
36465    test_ret += test_xmlGetUTF8Char();
36466    test_ret += test_xmlStrEqual();
36467    test_ret += test_xmlStrPrintf();
36468    test_ret += test_xmlStrQEqual();
36469    test_ret += test_xmlStrVPrintf();
36470    test_ret += test_xmlStrcasecmp();
36471    test_ret += test_xmlStrcasestr();
36472    test_ret += test_xmlStrchr();
36473    test_ret += test_xmlStrcmp();
36474    test_ret += test_xmlStrdup();
36475    test_ret += test_xmlStrlen();
36476    test_ret += test_xmlStrncasecmp();
36477    test_ret += test_xmlStrncatNew();
36478    test_ret += test_xmlStrncmp();
36479    test_ret += test_xmlStrndup();
36480    test_ret += test_xmlStrstr();
36481    test_ret += test_xmlStrsub();
36482    test_ret += test_xmlUTF8Charcmp();
36483    test_ret += test_xmlUTF8Size();
36484    test_ret += test_xmlUTF8Strlen();
36485    test_ret += test_xmlUTF8Strloc();
36486    test_ret += test_xmlUTF8Strndup();
36487    test_ret += test_xmlUTF8Strpos();
36488    test_ret += test_xmlUTF8Strsize();
36489    test_ret += test_xmlUTF8Strsub();
36490
36491    if (test_ret != 0)
36492	printf("Module xmlstring: %d errors\n", test_ret);
36493    return(test_ret);
36494}
36495
36496static int
36497test_xmlUCSIsAegeanNumbers(void) {
36498    int test_ret = 0;
36499
36500#if defined(LIBXML_UNICODE_ENABLED)
36501    int mem_base;
36502    int ret_val;
36503    int code; /* UCS code point */
36504    int n_code;
36505
36506    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36507        mem_base = xmlMemBlocks();
36508        code = gen_int(n_code, 0);
36509
36510        ret_val = xmlUCSIsAegeanNumbers(code);
36511        desret_int(ret_val);
36512        call_tests++;
36513        des_int(n_code, code, 0);
36514        xmlResetLastError();
36515        if (mem_base != xmlMemBlocks()) {
36516            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36517	           xmlMemBlocks() - mem_base);
36518	    test_ret++;
36519            printf(" %d", n_code);
36520            printf("\n");
36521        }
36522    }
36523    function_tests++;
36524#endif
36525
36526    return(test_ret);
36527}
36528
36529
36530static int
36531test_xmlUCSIsAlphabeticPresentationForms(void) {
36532    int test_ret = 0;
36533
36534#if defined(LIBXML_UNICODE_ENABLED)
36535    int mem_base;
36536    int ret_val;
36537    int code; /* UCS code point */
36538    int n_code;
36539
36540    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36541        mem_base = xmlMemBlocks();
36542        code = gen_int(n_code, 0);
36543
36544        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36545        desret_int(ret_val);
36546        call_tests++;
36547        des_int(n_code, code, 0);
36548        xmlResetLastError();
36549        if (mem_base != xmlMemBlocks()) {
36550            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36551	           xmlMemBlocks() - mem_base);
36552	    test_ret++;
36553            printf(" %d", n_code);
36554            printf("\n");
36555        }
36556    }
36557    function_tests++;
36558#endif
36559
36560    return(test_ret);
36561}
36562
36563
36564static int
36565test_xmlUCSIsArabic(void) {
36566    int test_ret = 0;
36567
36568#if defined(LIBXML_UNICODE_ENABLED)
36569    int mem_base;
36570    int ret_val;
36571    int code; /* UCS code point */
36572    int n_code;
36573
36574    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36575        mem_base = xmlMemBlocks();
36576        code = gen_int(n_code, 0);
36577
36578        ret_val = xmlUCSIsArabic(code);
36579        desret_int(ret_val);
36580        call_tests++;
36581        des_int(n_code, code, 0);
36582        xmlResetLastError();
36583        if (mem_base != xmlMemBlocks()) {
36584            printf("Leak of %d blocks found in xmlUCSIsArabic",
36585	           xmlMemBlocks() - mem_base);
36586	    test_ret++;
36587            printf(" %d", n_code);
36588            printf("\n");
36589        }
36590    }
36591    function_tests++;
36592#endif
36593
36594    return(test_ret);
36595}
36596
36597
36598static int
36599test_xmlUCSIsArabicPresentationFormsA(void) {
36600    int test_ret = 0;
36601
36602#if defined(LIBXML_UNICODE_ENABLED)
36603    int mem_base;
36604    int ret_val;
36605    int code; /* UCS code point */
36606    int n_code;
36607
36608    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36609        mem_base = xmlMemBlocks();
36610        code = gen_int(n_code, 0);
36611
36612        ret_val = xmlUCSIsArabicPresentationFormsA(code);
36613        desret_int(ret_val);
36614        call_tests++;
36615        des_int(n_code, code, 0);
36616        xmlResetLastError();
36617        if (mem_base != xmlMemBlocks()) {
36618            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36619	           xmlMemBlocks() - mem_base);
36620	    test_ret++;
36621            printf(" %d", n_code);
36622            printf("\n");
36623        }
36624    }
36625    function_tests++;
36626#endif
36627
36628    return(test_ret);
36629}
36630
36631
36632static int
36633test_xmlUCSIsArabicPresentationFormsB(void) {
36634    int test_ret = 0;
36635
36636#if defined(LIBXML_UNICODE_ENABLED)
36637    int mem_base;
36638    int ret_val;
36639    int code; /* UCS code point */
36640    int n_code;
36641
36642    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36643        mem_base = xmlMemBlocks();
36644        code = gen_int(n_code, 0);
36645
36646        ret_val = xmlUCSIsArabicPresentationFormsB(code);
36647        desret_int(ret_val);
36648        call_tests++;
36649        des_int(n_code, code, 0);
36650        xmlResetLastError();
36651        if (mem_base != xmlMemBlocks()) {
36652            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36653	           xmlMemBlocks() - mem_base);
36654	    test_ret++;
36655            printf(" %d", n_code);
36656            printf("\n");
36657        }
36658    }
36659    function_tests++;
36660#endif
36661
36662    return(test_ret);
36663}
36664
36665
36666static int
36667test_xmlUCSIsArmenian(void) {
36668    int test_ret = 0;
36669
36670#if defined(LIBXML_UNICODE_ENABLED)
36671    int mem_base;
36672    int ret_val;
36673    int code; /* UCS code point */
36674    int n_code;
36675
36676    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36677        mem_base = xmlMemBlocks();
36678        code = gen_int(n_code, 0);
36679
36680        ret_val = xmlUCSIsArmenian(code);
36681        desret_int(ret_val);
36682        call_tests++;
36683        des_int(n_code, code, 0);
36684        xmlResetLastError();
36685        if (mem_base != xmlMemBlocks()) {
36686            printf("Leak of %d blocks found in xmlUCSIsArmenian",
36687	           xmlMemBlocks() - mem_base);
36688	    test_ret++;
36689            printf(" %d", n_code);
36690            printf("\n");
36691        }
36692    }
36693    function_tests++;
36694#endif
36695
36696    return(test_ret);
36697}
36698
36699
36700static int
36701test_xmlUCSIsArrows(void) {
36702    int test_ret = 0;
36703
36704#if defined(LIBXML_UNICODE_ENABLED)
36705    int mem_base;
36706    int ret_val;
36707    int code; /* UCS code point */
36708    int n_code;
36709
36710    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36711        mem_base = xmlMemBlocks();
36712        code = gen_int(n_code, 0);
36713
36714        ret_val = xmlUCSIsArrows(code);
36715        desret_int(ret_val);
36716        call_tests++;
36717        des_int(n_code, code, 0);
36718        xmlResetLastError();
36719        if (mem_base != xmlMemBlocks()) {
36720            printf("Leak of %d blocks found in xmlUCSIsArrows",
36721	           xmlMemBlocks() - mem_base);
36722	    test_ret++;
36723            printf(" %d", n_code);
36724            printf("\n");
36725        }
36726    }
36727    function_tests++;
36728#endif
36729
36730    return(test_ret);
36731}
36732
36733
36734static int
36735test_xmlUCSIsBasicLatin(void) {
36736    int test_ret = 0;
36737
36738#if defined(LIBXML_UNICODE_ENABLED)
36739    int mem_base;
36740    int ret_val;
36741    int code; /* UCS code point */
36742    int n_code;
36743
36744    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36745        mem_base = xmlMemBlocks();
36746        code = gen_int(n_code, 0);
36747
36748        ret_val = xmlUCSIsBasicLatin(code);
36749        desret_int(ret_val);
36750        call_tests++;
36751        des_int(n_code, code, 0);
36752        xmlResetLastError();
36753        if (mem_base != xmlMemBlocks()) {
36754            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
36755	           xmlMemBlocks() - mem_base);
36756	    test_ret++;
36757            printf(" %d", n_code);
36758            printf("\n");
36759        }
36760    }
36761    function_tests++;
36762#endif
36763
36764    return(test_ret);
36765}
36766
36767
36768static int
36769test_xmlUCSIsBengali(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 = xmlUCSIsBengali(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 xmlUCSIsBengali",
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_xmlUCSIsBlock(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    char * block; /* UCS block name */
36812    int n_block;
36813
36814    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36815    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
36816        mem_base = xmlMemBlocks();
36817        code = gen_int(n_code, 0);
36818        block = gen_const_char_ptr(n_block, 1);
36819
36820        ret_val = xmlUCSIsBlock(code, (const char *)block);
36821        desret_int(ret_val);
36822        call_tests++;
36823        des_int(n_code, code, 0);
36824        des_const_char_ptr(n_block, (const char *)block, 1);
36825        xmlResetLastError();
36826        if (mem_base != xmlMemBlocks()) {
36827            printf("Leak of %d blocks found in xmlUCSIsBlock",
36828	           xmlMemBlocks() - mem_base);
36829	    test_ret++;
36830            printf(" %d", n_code);
36831            printf(" %d", n_block);
36832            printf("\n");
36833        }
36834    }
36835    }
36836    function_tests++;
36837#endif
36838
36839    return(test_ret);
36840}
36841
36842
36843static int
36844test_xmlUCSIsBlockElements(void) {
36845    int test_ret = 0;
36846
36847#if defined(LIBXML_UNICODE_ENABLED)
36848    int mem_base;
36849    int ret_val;
36850    int code; /* UCS code point */
36851    int n_code;
36852
36853    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36854        mem_base = xmlMemBlocks();
36855        code = gen_int(n_code, 0);
36856
36857        ret_val = xmlUCSIsBlockElements(code);
36858        desret_int(ret_val);
36859        call_tests++;
36860        des_int(n_code, code, 0);
36861        xmlResetLastError();
36862        if (mem_base != xmlMemBlocks()) {
36863            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
36864	           xmlMemBlocks() - mem_base);
36865	    test_ret++;
36866            printf(" %d", n_code);
36867            printf("\n");
36868        }
36869    }
36870    function_tests++;
36871#endif
36872
36873    return(test_ret);
36874}
36875
36876
36877static int
36878test_xmlUCSIsBopomofo(void) {
36879    int test_ret = 0;
36880
36881#if defined(LIBXML_UNICODE_ENABLED)
36882    int mem_base;
36883    int ret_val;
36884    int code; /* UCS code point */
36885    int n_code;
36886
36887    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36888        mem_base = xmlMemBlocks();
36889        code = gen_int(n_code, 0);
36890
36891        ret_val = xmlUCSIsBopomofo(code);
36892        desret_int(ret_val);
36893        call_tests++;
36894        des_int(n_code, code, 0);
36895        xmlResetLastError();
36896        if (mem_base != xmlMemBlocks()) {
36897            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
36898	           xmlMemBlocks() - mem_base);
36899	    test_ret++;
36900            printf(" %d", n_code);
36901            printf("\n");
36902        }
36903    }
36904    function_tests++;
36905#endif
36906
36907    return(test_ret);
36908}
36909
36910
36911static int
36912test_xmlUCSIsBopomofoExtended(void) {
36913    int test_ret = 0;
36914
36915#if defined(LIBXML_UNICODE_ENABLED)
36916    int mem_base;
36917    int ret_val;
36918    int code; /* UCS code point */
36919    int n_code;
36920
36921    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36922        mem_base = xmlMemBlocks();
36923        code = gen_int(n_code, 0);
36924
36925        ret_val = xmlUCSIsBopomofoExtended(code);
36926        desret_int(ret_val);
36927        call_tests++;
36928        des_int(n_code, code, 0);
36929        xmlResetLastError();
36930        if (mem_base != xmlMemBlocks()) {
36931            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
36932	           xmlMemBlocks() - mem_base);
36933	    test_ret++;
36934            printf(" %d", n_code);
36935            printf("\n");
36936        }
36937    }
36938    function_tests++;
36939#endif
36940
36941    return(test_ret);
36942}
36943
36944
36945static int
36946test_xmlUCSIsBoxDrawing(void) {
36947    int test_ret = 0;
36948
36949#if defined(LIBXML_UNICODE_ENABLED)
36950    int mem_base;
36951    int ret_val;
36952    int code; /* UCS code point */
36953    int n_code;
36954
36955    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36956        mem_base = xmlMemBlocks();
36957        code = gen_int(n_code, 0);
36958
36959        ret_val = xmlUCSIsBoxDrawing(code);
36960        desret_int(ret_val);
36961        call_tests++;
36962        des_int(n_code, code, 0);
36963        xmlResetLastError();
36964        if (mem_base != xmlMemBlocks()) {
36965            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
36966	           xmlMemBlocks() - mem_base);
36967	    test_ret++;
36968            printf(" %d", n_code);
36969            printf("\n");
36970        }
36971    }
36972    function_tests++;
36973#endif
36974
36975    return(test_ret);
36976}
36977
36978
36979static int
36980test_xmlUCSIsBraillePatterns(void) {
36981    int test_ret = 0;
36982
36983#if defined(LIBXML_UNICODE_ENABLED)
36984    int mem_base;
36985    int ret_val;
36986    int code; /* UCS code point */
36987    int n_code;
36988
36989    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36990        mem_base = xmlMemBlocks();
36991        code = gen_int(n_code, 0);
36992
36993        ret_val = xmlUCSIsBraillePatterns(code);
36994        desret_int(ret_val);
36995        call_tests++;
36996        des_int(n_code, code, 0);
36997        xmlResetLastError();
36998        if (mem_base != xmlMemBlocks()) {
36999            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37000	           xmlMemBlocks() - mem_base);
37001	    test_ret++;
37002            printf(" %d", n_code);
37003            printf("\n");
37004        }
37005    }
37006    function_tests++;
37007#endif
37008
37009    return(test_ret);
37010}
37011
37012
37013static int
37014test_xmlUCSIsBuhid(void) {
37015    int test_ret = 0;
37016
37017#if defined(LIBXML_UNICODE_ENABLED)
37018    int mem_base;
37019    int ret_val;
37020    int code; /* UCS code point */
37021    int n_code;
37022
37023    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37024        mem_base = xmlMemBlocks();
37025        code = gen_int(n_code, 0);
37026
37027        ret_val = xmlUCSIsBuhid(code);
37028        desret_int(ret_val);
37029        call_tests++;
37030        des_int(n_code, code, 0);
37031        xmlResetLastError();
37032        if (mem_base != xmlMemBlocks()) {
37033            printf("Leak of %d blocks found in xmlUCSIsBuhid",
37034	           xmlMemBlocks() - mem_base);
37035	    test_ret++;
37036            printf(" %d", n_code);
37037            printf("\n");
37038        }
37039    }
37040    function_tests++;
37041#endif
37042
37043    return(test_ret);
37044}
37045
37046
37047static int
37048test_xmlUCSIsByzantineMusicalSymbols(void) {
37049    int test_ret = 0;
37050
37051#if defined(LIBXML_UNICODE_ENABLED)
37052    int mem_base;
37053    int ret_val;
37054    int code; /* UCS code point */
37055    int n_code;
37056
37057    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37058        mem_base = xmlMemBlocks();
37059        code = gen_int(n_code, 0);
37060
37061        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37062        desret_int(ret_val);
37063        call_tests++;
37064        des_int(n_code, code, 0);
37065        xmlResetLastError();
37066        if (mem_base != xmlMemBlocks()) {
37067            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37068	           xmlMemBlocks() - mem_base);
37069	    test_ret++;
37070            printf(" %d", n_code);
37071            printf("\n");
37072        }
37073    }
37074    function_tests++;
37075#endif
37076
37077    return(test_ret);
37078}
37079
37080
37081static int
37082test_xmlUCSIsCJKCompatibility(void) {
37083    int test_ret = 0;
37084
37085#if defined(LIBXML_UNICODE_ENABLED)
37086    int mem_base;
37087    int ret_val;
37088    int code; /* UCS code point */
37089    int n_code;
37090
37091    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37092        mem_base = xmlMemBlocks();
37093        code = gen_int(n_code, 0);
37094
37095        ret_val = xmlUCSIsCJKCompatibility(code);
37096        desret_int(ret_val);
37097        call_tests++;
37098        des_int(n_code, code, 0);
37099        xmlResetLastError();
37100        if (mem_base != xmlMemBlocks()) {
37101            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37102	           xmlMemBlocks() - mem_base);
37103	    test_ret++;
37104            printf(" %d", n_code);
37105            printf("\n");
37106        }
37107    }
37108    function_tests++;
37109#endif
37110
37111    return(test_ret);
37112}
37113
37114
37115static int
37116test_xmlUCSIsCJKCompatibilityForms(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 = xmlUCSIsCJKCompatibilityForms(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 xmlUCSIsCJKCompatibilityForms",
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_xmlUCSIsCJKCompatibilityIdeographs(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 = xmlUCSIsCJKCompatibilityIdeographs(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 xmlUCSIsCJKCompatibilityIdeographs",
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_xmlUCSIsCJKCompatibilityIdeographsSupplement(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 = xmlUCSIsCJKCompatibilityIdeographsSupplement(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 xmlUCSIsCJKCompatibilityIdeographsSupplement",
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_xmlUCSIsCJKRadicalsSupplement(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 = xmlUCSIsCJKRadicalsSupplement(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 xmlUCSIsCJKRadicalsSupplement",
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_xmlUCSIsCJKSymbolsandPunctuation(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 = xmlUCSIsCJKSymbolsandPunctuation(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 xmlUCSIsCJKSymbolsandPunctuation",
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_xmlUCSIsCJKUnifiedIdeographs(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 = xmlUCSIsCJKUnifiedIdeographs(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 xmlUCSIsCJKUnifiedIdeographs",
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_xmlUCSIsCJKUnifiedIdeographsExtensionA(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 = xmlUCSIsCJKUnifiedIdeographsExtensionA(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 xmlUCSIsCJKUnifiedIdeographsExtensionA",
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_xmlUCSIsCJKUnifiedIdeographsExtensionB(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 = xmlUCSIsCJKUnifiedIdeographsExtensionB(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 xmlUCSIsCJKUnifiedIdeographsExtensionB",
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_xmlUCSIsCat(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    char * cat; /* UCS Category name */
37397    int n_cat;
37398
37399    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37400    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37401        mem_base = xmlMemBlocks();
37402        code = gen_int(n_code, 0);
37403        cat = gen_const_char_ptr(n_cat, 1);
37404
37405        ret_val = xmlUCSIsCat(code, (const char *)cat);
37406        desret_int(ret_val);
37407        call_tests++;
37408        des_int(n_code, code, 0);
37409        des_const_char_ptr(n_cat, (const char *)cat, 1);
37410        xmlResetLastError();
37411        if (mem_base != xmlMemBlocks()) {
37412            printf("Leak of %d blocks found in xmlUCSIsCat",
37413	           xmlMemBlocks() - mem_base);
37414	    test_ret++;
37415            printf(" %d", n_code);
37416            printf(" %d", n_cat);
37417            printf("\n");
37418        }
37419    }
37420    }
37421    function_tests++;
37422#endif
37423
37424    return(test_ret);
37425}
37426
37427
37428static int
37429test_xmlUCSIsCatC(void) {
37430    int test_ret = 0;
37431
37432#if defined(LIBXML_UNICODE_ENABLED)
37433    int mem_base;
37434    int ret_val;
37435    int code; /* UCS code point */
37436    int n_code;
37437
37438    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37439        mem_base = xmlMemBlocks();
37440        code = gen_int(n_code, 0);
37441
37442        ret_val = xmlUCSIsCatC(code);
37443        desret_int(ret_val);
37444        call_tests++;
37445        des_int(n_code, code, 0);
37446        xmlResetLastError();
37447        if (mem_base != xmlMemBlocks()) {
37448            printf("Leak of %d blocks found in xmlUCSIsCatC",
37449	           xmlMemBlocks() - mem_base);
37450	    test_ret++;
37451            printf(" %d", n_code);
37452            printf("\n");
37453        }
37454    }
37455    function_tests++;
37456#endif
37457
37458    return(test_ret);
37459}
37460
37461
37462static int
37463test_xmlUCSIsCatCc(void) {
37464    int test_ret = 0;
37465
37466#if defined(LIBXML_UNICODE_ENABLED)
37467    int mem_base;
37468    int ret_val;
37469    int code; /* UCS code point */
37470    int n_code;
37471
37472    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37473        mem_base = xmlMemBlocks();
37474        code = gen_int(n_code, 0);
37475
37476        ret_val = xmlUCSIsCatCc(code);
37477        desret_int(ret_val);
37478        call_tests++;
37479        des_int(n_code, code, 0);
37480        xmlResetLastError();
37481        if (mem_base != xmlMemBlocks()) {
37482            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37483	           xmlMemBlocks() - mem_base);
37484	    test_ret++;
37485            printf(" %d", n_code);
37486            printf("\n");
37487        }
37488    }
37489    function_tests++;
37490#endif
37491
37492    return(test_ret);
37493}
37494
37495
37496static int
37497test_xmlUCSIsCatCf(void) {
37498    int test_ret = 0;
37499
37500#if defined(LIBXML_UNICODE_ENABLED)
37501    int mem_base;
37502    int ret_val;
37503    int code; /* UCS code point */
37504    int n_code;
37505
37506    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37507        mem_base = xmlMemBlocks();
37508        code = gen_int(n_code, 0);
37509
37510        ret_val = xmlUCSIsCatCf(code);
37511        desret_int(ret_val);
37512        call_tests++;
37513        des_int(n_code, code, 0);
37514        xmlResetLastError();
37515        if (mem_base != xmlMemBlocks()) {
37516            printf("Leak of %d blocks found in xmlUCSIsCatCf",
37517	           xmlMemBlocks() - mem_base);
37518	    test_ret++;
37519            printf(" %d", n_code);
37520            printf("\n");
37521        }
37522    }
37523    function_tests++;
37524#endif
37525
37526    return(test_ret);
37527}
37528
37529
37530static int
37531test_xmlUCSIsCatCo(void) {
37532    int test_ret = 0;
37533
37534#if defined(LIBXML_UNICODE_ENABLED)
37535    int mem_base;
37536    int ret_val;
37537    int code; /* UCS code point */
37538    int n_code;
37539
37540    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37541        mem_base = xmlMemBlocks();
37542        code = gen_int(n_code, 0);
37543
37544        ret_val = xmlUCSIsCatCo(code);
37545        desret_int(ret_val);
37546        call_tests++;
37547        des_int(n_code, code, 0);
37548        xmlResetLastError();
37549        if (mem_base != xmlMemBlocks()) {
37550            printf("Leak of %d blocks found in xmlUCSIsCatCo",
37551	           xmlMemBlocks() - mem_base);
37552	    test_ret++;
37553            printf(" %d", n_code);
37554            printf("\n");
37555        }
37556    }
37557    function_tests++;
37558#endif
37559
37560    return(test_ret);
37561}
37562
37563
37564static int
37565test_xmlUCSIsCatCs(void) {
37566    int test_ret = 0;
37567
37568#if defined(LIBXML_UNICODE_ENABLED)
37569    int mem_base;
37570    int ret_val;
37571    int code; /* UCS code point */
37572    int n_code;
37573
37574    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37575        mem_base = xmlMemBlocks();
37576        code = gen_int(n_code, 0);
37577
37578        ret_val = xmlUCSIsCatCs(code);
37579        desret_int(ret_val);
37580        call_tests++;
37581        des_int(n_code, code, 0);
37582        xmlResetLastError();
37583        if (mem_base != xmlMemBlocks()) {
37584            printf("Leak of %d blocks found in xmlUCSIsCatCs",
37585	           xmlMemBlocks() - mem_base);
37586	    test_ret++;
37587            printf(" %d", n_code);
37588            printf("\n");
37589        }
37590    }
37591    function_tests++;
37592#endif
37593
37594    return(test_ret);
37595}
37596
37597
37598static int
37599test_xmlUCSIsCatL(void) {
37600    int test_ret = 0;
37601
37602#if defined(LIBXML_UNICODE_ENABLED)
37603    int mem_base;
37604    int ret_val;
37605    int code; /* UCS code point */
37606    int n_code;
37607
37608    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37609        mem_base = xmlMemBlocks();
37610        code = gen_int(n_code, 0);
37611
37612        ret_val = xmlUCSIsCatL(code);
37613        desret_int(ret_val);
37614        call_tests++;
37615        des_int(n_code, code, 0);
37616        xmlResetLastError();
37617        if (mem_base != xmlMemBlocks()) {
37618            printf("Leak of %d blocks found in xmlUCSIsCatL",
37619	           xmlMemBlocks() - mem_base);
37620	    test_ret++;
37621            printf(" %d", n_code);
37622            printf("\n");
37623        }
37624    }
37625    function_tests++;
37626#endif
37627
37628    return(test_ret);
37629}
37630
37631
37632static int
37633test_xmlUCSIsCatLl(void) {
37634    int test_ret = 0;
37635
37636#if defined(LIBXML_UNICODE_ENABLED)
37637    int mem_base;
37638    int ret_val;
37639    int code; /* UCS code point */
37640    int n_code;
37641
37642    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37643        mem_base = xmlMemBlocks();
37644        code = gen_int(n_code, 0);
37645
37646        ret_val = xmlUCSIsCatLl(code);
37647        desret_int(ret_val);
37648        call_tests++;
37649        des_int(n_code, code, 0);
37650        xmlResetLastError();
37651        if (mem_base != xmlMemBlocks()) {
37652            printf("Leak of %d blocks found in xmlUCSIsCatLl",
37653	           xmlMemBlocks() - mem_base);
37654	    test_ret++;
37655            printf(" %d", n_code);
37656            printf("\n");
37657        }
37658    }
37659    function_tests++;
37660#endif
37661
37662    return(test_ret);
37663}
37664
37665
37666static int
37667test_xmlUCSIsCatLm(void) {
37668    int test_ret = 0;
37669
37670#if defined(LIBXML_UNICODE_ENABLED)
37671    int mem_base;
37672    int ret_val;
37673    int code; /* UCS code point */
37674    int n_code;
37675
37676    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37677        mem_base = xmlMemBlocks();
37678        code = gen_int(n_code, 0);
37679
37680        ret_val = xmlUCSIsCatLm(code);
37681        desret_int(ret_val);
37682        call_tests++;
37683        des_int(n_code, code, 0);
37684        xmlResetLastError();
37685        if (mem_base != xmlMemBlocks()) {
37686            printf("Leak of %d blocks found in xmlUCSIsCatLm",
37687	           xmlMemBlocks() - mem_base);
37688	    test_ret++;
37689            printf(" %d", n_code);
37690            printf("\n");
37691        }
37692    }
37693    function_tests++;
37694#endif
37695
37696    return(test_ret);
37697}
37698
37699
37700static int
37701test_xmlUCSIsCatLo(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 = xmlUCSIsCatLo(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 xmlUCSIsCatLo",
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_xmlUCSIsCatLt(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 = xmlUCSIsCatLt(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 xmlUCSIsCatLt",
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_xmlUCSIsCatLu(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 = xmlUCSIsCatLu(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 xmlUCSIsCatLu",
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_xmlUCSIsCatM(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 = xmlUCSIsCatM(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 xmlUCSIsCatM",
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_xmlUCSIsCatMc(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 = xmlUCSIsCatMc(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 xmlUCSIsCatMc",
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_xmlUCSIsCatMe(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 = xmlUCSIsCatMe(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 xmlUCSIsCatMe",
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_xmlUCSIsCatMn(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 = xmlUCSIsCatMn(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 xmlUCSIsCatMn",
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_xmlUCSIsCatN(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 = xmlUCSIsCatN(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 xmlUCSIsCatN",
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_xmlUCSIsCatNd(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 = xmlUCSIsCatNd(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 xmlUCSIsCatNd",
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_xmlUCSIsCatNl(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 = xmlUCSIsCatNl(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 xmlUCSIsCatNl",
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_xmlUCSIsCatNo(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 = xmlUCSIsCatNo(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 xmlUCSIsCatNo",
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_xmlUCSIsCatP(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 = xmlUCSIsCatP(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 xmlUCSIsCatP",
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_xmlUCSIsCatPc(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 = xmlUCSIsCatPc(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 xmlUCSIsCatPc",
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_xmlUCSIsCatPd(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 = xmlUCSIsCatPd(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 xmlUCSIsCatPd",
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_xmlUCSIsCatPe(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 = xmlUCSIsCatPe(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 xmlUCSIsCatPe",
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_xmlUCSIsCatPf(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 = xmlUCSIsCatPf(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 xmlUCSIsCatPf",
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_xmlUCSIsCatPi(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 = xmlUCSIsCatPi(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 xmlUCSIsCatPi",
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_xmlUCSIsCatPo(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 = xmlUCSIsCatPo(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 xmlUCSIsCatPo",
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_xmlUCSIsCatPs(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 = xmlUCSIsCatPs(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 xmlUCSIsCatPs",
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_xmlUCSIsCatS(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 = xmlUCSIsCatS(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 xmlUCSIsCatS",
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_xmlUCSIsCatSc(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 = xmlUCSIsCatSc(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 xmlUCSIsCatSc",
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_xmlUCSIsCatSk(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 = xmlUCSIsCatSk(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 xmlUCSIsCatSk",
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_xmlUCSIsCatSm(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 = xmlUCSIsCatSm(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 xmlUCSIsCatSm",
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_xmlUCSIsCatSo(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 = xmlUCSIsCatSo(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 xmlUCSIsCatSo",
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_xmlUCSIsCatZ(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 = xmlUCSIsCatZ(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 xmlUCSIsCatZ",
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_xmlUCSIsCatZl(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 = xmlUCSIsCatZl(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 xmlUCSIsCatZl",
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_xmlUCSIsCatZp(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 = xmlUCSIsCatZp(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 xmlUCSIsCatZp",
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_xmlUCSIsCatZs(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 = xmlUCSIsCatZs(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 xmlUCSIsCatZs",
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_xmlUCSIsCherokee(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 = xmlUCSIsCherokee(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 xmlUCSIsCherokee",
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_xmlUCSIsCombiningDiacriticalMarks(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 = xmlUCSIsCombiningDiacriticalMarks(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 xmlUCSIsCombiningDiacriticalMarks",
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_xmlUCSIsCombiningDiacriticalMarksforSymbols(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 = xmlUCSIsCombiningDiacriticalMarksforSymbols(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 xmlUCSIsCombiningDiacriticalMarksforSymbols",
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_xmlUCSIsCombiningHalfMarks(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 = xmlUCSIsCombiningHalfMarks(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 xmlUCSIsCombiningHalfMarks",
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_xmlUCSIsCombiningMarksforSymbols(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 = xmlUCSIsCombiningMarksforSymbols(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 xmlUCSIsCombiningMarksforSymbols",
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_xmlUCSIsControlPictures(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 = xmlUCSIsControlPictures(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 xmlUCSIsControlPictures",
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_xmlUCSIsCurrencySymbols(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 = xmlUCSIsCurrencySymbols(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 xmlUCSIsCurrencySymbols",
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_xmlUCSIsCypriotSyllabary(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 = xmlUCSIsCypriotSyllabary(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 xmlUCSIsCypriotSyllabary",
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_xmlUCSIsCyrillic(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 = xmlUCSIsCyrillic(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 xmlUCSIsCyrillic",
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_xmlUCSIsCyrillicSupplement(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 = xmlUCSIsCyrillicSupplement(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 xmlUCSIsCyrillicSupplement",
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_xmlUCSIsDeseret(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 = xmlUCSIsDeseret(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 xmlUCSIsDeseret",
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_xmlUCSIsDevanagari(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 = xmlUCSIsDevanagari(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 xmlUCSIsDevanagari",
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_xmlUCSIsDingbats(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 = xmlUCSIsDingbats(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 xmlUCSIsDingbats",
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_xmlUCSIsEnclosedAlphanumerics(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 = xmlUCSIsEnclosedAlphanumerics(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 xmlUCSIsEnclosedAlphanumerics",
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_xmlUCSIsEnclosedCJKLettersandMonths(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 = xmlUCSIsEnclosedCJKLettersandMonths(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 xmlUCSIsEnclosedCJKLettersandMonths",
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_xmlUCSIsEthiopic(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 = xmlUCSIsEthiopic(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 xmlUCSIsEthiopic",
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_xmlUCSIsGeneralPunctuation(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 = xmlUCSIsGeneralPunctuation(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 xmlUCSIsGeneralPunctuation",
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_xmlUCSIsGeometricShapes(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 = xmlUCSIsGeometricShapes(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 xmlUCSIsGeometricShapes",
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_xmlUCSIsGeorgian(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 = xmlUCSIsGeorgian(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 xmlUCSIsGeorgian",
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_xmlUCSIsGothic(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 = xmlUCSIsGothic(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 xmlUCSIsGothic",
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_xmlUCSIsGreek(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 = xmlUCSIsGreek(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 xmlUCSIsGreek",
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_xmlUCSIsGreekExtended(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 = xmlUCSIsGreekExtended(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 xmlUCSIsGreekExtended",
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_xmlUCSIsGreekandCoptic(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 = xmlUCSIsGreekandCoptic(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 xmlUCSIsGreekandCoptic",
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_xmlUCSIsGujarati(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 = xmlUCSIsGujarati(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 xmlUCSIsGujarati",
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_xmlUCSIsGurmukhi(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 = xmlUCSIsGurmukhi(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 xmlUCSIsGurmukhi",
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_xmlUCSIsHalfwidthandFullwidthForms(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 = xmlUCSIsHalfwidthandFullwidthForms(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 xmlUCSIsHalfwidthandFullwidthForms",
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_xmlUCSIsHangulCompatibilityJamo(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 = xmlUCSIsHangulCompatibilityJamo(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 xmlUCSIsHangulCompatibilityJamo",
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_xmlUCSIsHangulJamo(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 = xmlUCSIsHangulJamo(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 xmlUCSIsHangulJamo",
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_xmlUCSIsHangulSyllables(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 = xmlUCSIsHangulSyllables(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 xmlUCSIsHangulSyllables",
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_xmlUCSIsHanunoo(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 = xmlUCSIsHanunoo(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 xmlUCSIsHanunoo",
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_xmlUCSIsHebrew(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 = xmlUCSIsHebrew(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 xmlUCSIsHebrew",
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_xmlUCSIsHighPrivateUseSurrogates(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 = xmlUCSIsHighPrivateUseSurrogates(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 xmlUCSIsHighPrivateUseSurrogates",
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_xmlUCSIsHighSurrogates(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 = xmlUCSIsHighSurrogates(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 xmlUCSIsHighSurrogates",
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_xmlUCSIsHiragana(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 = xmlUCSIsHiragana(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 xmlUCSIsHiragana",
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_xmlUCSIsIPAExtensions(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 = xmlUCSIsIPAExtensions(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 xmlUCSIsIPAExtensions",
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_xmlUCSIsIdeographicDescriptionCharacters(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 = xmlUCSIsIdeographicDescriptionCharacters(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 xmlUCSIsIdeographicDescriptionCharacters",
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_xmlUCSIsKanbun(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 = xmlUCSIsKanbun(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 xmlUCSIsKanbun",
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_xmlUCSIsKangxiRadicals(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 = xmlUCSIsKangxiRadicals(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 xmlUCSIsKangxiRadicals",
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_xmlUCSIsKannada(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 = xmlUCSIsKannada(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 xmlUCSIsKannada",
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_xmlUCSIsKatakana(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 = xmlUCSIsKatakana(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 xmlUCSIsKatakana",
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_xmlUCSIsKatakanaPhoneticExtensions(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 = xmlUCSIsKatakanaPhoneticExtensions(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 xmlUCSIsKatakanaPhoneticExtensions",
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_xmlUCSIsKhmer(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 = xmlUCSIsKhmer(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 xmlUCSIsKhmer",
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_xmlUCSIsKhmerSymbols(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 = xmlUCSIsKhmerSymbols(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 xmlUCSIsKhmerSymbols",
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_xmlUCSIsLao(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 = xmlUCSIsLao(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 xmlUCSIsLao",
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_xmlUCSIsLatin1Supplement(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 = xmlUCSIsLatin1Supplement(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 xmlUCSIsLatin1Supplement",
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_xmlUCSIsLatinExtendedA(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 = xmlUCSIsLatinExtendedA(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 xmlUCSIsLatinExtendedA",
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_xmlUCSIsLatinExtendedAdditional(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 = xmlUCSIsLatinExtendedAdditional(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 xmlUCSIsLatinExtendedAdditional",
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_xmlUCSIsLatinExtendedB(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 = xmlUCSIsLatinExtendedB(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 xmlUCSIsLatinExtendedB",
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_xmlUCSIsLetterlikeSymbols(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 = xmlUCSIsLetterlikeSymbols(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 xmlUCSIsLetterlikeSymbols",
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_xmlUCSIsLimbu(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 = xmlUCSIsLimbu(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 xmlUCSIsLimbu",
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_xmlUCSIsLinearBIdeograms(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 = xmlUCSIsLinearBIdeograms(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 xmlUCSIsLinearBIdeograms",
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_xmlUCSIsLinearBSyllabary(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 = xmlUCSIsLinearBSyllabary(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 xmlUCSIsLinearBSyllabary",
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_xmlUCSIsLowSurrogates(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 = xmlUCSIsLowSurrogates(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 xmlUCSIsLowSurrogates",
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_xmlUCSIsMalayalam(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 = xmlUCSIsMalayalam(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 xmlUCSIsMalayalam",
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_xmlUCSIsMathematicalAlphanumericSymbols(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 = xmlUCSIsMathematicalAlphanumericSymbols(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 xmlUCSIsMathematicalAlphanumericSymbols",
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_xmlUCSIsMathematicalOperators(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 = xmlUCSIsMathematicalOperators(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 xmlUCSIsMathematicalOperators",
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_xmlUCSIsMiscellaneousMathematicalSymbolsA(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 = xmlUCSIsMiscellaneousMathematicalSymbolsA(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 xmlUCSIsMiscellaneousMathematicalSymbolsA",
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_xmlUCSIsMiscellaneousMathematicalSymbolsB(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 = xmlUCSIsMiscellaneousMathematicalSymbolsB(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 xmlUCSIsMiscellaneousMathematicalSymbolsB",
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_xmlUCSIsMiscellaneousSymbols(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 = xmlUCSIsMiscellaneousSymbols(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 xmlUCSIsMiscellaneousSymbols",
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_xmlUCSIsMiscellaneousSymbolsandArrows(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 = xmlUCSIsMiscellaneousSymbolsandArrows(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 xmlUCSIsMiscellaneousSymbolsandArrows",
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_xmlUCSIsMiscellaneousTechnical(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 = xmlUCSIsMiscellaneousTechnical(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 xmlUCSIsMiscellaneousTechnical",
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_xmlUCSIsMongolian(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 = xmlUCSIsMongolian(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 xmlUCSIsMongolian",
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_xmlUCSIsMusicalSymbols(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 = xmlUCSIsMusicalSymbols(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 xmlUCSIsMusicalSymbols",
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_xmlUCSIsMyanmar(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 = xmlUCSIsMyanmar(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 xmlUCSIsMyanmar",
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_xmlUCSIsNumberForms(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 = xmlUCSIsNumberForms(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 xmlUCSIsNumberForms",
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_xmlUCSIsOgham(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 = xmlUCSIsOgham(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 xmlUCSIsOgham",
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_xmlUCSIsOldItalic(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 = xmlUCSIsOldItalic(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 xmlUCSIsOldItalic",
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_xmlUCSIsOpticalCharacterRecognition(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 = xmlUCSIsOpticalCharacterRecognition(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 xmlUCSIsOpticalCharacterRecognition",
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_xmlUCSIsOriya(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 = xmlUCSIsOriya(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 xmlUCSIsOriya",
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_xmlUCSIsOsmanya(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 = xmlUCSIsOsmanya(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 xmlUCSIsOsmanya",
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_xmlUCSIsPhoneticExtensions(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 = xmlUCSIsPhoneticExtensions(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 xmlUCSIsPhoneticExtensions",
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_xmlUCSIsPrivateUse(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 = xmlUCSIsPrivateUse(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 xmlUCSIsPrivateUse",
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_xmlUCSIsPrivateUseArea(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 = xmlUCSIsPrivateUseArea(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 xmlUCSIsPrivateUseArea",
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_xmlUCSIsRunic(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 = xmlUCSIsRunic(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 xmlUCSIsRunic",
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_xmlUCSIsShavian(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 = xmlUCSIsShavian(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 xmlUCSIsShavian",
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_xmlUCSIsSinhala(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 = xmlUCSIsSinhala(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 xmlUCSIsSinhala",
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_xmlUCSIsSmallFormVariants(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 = xmlUCSIsSmallFormVariants(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 xmlUCSIsSmallFormVariants",
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_xmlUCSIsSpacingModifierLetters(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 = xmlUCSIsSpacingModifierLetters(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 xmlUCSIsSpacingModifierLetters",
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_xmlUCSIsSpecials(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 = xmlUCSIsSpecials(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 xmlUCSIsSpecials",
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_xmlUCSIsSuperscriptsandSubscripts(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 = xmlUCSIsSuperscriptsandSubscripts(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 xmlUCSIsSuperscriptsandSubscripts",
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_xmlUCSIsSupplementalArrowsA(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 = xmlUCSIsSupplementalArrowsA(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 xmlUCSIsSupplementalArrowsA",
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_xmlUCSIsSupplementalArrowsB(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 = xmlUCSIsSupplementalArrowsB(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 xmlUCSIsSupplementalArrowsB",
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_xmlUCSIsSupplementalMathematicalOperators(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 = xmlUCSIsSupplementalMathematicalOperators(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 xmlUCSIsSupplementalMathematicalOperators",
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_xmlUCSIsSupplementaryPrivateUseAreaA(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 = xmlUCSIsSupplementaryPrivateUseAreaA(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 xmlUCSIsSupplementaryPrivateUseAreaA",
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_xmlUCSIsSupplementaryPrivateUseAreaB(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 = xmlUCSIsSupplementaryPrivateUseAreaB(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 xmlUCSIsSupplementaryPrivateUseAreaB",
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_xmlUCSIsSyriac(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 = xmlUCSIsSyriac(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 xmlUCSIsSyriac",
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_xmlUCSIsTagalog(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 = xmlUCSIsTagalog(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 xmlUCSIsTagalog",
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_xmlUCSIsTagbanwa(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 = xmlUCSIsTagbanwa(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 xmlUCSIsTagbanwa",
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_xmlUCSIsTags(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 = xmlUCSIsTags(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 xmlUCSIsTags",
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_xmlUCSIsTaiLe(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 = xmlUCSIsTaiLe(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 xmlUCSIsTaiLe",
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_xmlUCSIsTaiXuanJingSymbols(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 = xmlUCSIsTaiXuanJingSymbols(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 xmlUCSIsTaiXuanJingSymbols",
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_xmlUCSIsTamil(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 = xmlUCSIsTamil(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 xmlUCSIsTamil",
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_xmlUCSIsTelugu(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 = xmlUCSIsTelugu(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 xmlUCSIsTelugu",
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_xmlUCSIsThaana(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 = xmlUCSIsThaana(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 xmlUCSIsThaana",
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_xmlUCSIsThai(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 = xmlUCSIsThai(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 xmlUCSIsThai",
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_xmlUCSIsTibetan(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 = xmlUCSIsTibetan(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 xmlUCSIsTibetan",
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_xmlUCSIsUgaritic(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 = xmlUCSIsUgaritic(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 xmlUCSIsUgaritic",
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_xmlUCSIsUnifiedCanadianAboriginalSyllabics(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 = xmlUCSIsUnifiedCanadianAboriginalSyllabics(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 xmlUCSIsUnifiedCanadianAboriginalSyllabics",
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_xmlUCSIsVariationSelectors(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 = xmlUCSIsVariationSelectors(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 xmlUCSIsVariationSelectors",
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_xmlUCSIsVariationSelectorsSupplement(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 = xmlUCSIsVariationSelectorsSupplement(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 xmlUCSIsVariationSelectorsSupplement",
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_xmlUCSIsYiRadicals(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 = xmlUCSIsYiRadicals(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 xmlUCSIsYiRadicals",
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_xmlUCSIsYiSyllables(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 = xmlUCSIsYiSyllables(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 xmlUCSIsYiSyllables",
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_xmlUCSIsYijingHexagramSymbols(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 = xmlUCSIsYijingHexagramSymbols(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 xmlUCSIsYijingHexagramSymbols",
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
42153static int
42154test_xmlunicode(void) {
42155    int test_ret = 0;
42156
42157    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42158    test_ret += test_xmlUCSIsAegeanNumbers();
42159    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42160    test_ret += test_xmlUCSIsArabic();
42161    test_ret += test_xmlUCSIsArabicPresentationFormsA();
42162    test_ret += test_xmlUCSIsArabicPresentationFormsB();
42163    test_ret += test_xmlUCSIsArmenian();
42164    test_ret += test_xmlUCSIsArrows();
42165    test_ret += test_xmlUCSIsBasicLatin();
42166    test_ret += test_xmlUCSIsBengali();
42167    test_ret += test_xmlUCSIsBlock();
42168    test_ret += test_xmlUCSIsBlockElements();
42169    test_ret += test_xmlUCSIsBopomofo();
42170    test_ret += test_xmlUCSIsBopomofoExtended();
42171    test_ret += test_xmlUCSIsBoxDrawing();
42172    test_ret += test_xmlUCSIsBraillePatterns();
42173    test_ret += test_xmlUCSIsBuhid();
42174    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42175    test_ret += test_xmlUCSIsCJKCompatibility();
42176    test_ret += test_xmlUCSIsCJKCompatibilityForms();
42177    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42178    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42179    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42180    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42181    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42182    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42183    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42184    test_ret += test_xmlUCSIsCat();
42185    test_ret += test_xmlUCSIsCatC();
42186    test_ret += test_xmlUCSIsCatCc();
42187    test_ret += test_xmlUCSIsCatCf();
42188    test_ret += test_xmlUCSIsCatCo();
42189    test_ret += test_xmlUCSIsCatCs();
42190    test_ret += test_xmlUCSIsCatL();
42191    test_ret += test_xmlUCSIsCatLl();
42192    test_ret += test_xmlUCSIsCatLm();
42193    test_ret += test_xmlUCSIsCatLo();
42194    test_ret += test_xmlUCSIsCatLt();
42195    test_ret += test_xmlUCSIsCatLu();
42196    test_ret += test_xmlUCSIsCatM();
42197    test_ret += test_xmlUCSIsCatMc();
42198    test_ret += test_xmlUCSIsCatMe();
42199    test_ret += test_xmlUCSIsCatMn();
42200    test_ret += test_xmlUCSIsCatN();
42201    test_ret += test_xmlUCSIsCatNd();
42202    test_ret += test_xmlUCSIsCatNl();
42203    test_ret += test_xmlUCSIsCatNo();
42204    test_ret += test_xmlUCSIsCatP();
42205    test_ret += test_xmlUCSIsCatPc();
42206    test_ret += test_xmlUCSIsCatPd();
42207    test_ret += test_xmlUCSIsCatPe();
42208    test_ret += test_xmlUCSIsCatPf();
42209    test_ret += test_xmlUCSIsCatPi();
42210    test_ret += test_xmlUCSIsCatPo();
42211    test_ret += test_xmlUCSIsCatPs();
42212    test_ret += test_xmlUCSIsCatS();
42213    test_ret += test_xmlUCSIsCatSc();
42214    test_ret += test_xmlUCSIsCatSk();
42215    test_ret += test_xmlUCSIsCatSm();
42216    test_ret += test_xmlUCSIsCatSo();
42217    test_ret += test_xmlUCSIsCatZ();
42218    test_ret += test_xmlUCSIsCatZl();
42219    test_ret += test_xmlUCSIsCatZp();
42220    test_ret += test_xmlUCSIsCatZs();
42221    test_ret += test_xmlUCSIsCherokee();
42222    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42223    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42224    test_ret += test_xmlUCSIsCombiningHalfMarks();
42225    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42226    test_ret += test_xmlUCSIsControlPictures();
42227    test_ret += test_xmlUCSIsCurrencySymbols();
42228    test_ret += test_xmlUCSIsCypriotSyllabary();
42229    test_ret += test_xmlUCSIsCyrillic();
42230    test_ret += test_xmlUCSIsCyrillicSupplement();
42231    test_ret += test_xmlUCSIsDeseret();
42232    test_ret += test_xmlUCSIsDevanagari();
42233    test_ret += test_xmlUCSIsDingbats();
42234    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42235    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42236    test_ret += test_xmlUCSIsEthiopic();
42237    test_ret += test_xmlUCSIsGeneralPunctuation();
42238    test_ret += test_xmlUCSIsGeometricShapes();
42239    test_ret += test_xmlUCSIsGeorgian();
42240    test_ret += test_xmlUCSIsGothic();
42241    test_ret += test_xmlUCSIsGreek();
42242    test_ret += test_xmlUCSIsGreekExtended();
42243    test_ret += test_xmlUCSIsGreekandCoptic();
42244    test_ret += test_xmlUCSIsGujarati();
42245    test_ret += test_xmlUCSIsGurmukhi();
42246    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42247    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42248    test_ret += test_xmlUCSIsHangulJamo();
42249    test_ret += test_xmlUCSIsHangulSyllables();
42250    test_ret += test_xmlUCSIsHanunoo();
42251    test_ret += test_xmlUCSIsHebrew();
42252    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42253    test_ret += test_xmlUCSIsHighSurrogates();
42254    test_ret += test_xmlUCSIsHiragana();
42255    test_ret += test_xmlUCSIsIPAExtensions();
42256    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42257    test_ret += test_xmlUCSIsKanbun();
42258    test_ret += test_xmlUCSIsKangxiRadicals();
42259    test_ret += test_xmlUCSIsKannada();
42260    test_ret += test_xmlUCSIsKatakana();
42261    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42262    test_ret += test_xmlUCSIsKhmer();
42263    test_ret += test_xmlUCSIsKhmerSymbols();
42264    test_ret += test_xmlUCSIsLao();
42265    test_ret += test_xmlUCSIsLatin1Supplement();
42266    test_ret += test_xmlUCSIsLatinExtendedA();
42267    test_ret += test_xmlUCSIsLatinExtendedAdditional();
42268    test_ret += test_xmlUCSIsLatinExtendedB();
42269    test_ret += test_xmlUCSIsLetterlikeSymbols();
42270    test_ret += test_xmlUCSIsLimbu();
42271    test_ret += test_xmlUCSIsLinearBIdeograms();
42272    test_ret += test_xmlUCSIsLinearBSyllabary();
42273    test_ret += test_xmlUCSIsLowSurrogates();
42274    test_ret += test_xmlUCSIsMalayalam();
42275    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42276    test_ret += test_xmlUCSIsMathematicalOperators();
42277    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42278    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42279    test_ret += test_xmlUCSIsMiscellaneousSymbols();
42280    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42281    test_ret += test_xmlUCSIsMiscellaneousTechnical();
42282    test_ret += test_xmlUCSIsMongolian();
42283    test_ret += test_xmlUCSIsMusicalSymbols();
42284    test_ret += test_xmlUCSIsMyanmar();
42285    test_ret += test_xmlUCSIsNumberForms();
42286    test_ret += test_xmlUCSIsOgham();
42287    test_ret += test_xmlUCSIsOldItalic();
42288    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42289    test_ret += test_xmlUCSIsOriya();
42290    test_ret += test_xmlUCSIsOsmanya();
42291    test_ret += test_xmlUCSIsPhoneticExtensions();
42292    test_ret += test_xmlUCSIsPrivateUse();
42293    test_ret += test_xmlUCSIsPrivateUseArea();
42294    test_ret += test_xmlUCSIsRunic();
42295    test_ret += test_xmlUCSIsShavian();
42296    test_ret += test_xmlUCSIsSinhala();
42297    test_ret += test_xmlUCSIsSmallFormVariants();
42298    test_ret += test_xmlUCSIsSpacingModifierLetters();
42299    test_ret += test_xmlUCSIsSpecials();
42300    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42301    test_ret += test_xmlUCSIsSupplementalArrowsA();
42302    test_ret += test_xmlUCSIsSupplementalArrowsB();
42303    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42304    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42305    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42306    test_ret += test_xmlUCSIsSyriac();
42307    test_ret += test_xmlUCSIsTagalog();
42308    test_ret += test_xmlUCSIsTagbanwa();
42309    test_ret += test_xmlUCSIsTags();
42310    test_ret += test_xmlUCSIsTaiLe();
42311    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42312    test_ret += test_xmlUCSIsTamil();
42313    test_ret += test_xmlUCSIsTelugu();
42314    test_ret += test_xmlUCSIsThaana();
42315    test_ret += test_xmlUCSIsThai();
42316    test_ret += test_xmlUCSIsTibetan();
42317    test_ret += test_xmlUCSIsUgaritic();
42318    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42319    test_ret += test_xmlUCSIsVariationSelectors();
42320    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42321    test_ret += test_xmlUCSIsYiRadicals();
42322    test_ret += test_xmlUCSIsYiSyllables();
42323    test_ret += test_xmlUCSIsYijingHexagramSymbols();
42324
42325    if (test_ret != 0)
42326	printf("Module xmlunicode: %d errors\n", test_ret);
42327    return(test_ret);
42328}
42329
42330static int
42331test_xmlNewTextWriter(void) {
42332    int test_ret = 0;
42333
42334#if defined(LIBXML_WRITER_ENABLED)
42335    int mem_base;
42336    xmlTextWriterPtr ret_val;
42337    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42338    int n_out;
42339
42340    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42341        mem_base = xmlMemBlocks();
42342        out = gen_xmlOutputBufferPtr(n_out, 0);
42343
42344        ret_val = xmlNewTextWriter(out);
42345        if (ret_val != NULL) out = NULL;
42346        desret_xmlTextWriterPtr(ret_val);
42347        call_tests++;
42348        des_xmlOutputBufferPtr(n_out, out, 0);
42349        xmlResetLastError();
42350        if (mem_base != xmlMemBlocks()) {
42351            printf("Leak of %d blocks found in xmlNewTextWriter",
42352	           xmlMemBlocks() - mem_base);
42353	    test_ret++;
42354            printf(" %d", n_out);
42355            printf("\n");
42356        }
42357    }
42358    function_tests++;
42359#endif
42360
42361    return(test_ret);
42362}
42363
42364
42365static int
42366test_xmlNewTextWriterFilename(void) {
42367    int test_ret = 0;
42368
42369#if defined(LIBXML_WRITER_ENABLED)
42370    int mem_base;
42371    xmlTextWriterPtr ret_val;
42372    const char * uri; /* the URI of the resource for the output */
42373    int n_uri;
42374    int compression; /* compress the output? */
42375    int n_compression;
42376
42377    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42378    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42379        mem_base = xmlMemBlocks();
42380        uri = gen_fileoutput(n_uri, 0);
42381        compression = gen_int(n_compression, 1);
42382
42383        ret_val = xmlNewTextWriterFilename(uri, compression);
42384        desret_xmlTextWriterPtr(ret_val);
42385        call_tests++;
42386        des_fileoutput(n_uri, uri, 0);
42387        des_int(n_compression, compression, 1);
42388        xmlResetLastError();
42389        if (mem_base != xmlMemBlocks()) {
42390            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42391	           xmlMemBlocks() - mem_base);
42392	    test_ret++;
42393            printf(" %d", n_uri);
42394            printf(" %d", n_compression);
42395            printf("\n");
42396        }
42397    }
42398    }
42399    function_tests++;
42400#endif
42401
42402    return(test_ret);
42403}
42404
42405
42406static int
42407test_xmlNewTextWriterMemory(void) {
42408    int test_ret = 0;
42409
42410#if defined(LIBXML_WRITER_ENABLED)
42411    int mem_base;
42412    xmlTextWriterPtr ret_val;
42413    xmlBufferPtr buf; /* xmlBufferPtr */
42414    int n_buf;
42415    int compression; /* compress the output? */
42416    int n_compression;
42417
42418    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42419    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42420        mem_base = xmlMemBlocks();
42421        buf = gen_xmlBufferPtr(n_buf, 0);
42422        compression = gen_int(n_compression, 1);
42423
42424        ret_val = xmlNewTextWriterMemory(buf, compression);
42425        desret_xmlTextWriterPtr(ret_val);
42426        call_tests++;
42427        des_xmlBufferPtr(n_buf, buf, 0);
42428        des_int(n_compression, compression, 1);
42429        xmlResetLastError();
42430        if (mem_base != xmlMemBlocks()) {
42431            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42432	           xmlMemBlocks() - mem_base);
42433	    test_ret++;
42434            printf(" %d", n_buf);
42435            printf(" %d", n_compression);
42436            printf("\n");
42437        }
42438    }
42439    }
42440    function_tests++;
42441#endif
42442
42443    return(test_ret);
42444}
42445
42446
42447static int
42448test_xmlNewTextWriterPushParser(void) {
42449    int test_ret = 0;
42450
42451#if defined(LIBXML_WRITER_ENABLED)
42452    int mem_base;
42453    xmlTextWriterPtr ret_val;
42454    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42455    int n_ctxt;
42456    int compression; /* compress the output? */
42457    int n_compression;
42458
42459    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42460    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42461        mem_base = xmlMemBlocks();
42462        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42463        compression = gen_int(n_compression, 1);
42464
42465        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42466        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42467        desret_xmlTextWriterPtr(ret_val);
42468        call_tests++;
42469        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42470        des_int(n_compression, compression, 1);
42471        xmlResetLastError();
42472        if (mem_base != xmlMemBlocks()) {
42473            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42474	           xmlMemBlocks() - mem_base);
42475	    test_ret++;
42476            printf(" %d", n_ctxt);
42477            printf(" %d", n_compression);
42478            printf("\n");
42479        }
42480    }
42481    }
42482    function_tests++;
42483#endif
42484
42485    return(test_ret);
42486}
42487
42488
42489static int
42490test_xmlNewTextWriterTree(void) {
42491    int test_ret = 0;
42492
42493#if defined(LIBXML_WRITER_ENABLED)
42494    int mem_base;
42495    xmlTextWriterPtr ret_val;
42496    xmlDocPtr doc; /* xmlDocPtr */
42497    int n_doc;
42498    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42499    int n_node;
42500    int compression; /* compress the output? */
42501    int n_compression;
42502
42503    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42504    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42505    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42506        mem_base = xmlMemBlocks();
42507        doc = gen_xmlDocPtr(n_doc, 0);
42508        node = gen_xmlNodePtr(n_node, 1);
42509        compression = gen_int(n_compression, 2);
42510
42511        ret_val = xmlNewTextWriterTree(doc, node, compression);
42512        desret_xmlTextWriterPtr(ret_val);
42513        call_tests++;
42514        des_xmlDocPtr(n_doc, doc, 0);
42515        des_xmlNodePtr(n_node, node, 1);
42516        des_int(n_compression, compression, 2);
42517        xmlResetLastError();
42518        if (mem_base != xmlMemBlocks()) {
42519            printf("Leak of %d blocks found in xmlNewTextWriterTree",
42520	           xmlMemBlocks() - mem_base);
42521	    test_ret++;
42522            printf(" %d", n_doc);
42523            printf(" %d", n_node);
42524            printf(" %d", n_compression);
42525            printf("\n");
42526        }
42527    }
42528    }
42529    }
42530    function_tests++;
42531#endif
42532
42533    return(test_ret);
42534}
42535
42536
42537static int
42538test_xmlTextWriterEndAttribute(void) {
42539    int test_ret = 0;
42540
42541#if defined(LIBXML_WRITER_ENABLED)
42542    int mem_base;
42543    int ret_val;
42544    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42545    int n_writer;
42546
42547    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42548        mem_base = xmlMemBlocks();
42549        writer = gen_xmlTextWriterPtr(n_writer, 0);
42550
42551        ret_val = xmlTextWriterEndAttribute(writer);
42552        desret_int(ret_val);
42553        call_tests++;
42554        des_xmlTextWriterPtr(n_writer, writer, 0);
42555        xmlResetLastError();
42556        if (mem_base != xmlMemBlocks()) {
42557            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42558	           xmlMemBlocks() - mem_base);
42559	    test_ret++;
42560            printf(" %d", n_writer);
42561            printf("\n");
42562        }
42563    }
42564    function_tests++;
42565#endif
42566
42567    return(test_ret);
42568}
42569
42570
42571static int
42572test_xmlTextWriterEndCDATA(void) {
42573    int test_ret = 0;
42574
42575#if defined(LIBXML_WRITER_ENABLED)
42576    int mem_base;
42577    int ret_val;
42578    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42579    int n_writer;
42580
42581    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42582        mem_base = xmlMemBlocks();
42583        writer = gen_xmlTextWriterPtr(n_writer, 0);
42584
42585        ret_val = xmlTextWriterEndCDATA(writer);
42586        desret_int(ret_val);
42587        call_tests++;
42588        des_xmlTextWriterPtr(n_writer, writer, 0);
42589        xmlResetLastError();
42590        if (mem_base != xmlMemBlocks()) {
42591            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42592	           xmlMemBlocks() - mem_base);
42593	    test_ret++;
42594            printf(" %d", n_writer);
42595            printf("\n");
42596        }
42597    }
42598    function_tests++;
42599#endif
42600
42601    return(test_ret);
42602}
42603
42604
42605static int
42606test_xmlTextWriterEndComment(void) {
42607    int test_ret = 0;
42608
42609#if defined(LIBXML_WRITER_ENABLED)
42610    int mem_base;
42611    int ret_val;
42612    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42613    int n_writer;
42614
42615    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42616        mem_base = xmlMemBlocks();
42617        writer = gen_xmlTextWriterPtr(n_writer, 0);
42618
42619        ret_val = xmlTextWriterEndComment(writer);
42620        desret_int(ret_val);
42621        call_tests++;
42622        des_xmlTextWriterPtr(n_writer, writer, 0);
42623        xmlResetLastError();
42624        if (mem_base != xmlMemBlocks()) {
42625            printf("Leak of %d blocks found in xmlTextWriterEndComment",
42626	           xmlMemBlocks() - mem_base);
42627	    test_ret++;
42628            printf(" %d", n_writer);
42629            printf("\n");
42630        }
42631    }
42632    function_tests++;
42633#endif
42634
42635    return(test_ret);
42636}
42637
42638
42639static int
42640test_xmlTextWriterEndDTD(void) {
42641    int test_ret = 0;
42642
42643#if defined(LIBXML_WRITER_ENABLED)
42644    int mem_base;
42645    int ret_val;
42646    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42647    int n_writer;
42648
42649    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42650        mem_base = xmlMemBlocks();
42651        writer = gen_xmlTextWriterPtr(n_writer, 0);
42652
42653        ret_val = xmlTextWriterEndDTD(writer);
42654        desret_int(ret_val);
42655        call_tests++;
42656        des_xmlTextWriterPtr(n_writer, writer, 0);
42657        xmlResetLastError();
42658        if (mem_base != xmlMemBlocks()) {
42659            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42660	           xmlMemBlocks() - mem_base);
42661	    test_ret++;
42662            printf(" %d", n_writer);
42663            printf("\n");
42664        }
42665    }
42666    function_tests++;
42667#endif
42668
42669    return(test_ret);
42670}
42671
42672
42673static int
42674test_xmlTextWriterEndDTDAttlist(void) {
42675    int test_ret = 0;
42676
42677#if defined(LIBXML_WRITER_ENABLED)
42678    int mem_base;
42679    int ret_val;
42680    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42681    int n_writer;
42682
42683    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42684        mem_base = xmlMemBlocks();
42685        writer = gen_xmlTextWriterPtr(n_writer, 0);
42686
42687        ret_val = xmlTextWriterEndDTDAttlist(writer);
42688        desret_int(ret_val);
42689        call_tests++;
42690        des_xmlTextWriterPtr(n_writer, writer, 0);
42691        xmlResetLastError();
42692        if (mem_base != xmlMemBlocks()) {
42693            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42694	           xmlMemBlocks() - mem_base);
42695	    test_ret++;
42696            printf(" %d", n_writer);
42697            printf("\n");
42698        }
42699    }
42700    function_tests++;
42701#endif
42702
42703    return(test_ret);
42704}
42705
42706
42707static int
42708test_xmlTextWriterEndDTDElement(void) {
42709    int test_ret = 0;
42710
42711#if defined(LIBXML_WRITER_ENABLED)
42712    int mem_base;
42713    int ret_val;
42714    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42715    int n_writer;
42716
42717    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42718        mem_base = xmlMemBlocks();
42719        writer = gen_xmlTextWriterPtr(n_writer, 0);
42720
42721        ret_val = xmlTextWriterEndDTDElement(writer);
42722        desret_int(ret_val);
42723        call_tests++;
42724        des_xmlTextWriterPtr(n_writer, writer, 0);
42725        xmlResetLastError();
42726        if (mem_base != xmlMemBlocks()) {
42727            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
42728	           xmlMemBlocks() - mem_base);
42729	    test_ret++;
42730            printf(" %d", n_writer);
42731            printf("\n");
42732        }
42733    }
42734    function_tests++;
42735#endif
42736
42737    return(test_ret);
42738}
42739
42740
42741static int
42742test_xmlTextWriterEndDTDEntity(void) {
42743    int test_ret = 0;
42744
42745#if defined(LIBXML_WRITER_ENABLED)
42746    int mem_base;
42747    int ret_val;
42748    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42749    int n_writer;
42750
42751    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42752        mem_base = xmlMemBlocks();
42753        writer = gen_xmlTextWriterPtr(n_writer, 0);
42754
42755        ret_val = xmlTextWriterEndDTDEntity(writer);
42756        desret_int(ret_val);
42757        call_tests++;
42758        des_xmlTextWriterPtr(n_writer, writer, 0);
42759        xmlResetLastError();
42760        if (mem_base != xmlMemBlocks()) {
42761            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
42762	           xmlMemBlocks() - mem_base);
42763	    test_ret++;
42764            printf(" %d", n_writer);
42765            printf("\n");
42766        }
42767    }
42768    function_tests++;
42769#endif
42770
42771    return(test_ret);
42772}
42773
42774
42775static int
42776test_xmlTextWriterEndDocument(void) {
42777    int test_ret = 0;
42778
42779#if defined(LIBXML_WRITER_ENABLED)
42780    int mem_base;
42781    int ret_val;
42782    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42783    int n_writer;
42784
42785    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42786        mem_base = xmlMemBlocks();
42787        writer = gen_xmlTextWriterPtr(n_writer, 0);
42788
42789        ret_val = xmlTextWriterEndDocument(writer);
42790        desret_int(ret_val);
42791        call_tests++;
42792        des_xmlTextWriterPtr(n_writer, writer, 0);
42793        xmlResetLastError();
42794        if (mem_base != xmlMemBlocks()) {
42795            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
42796	           xmlMemBlocks() - mem_base);
42797	    test_ret++;
42798            printf(" %d", n_writer);
42799            printf("\n");
42800        }
42801    }
42802    function_tests++;
42803#endif
42804
42805    return(test_ret);
42806}
42807
42808
42809static int
42810test_xmlTextWriterEndElement(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 = xmlTextWriterEndElement(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 xmlTextWriterEndElement",
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_xmlTextWriterEndPI(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 = xmlTextWriterEndPI(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 xmlTextWriterEndPI",
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_xmlTextWriterFlush(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 = xmlTextWriterFlush(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 xmlTextWriterFlush",
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_xmlTextWriterFullEndElement(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 = xmlTextWriterFullEndElement(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 xmlTextWriterFullEndElement",
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_xmlTextWriterSetIndent(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    int indent; /* do indentation? */
42955    int n_indent;
42956
42957    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42958    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
42959        mem_base = xmlMemBlocks();
42960        writer = gen_xmlTextWriterPtr(n_writer, 0);
42961        indent = gen_int(n_indent, 1);
42962
42963        ret_val = xmlTextWriterSetIndent(writer, indent);
42964        desret_int(ret_val);
42965        call_tests++;
42966        des_xmlTextWriterPtr(n_writer, writer, 0);
42967        des_int(n_indent, indent, 1);
42968        xmlResetLastError();
42969        if (mem_base != xmlMemBlocks()) {
42970            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
42971	           xmlMemBlocks() - mem_base);
42972	    test_ret++;
42973            printf(" %d", n_writer);
42974            printf(" %d", n_indent);
42975            printf("\n");
42976        }
42977    }
42978    }
42979    function_tests++;
42980#endif
42981
42982    return(test_ret);
42983}
42984
42985
42986static int
42987test_xmlTextWriterSetIndentString(void) {
42988    int test_ret = 0;
42989
42990#if defined(LIBXML_WRITER_ENABLED)
42991    int mem_base;
42992    int ret_val;
42993    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42994    int n_writer;
42995    xmlChar * str; /* the xmlChar string */
42996    int n_str;
42997
42998    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42999    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43000        mem_base = xmlMemBlocks();
43001        writer = gen_xmlTextWriterPtr(n_writer, 0);
43002        str = gen_const_xmlChar_ptr(n_str, 1);
43003
43004        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43005        desret_int(ret_val);
43006        call_tests++;
43007        des_xmlTextWriterPtr(n_writer, writer, 0);
43008        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43009        xmlResetLastError();
43010        if (mem_base != xmlMemBlocks()) {
43011            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43012	           xmlMemBlocks() - mem_base);
43013	    test_ret++;
43014            printf(" %d", n_writer);
43015            printf(" %d", n_str);
43016            printf("\n");
43017        }
43018    }
43019    }
43020    function_tests++;
43021#endif
43022
43023    return(test_ret);
43024}
43025
43026
43027static int
43028test_xmlTextWriterStartAttribute(void) {
43029    int test_ret = 0;
43030
43031#if defined(LIBXML_WRITER_ENABLED)
43032    int mem_base;
43033    int ret_val;
43034    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43035    int n_writer;
43036    xmlChar * name; /* element name */
43037    int n_name;
43038
43039    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43040    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43041        mem_base = xmlMemBlocks();
43042        writer = gen_xmlTextWriterPtr(n_writer, 0);
43043        name = gen_const_xmlChar_ptr(n_name, 1);
43044
43045        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43046        desret_int(ret_val);
43047        call_tests++;
43048        des_xmlTextWriterPtr(n_writer, writer, 0);
43049        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43050        xmlResetLastError();
43051        if (mem_base != xmlMemBlocks()) {
43052            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43053	           xmlMemBlocks() - mem_base);
43054	    test_ret++;
43055            printf(" %d", n_writer);
43056            printf(" %d", n_name);
43057            printf("\n");
43058        }
43059    }
43060    }
43061    function_tests++;
43062#endif
43063
43064    return(test_ret);
43065}
43066
43067
43068static int
43069test_xmlTextWriterStartAttributeNS(void) {
43070    int test_ret = 0;
43071
43072#if defined(LIBXML_WRITER_ENABLED)
43073    int mem_base;
43074    int ret_val;
43075    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43076    int n_writer;
43077    xmlChar * prefix; /* namespace prefix or NULL */
43078    int n_prefix;
43079    xmlChar * name; /* element local name */
43080    int n_name;
43081    xmlChar * namespaceURI; /* namespace URI or NULL */
43082    int n_namespaceURI;
43083
43084    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43085    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43086    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43087    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43088        mem_base = xmlMemBlocks();
43089        writer = gen_xmlTextWriterPtr(n_writer, 0);
43090        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43091        name = gen_const_xmlChar_ptr(n_name, 2);
43092        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43093
43094        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43095        desret_int(ret_val);
43096        call_tests++;
43097        des_xmlTextWriterPtr(n_writer, writer, 0);
43098        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43099        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43100        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43101        xmlResetLastError();
43102        if (mem_base != xmlMemBlocks()) {
43103            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43104	           xmlMemBlocks() - mem_base);
43105	    test_ret++;
43106            printf(" %d", n_writer);
43107            printf(" %d", n_prefix);
43108            printf(" %d", n_name);
43109            printf(" %d", n_namespaceURI);
43110            printf("\n");
43111        }
43112    }
43113    }
43114    }
43115    }
43116    function_tests++;
43117#endif
43118
43119    return(test_ret);
43120}
43121
43122
43123static int
43124test_xmlTextWriterStartCDATA(void) {
43125    int test_ret = 0;
43126
43127#if defined(LIBXML_WRITER_ENABLED)
43128    int mem_base;
43129    int ret_val;
43130    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43131    int n_writer;
43132
43133    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43134        mem_base = xmlMemBlocks();
43135        writer = gen_xmlTextWriterPtr(n_writer, 0);
43136
43137        ret_val = xmlTextWriterStartCDATA(writer);
43138        desret_int(ret_val);
43139        call_tests++;
43140        des_xmlTextWriterPtr(n_writer, writer, 0);
43141        xmlResetLastError();
43142        if (mem_base != xmlMemBlocks()) {
43143            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43144	           xmlMemBlocks() - mem_base);
43145	    test_ret++;
43146            printf(" %d", n_writer);
43147            printf("\n");
43148        }
43149    }
43150    function_tests++;
43151#endif
43152
43153    return(test_ret);
43154}
43155
43156
43157static int
43158test_xmlTextWriterStartComment(void) {
43159    int test_ret = 0;
43160
43161#if defined(LIBXML_WRITER_ENABLED)
43162    int mem_base;
43163    int ret_val;
43164    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43165    int n_writer;
43166
43167    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43168        mem_base = xmlMemBlocks();
43169        writer = gen_xmlTextWriterPtr(n_writer, 0);
43170
43171        ret_val = xmlTextWriterStartComment(writer);
43172        desret_int(ret_val);
43173        call_tests++;
43174        des_xmlTextWriterPtr(n_writer, writer, 0);
43175        xmlResetLastError();
43176        if (mem_base != xmlMemBlocks()) {
43177            printf("Leak of %d blocks found in xmlTextWriterStartComment",
43178	           xmlMemBlocks() - mem_base);
43179	    test_ret++;
43180            printf(" %d", n_writer);
43181            printf("\n");
43182        }
43183    }
43184    function_tests++;
43185#endif
43186
43187    return(test_ret);
43188}
43189
43190
43191static int
43192test_xmlTextWriterStartDTD(void) {
43193    int test_ret = 0;
43194
43195#if defined(LIBXML_WRITER_ENABLED)
43196    int mem_base;
43197    int ret_val;
43198    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43199    int n_writer;
43200    xmlChar * name; /* the name of the DTD */
43201    int n_name;
43202    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43203    int n_pubid;
43204    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43205    int n_sysid;
43206
43207    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43208    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43209    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43210    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43211        mem_base = xmlMemBlocks();
43212        writer = gen_xmlTextWriterPtr(n_writer, 0);
43213        name = gen_const_xmlChar_ptr(n_name, 1);
43214        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43215        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43216
43217        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43218        desret_int(ret_val);
43219        call_tests++;
43220        des_xmlTextWriterPtr(n_writer, writer, 0);
43221        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43222        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43223        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43224        xmlResetLastError();
43225        if (mem_base != xmlMemBlocks()) {
43226            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43227	           xmlMemBlocks() - mem_base);
43228	    test_ret++;
43229            printf(" %d", n_writer);
43230            printf(" %d", n_name);
43231            printf(" %d", n_pubid);
43232            printf(" %d", n_sysid);
43233            printf("\n");
43234        }
43235    }
43236    }
43237    }
43238    }
43239    function_tests++;
43240#endif
43241
43242    return(test_ret);
43243}
43244
43245
43246static int
43247test_xmlTextWriterStartDTDAttlist(void) {
43248    int test_ret = 0;
43249
43250#if defined(LIBXML_WRITER_ENABLED)
43251    int mem_base;
43252    int ret_val;
43253    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43254    int n_writer;
43255    xmlChar * name; /* the name of the DTD ATTLIST */
43256    int n_name;
43257
43258    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43259    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43260        mem_base = xmlMemBlocks();
43261        writer = gen_xmlTextWriterPtr(n_writer, 0);
43262        name = gen_const_xmlChar_ptr(n_name, 1);
43263
43264        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43265        desret_int(ret_val);
43266        call_tests++;
43267        des_xmlTextWriterPtr(n_writer, writer, 0);
43268        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43269        xmlResetLastError();
43270        if (mem_base != xmlMemBlocks()) {
43271            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43272	           xmlMemBlocks() - mem_base);
43273	    test_ret++;
43274            printf(" %d", n_writer);
43275            printf(" %d", n_name);
43276            printf("\n");
43277        }
43278    }
43279    }
43280    function_tests++;
43281#endif
43282
43283    return(test_ret);
43284}
43285
43286
43287static int
43288test_xmlTextWriterStartDTDElement(void) {
43289    int test_ret = 0;
43290
43291#if defined(LIBXML_WRITER_ENABLED)
43292    int mem_base;
43293    int ret_val;
43294    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43295    int n_writer;
43296    xmlChar * name; /* the name of the DTD element */
43297    int n_name;
43298
43299    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43300    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43301        mem_base = xmlMemBlocks();
43302        writer = gen_xmlTextWriterPtr(n_writer, 0);
43303        name = gen_const_xmlChar_ptr(n_name, 1);
43304
43305        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43306        desret_int(ret_val);
43307        call_tests++;
43308        des_xmlTextWriterPtr(n_writer, writer, 0);
43309        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43310        xmlResetLastError();
43311        if (mem_base != xmlMemBlocks()) {
43312            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43313	           xmlMemBlocks() - mem_base);
43314	    test_ret++;
43315            printf(" %d", n_writer);
43316            printf(" %d", n_name);
43317            printf("\n");
43318        }
43319    }
43320    }
43321    function_tests++;
43322#endif
43323
43324    return(test_ret);
43325}
43326
43327
43328static int
43329test_xmlTextWriterStartDTDEntity(void) {
43330    int test_ret = 0;
43331
43332#if defined(LIBXML_WRITER_ENABLED)
43333    int mem_base;
43334    int ret_val;
43335    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43336    int n_writer;
43337    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43338    int n_pe;
43339    xmlChar * name; /* the name of the DTD ATTLIST */
43340    int n_name;
43341
43342    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43343    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43344    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43345        mem_base = xmlMemBlocks();
43346        writer = gen_xmlTextWriterPtr(n_writer, 0);
43347        pe = gen_int(n_pe, 1);
43348        name = gen_const_xmlChar_ptr(n_name, 2);
43349
43350        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43351        desret_int(ret_val);
43352        call_tests++;
43353        des_xmlTextWriterPtr(n_writer, writer, 0);
43354        des_int(n_pe, pe, 1);
43355        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43356        xmlResetLastError();
43357        if (mem_base != xmlMemBlocks()) {
43358            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43359	           xmlMemBlocks() - mem_base);
43360	    test_ret++;
43361            printf(" %d", n_writer);
43362            printf(" %d", n_pe);
43363            printf(" %d", n_name);
43364            printf("\n");
43365        }
43366    }
43367    }
43368    }
43369    function_tests++;
43370#endif
43371
43372    return(test_ret);
43373}
43374
43375
43376static int
43377test_xmlTextWriterStartDocument(void) {
43378    int test_ret = 0;
43379
43380#if defined(LIBXML_WRITER_ENABLED)
43381    int mem_base;
43382    int ret_val;
43383    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43384    int n_writer;
43385    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43386    int n_version;
43387    char * encoding; /* the encoding or NULL for default */
43388    int n_encoding;
43389    char * standalone; /* "yes" or "no" or NULL for default */
43390    int n_standalone;
43391
43392    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43393    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43394    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43395    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43396        mem_base = xmlMemBlocks();
43397        writer = gen_xmlTextWriterPtr(n_writer, 0);
43398        version = gen_const_char_ptr(n_version, 1);
43399        encoding = gen_const_char_ptr(n_encoding, 2);
43400        standalone = gen_const_char_ptr(n_standalone, 3);
43401
43402        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43403        desret_int(ret_val);
43404        call_tests++;
43405        des_xmlTextWriterPtr(n_writer, writer, 0);
43406        des_const_char_ptr(n_version, (const char *)version, 1);
43407        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43408        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43409        xmlResetLastError();
43410        if (mem_base != xmlMemBlocks()) {
43411            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43412	           xmlMemBlocks() - mem_base);
43413	    test_ret++;
43414            printf(" %d", n_writer);
43415            printf(" %d", n_version);
43416            printf(" %d", n_encoding);
43417            printf(" %d", n_standalone);
43418            printf("\n");
43419        }
43420    }
43421    }
43422    }
43423    }
43424    function_tests++;
43425#endif
43426
43427    return(test_ret);
43428}
43429
43430
43431static int
43432test_xmlTextWriterStartElement(void) {
43433    int test_ret = 0;
43434
43435#if defined(LIBXML_WRITER_ENABLED)
43436    int mem_base;
43437    int ret_val;
43438    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43439    int n_writer;
43440    xmlChar * name; /* element name */
43441    int n_name;
43442
43443    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43444    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43445        mem_base = xmlMemBlocks();
43446        writer = gen_xmlTextWriterPtr(n_writer, 0);
43447        name = gen_const_xmlChar_ptr(n_name, 1);
43448
43449        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43450        desret_int(ret_val);
43451        call_tests++;
43452        des_xmlTextWriterPtr(n_writer, writer, 0);
43453        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43454        xmlResetLastError();
43455        if (mem_base != xmlMemBlocks()) {
43456            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43457	           xmlMemBlocks() - mem_base);
43458	    test_ret++;
43459            printf(" %d", n_writer);
43460            printf(" %d", n_name);
43461            printf("\n");
43462        }
43463    }
43464    }
43465    function_tests++;
43466#endif
43467
43468    return(test_ret);
43469}
43470
43471
43472static int
43473test_xmlTextWriterStartElementNS(void) {
43474    int test_ret = 0;
43475
43476#if defined(LIBXML_WRITER_ENABLED)
43477    int mem_base;
43478    int ret_val;
43479    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43480    int n_writer;
43481    xmlChar * prefix; /* namespace prefix or NULL */
43482    int n_prefix;
43483    xmlChar * name; /* element local name */
43484    int n_name;
43485    xmlChar * namespaceURI; /* namespace URI or NULL */
43486    int n_namespaceURI;
43487
43488    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43489    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43490    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43491    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43492        mem_base = xmlMemBlocks();
43493        writer = gen_xmlTextWriterPtr(n_writer, 0);
43494        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43495        name = gen_const_xmlChar_ptr(n_name, 2);
43496        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43497
43498        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43499        desret_int(ret_val);
43500        call_tests++;
43501        des_xmlTextWriterPtr(n_writer, writer, 0);
43502        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43503        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43504        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43505        xmlResetLastError();
43506        if (mem_base != xmlMemBlocks()) {
43507            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43508	           xmlMemBlocks() - mem_base);
43509	    test_ret++;
43510            printf(" %d", n_writer);
43511            printf(" %d", n_prefix);
43512            printf(" %d", n_name);
43513            printf(" %d", n_namespaceURI);
43514            printf("\n");
43515        }
43516    }
43517    }
43518    }
43519    }
43520    function_tests++;
43521#endif
43522
43523    return(test_ret);
43524}
43525
43526
43527static int
43528test_xmlTextWriterStartPI(void) {
43529    int test_ret = 0;
43530
43531#if defined(LIBXML_WRITER_ENABLED)
43532    int mem_base;
43533    int ret_val;
43534    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43535    int n_writer;
43536    xmlChar * target; /* PI target */
43537    int n_target;
43538
43539    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43540    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43541        mem_base = xmlMemBlocks();
43542        writer = gen_xmlTextWriterPtr(n_writer, 0);
43543        target = gen_const_xmlChar_ptr(n_target, 1);
43544
43545        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43546        desret_int(ret_val);
43547        call_tests++;
43548        des_xmlTextWriterPtr(n_writer, writer, 0);
43549        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43550        xmlResetLastError();
43551        if (mem_base != xmlMemBlocks()) {
43552            printf("Leak of %d blocks found in xmlTextWriterStartPI",
43553	           xmlMemBlocks() - mem_base);
43554	    test_ret++;
43555            printf(" %d", n_writer);
43556            printf(" %d", n_target);
43557            printf("\n");
43558        }
43559    }
43560    }
43561    function_tests++;
43562#endif
43563
43564    return(test_ret);
43565}
43566
43567
43568static int
43569test_xmlTextWriterWriteAttribute(void) {
43570    int test_ret = 0;
43571
43572#if defined(LIBXML_WRITER_ENABLED)
43573    int mem_base;
43574    int ret_val;
43575    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43576    int n_writer;
43577    xmlChar * name; /* attribute name */
43578    int n_name;
43579    xmlChar * content; /* attribute content */
43580    int n_content;
43581
43582    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43583    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43584    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43585        mem_base = xmlMemBlocks();
43586        writer = gen_xmlTextWriterPtr(n_writer, 0);
43587        name = gen_const_xmlChar_ptr(n_name, 1);
43588        content = gen_const_xmlChar_ptr(n_content, 2);
43589
43590        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43591        desret_int(ret_val);
43592        call_tests++;
43593        des_xmlTextWriterPtr(n_writer, writer, 0);
43594        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43595        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43596        xmlResetLastError();
43597        if (mem_base != xmlMemBlocks()) {
43598            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43599	           xmlMemBlocks() - mem_base);
43600	    test_ret++;
43601            printf(" %d", n_writer);
43602            printf(" %d", n_name);
43603            printf(" %d", n_content);
43604            printf("\n");
43605        }
43606    }
43607    }
43608    }
43609    function_tests++;
43610#endif
43611
43612    return(test_ret);
43613}
43614
43615
43616static int
43617test_xmlTextWriterWriteAttributeNS(void) {
43618    int test_ret = 0;
43619
43620#if defined(LIBXML_WRITER_ENABLED)
43621    int mem_base;
43622    int ret_val;
43623    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43624    int n_writer;
43625    xmlChar * prefix; /* namespace prefix */
43626    int n_prefix;
43627    xmlChar * name; /* attribute local name */
43628    int n_name;
43629    xmlChar * namespaceURI; /* namespace URI */
43630    int n_namespaceURI;
43631    xmlChar * content; /* attribute content */
43632    int n_content;
43633
43634    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43635    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43636    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43637    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43638    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43639        mem_base = xmlMemBlocks();
43640        writer = gen_xmlTextWriterPtr(n_writer, 0);
43641        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43642        name = gen_const_xmlChar_ptr(n_name, 2);
43643        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43644        content = gen_const_xmlChar_ptr(n_content, 4);
43645
43646        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43647        desret_int(ret_val);
43648        call_tests++;
43649        des_xmlTextWriterPtr(n_writer, writer, 0);
43650        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43651        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43652        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43653        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43654        xmlResetLastError();
43655        if (mem_base != xmlMemBlocks()) {
43656            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43657	           xmlMemBlocks() - mem_base);
43658	    test_ret++;
43659            printf(" %d", n_writer);
43660            printf(" %d", n_prefix);
43661            printf(" %d", n_name);
43662            printf(" %d", n_namespaceURI);
43663            printf(" %d", n_content);
43664            printf("\n");
43665        }
43666    }
43667    }
43668    }
43669    }
43670    }
43671    function_tests++;
43672#endif
43673
43674    return(test_ret);
43675}
43676
43677
43678static int
43679test_xmlTextWriterWriteBase64(void) {
43680    int test_ret = 0;
43681
43682#if defined(LIBXML_WRITER_ENABLED)
43683    int mem_base;
43684    int ret_val;
43685    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43686    int n_writer;
43687    char * data; /* binary data */
43688    int n_data;
43689    int start; /* the position within the data of the first byte to encode */
43690    int n_start;
43691    int len; /* the number of bytes to encode */
43692    int n_len;
43693
43694    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43695    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43696    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43697    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43698        mem_base = xmlMemBlocks();
43699        writer = gen_xmlTextWriterPtr(n_writer, 0);
43700        data = gen_const_char_ptr(n_data, 1);
43701        start = gen_int(n_start, 2);
43702        len = gen_int(n_len, 3);
43703
43704        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43705        desret_int(ret_val);
43706        call_tests++;
43707        des_xmlTextWriterPtr(n_writer, writer, 0);
43708        des_const_char_ptr(n_data, (const char *)data, 1);
43709        des_int(n_start, start, 2);
43710        des_int(n_len, len, 3);
43711        xmlResetLastError();
43712        if (mem_base != xmlMemBlocks()) {
43713            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43714	           xmlMemBlocks() - mem_base);
43715	    test_ret++;
43716            printf(" %d", n_writer);
43717            printf(" %d", n_data);
43718            printf(" %d", n_start);
43719            printf(" %d", n_len);
43720            printf("\n");
43721        }
43722    }
43723    }
43724    }
43725    }
43726    function_tests++;
43727#endif
43728
43729    return(test_ret);
43730}
43731
43732
43733static int
43734test_xmlTextWriterWriteBinHex(void) {
43735    int test_ret = 0;
43736
43737#if defined(LIBXML_WRITER_ENABLED)
43738    int mem_base;
43739    int ret_val;
43740    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43741    int n_writer;
43742    char * data; /* binary data */
43743    int n_data;
43744    int start; /* the position within the data of the first byte to encode */
43745    int n_start;
43746    int len; /* the number of bytes to encode */
43747    int n_len;
43748
43749    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43750    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43751    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43752    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43753        mem_base = xmlMemBlocks();
43754        writer = gen_xmlTextWriterPtr(n_writer, 0);
43755        data = gen_const_char_ptr(n_data, 1);
43756        start = gen_int(n_start, 2);
43757        len = gen_int(n_len, 3);
43758
43759        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
43760        desret_int(ret_val);
43761        call_tests++;
43762        des_xmlTextWriterPtr(n_writer, writer, 0);
43763        des_const_char_ptr(n_data, (const char *)data, 1);
43764        des_int(n_start, start, 2);
43765        des_int(n_len, len, 3);
43766        xmlResetLastError();
43767        if (mem_base != xmlMemBlocks()) {
43768            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
43769	           xmlMemBlocks() - mem_base);
43770	    test_ret++;
43771            printf(" %d", n_writer);
43772            printf(" %d", n_data);
43773            printf(" %d", n_start);
43774            printf(" %d", n_len);
43775            printf("\n");
43776        }
43777    }
43778    }
43779    }
43780    }
43781    function_tests++;
43782#endif
43783
43784    return(test_ret);
43785}
43786
43787
43788static int
43789test_xmlTextWriterWriteCDATA(void) {
43790    int test_ret = 0;
43791
43792#if defined(LIBXML_WRITER_ENABLED)
43793    int mem_base;
43794    int ret_val;
43795    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43796    int n_writer;
43797    xmlChar * content; /* CDATA content */
43798    int n_content;
43799
43800    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43801    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43802        mem_base = xmlMemBlocks();
43803        writer = gen_xmlTextWriterPtr(n_writer, 0);
43804        content = gen_const_xmlChar_ptr(n_content, 1);
43805
43806        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
43807        desret_int(ret_val);
43808        call_tests++;
43809        des_xmlTextWriterPtr(n_writer, writer, 0);
43810        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43811        xmlResetLastError();
43812        if (mem_base != xmlMemBlocks()) {
43813            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
43814	           xmlMemBlocks() - mem_base);
43815	    test_ret++;
43816            printf(" %d", n_writer);
43817            printf(" %d", n_content);
43818            printf("\n");
43819        }
43820    }
43821    }
43822    function_tests++;
43823#endif
43824
43825    return(test_ret);
43826}
43827
43828
43829static int
43830test_xmlTextWriterWriteComment(void) {
43831    int test_ret = 0;
43832
43833#if defined(LIBXML_WRITER_ENABLED)
43834    int mem_base;
43835    int ret_val;
43836    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43837    int n_writer;
43838    xmlChar * content; /* comment string */
43839    int n_content;
43840
43841    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43842    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43843        mem_base = xmlMemBlocks();
43844        writer = gen_xmlTextWriterPtr(n_writer, 0);
43845        content = gen_const_xmlChar_ptr(n_content, 1);
43846
43847        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
43848        desret_int(ret_val);
43849        call_tests++;
43850        des_xmlTextWriterPtr(n_writer, writer, 0);
43851        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43852        xmlResetLastError();
43853        if (mem_base != xmlMemBlocks()) {
43854            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
43855	           xmlMemBlocks() - mem_base);
43856	    test_ret++;
43857            printf(" %d", n_writer);
43858            printf(" %d", n_content);
43859            printf("\n");
43860        }
43861    }
43862    }
43863    function_tests++;
43864#endif
43865
43866    return(test_ret);
43867}
43868
43869
43870static int
43871test_xmlTextWriterWriteDTD(void) {
43872    int test_ret = 0;
43873
43874#if defined(LIBXML_WRITER_ENABLED)
43875    int mem_base;
43876    int ret_val;
43877    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43878    int n_writer;
43879    xmlChar * name; /* the name of the DTD */
43880    int n_name;
43881    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43882    int n_pubid;
43883    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43884    int n_sysid;
43885    xmlChar * subset; /* string content of the DTD */
43886    int n_subset;
43887
43888    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43889    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43890    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43891    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43892    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
43893        mem_base = xmlMemBlocks();
43894        writer = gen_xmlTextWriterPtr(n_writer, 0);
43895        name = gen_const_xmlChar_ptr(n_name, 1);
43896        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43897        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43898        subset = gen_const_xmlChar_ptr(n_subset, 4);
43899
43900        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
43901        desret_int(ret_val);
43902        call_tests++;
43903        des_xmlTextWriterPtr(n_writer, writer, 0);
43904        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43905        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43906        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43907        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
43908        xmlResetLastError();
43909        if (mem_base != xmlMemBlocks()) {
43910            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
43911	           xmlMemBlocks() - mem_base);
43912	    test_ret++;
43913            printf(" %d", n_writer);
43914            printf(" %d", n_name);
43915            printf(" %d", n_pubid);
43916            printf(" %d", n_sysid);
43917            printf(" %d", n_subset);
43918            printf("\n");
43919        }
43920    }
43921    }
43922    }
43923    }
43924    }
43925    function_tests++;
43926#endif
43927
43928    return(test_ret);
43929}
43930
43931
43932static int
43933test_xmlTextWriterWriteDTDAttlist(void) {
43934    int test_ret = 0;
43935
43936#if defined(LIBXML_WRITER_ENABLED)
43937    int mem_base;
43938    int ret_val;
43939    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43940    int n_writer;
43941    xmlChar * name; /* the name of the DTD ATTLIST */
43942    int n_name;
43943    xmlChar * content; /* content of the ATTLIST */
43944    int n_content;
43945
43946    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43947    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43948    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43949        mem_base = xmlMemBlocks();
43950        writer = gen_xmlTextWriterPtr(n_writer, 0);
43951        name = gen_const_xmlChar_ptr(n_name, 1);
43952        content = gen_const_xmlChar_ptr(n_content, 2);
43953
43954        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
43955        desret_int(ret_val);
43956        call_tests++;
43957        des_xmlTextWriterPtr(n_writer, writer, 0);
43958        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43959        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43960        xmlResetLastError();
43961        if (mem_base != xmlMemBlocks()) {
43962            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
43963	           xmlMemBlocks() - mem_base);
43964	    test_ret++;
43965            printf(" %d", n_writer);
43966            printf(" %d", n_name);
43967            printf(" %d", n_content);
43968            printf("\n");
43969        }
43970    }
43971    }
43972    }
43973    function_tests++;
43974#endif
43975
43976    return(test_ret);
43977}
43978
43979
43980static int
43981test_xmlTextWriterWriteDTDElement(void) {
43982    int test_ret = 0;
43983
43984#if defined(LIBXML_WRITER_ENABLED)
43985    int mem_base;
43986    int ret_val;
43987    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43988    int n_writer;
43989    xmlChar * name; /* the name of the DTD element */
43990    int n_name;
43991    xmlChar * content; /* content of the element */
43992    int n_content;
43993
43994    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43995    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43996    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43997        mem_base = xmlMemBlocks();
43998        writer = gen_xmlTextWriterPtr(n_writer, 0);
43999        name = gen_const_xmlChar_ptr(n_name, 1);
44000        content = gen_const_xmlChar_ptr(n_content, 2);
44001
44002        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44003        desret_int(ret_val);
44004        call_tests++;
44005        des_xmlTextWriterPtr(n_writer, writer, 0);
44006        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44007        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44008        xmlResetLastError();
44009        if (mem_base != xmlMemBlocks()) {
44010            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44011	           xmlMemBlocks() - mem_base);
44012	    test_ret++;
44013            printf(" %d", n_writer);
44014            printf(" %d", n_name);
44015            printf(" %d", n_content);
44016            printf("\n");
44017        }
44018    }
44019    }
44020    }
44021    function_tests++;
44022#endif
44023
44024    return(test_ret);
44025}
44026
44027
44028static int
44029test_xmlTextWriterWriteDTDEntity(void) {
44030    int test_ret = 0;
44031
44032#if defined(LIBXML_WRITER_ENABLED)
44033    int mem_base;
44034    int ret_val;
44035    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44036    int n_writer;
44037    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44038    int n_pe;
44039    xmlChar * name; /* the name of the DTD entity */
44040    int n_name;
44041    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44042    int n_pubid;
44043    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44044    int n_sysid;
44045    xmlChar * ndataid; /* the xml notation name. */
44046    int n_ndataid;
44047    xmlChar * content; /* content of the entity */
44048    int n_content;
44049
44050    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44051    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44052    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44053    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44054    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44055    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44056    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44057        mem_base = xmlMemBlocks();
44058        writer = gen_xmlTextWriterPtr(n_writer, 0);
44059        pe = gen_int(n_pe, 1);
44060        name = gen_const_xmlChar_ptr(n_name, 2);
44061        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44062        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44063        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44064        content = gen_const_xmlChar_ptr(n_content, 6);
44065
44066        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44067        desret_int(ret_val);
44068        call_tests++;
44069        des_xmlTextWriterPtr(n_writer, writer, 0);
44070        des_int(n_pe, pe, 1);
44071        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44072        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44073        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44074        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44075        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44076        xmlResetLastError();
44077        if (mem_base != xmlMemBlocks()) {
44078            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44079	           xmlMemBlocks() - mem_base);
44080	    test_ret++;
44081            printf(" %d", n_writer);
44082            printf(" %d", n_pe);
44083            printf(" %d", n_name);
44084            printf(" %d", n_pubid);
44085            printf(" %d", n_sysid);
44086            printf(" %d", n_ndataid);
44087            printf(" %d", n_content);
44088            printf("\n");
44089        }
44090    }
44091    }
44092    }
44093    }
44094    }
44095    }
44096    }
44097    function_tests++;
44098#endif
44099
44100    return(test_ret);
44101}
44102
44103
44104static int
44105test_xmlTextWriterWriteDTDExternalEntity(void) {
44106    int test_ret = 0;
44107
44108#if defined(LIBXML_WRITER_ENABLED)
44109    int mem_base;
44110    int ret_val;
44111    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44112    int n_writer;
44113    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44114    int n_pe;
44115    xmlChar * name; /* the name of the DTD entity */
44116    int n_name;
44117    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44118    int n_pubid;
44119    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44120    int n_sysid;
44121    xmlChar * ndataid; /* the xml notation name. */
44122    int n_ndataid;
44123
44124    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44125    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44126    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44127    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44128    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44129    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44130        mem_base = xmlMemBlocks();
44131        writer = gen_xmlTextWriterPtr(n_writer, 0);
44132        pe = gen_int(n_pe, 1);
44133        name = gen_const_xmlChar_ptr(n_name, 2);
44134        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44135        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44136        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44137
44138        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44139        desret_int(ret_val);
44140        call_tests++;
44141        des_xmlTextWriterPtr(n_writer, writer, 0);
44142        des_int(n_pe, pe, 1);
44143        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44144        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44145        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44146        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44147        xmlResetLastError();
44148        if (mem_base != xmlMemBlocks()) {
44149            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44150	           xmlMemBlocks() - mem_base);
44151	    test_ret++;
44152            printf(" %d", n_writer);
44153            printf(" %d", n_pe);
44154            printf(" %d", n_name);
44155            printf(" %d", n_pubid);
44156            printf(" %d", n_sysid);
44157            printf(" %d", n_ndataid);
44158            printf("\n");
44159        }
44160    }
44161    }
44162    }
44163    }
44164    }
44165    }
44166    function_tests++;
44167#endif
44168
44169    return(test_ret);
44170}
44171
44172
44173static int
44174test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44175    int test_ret = 0;
44176
44177#if defined(LIBXML_WRITER_ENABLED)
44178    int mem_base;
44179    int ret_val;
44180    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44181    int n_writer;
44182    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44183    int n_pubid;
44184    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44185    int n_sysid;
44186    xmlChar * ndataid; /* the xml notation name. */
44187    int n_ndataid;
44188
44189    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44190    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44191    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44192    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44193        mem_base = xmlMemBlocks();
44194        writer = gen_xmlTextWriterPtr(n_writer, 0);
44195        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44196        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44197        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44198
44199        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44200        desret_int(ret_val);
44201        call_tests++;
44202        des_xmlTextWriterPtr(n_writer, writer, 0);
44203        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44204        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44205        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44206        xmlResetLastError();
44207        if (mem_base != xmlMemBlocks()) {
44208            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44209	           xmlMemBlocks() - mem_base);
44210	    test_ret++;
44211            printf(" %d", n_writer);
44212            printf(" %d", n_pubid);
44213            printf(" %d", n_sysid);
44214            printf(" %d", n_ndataid);
44215            printf("\n");
44216        }
44217    }
44218    }
44219    }
44220    }
44221    function_tests++;
44222#endif
44223
44224    return(test_ret);
44225}
44226
44227
44228static int
44229test_xmlTextWriterWriteDTDInternalEntity(void) {
44230    int test_ret = 0;
44231
44232#if defined(LIBXML_WRITER_ENABLED)
44233    int mem_base;
44234    int ret_val;
44235    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44236    int n_writer;
44237    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44238    int n_pe;
44239    xmlChar * name; /* the name of the DTD entity */
44240    int n_name;
44241    xmlChar * content; /* content of the entity */
44242    int n_content;
44243
44244    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44245    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44246    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44247    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44248        mem_base = xmlMemBlocks();
44249        writer = gen_xmlTextWriterPtr(n_writer, 0);
44250        pe = gen_int(n_pe, 1);
44251        name = gen_const_xmlChar_ptr(n_name, 2);
44252        content = gen_const_xmlChar_ptr(n_content, 3);
44253
44254        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44255        desret_int(ret_val);
44256        call_tests++;
44257        des_xmlTextWriterPtr(n_writer, writer, 0);
44258        des_int(n_pe, pe, 1);
44259        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44260        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44261        xmlResetLastError();
44262        if (mem_base != xmlMemBlocks()) {
44263            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44264	           xmlMemBlocks() - mem_base);
44265	    test_ret++;
44266            printf(" %d", n_writer);
44267            printf(" %d", n_pe);
44268            printf(" %d", n_name);
44269            printf(" %d", n_content);
44270            printf("\n");
44271        }
44272    }
44273    }
44274    }
44275    }
44276    function_tests++;
44277#endif
44278
44279    return(test_ret);
44280}
44281
44282
44283static int
44284test_xmlTextWriterWriteDTDNotation(void) {
44285    int test_ret = 0;
44286
44287#if defined(LIBXML_WRITER_ENABLED)
44288    int mem_base;
44289    int ret_val;
44290    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44291    int n_writer;
44292    xmlChar * name; /* the name of the xml notation */
44293    int n_name;
44294    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44295    int n_pubid;
44296    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44297    int n_sysid;
44298
44299    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44300    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44301    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44302    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44303        mem_base = xmlMemBlocks();
44304        writer = gen_xmlTextWriterPtr(n_writer, 0);
44305        name = gen_const_xmlChar_ptr(n_name, 1);
44306        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44307        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44308
44309        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44310        desret_int(ret_val);
44311        call_tests++;
44312        des_xmlTextWriterPtr(n_writer, writer, 0);
44313        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44314        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44315        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44316        xmlResetLastError();
44317        if (mem_base != xmlMemBlocks()) {
44318            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44319	           xmlMemBlocks() - mem_base);
44320	    test_ret++;
44321            printf(" %d", n_writer);
44322            printf(" %d", n_name);
44323            printf(" %d", n_pubid);
44324            printf(" %d", n_sysid);
44325            printf("\n");
44326        }
44327    }
44328    }
44329    }
44330    }
44331    function_tests++;
44332#endif
44333
44334    return(test_ret);
44335}
44336
44337
44338static int
44339test_xmlTextWriterWriteElement(void) {
44340    int test_ret = 0;
44341
44342#if defined(LIBXML_WRITER_ENABLED)
44343    int mem_base;
44344    int ret_val;
44345    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44346    int n_writer;
44347    xmlChar * name; /* element name */
44348    int n_name;
44349    xmlChar * content; /* element content */
44350    int n_content;
44351
44352    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44353    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44354    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44355        mem_base = xmlMemBlocks();
44356        writer = gen_xmlTextWriterPtr(n_writer, 0);
44357        name = gen_const_xmlChar_ptr(n_name, 1);
44358        content = gen_const_xmlChar_ptr(n_content, 2);
44359
44360        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44361        desret_int(ret_val);
44362        call_tests++;
44363        des_xmlTextWriterPtr(n_writer, writer, 0);
44364        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44365        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44366        xmlResetLastError();
44367        if (mem_base != xmlMemBlocks()) {
44368            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44369	           xmlMemBlocks() - mem_base);
44370	    test_ret++;
44371            printf(" %d", n_writer);
44372            printf(" %d", n_name);
44373            printf(" %d", n_content);
44374            printf("\n");
44375        }
44376    }
44377    }
44378    }
44379    function_tests++;
44380#endif
44381
44382    return(test_ret);
44383}
44384
44385
44386static int
44387test_xmlTextWriterWriteElementNS(void) {
44388    int test_ret = 0;
44389
44390#if defined(LIBXML_WRITER_ENABLED)
44391    int mem_base;
44392    int ret_val;
44393    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44394    int n_writer;
44395    xmlChar * prefix; /* namespace prefix */
44396    int n_prefix;
44397    xmlChar * name; /* element local name */
44398    int n_name;
44399    xmlChar * namespaceURI; /* namespace URI */
44400    int n_namespaceURI;
44401    xmlChar * content; /* element content */
44402    int n_content;
44403
44404    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44405    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44406    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44407    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44408    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44409        mem_base = xmlMemBlocks();
44410        writer = gen_xmlTextWriterPtr(n_writer, 0);
44411        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44412        name = gen_const_xmlChar_ptr(n_name, 2);
44413        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44414        content = gen_const_xmlChar_ptr(n_content, 4);
44415
44416        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44417        desret_int(ret_val);
44418        call_tests++;
44419        des_xmlTextWriterPtr(n_writer, writer, 0);
44420        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44421        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44422        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44423        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44424        xmlResetLastError();
44425        if (mem_base != xmlMemBlocks()) {
44426            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44427	           xmlMemBlocks() - mem_base);
44428	    test_ret++;
44429            printf(" %d", n_writer);
44430            printf(" %d", n_prefix);
44431            printf(" %d", n_name);
44432            printf(" %d", n_namespaceURI);
44433            printf(" %d", n_content);
44434            printf("\n");
44435        }
44436    }
44437    }
44438    }
44439    }
44440    }
44441    function_tests++;
44442#endif
44443
44444    return(test_ret);
44445}
44446
44447
44448static int
44449test_xmlTextWriterWriteFormatAttribute(void) {
44450    int test_ret = 0;
44451
44452
44453    /* missing type support */
44454    return(test_ret);
44455}
44456
44457
44458static int
44459test_xmlTextWriterWriteFormatAttributeNS(void) {
44460    int test_ret = 0;
44461
44462
44463    /* missing type support */
44464    return(test_ret);
44465}
44466
44467
44468static int
44469test_xmlTextWriterWriteFormatCDATA(void) {
44470    int test_ret = 0;
44471
44472
44473    /* missing type support */
44474    return(test_ret);
44475}
44476
44477
44478static int
44479test_xmlTextWriterWriteFormatComment(void) {
44480    int test_ret = 0;
44481
44482
44483    /* missing type support */
44484    return(test_ret);
44485}
44486
44487
44488static int
44489test_xmlTextWriterWriteFormatDTD(void) {
44490    int test_ret = 0;
44491
44492
44493    /* missing type support */
44494    return(test_ret);
44495}
44496
44497
44498static int
44499test_xmlTextWriterWriteFormatDTDAttlist(void) {
44500    int test_ret = 0;
44501
44502
44503    /* missing type support */
44504    return(test_ret);
44505}
44506
44507
44508static int
44509test_xmlTextWriterWriteFormatDTDElement(void) {
44510    int test_ret = 0;
44511
44512
44513    /* missing type support */
44514    return(test_ret);
44515}
44516
44517
44518static int
44519test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44520    int test_ret = 0;
44521
44522
44523    /* missing type support */
44524    return(test_ret);
44525}
44526
44527
44528static int
44529test_xmlTextWriterWriteFormatElement(void) {
44530    int test_ret = 0;
44531
44532
44533    /* missing type support */
44534    return(test_ret);
44535}
44536
44537
44538static int
44539test_xmlTextWriterWriteFormatElementNS(void) {
44540    int test_ret = 0;
44541
44542
44543    /* missing type support */
44544    return(test_ret);
44545}
44546
44547
44548static int
44549test_xmlTextWriterWriteFormatPI(void) {
44550    int test_ret = 0;
44551
44552
44553    /* missing type support */
44554    return(test_ret);
44555}
44556
44557
44558static int
44559test_xmlTextWriterWriteFormatRaw(void) {
44560    int test_ret = 0;
44561
44562
44563    /* missing type support */
44564    return(test_ret);
44565}
44566
44567
44568static int
44569test_xmlTextWriterWriteFormatString(void) {
44570    int test_ret = 0;
44571
44572
44573    /* missing type support */
44574    return(test_ret);
44575}
44576
44577
44578static int
44579test_xmlTextWriterWritePI(void) {
44580    int test_ret = 0;
44581
44582#if defined(LIBXML_WRITER_ENABLED)
44583    int mem_base;
44584    int ret_val;
44585    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44586    int n_writer;
44587    xmlChar * target; /* PI target */
44588    int n_target;
44589    xmlChar * content; /* PI content */
44590    int n_content;
44591
44592    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44593    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44594    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44595        mem_base = xmlMemBlocks();
44596        writer = gen_xmlTextWriterPtr(n_writer, 0);
44597        target = gen_const_xmlChar_ptr(n_target, 1);
44598        content = gen_const_xmlChar_ptr(n_content, 2);
44599
44600        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44601        desret_int(ret_val);
44602        call_tests++;
44603        des_xmlTextWriterPtr(n_writer, writer, 0);
44604        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44605        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44606        xmlResetLastError();
44607        if (mem_base != xmlMemBlocks()) {
44608            printf("Leak of %d blocks found in xmlTextWriterWritePI",
44609	           xmlMemBlocks() - mem_base);
44610	    test_ret++;
44611            printf(" %d", n_writer);
44612            printf(" %d", n_target);
44613            printf(" %d", n_content);
44614            printf("\n");
44615        }
44616    }
44617    }
44618    }
44619    function_tests++;
44620#endif
44621
44622    return(test_ret);
44623}
44624
44625
44626static int
44627test_xmlTextWriterWriteRaw(void) {
44628    int test_ret = 0;
44629
44630#if defined(LIBXML_WRITER_ENABLED)
44631    int mem_base;
44632    int ret_val;
44633    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44634    int n_writer;
44635    xmlChar * content; /* text string */
44636    int n_content;
44637
44638    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44639    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44640        mem_base = xmlMemBlocks();
44641        writer = gen_xmlTextWriterPtr(n_writer, 0);
44642        content = gen_const_xmlChar_ptr(n_content, 1);
44643
44644        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44645        desret_int(ret_val);
44646        call_tests++;
44647        des_xmlTextWriterPtr(n_writer, writer, 0);
44648        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44649        xmlResetLastError();
44650        if (mem_base != xmlMemBlocks()) {
44651            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44652	           xmlMemBlocks() - mem_base);
44653	    test_ret++;
44654            printf(" %d", n_writer);
44655            printf(" %d", n_content);
44656            printf("\n");
44657        }
44658    }
44659    }
44660    function_tests++;
44661#endif
44662
44663    return(test_ret);
44664}
44665
44666
44667static int
44668test_xmlTextWriterWriteRawLen(void) {
44669    int test_ret = 0;
44670
44671#if defined(LIBXML_WRITER_ENABLED)
44672    int mem_base;
44673    int ret_val;
44674    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44675    int n_writer;
44676    xmlChar * content; /* text string */
44677    int n_content;
44678    int len; /* length of the text string */
44679    int n_len;
44680
44681    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44682    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44683    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44684        mem_base = xmlMemBlocks();
44685        writer = gen_xmlTextWriterPtr(n_writer, 0);
44686        content = gen_const_xmlChar_ptr(n_content, 1);
44687        len = gen_int(n_len, 2);
44688
44689        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44690        desret_int(ret_val);
44691        call_tests++;
44692        des_xmlTextWriterPtr(n_writer, writer, 0);
44693        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44694        des_int(n_len, len, 2);
44695        xmlResetLastError();
44696        if (mem_base != xmlMemBlocks()) {
44697            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44698	           xmlMemBlocks() - mem_base);
44699	    test_ret++;
44700            printf(" %d", n_writer);
44701            printf(" %d", n_content);
44702            printf(" %d", n_len);
44703            printf("\n");
44704        }
44705    }
44706    }
44707    }
44708    function_tests++;
44709#endif
44710
44711    return(test_ret);
44712}
44713
44714
44715static int
44716test_xmlTextWriterWriteString(void) {
44717    int test_ret = 0;
44718
44719#if defined(LIBXML_WRITER_ENABLED)
44720    int mem_base;
44721    int ret_val;
44722    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44723    int n_writer;
44724    xmlChar * content; /* text string */
44725    int n_content;
44726
44727    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44728    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44729        mem_base = xmlMemBlocks();
44730        writer = gen_xmlTextWriterPtr(n_writer, 0);
44731        content = gen_const_xmlChar_ptr(n_content, 1);
44732
44733        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
44734        desret_int(ret_val);
44735        call_tests++;
44736        des_xmlTextWriterPtr(n_writer, writer, 0);
44737        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44738        xmlResetLastError();
44739        if (mem_base != xmlMemBlocks()) {
44740            printf("Leak of %d blocks found in xmlTextWriterWriteString",
44741	           xmlMemBlocks() - mem_base);
44742	    test_ret++;
44743            printf(" %d", n_writer);
44744            printf(" %d", n_content);
44745            printf("\n");
44746        }
44747    }
44748    }
44749    function_tests++;
44750#endif
44751
44752    return(test_ret);
44753}
44754
44755
44756static int
44757test_xmlTextWriterWriteVFormatAttribute(void) {
44758    int test_ret = 0;
44759
44760
44761    /* missing type support */
44762    return(test_ret);
44763}
44764
44765
44766static int
44767test_xmlTextWriterWriteVFormatAttributeNS(void) {
44768    int test_ret = 0;
44769
44770
44771    /* missing type support */
44772    return(test_ret);
44773}
44774
44775
44776static int
44777test_xmlTextWriterWriteVFormatCDATA(void) {
44778    int test_ret = 0;
44779
44780
44781    /* missing type support */
44782    return(test_ret);
44783}
44784
44785
44786static int
44787test_xmlTextWriterWriteVFormatComment(void) {
44788    int test_ret = 0;
44789
44790
44791    /* missing type support */
44792    return(test_ret);
44793}
44794
44795
44796static int
44797test_xmlTextWriterWriteVFormatDTD(void) {
44798    int test_ret = 0;
44799
44800
44801    /* missing type support */
44802    return(test_ret);
44803}
44804
44805
44806static int
44807test_xmlTextWriterWriteVFormatDTDAttlist(void) {
44808    int test_ret = 0;
44809
44810
44811    /* missing type support */
44812    return(test_ret);
44813}
44814
44815
44816static int
44817test_xmlTextWriterWriteVFormatDTDElement(void) {
44818    int test_ret = 0;
44819
44820
44821    /* missing type support */
44822    return(test_ret);
44823}
44824
44825
44826static int
44827test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
44828    int test_ret = 0;
44829
44830
44831    /* missing type support */
44832    return(test_ret);
44833}
44834
44835
44836static int
44837test_xmlTextWriterWriteVFormatElement(void) {
44838    int test_ret = 0;
44839
44840
44841    /* missing type support */
44842    return(test_ret);
44843}
44844
44845
44846static int
44847test_xmlTextWriterWriteVFormatElementNS(void) {
44848    int test_ret = 0;
44849
44850
44851    /* missing type support */
44852    return(test_ret);
44853}
44854
44855
44856static int
44857test_xmlTextWriterWriteVFormatPI(void) {
44858    int test_ret = 0;
44859
44860
44861    /* missing type support */
44862    return(test_ret);
44863}
44864
44865
44866static int
44867test_xmlTextWriterWriteVFormatRaw(void) {
44868    int test_ret = 0;
44869
44870
44871    /* missing type support */
44872    return(test_ret);
44873}
44874
44875
44876static int
44877test_xmlTextWriterWriteVFormatString(void) {
44878    int test_ret = 0;
44879
44880
44881    /* missing type support */
44882    return(test_ret);
44883}
44884
44885static int
44886test_xmlwriter(void) {
44887    int test_ret = 0;
44888
44889    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
44890    test_ret += test_xmlNewTextWriter();
44891    test_ret += test_xmlNewTextWriterFilename();
44892    test_ret += test_xmlNewTextWriterMemory();
44893    test_ret += test_xmlNewTextWriterPushParser();
44894    test_ret += test_xmlNewTextWriterTree();
44895    test_ret += test_xmlTextWriterEndAttribute();
44896    test_ret += test_xmlTextWriterEndCDATA();
44897    test_ret += test_xmlTextWriterEndComment();
44898    test_ret += test_xmlTextWriterEndDTD();
44899    test_ret += test_xmlTextWriterEndDTDAttlist();
44900    test_ret += test_xmlTextWriterEndDTDElement();
44901    test_ret += test_xmlTextWriterEndDTDEntity();
44902    test_ret += test_xmlTextWriterEndDocument();
44903    test_ret += test_xmlTextWriterEndElement();
44904    test_ret += test_xmlTextWriterEndPI();
44905    test_ret += test_xmlTextWriterFlush();
44906    test_ret += test_xmlTextWriterFullEndElement();
44907    test_ret += test_xmlTextWriterSetIndent();
44908    test_ret += test_xmlTextWriterSetIndentString();
44909    test_ret += test_xmlTextWriterStartAttribute();
44910    test_ret += test_xmlTextWriterStartAttributeNS();
44911    test_ret += test_xmlTextWriterStartCDATA();
44912    test_ret += test_xmlTextWriterStartComment();
44913    test_ret += test_xmlTextWriterStartDTD();
44914    test_ret += test_xmlTextWriterStartDTDAttlist();
44915    test_ret += test_xmlTextWriterStartDTDElement();
44916    test_ret += test_xmlTextWriterStartDTDEntity();
44917    test_ret += test_xmlTextWriterStartDocument();
44918    test_ret += test_xmlTextWriterStartElement();
44919    test_ret += test_xmlTextWriterStartElementNS();
44920    test_ret += test_xmlTextWriterStartPI();
44921    test_ret += test_xmlTextWriterWriteAttribute();
44922    test_ret += test_xmlTextWriterWriteAttributeNS();
44923    test_ret += test_xmlTextWriterWriteBase64();
44924    test_ret += test_xmlTextWriterWriteBinHex();
44925    test_ret += test_xmlTextWriterWriteCDATA();
44926    test_ret += test_xmlTextWriterWriteComment();
44927    test_ret += test_xmlTextWriterWriteDTD();
44928    test_ret += test_xmlTextWriterWriteDTDAttlist();
44929    test_ret += test_xmlTextWriterWriteDTDElement();
44930    test_ret += test_xmlTextWriterWriteDTDEntity();
44931    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
44932    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
44933    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
44934    test_ret += test_xmlTextWriterWriteDTDNotation();
44935    test_ret += test_xmlTextWriterWriteElement();
44936    test_ret += test_xmlTextWriterWriteElementNS();
44937    test_ret += test_xmlTextWriterWriteFormatAttribute();
44938    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
44939    test_ret += test_xmlTextWriterWriteFormatCDATA();
44940    test_ret += test_xmlTextWriterWriteFormatComment();
44941    test_ret += test_xmlTextWriterWriteFormatDTD();
44942    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
44943    test_ret += test_xmlTextWriterWriteFormatDTDElement();
44944    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
44945    test_ret += test_xmlTextWriterWriteFormatElement();
44946    test_ret += test_xmlTextWriterWriteFormatElementNS();
44947    test_ret += test_xmlTextWriterWriteFormatPI();
44948    test_ret += test_xmlTextWriterWriteFormatRaw();
44949    test_ret += test_xmlTextWriterWriteFormatString();
44950    test_ret += test_xmlTextWriterWritePI();
44951    test_ret += test_xmlTextWriterWriteRaw();
44952    test_ret += test_xmlTextWriterWriteRawLen();
44953    test_ret += test_xmlTextWriterWriteString();
44954    test_ret += test_xmlTextWriterWriteVFormatAttribute();
44955    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
44956    test_ret += test_xmlTextWriterWriteVFormatCDATA();
44957    test_ret += test_xmlTextWriterWriteVFormatComment();
44958    test_ret += test_xmlTextWriterWriteVFormatDTD();
44959    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
44960    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
44961    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
44962    test_ret += test_xmlTextWriterWriteVFormatElement();
44963    test_ret += test_xmlTextWriterWriteVFormatElementNS();
44964    test_ret += test_xmlTextWriterWriteVFormatPI();
44965    test_ret += test_xmlTextWriterWriteVFormatRaw();
44966    test_ret += test_xmlTextWriterWriteVFormatString();
44967
44968    if (test_ret != 0)
44969	printf("Module xmlwriter: %d errors\n", test_ret);
44970    return(test_ret);
44971}
44972
44973static int
44974test_xmlXPathCastBooleanToNumber(void) {
44975    int test_ret = 0;
44976
44977#if defined(LIBXML_XPATH_ENABLED)
44978    int mem_base;
44979    double ret_val;
44980    int val; /* a boolean */
44981    int n_val;
44982
44983    for (n_val = 0;n_val < gen_nb_int;n_val++) {
44984        mem_base = xmlMemBlocks();
44985        val = gen_int(n_val, 0);
44986
44987        ret_val = xmlXPathCastBooleanToNumber(val);
44988        desret_double(ret_val);
44989        call_tests++;
44990        des_int(n_val, val, 0);
44991        xmlResetLastError();
44992        if (mem_base != xmlMemBlocks()) {
44993            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
44994	           xmlMemBlocks() - mem_base);
44995	    test_ret++;
44996            printf(" %d", n_val);
44997            printf("\n");
44998        }
44999    }
45000    function_tests++;
45001#endif
45002
45003    return(test_ret);
45004}
45005
45006
45007static int
45008test_xmlXPathCastBooleanToString(void) {
45009    int test_ret = 0;
45010
45011#if defined(LIBXML_XPATH_ENABLED)
45012    int mem_base;
45013    xmlChar * ret_val;
45014    int val; /* a boolean */
45015    int n_val;
45016
45017    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45018        mem_base = xmlMemBlocks();
45019        val = gen_int(n_val, 0);
45020
45021        ret_val = xmlXPathCastBooleanToString(val);
45022        desret_xmlChar_ptr(ret_val);
45023        call_tests++;
45024        des_int(n_val, val, 0);
45025        xmlResetLastError();
45026        if (mem_base != xmlMemBlocks()) {
45027            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45028	           xmlMemBlocks() - mem_base);
45029	    test_ret++;
45030            printf(" %d", n_val);
45031            printf("\n");
45032        }
45033    }
45034    function_tests++;
45035#endif
45036
45037    return(test_ret);
45038}
45039
45040
45041static int
45042test_xmlXPathCastNodeSetToBoolean(void) {
45043    int test_ret = 0;
45044
45045#if defined(LIBXML_XPATH_ENABLED)
45046    int mem_base;
45047    int ret_val;
45048    xmlNodeSetPtr ns; /* a node-set */
45049    int n_ns;
45050
45051    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45052        mem_base = xmlMemBlocks();
45053        ns = gen_xmlNodeSetPtr(n_ns, 0);
45054
45055        ret_val = xmlXPathCastNodeSetToBoolean(ns);
45056        desret_int(ret_val);
45057        call_tests++;
45058        des_xmlNodeSetPtr(n_ns, ns, 0);
45059        xmlResetLastError();
45060        if (mem_base != xmlMemBlocks()) {
45061            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45062	           xmlMemBlocks() - mem_base);
45063	    test_ret++;
45064            printf(" %d", n_ns);
45065            printf("\n");
45066        }
45067    }
45068    function_tests++;
45069#endif
45070
45071    return(test_ret);
45072}
45073
45074
45075static int
45076test_xmlXPathCastNodeSetToNumber(void) {
45077    int test_ret = 0;
45078
45079#if defined(LIBXML_XPATH_ENABLED)
45080    int mem_base;
45081    double ret_val;
45082    xmlNodeSetPtr ns; /* a node-set */
45083    int n_ns;
45084
45085    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45086        mem_base = xmlMemBlocks();
45087        ns = gen_xmlNodeSetPtr(n_ns, 0);
45088
45089        ret_val = xmlXPathCastNodeSetToNumber(ns);
45090        desret_double(ret_val);
45091        call_tests++;
45092        des_xmlNodeSetPtr(n_ns, ns, 0);
45093        xmlResetLastError();
45094        if (mem_base != xmlMemBlocks()) {
45095            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45096	           xmlMemBlocks() - mem_base);
45097	    test_ret++;
45098            printf(" %d", n_ns);
45099            printf("\n");
45100        }
45101    }
45102    function_tests++;
45103#endif
45104
45105    return(test_ret);
45106}
45107
45108
45109static int
45110test_xmlXPathCastNodeSetToString(void) {
45111    int test_ret = 0;
45112
45113#if defined(LIBXML_XPATH_ENABLED)
45114    int mem_base;
45115    xmlChar * ret_val;
45116    xmlNodeSetPtr ns; /* a node-set */
45117    int n_ns;
45118
45119    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45120        mem_base = xmlMemBlocks();
45121        ns = gen_xmlNodeSetPtr(n_ns, 0);
45122
45123        ret_val = xmlXPathCastNodeSetToString(ns);
45124        desret_xmlChar_ptr(ret_val);
45125        call_tests++;
45126        des_xmlNodeSetPtr(n_ns, ns, 0);
45127        xmlResetLastError();
45128        if (mem_base != xmlMemBlocks()) {
45129            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45130	           xmlMemBlocks() - mem_base);
45131	    test_ret++;
45132            printf(" %d", n_ns);
45133            printf("\n");
45134        }
45135    }
45136    function_tests++;
45137#endif
45138
45139    return(test_ret);
45140}
45141
45142
45143static int
45144test_xmlXPathCastNodeToNumber(void) {
45145    int test_ret = 0;
45146
45147#if defined(LIBXML_XPATH_ENABLED)
45148    int mem_base;
45149    double ret_val;
45150    xmlNodePtr node; /* a node */
45151    int n_node;
45152
45153    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45154        mem_base = xmlMemBlocks();
45155        node = gen_xmlNodePtr(n_node, 0);
45156
45157        ret_val = xmlXPathCastNodeToNumber(node);
45158        desret_double(ret_val);
45159        call_tests++;
45160        des_xmlNodePtr(n_node, node, 0);
45161        xmlResetLastError();
45162        if (mem_base != xmlMemBlocks()) {
45163            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45164	           xmlMemBlocks() - mem_base);
45165	    test_ret++;
45166            printf(" %d", n_node);
45167            printf("\n");
45168        }
45169    }
45170    function_tests++;
45171#endif
45172
45173    return(test_ret);
45174}
45175
45176
45177static int
45178test_xmlXPathCastNodeToString(void) {
45179    int test_ret = 0;
45180
45181#if defined(LIBXML_XPATH_ENABLED)
45182    int mem_base;
45183    xmlChar * ret_val;
45184    xmlNodePtr node; /* a node */
45185    int n_node;
45186
45187    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45188        mem_base = xmlMemBlocks();
45189        node = gen_xmlNodePtr(n_node, 0);
45190
45191        ret_val = xmlXPathCastNodeToString(node);
45192        desret_xmlChar_ptr(ret_val);
45193        call_tests++;
45194        des_xmlNodePtr(n_node, node, 0);
45195        xmlResetLastError();
45196        if (mem_base != xmlMemBlocks()) {
45197            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45198	           xmlMemBlocks() - mem_base);
45199	    test_ret++;
45200            printf(" %d", n_node);
45201            printf("\n");
45202        }
45203    }
45204    function_tests++;
45205#endif
45206
45207    return(test_ret);
45208}
45209
45210
45211static int
45212test_xmlXPathCastNumberToBoolean(void) {
45213    int test_ret = 0;
45214
45215#if defined(LIBXML_XPATH_ENABLED)
45216    int mem_base;
45217    int ret_val;
45218    double val; /* a number */
45219    int n_val;
45220
45221    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45222        mem_base = xmlMemBlocks();
45223        val = gen_double(n_val, 0);
45224
45225        ret_val = xmlXPathCastNumberToBoolean(val);
45226        desret_int(ret_val);
45227        call_tests++;
45228        des_double(n_val, val, 0);
45229        xmlResetLastError();
45230        if (mem_base != xmlMemBlocks()) {
45231            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45232	           xmlMemBlocks() - mem_base);
45233	    test_ret++;
45234            printf(" %d", n_val);
45235            printf("\n");
45236        }
45237    }
45238    function_tests++;
45239#endif
45240
45241    return(test_ret);
45242}
45243
45244
45245static int
45246test_xmlXPathCastNumberToString(void) {
45247    int test_ret = 0;
45248
45249#if defined(LIBXML_XPATH_ENABLED)
45250    int mem_base;
45251    xmlChar * ret_val;
45252    double val; /* a number */
45253    int n_val;
45254
45255    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45256        mem_base = xmlMemBlocks();
45257        val = gen_double(n_val, 0);
45258
45259        ret_val = xmlXPathCastNumberToString(val);
45260        desret_xmlChar_ptr(ret_val);
45261        call_tests++;
45262        des_double(n_val, val, 0);
45263        xmlResetLastError();
45264        if (mem_base != xmlMemBlocks()) {
45265            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
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_xmlXPathCastStringToBoolean(void) {
45281    int test_ret = 0;
45282
45283#if defined(LIBXML_XPATH_ENABLED)
45284    int mem_base;
45285    int ret_val;
45286    xmlChar * val; /* a string */
45287    int n_val;
45288
45289    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45290        mem_base = xmlMemBlocks();
45291        val = gen_const_xmlChar_ptr(n_val, 0);
45292
45293        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45294        desret_int(ret_val);
45295        call_tests++;
45296        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45297        xmlResetLastError();
45298        if (mem_base != xmlMemBlocks()) {
45299            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
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_xmlXPathCastStringToNumber(void) {
45315    int test_ret = 0;
45316
45317#if defined(LIBXML_XPATH_ENABLED)
45318    int mem_base;
45319    double ret_val;
45320    xmlChar * val; /* a string */
45321    int n_val;
45322
45323    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45324        mem_base = xmlMemBlocks();
45325        val = gen_const_xmlChar_ptr(n_val, 0);
45326
45327        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45328        desret_double(ret_val);
45329        call_tests++;
45330        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45331        xmlResetLastError();
45332        if (mem_base != xmlMemBlocks()) {
45333            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45334	           xmlMemBlocks() - mem_base);
45335	    test_ret++;
45336            printf(" %d", n_val);
45337            printf("\n");
45338        }
45339    }
45340    function_tests++;
45341#endif
45342
45343    return(test_ret);
45344}
45345
45346
45347static int
45348test_xmlXPathCastToBoolean(void) {
45349    int test_ret = 0;
45350
45351#if defined(LIBXML_XPATH_ENABLED)
45352    int mem_base;
45353    int ret_val;
45354    xmlXPathObjectPtr val; /* an XPath object */
45355    int n_val;
45356
45357    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45358        mem_base = xmlMemBlocks();
45359        val = gen_xmlXPathObjectPtr(n_val, 0);
45360
45361        ret_val = xmlXPathCastToBoolean(val);
45362        desret_int(ret_val);
45363        call_tests++;
45364        des_xmlXPathObjectPtr(n_val, val, 0);
45365        xmlResetLastError();
45366        if (mem_base != xmlMemBlocks()) {
45367            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45368	           xmlMemBlocks() - mem_base);
45369	    test_ret++;
45370            printf(" %d", n_val);
45371            printf("\n");
45372        }
45373    }
45374    function_tests++;
45375#endif
45376
45377    return(test_ret);
45378}
45379
45380
45381static int
45382test_xmlXPathCastToNumber(void) {
45383    int test_ret = 0;
45384
45385#if defined(LIBXML_XPATH_ENABLED)
45386    int mem_base;
45387    double ret_val;
45388    xmlXPathObjectPtr val; /* an XPath object */
45389    int n_val;
45390
45391    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45392        mem_base = xmlMemBlocks();
45393        val = gen_xmlXPathObjectPtr(n_val, 0);
45394
45395        ret_val = xmlXPathCastToNumber(val);
45396        desret_double(ret_val);
45397        call_tests++;
45398        des_xmlXPathObjectPtr(n_val, val, 0);
45399        xmlResetLastError();
45400        if (mem_base != xmlMemBlocks()) {
45401            printf("Leak of %d blocks found in xmlXPathCastToNumber",
45402	           xmlMemBlocks() - mem_base);
45403	    test_ret++;
45404            printf(" %d", n_val);
45405            printf("\n");
45406        }
45407    }
45408    function_tests++;
45409#endif
45410
45411    return(test_ret);
45412}
45413
45414
45415static int
45416test_xmlXPathCastToString(void) {
45417    int test_ret = 0;
45418
45419#if defined(LIBXML_XPATH_ENABLED)
45420    int mem_base;
45421    xmlChar * ret_val;
45422    xmlXPathObjectPtr val; /* an XPath object */
45423    int n_val;
45424
45425    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45426        mem_base = xmlMemBlocks();
45427        val = gen_xmlXPathObjectPtr(n_val, 0);
45428
45429        ret_val = xmlXPathCastToString(val);
45430        desret_xmlChar_ptr(ret_val);
45431        call_tests++;
45432        des_xmlXPathObjectPtr(n_val, val, 0);
45433        xmlResetLastError();
45434        if (mem_base != xmlMemBlocks()) {
45435            printf("Leak of %d blocks found in xmlXPathCastToString",
45436	           xmlMemBlocks() - mem_base);
45437	    test_ret++;
45438            printf(" %d", n_val);
45439            printf("\n");
45440        }
45441    }
45442    function_tests++;
45443#endif
45444
45445    return(test_ret);
45446}
45447
45448
45449static int
45450test_xmlXPathCmpNodes(void) {
45451    int test_ret = 0;
45452
45453#if defined(LIBXML_XPATH_ENABLED)
45454    int mem_base;
45455    int ret_val;
45456    xmlNodePtr node1; /* the first node */
45457    int n_node1;
45458    xmlNodePtr node2; /* the second node */
45459    int n_node2;
45460
45461    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45462    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45463        mem_base = xmlMemBlocks();
45464        node1 = gen_xmlNodePtr(n_node1, 0);
45465        node2 = gen_xmlNodePtr(n_node2, 1);
45466
45467        ret_val = xmlXPathCmpNodes(node1, node2);
45468        desret_int(ret_val);
45469        call_tests++;
45470        des_xmlNodePtr(n_node1, node1, 0);
45471        des_xmlNodePtr(n_node2, node2, 1);
45472        xmlResetLastError();
45473        if (mem_base != xmlMemBlocks()) {
45474            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45475	           xmlMemBlocks() - mem_base);
45476	    test_ret++;
45477            printf(" %d", n_node1);
45478            printf(" %d", n_node2);
45479            printf("\n");
45480        }
45481    }
45482    }
45483    function_tests++;
45484#endif
45485
45486    return(test_ret);
45487}
45488
45489
45490static int
45491test_xmlXPathCompile(void) {
45492    int test_ret = 0;
45493
45494
45495    /* missing type support */
45496    return(test_ret);
45497}
45498
45499#ifdef LIBXML_XPATH_ENABLED
45500
45501#define gen_nb_xmlXPathCompExprPtr 1
45502static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45503    return(NULL);
45504}
45505static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45506}
45507#endif
45508
45509#ifdef LIBXML_XPATH_ENABLED
45510
45511#define gen_nb_xmlXPathContextPtr 1
45512static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45513    return(NULL);
45514}
45515static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45516}
45517#endif
45518
45519
45520static int
45521test_xmlXPathCompiledEval(void) {
45522    int test_ret = 0;
45523
45524#if defined(LIBXML_XPATH_ENABLED)
45525    int mem_base;
45526    xmlXPathObjectPtr ret_val;
45527    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45528    int n_comp;
45529    xmlXPathContextPtr ctx; /* the XPath context */
45530    int n_ctx;
45531
45532    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45533    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45534        mem_base = xmlMemBlocks();
45535        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45536        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45537
45538        ret_val = xmlXPathCompiledEval(comp, ctx);
45539        desret_xmlXPathObjectPtr(ret_val);
45540        call_tests++;
45541        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45542        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45543        xmlResetLastError();
45544        if (mem_base != xmlMemBlocks()) {
45545            printf("Leak of %d blocks found in xmlXPathCompiledEval",
45546	           xmlMemBlocks() - mem_base);
45547	    test_ret++;
45548            printf(" %d", n_comp);
45549            printf(" %d", n_ctx);
45550            printf("\n");
45551        }
45552    }
45553    }
45554    function_tests++;
45555#endif
45556
45557    return(test_ret);
45558}
45559
45560
45561static int
45562test_xmlXPathContextSetCache(void) {
45563    int test_ret = 0;
45564
45565#if defined(LIBXML_XPATH_ENABLED)
45566    int mem_base;
45567    int ret_val;
45568    xmlXPathContextPtr ctxt; /* the XPath context */
45569    int n_ctxt;
45570    int active; /* enables/disables (creates/frees) the cache */
45571    int n_active;
45572    int value; /* a value with semantics dependant on @options */
45573    int n_value;
45574    int options; /* options (currently only the value 0 is used) */
45575    int n_options;
45576
45577    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45578    for (n_active = 0;n_active < gen_nb_int;n_active++) {
45579    for (n_value = 0;n_value < gen_nb_int;n_value++) {
45580    for (n_options = 0;n_options < gen_nb_int;n_options++) {
45581        mem_base = xmlMemBlocks();
45582        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45583        active = gen_int(n_active, 1);
45584        value = gen_int(n_value, 2);
45585        options = gen_int(n_options, 3);
45586
45587        ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
45588        desret_int(ret_val);
45589        call_tests++;
45590        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45591        des_int(n_active, active, 1);
45592        des_int(n_value, value, 2);
45593        des_int(n_options, options, 3);
45594        xmlResetLastError();
45595        if (mem_base != xmlMemBlocks()) {
45596            printf("Leak of %d blocks found in xmlXPathContextSetCache",
45597	           xmlMemBlocks() - mem_base);
45598	    test_ret++;
45599            printf(" %d", n_ctxt);
45600            printf(" %d", n_active);
45601            printf(" %d", n_value);
45602            printf(" %d", n_options);
45603            printf("\n");
45604        }
45605    }
45606    }
45607    }
45608    }
45609    function_tests++;
45610#endif
45611
45612    return(test_ret);
45613}
45614
45615
45616static int
45617test_xmlXPathConvertBoolean(void) {
45618    int test_ret = 0;
45619
45620#if defined(LIBXML_XPATH_ENABLED)
45621    int mem_base;
45622    xmlXPathObjectPtr ret_val;
45623    xmlXPathObjectPtr val; /* an XPath object */
45624    int n_val;
45625
45626    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45627        mem_base = xmlMemBlocks();
45628        val = gen_xmlXPathObjectPtr(n_val, 0);
45629
45630        ret_val = xmlXPathConvertBoolean(val);
45631        val = NULL;
45632        desret_xmlXPathObjectPtr(ret_val);
45633        call_tests++;
45634        des_xmlXPathObjectPtr(n_val, val, 0);
45635        xmlResetLastError();
45636        if (mem_base != xmlMemBlocks()) {
45637            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45638	           xmlMemBlocks() - mem_base);
45639	    test_ret++;
45640            printf(" %d", n_val);
45641            printf("\n");
45642        }
45643    }
45644    function_tests++;
45645#endif
45646
45647    return(test_ret);
45648}
45649
45650
45651static int
45652test_xmlXPathConvertNumber(void) {
45653    int test_ret = 0;
45654
45655#if defined(LIBXML_XPATH_ENABLED)
45656    int mem_base;
45657    xmlXPathObjectPtr ret_val;
45658    xmlXPathObjectPtr val; /* an XPath object */
45659    int n_val;
45660
45661    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45662        mem_base = xmlMemBlocks();
45663        val = gen_xmlXPathObjectPtr(n_val, 0);
45664
45665        ret_val = xmlXPathConvertNumber(val);
45666        val = NULL;
45667        desret_xmlXPathObjectPtr(ret_val);
45668        call_tests++;
45669        des_xmlXPathObjectPtr(n_val, val, 0);
45670        xmlResetLastError();
45671        if (mem_base != xmlMemBlocks()) {
45672            printf("Leak of %d blocks found in xmlXPathConvertNumber",
45673	           xmlMemBlocks() - mem_base);
45674	    test_ret++;
45675            printf(" %d", n_val);
45676            printf("\n");
45677        }
45678    }
45679    function_tests++;
45680#endif
45681
45682    return(test_ret);
45683}
45684
45685
45686static int
45687test_xmlXPathConvertString(void) {
45688    int test_ret = 0;
45689
45690#if defined(LIBXML_XPATH_ENABLED)
45691    int mem_base;
45692    xmlXPathObjectPtr ret_val;
45693    xmlXPathObjectPtr val; /* an XPath object */
45694    int n_val;
45695
45696    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45697        mem_base = xmlMemBlocks();
45698        val = gen_xmlXPathObjectPtr(n_val, 0);
45699
45700        ret_val = xmlXPathConvertString(val);
45701        val = NULL;
45702        desret_xmlXPathObjectPtr(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 xmlXPathConvertString",
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_xmlXPathCtxtCompile(void) {
45723    int test_ret = 0;
45724
45725
45726    /* missing type support */
45727    return(test_ret);
45728}
45729
45730
45731static int
45732test_xmlXPathEval(void) {
45733    int test_ret = 0;
45734
45735#if defined(LIBXML_XPATH_ENABLED)
45736    int mem_base;
45737    xmlXPathObjectPtr ret_val;
45738    xmlChar * str; /* the XPath expression */
45739    int n_str;
45740    xmlXPathContextPtr ctx; /* the XPath context */
45741    int n_ctx;
45742
45743    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45744    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45745        mem_base = xmlMemBlocks();
45746        str = gen_const_xmlChar_ptr(n_str, 0);
45747        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45748
45749        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
45750        desret_xmlXPathObjectPtr(ret_val);
45751        call_tests++;
45752        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
45753        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45754        xmlResetLastError();
45755        if (mem_base != xmlMemBlocks()) {
45756            printf("Leak of %d blocks found in xmlXPathEval",
45757	           xmlMemBlocks() - mem_base);
45758	    test_ret++;
45759            printf(" %d", n_str);
45760            printf(" %d", n_ctx);
45761            printf("\n");
45762        }
45763    }
45764    }
45765    function_tests++;
45766#endif
45767
45768    return(test_ret);
45769}
45770
45771
45772static int
45773test_xmlXPathEvalExpression(void) {
45774    int test_ret = 0;
45775
45776#if defined(LIBXML_XPATH_ENABLED)
45777    int mem_base;
45778    xmlXPathObjectPtr ret_val;
45779    xmlChar * str; /* the XPath expression */
45780    int n_str;
45781    xmlXPathContextPtr ctxt; /* the XPath context */
45782    int n_ctxt;
45783
45784    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45785    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45786        mem_base = xmlMemBlocks();
45787        str = gen_const_xmlChar_ptr(n_str, 0);
45788        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45789
45790        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
45791        desret_xmlXPathObjectPtr(ret_val);
45792        call_tests++;
45793        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
45794        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45795        xmlResetLastError();
45796        if (mem_base != xmlMemBlocks()) {
45797            printf("Leak of %d blocks found in xmlXPathEvalExpression",
45798	           xmlMemBlocks() - mem_base);
45799	    test_ret++;
45800            printf(" %d", n_str);
45801            printf(" %d", n_ctxt);
45802            printf("\n");
45803        }
45804    }
45805    }
45806    function_tests++;
45807#endif
45808
45809    return(test_ret);
45810}
45811
45812
45813static int
45814test_xmlXPathEvalPredicate(void) {
45815    int test_ret = 0;
45816
45817#if defined(LIBXML_XPATH_ENABLED)
45818    int mem_base;
45819    int ret_val;
45820    xmlXPathContextPtr ctxt; /* the XPath context */
45821    int n_ctxt;
45822    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
45823    int n_res;
45824
45825    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45826    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
45827        mem_base = xmlMemBlocks();
45828        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45829        res = gen_xmlXPathObjectPtr(n_res, 1);
45830
45831        ret_val = xmlXPathEvalPredicate(ctxt, res);
45832        desret_int(ret_val);
45833        call_tests++;
45834        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45835        des_xmlXPathObjectPtr(n_res, res, 1);
45836        xmlResetLastError();
45837        if (mem_base != xmlMemBlocks()) {
45838            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
45839	           xmlMemBlocks() - mem_base);
45840	    test_ret++;
45841            printf(" %d", n_ctxt);
45842            printf(" %d", n_res);
45843            printf("\n");
45844        }
45845    }
45846    }
45847    function_tests++;
45848#endif
45849
45850    return(test_ret);
45851}
45852
45853
45854static int
45855test_xmlXPathInit(void) {
45856    int test_ret = 0;
45857
45858#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45859    int mem_base;
45860
45861        mem_base = xmlMemBlocks();
45862
45863        xmlXPathInit();
45864        call_tests++;
45865        xmlResetLastError();
45866        if (mem_base != xmlMemBlocks()) {
45867            printf("Leak of %d blocks found in xmlXPathInit",
45868	           xmlMemBlocks() - mem_base);
45869	    test_ret++;
45870            printf("\n");
45871        }
45872    function_tests++;
45873#endif
45874
45875    return(test_ret);
45876}
45877
45878
45879static int
45880test_xmlXPathIsInf(void) {
45881    int test_ret = 0;
45882
45883#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45884    int mem_base;
45885    int ret_val;
45886    double val; /* a double value */
45887    int n_val;
45888
45889    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45890        mem_base = xmlMemBlocks();
45891        val = gen_double(n_val, 0);
45892
45893        ret_val = xmlXPathIsInf(val);
45894        desret_int(ret_val);
45895        call_tests++;
45896        des_double(n_val, val, 0);
45897        xmlResetLastError();
45898        if (mem_base != xmlMemBlocks()) {
45899            printf("Leak of %d blocks found in xmlXPathIsInf",
45900	           xmlMemBlocks() - mem_base);
45901	    test_ret++;
45902            printf(" %d", n_val);
45903            printf("\n");
45904        }
45905    }
45906    function_tests++;
45907#endif
45908
45909    return(test_ret);
45910}
45911
45912
45913static int
45914test_xmlXPathIsNaN(void) {
45915    int test_ret = 0;
45916
45917#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45918    int mem_base;
45919    int ret_val;
45920    double val; /* a double value */
45921    int n_val;
45922
45923    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45924        mem_base = xmlMemBlocks();
45925        val = gen_double(n_val, 0);
45926
45927        ret_val = xmlXPathIsNaN(val);
45928        desret_int(ret_val);
45929        call_tests++;
45930        des_double(n_val, val, 0);
45931        xmlResetLastError();
45932        if (mem_base != xmlMemBlocks()) {
45933            printf("Leak of %d blocks found in xmlXPathIsNaN",
45934	           xmlMemBlocks() - mem_base);
45935	    test_ret++;
45936            printf(" %d", n_val);
45937            printf("\n");
45938        }
45939    }
45940    function_tests++;
45941#endif
45942
45943    return(test_ret);
45944}
45945
45946
45947static int
45948test_xmlXPathNewContext(void) {
45949    int test_ret = 0;
45950
45951
45952    /* missing type support */
45953    return(test_ret);
45954}
45955
45956
45957static int
45958test_xmlXPathNodeSetCreate(void) {
45959    int test_ret = 0;
45960
45961#if defined(LIBXML_XPATH_ENABLED)
45962    int mem_base;
45963    xmlNodeSetPtr ret_val;
45964    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
45965    int n_val;
45966
45967    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45968        mem_base = xmlMemBlocks();
45969        val = gen_xmlNodePtr(n_val, 0);
45970
45971        ret_val = xmlXPathNodeSetCreate(val);
45972        desret_xmlNodeSetPtr(ret_val);
45973        call_tests++;
45974        des_xmlNodePtr(n_val, val, 0);
45975        xmlResetLastError();
45976        if (mem_base != xmlMemBlocks()) {
45977            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
45978	           xmlMemBlocks() - mem_base);
45979	    test_ret++;
45980            printf(" %d", n_val);
45981            printf("\n");
45982        }
45983    }
45984    function_tests++;
45985#endif
45986
45987    return(test_ret);
45988}
45989
45990
45991static int
45992test_xmlXPathObjectCopy(void) {
45993    int test_ret = 0;
45994
45995#if defined(LIBXML_XPATH_ENABLED)
45996    int mem_base;
45997    xmlXPathObjectPtr ret_val;
45998    xmlXPathObjectPtr val; /* the original object */
45999    int n_val;
46000
46001    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46002        mem_base = xmlMemBlocks();
46003        val = gen_xmlXPathObjectPtr(n_val, 0);
46004
46005        ret_val = xmlXPathObjectCopy(val);
46006        desret_xmlXPathObjectPtr(ret_val);
46007        call_tests++;
46008        des_xmlXPathObjectPtr(n_val, val, 0);
46009        xmlResetLastError();
46010        if (mem_base != xmlMemBlocks()) {
46011            printf("Leak of %d blocks found in xmlXPathObjectCopy",
46012	           xmlMemBlocks() - mem_base);
46013	    test_ret++;
46014            printf(" %d", n_val);
46015            printf("\n");
46016        }
46017    }
46018    function_tests++;
46019#endif
46020
46021    return(test_ret);
46022}
46023
46024
46025static int
46026test_xmlXPathOrderDocElems(void) {
46027    int test_ret = 0;
46028
46029#if defined(LIBXML_XPATH_ENABLED)
46030    int mem_base;
46031    long ret_val;
46032    xmlDocPtr doc; /* an input document */
46033    int n_doc;
46034
46035    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46036        mem_base = xmlMemBlocks();
46037        doc = gen_xmlDocPtr(n_doc, 0);
46038
46039        ret_val = xmlXPathOrderDocElems(doc);
46040        desret_long(ret_val);
46041        call_tests++;
46042        des_xmlDocPtr(n_doc, doc, 0);
46043        xmlResetLastError();
46044        if (mem_base != xmlMemBlocks()) {
46045            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46046	           xmlMemBlocks() - mem_base);
46047	    test_ret++;
46048            printf(" %d", n_doc);
46049            printf("\n");
46050        }
46051    }
46052    function_tests++;
46053#endif
46054
46055    return(test_ret);
46056}
46057
46058static int
46059test_xpath(void) {
46060    int test_ret = 0;
46061
46062    if (quiet == 0) printf("Testing xpath : 29 of 37 functions ...\n");
46063    test_ret += test_xmlXPathCastBooleanToNumber();
46064    test_ret += test_xmlXPathCastBooleanToString();
46065    test_ret += test_xmlXPathCastNodeSetToBoolean();
46066    test_ret += test_xmlXPathCastNodeSetToNumber();
46067    test_ret += test_xmlXPathCastNodeSetToString();
46068    test_ret += test_xmlXPathCastNodeToNumber();
46069    test_ret += test_xmlXPathCastNodeToString();
46070    test_ret += test_xmlXPathCastNumberToBoolean();
46071    test_ret += test_xmlXPathCastNumberToString();
46072    test_ret += test_xmlXPathCastStringToBoolean();
46073    test_ret += test_xmlXPathCastStringToNumber();
46074    test_ret += test_xmlXPathCastToBoolean();
46075    test_ret += test_xmlXPathCastToNumber();
46076    test_ret += test_xmlXPathCastToString();
46077    test_ret += test_xmlXPathCmpNodes();
46078    test_ret += test_xmlXPathCompile();
46079    test_ret += test_xmlXPathCompiledEval();
46080    test_ret += test_xmlXPathContextSetCache();
46081    test_ret += test_xmlXPathConvertBoolean();
46082    test_ret += test_xmlXPathConvertNumber();
46083    test_ret += test_xmlXPathConvertString();
46084    test_ret += test_xmlXPathCtxtCompile();
46085    test_ret += test_xmlXPathEval();
46086    test_ret += test_xmlXPathEvalExpression();
46087    test_ret += test_xmlXPathEvalPredicate();
46088    test_ret += test_xmlXPathInit();
46089    test_ret += test_xmlXPathIsInf();
46090    test_ret += test_xmlXPathIsNaN();
46091    test_ret += test_xmlXPathNewContext();
46092    test_ret += test_xmlXPathNodeSetCreate();
46093    test_ret += test_xmlXPathObjectCopy();
46094    test_ret += test_xmlXPathOrderDocElems();
46095
46096    if (test_ret != 0)
46097	printf("Module xpath: %d errors\n", test_ret);
46098    return(test_ret);
46099}
46100#ifdef LIBXML_XPATH_ENABLED
46101
46102#define gen_nb_xmlXPathParserContextPtr 1
46103static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46104    return(NULL);
46105}
46106static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46107}
46108#endif
46109
46110
46111static int
46112test_valuePop(void) {
46113    int test_ret = 0;
46114
46115#if defined(LIBXML_XPATH_ENABLED)
46116    int mem_base;
46117    xmlXPathObjectPtr ret_val;
46118    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46119    int n_ctxt;
46120
46121    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46122        mem_base = xmlMemBlocks();
46123        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46124
46125        ret_val = valuePop(ctxt);
46126        desret_xmlXPathObjectPtr(ret_val);
46127        call_tests++;
46128        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46129        xmlResetLastError();
46130        if (mem_base != xmlMemBlocks()) {
46131            printf("Leak of %d blocks found in valuePop",
46132	           xmlMemBlocks() - mem_base);
46133	    test_ret++;
46134            printf(" %d", n_ctxt);
46135            printf("\n");
46136        }
46137    }
46138    function_tests++;
46139#endif
46140
46141    return(test_ret);
46142}
46143
46144
46145static int
46146test_valuePush(void) {
46147    int test_ret = 0;
46148
46149#if defined(LIBXML_XPATH_ENABLED)
46150    int mem_base;
46151    int ret_val;
46152    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46153    int n_ctxt;
46154    xmlXPathObjectPtr value; /* the XPath object */
46155    int n_value;
46156
46157    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46158    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46159        mem_base = xmlMemBlocks();
46160        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46161        value = gen_xmlXPathObjectPtr(n_value, 1);
46162
46163        ret_val = valuePush(ctxt, value);
46164        desret_int(ret_val);
46165        call_tests++;
46166        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46167        des_xmlXPathObjectPtr(n_value, value, 1);
46168        xmlResetLastError();
46169        if (mem_base != xmlMemBlocks()) {
46170            printf("Leak of %d blocks found in valuePush",
46171	           xmlMemBlocks() - mem_base);
46172	    test_ret++;
46173            printf(" %d", n_ctxt);
46174            printf(" %d", n_value);
46175            printf("\n");
46176        }
46177    }
46178    }
46179    function_tests++;
46180#endif
46181
46182    return(test_ret);
46183}
46184
46185
46186static int
46187test_xmlXPathAddValues(void) {
46188    int test_ret = 0;
46189
46190#if defined(LIBXML_XPATH_ENABLED)
46191    int mem_base;
46192    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46193    int n_ctxt;
46194
46195    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46196        mem_base = xmlMemBlocks();
46197        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46198
46199        xmlXPathAddValues(ctxt);
46200        call_tests++;
46201        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46202        xmlResetLastError();
46203        if (mem_base != xmlMemBlocks()) {
46204            printf("Leak of %d blocks found in xmlXPathAddValues",
46205	           xmlMemBlocks() - mem_base);
46206	    test_ret++;
46207            printf(" %d", n_ctxt);
46208            printf("\n");
46209        }
46210    }
46211    function_tests++;
46212#endif
46213
46214    return(test_ret);
46215}
46216
46217
46218static int
46219test_xmlXPathBooleanFunction(void) {
46220    int test_ret = 0;
46221
46222#if defined(LIBXML_XPATH_ENABLED)
46223    int mem_base;
46224    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46225    int n_ctxt;
46226    int nargs; /* the number of arguments */
46227    int n_nargs;
46228
46229    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46230    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46231        mem_base = xmlMemBlocks();
46232        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46233        nargs = gen_int(n_nargs, 1);
46234
46235        xmlXPathBooleanFunction(ctxt, nargs);
46236        call_tests++;
46237        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46238        des_int(n_nargs, nargs, 1);
46239        xmlResetLastError();
46240        if (mem_base != xmlMemBlocks()) {
46241            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46242	           xmlMemBlocks() - mem_base);
46243	    test_ret++;
46244            printf(" %d", n_ctxt);
46245            printf(" %d", n_nargs);
46246            printf("\n");
46247        }
46248    }
46249    }
46250    function_tests++;
46251#endif
46252
46253    return(test_ret);
46254}
46255
46256
46257static int
46258test_xmlXPathCeilingFunction(void) {
46259    int test_ret = 0;
46260
46261#if defined(LIBXML_XPATH_ENABLED)
46262    int mem_base;
46263    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46264    int n_ctxt;
46265    int nargs; /* the number of arguments */
46266    int n_nargs;
46267
46268    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46269    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46270        mem_base = xmlMemBlocks();
46271        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46272        nargs = gen_int(n_nargs, 1);
46273
46274        xmlXPathCeilingFunction(ctxt, nargs);
46275        call_tests++;
46276        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46277        des_int(n_nargs, nargs, 1);
46278        xmlResetLastError();
46279        if (mem_base != xmlMemBlocks()) {
46280            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46281	           xmlMemBlocks() - mem_base);
46282	    test_ret++;
46283            printf(" %d", n_ctxt);
46284            printf(" %d", n_nargs);
46285            printf("\n");
46286        }
46287    }
46288    }
46289    function_tests++;
46290#endif
46291
46292    return(test_ret);
46293}
46294
46295
46296static int
46297test_xmlXPathCompareValues(void) {
46298    int test_ret = 0;
46299
46300#if defined(LIBXML_XPATH_ENABLED)
46301    int mem_base;
46302    int ret_val;
46303    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46304    int n_ctxt;
46305    int inf; /* less than (1) or greater than (0) */
46306    int n_inf;
46307    int strict; /* is the comparison strict */
46308    int n_strict;
46309
46310    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46311    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46312    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46313        mem_base = xmlMemBlocks();
46314        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46315        inf = gen_int(n_inf, 1);
46316        strict = gen_int(n_strict, 2);
46317
46318        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46319        desret_int(ret_val);
46320        call_tests++;
46321        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46322        des_int(n_inf, inf, 1);
46323        des_int(n_strict, strict, 2);
46324        xmlResetLastError();
46325        if (mem_base != xmlMemBlocks()) {
46326            printf("Leak of %d blocks found in xmlXPathCompareValues",
46327	           xmlMemBlocks() - mem_base);
46328	    test_ret++;
46329            printf(" %d", n_ctxt);
46330            printf(" %d", n_inf);
46331            printf(" %d", n_strict);
46332            printf("\n");
46333        }
46334    }
46335    }
46336    }
46337    function_tests++;
46338#endif
46339
46340    return(test_ret);
46341}
46342
46343
46344static int
46345test_xmlXPathConcatFunction(void) {
46346    int test_ret = 0;
46347
46348#if defined(LIBXML_XPATH_ENABLED)
46349    int mem_base;
46350    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46351    int n_ctxt;
46352    int nargs; /* the number of arguments */
46353    int n_nargs;
46354
46355    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46356    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46357        mem_base = xmlMemBlocks();
46358        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46359        nargs = gen_int(n_nargs, 1);
46360
46361        xmlXPathConcatFunction(ctxt, nargs);
46362        call_tests++;
46363        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46364        des_int(n_nargs, nargs, 1);
46365        xmlResetLastError();
46366        if (mem_base != xmlMemBlocks()) {
46367            printf("Leak of %d blocks found in xmlXPathConcatFunction",
46368	           xmlMemBlocks() - mem_base);
46369	    test_ret++;
46370            printf(" %d", n_ctxt);
46371            printf(" %d", n_nargs);
46372            printf("\n");
46373        }
46374    }
46375    }
46376    function_tests++;
46377#endif
46378
46379    return(test_ret);
46380}
46381
46382
46383static int
46384test_xmlXPathContainsFunction(void) {
46385    int test_ret = 0;
46386
46387#if defined(LIBXML_XPATH_ENABLED)
46388    int mem_base;
46389    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46390    int n_ctxt;
46391    int nargs; /* the number of arguments */
46392    int n_nargs;
46393
46394    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46395    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46396        mem_base = xmlMemBlocks();
46397        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46398        nargs = gen_int(n_nargs, 1);
46399
46400        xmlXPathContainsFunction(ctxt, nargs);
46401        call_tests++;
46402        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46403        des_int(n_nargs, nargs, 1);
46404        xmlResetLastError();
46405        if (mem_base != xmlMemBlocks()) {
46406            printf("Leak of %d blocks found in xmlXPathContainsFunction",
46407	           xmlMemBlocks() - mem_base);
46408	    test_ret++;
46409            printf(" %d", n_ctxt);
46410            printf(" %d", n_nargs);
46411            printf("\n");
46412        }
46413    }
46414    }
46415    function_tests++;
46416#endif
46417
46418    return(test_ret);
46419}
46420
46421
46422static int
46423test_xmlXPathCountFunction(void) {
46424    int test_ret = 0;
46425
46426#if defined(LIBXML_XPATH_ENABLED)
46427    int mem_base;
46428    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46429    int n_ctxt;
46430    int nargs; /* the number of arguments */
46431    int n_nargs;
46432
46433    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46434    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46435        mem_base = xmlMemBlocks();
46436        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46437        nargs = gen_int(n_nargs, 1);
46438
46439        xmlXPathCountFunction(ctxt, nargs);
46440        call_tests++;
46441        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46442        des_int(n_nargs, nargs, 1);
46443        xmlResetLastError();
46444        if (mem_base != xmlMemBlocks()) {
46445            printf("Leak of %d blocks found in xmlXPathCountFunction",
46446	           xmlMemBlocks() - mem_base);
46447	    test_ret++;
46448            printf(" %d", n_ctxt);
46449            printf(" %d", n_nargs);
46450            printf("\n");
46451        }
46452    }
46453    }
46454    function_tests++;
46455#endif
46456
46457    return(test_ret);
46458}
46459
46460
46461static int
46462test_xmlXPathDebugDumpCompExpr(void) {
46463    int test_ret = 0;
46464
46465#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46466    int mem_base;
46467    FILE * output; /* the FILE * for the output */
46468    int n_output;
46469    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46470    int n_comp;
46471    int depth; /* the indentation level. */
46472    int n_depth;
46473
46474    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46475    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46476    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46477        mem_base = xmlMemBlocks();
46478        output = gen_FILE_ptr(n_output, 0);
46479        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46480        depth = gen_int(n_depth, 2);
46481
46482        xmlXPathDebugDumpCompExpr(output, comp, depth);
46483        call_tests++;
46484        des_FILE_ptr(n_output, output, 0);
46485        des_xmlXPathCompExprPtr(n_comp, comp, 1);
46486        des_int(n_depth, depth, 2);
46487        xmlResetLastError();
46488        if (mem_base != xmlMemBlocks()) {
46489            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46490	           xmlMemBlocks() - mem_base);
46491	    test_ret++;
46492            printf(" %d", n_output);
46493            printf(" %d", n_comp);
46494            printf(" %d", n_depth);
46495            printf("\n");
46496        }
46497    }
46498    }
46499    }
46500    function_tests++;
46501#endif
46502
46503    return(test_ret);
46504}
46505
46506
46507static int
46508test_xmlXPathDebugDumpObject(void) {
46509    int test_ret = 0;
46510
46511#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46512    int mem_base;
46513    FILE * output; /* the FILE * to dump the output */
46514    int n_output;
46515    xmlXPathObjectPtr cur; /* the object to inspect */
46516    int n_cur;
46517    int depth; /* indentation level */
46518    int n_depth;
46519
46520    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46521    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46522    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46523        mem_base = xmlMemBlocks();
46524        output = gen_FILE_ptr(n_output, 0);
46525        cur = gen_xmlXPathObjectPtr(n_cur, 1);
46526        depth = gen_int(n_depth, 2);
46527
46528        xmlXPathDebugDumpObject(output, cur, depth);
46529        call_tests++;
46530        des_FILE_ptr(n_output, output, 0);
46531        des_xmlXPathObjectPtr(n_cur, cur, 1);
46532        des_int(n_depth, depth, 2);
46533        xmlResetLastError();
46534        if (mem_base != xmlMemBlocks()) {
46535            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46536	           xmlMemBlocks() - mem_base);
46537	    test_ret++;
46538            printf(" %d", n_output);
46539            printf(" %d", n_cur);
46540            printf(" %d", n_depth);
46541            printf("\n");
46542        }
46543    }
46544    }
46545    }
46546    function_tests++;
46547#endif
46548
46549    return(test_ret);
46550}
46551
46552
46553static int
46554test_xmlXPathDifference(void) {
46555    int test_ret = 0;
46556
46557#if defined(LIBXML_XPATH_ENABLED)
46558    int mem_base;
46559    xmlNodeSetPtr ret_val;
46560    xmlNodeSetPtr nodes1; /* a node-set */
46561    int n_nodes1;
46562    xmlNodeSetPtr nodes2; /* a node-set */
46563    int n_nodes2;
46564
46565    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46566    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46567        mem_base = xmlMemBlocks();
46568        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46569        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46570
46571        ret_val = xmlXPathDifference(nodes1, nodes2);
46572        desret_xmlNodeSetPtr(ret_val);
46573        call_tests++;
46574        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46575        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46576        xmlResetLastError();
46577        if (mem_base != xmlMemBlocks()) {
46578            printf("Leak of %d blocks found in xmlXPathDifference",
46579	           xmlMemBlocks() - mem_base);
46580	    test_ret++;
46581            printf(" %d", n_nodes1);
46582            printf(" %d", n_nodes2);
46583            printf("\n");
46584        }
46585    }
46586    }
46587    function_tests++;
46588#endif
46589
46590    return(test_ret);
46591}
46592
46593
46594static int
46595test_xmlXPathDistinct(void) {
46596    int test_ret = 0;
46597
46598#if defined(LIBXML_XPATH_ENABLED)
46599    int mem_base;
46600    xmlNodeSetPtr ret_val;
46601    xmlNodeSetPtr nodes; /* a node-set */
46602    int n_nodes;
46603
46604    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46605        mem_base = xmlMemBlocks();
46606        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46607
46608        ret_val = xmlXPathDistinct(nodes);
46609        desret_xmlNodeSetPtr(ret_val);
46610        call_tests++;
46611        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46612        xmlResetLastError();
46613        if (mem_base != xmlMemBlocks()) {
46614            printf("Leak of %d blocks found in xmlXPathDistinct",
46615	           xmlMemBlocks() - mem_base);
46616	    test_ret++;
46617            printf(" %d", n_nodes);
46618            printf("\n");
46619        }
46620    }
46621    function_tests++;
46622#endif
46623
46624    return(test_ret);
46625}
46626
46627
46628static int
46629test_xmlXPathDistinctSorted(void) {
46630    int test_ret = 0;
46631
46632#if defined(LIBXML_XPATH_ENABLED)
46633    int mem_base;
46634    xmlNodeSetPtr ret_val;
46635    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46636    int n_nodes;
46637
46638    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46639        mem_base = xmlMemBlocks();
46640        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46641
46642        ret_val = xmlXPathDistinctSorted(nodes);
46643        desret_xmlNodeSetPtr(ret_val);
46644        call_tests++;
46645        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46646        xmlResetLastError();
46647        if (mem_base != xmlMemBlocks()) {
46648            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46649	           xmlMemBlocks() - mem_base);
46650	    test_ret++;
46651            printf(" %d", n_nodes);
46652            printf("\n");
46653        }
46654    }
46655    function_tests++;
46656#endif
46657
46658    return(test_ret);
46659}
46660
46661
46662static int
46663test_xmlXPathDivValues(void) {
46664    int test_ret = 0;
46665
46666#if defined(LIBXML_XPATH_ENABLED)
46667    int mem_base;
46668    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46669    int n_ctxt;
46670
46671    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46672        mem_base = xmlMemBlocks();
46673        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46674
46675        xmlXPathDivValues(ctxt);
46676        call_tests++;
46677        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46678        xmlResetLastError();
46679        if (mem_base != xmlMemBlocks()) {
46680            printf("Leak of %d blocks found in xmlXPathDivValues",
46681	           xmlMemBlocks() - mem_base);
46682	    test_ret++;
46683            printf(" %d", n_ctxt);
46684            printf("\n");
46685        }
46686    }
46687    function_tests++;
46688#endif
46689
46690    return(test_ret);
46691}
46692
46693
46694static int
46695test_xmlXPathEqualValues(void) {
46696    int test_ret = 0;
46697
46698#if defined(LIBXML_XPATH_ENABLED)
46699    int mem_base;
46700    int ret_val;
46701    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46702    int n_ctxt;
46703
46704    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46705        mem_base = xmlMemBlocks();
46706        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46707
46708        ret_val = xmlXPathEqualValues(ctxt);
46709        desret_int(ret_val);
46710        call_tests++;
46711        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46712        xmlResetLastError();
46713        if (mem_base != xmlMemBlocks()) {
46714            printf("Leak of %d blocks found in xmlXPathEqualValues",
46715	           xmlMemBlocks() - mem_base);
46716	    test_ret++;
46717            printf(" %d", n_ctxt);
46718            printf("\n");
46719        }
46720    }
46721    function_tests++;
46722#endif
46723
46724    return(test_ret);
46725}
46726
46727
46728static int
46729test_xmlXPathErr(void) {
46730    int test_ret = 0;
46731
46732#if defined(LIBXML_XPATH_ENABLED)
46733    int mem_base;
46734    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
46735    int n_ctxt;
46736    int error; /* the error code */
46737    int n_error;
46738
46739    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46740    for (n_error = 0;n_error < gen_nb_int;n_error++) {
46741        mem_base = xmlMemBlocks();
46742        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46743        error = gen_int(n_error, 1);
46744
46745        xmlXPathErr(ctxt, error);
46746        call_tests++;
46747        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46748        des_int(n_error, error, 1);
46749        xmlResetLastError();
46750        if (mem_base != xmlMemBlocks()) {
46751            printf("Leak of %d blocks found in xmlXPathErr",
46752	           xmlMemBlocks() - mem_base);
46753	    test_ret++;
46754            printf(" %d", n_ctxt);
46755            printf(" %d", n_error);
46756            printf("\n");
46757        }
46758    }
46759    }
46760    function_tests++;
46761#endif
46762
46763    return(test_ret);
46764}
46765
46766
46767static int
46768test_xmlXPathEvalExpr(void) {
46769    int test_ret = 0;
46770
46771#if defined(LIBXML_XPATH_ENABLED)
46772    int mem_base;
46773    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46774    int n_ctxt;
46775
46776    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46777        mem_base = xmlMemBlocks();
46778        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46779
46780        xmlXPathEvalExpr(ctxt);
46781        call_tests++;
46782        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46783        xmlResetLastError();
46784        if (mem_base != xmlMemBlocks()) {
46785            printf("Leak of %d blocks found in xmlXPathEvalExpr",
46786	           xmlMemBlocks() - mem_base);
46787	    test_ret++;
46788            printf(" %d", n_ctxt);
46789            printf("\n");
46790        }
46791    }
46792    function_tests++;
46793#endif
46794
46795    return(test_ret);
46796}
46797
46798
46799static int
46800test_xmlXPathEvaluatePredicateResult(void) {
46801    int test_ret = 0;
46802
46803#if defined(LIBXML_XPATH_ENABLED)
46804    int mem_base;
46805    int ret_val;
46806    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46807    int n_ctxt;
46808    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46809    int n_res;
46810
46811    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46812    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46813        mem_base = xmlMemBlocks();
46814        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46815        res = gen_xmlXPathObjectPtr(n_res, 1);
46816
46817        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
46818        desret_int(ret_val);
46819        call_tests++;
46820        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46821        des_xmlXPathObjectPtr(n_res, res, 1);
46822        xmlResetLastError();
46823        if (mem_base != xmlMemBlocks()) {
46824            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
46825	           xmlMemBlocks() - mem_base);
46826	    test_ret++;
46827            printf(" %d", n_ctxt);
46828            printf(" %d", n_res);
46829            printf("\n");
46830        }
46831    }
46832    }
46833    function_tests++;
46834#endif
46835
46836    return(test_ret);
46837}
46838
46839
46840static int
46841test_xmlXPathFalseFunction(void) {
46842    int test_ret = 0;
46843
46844#if defined(LIBXML_XPATH_ENABLED)
46845    int mem_base;
46846    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46847    int n_ctxt;
46848    int nargs; /* the number of arguments */
46849    int n_nargs;
46850
46851    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46852    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46853        mem_base = xmlMemBlocks();
46854        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46855        nargs = gen_int(n_nargs, 1);
46856
46857        xmlXPathFalseFunction(ctxt, nargs);
46858        call_tests++;
46859        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46860        des_int(n_nargs, nargs, 1);
46861        xmlResetLastError();
46862        if (mem_base != xmlMemBlocks()) {
46863            printf("Leak of %d blocks found in xmlXPathFalseFunction",
46864	           xmlMemBlocks() - mem_base);
46865	    test_ret++;
46866            printf(" %d", n_ctxt);
46867            printf(" %d", n_nargs);
46868            printf("\n");
46869        }
46870    }
46871    }
46872    function_tests++;
46873#endif
46874
46875    return(test_ret);
46876}
46877
46878
46879static int
46880test_xmlXPathFloorFunction(void) {
46881    int test_ret = 0;
46882
46883#if defined(LIBXML_XPATH_ENABLED)
46884    int mem_base;
46885    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46886    int n_ctxt;
46887    int nargs; /* the number of arguments */
46888    int n_nargs;
46889
46890    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46891    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46892        mem_base = xmlMemBlocks();
46893        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46894        nargs = gen_int(n_nargs, 1);
46895
46896        xmlXPathFloorFunction(ctxt, nargs);
46897        call_tests++;
46898        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46899        des_int(n_nargs, nargs, 1);
46900        xmlResetLastError();
46901        if (mem_base != xmlMemBlocks()) {
46902            printf("Leak of %d blocks found in xmlXPathFloorFunction",
46903	           xmlMemBlocks() - mem_base);
46904	    test_ret++;
46905            printf(" %d", n_ctxt);
46906            printf(" %d", n_nargs);
46907            printf("\n");
46908        }
46909    }
46910    }
46911    function_tests++;
46912#endif
46913
46914    return(test_ret);
46915}
46916
46917
46918static int
46919test_xmlXPathFunctionLookup(void) {
46920    int test_ret = 0;
46921
46922
46923    /* missing type support */
46924    return(test_ret);
46925}
46926
46927
46928static int
46929test_xmlXPathFunctionLookupNS(void) {
46930    int test_ret = 0;
46931
46932
46933    /* missing type support */
46934    return(test_ret);
46935}
46936
46937
46938static int
46939test_xmlXPathHasSameNodes(void) {
46940    int test_ret = 0;
46941
46942#if defined(LIBXML_XPATH_ENABLED)
46943    int mem_base;
46944    int ret_val;
46945    xmlNodeSetPtr nodes1; /* a node-set */
46946    int n_nodes1;
46947    xmlNodeSetPtr nodes2; /* a node-set */
46948    int n_nodes2;
46949
46950    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46951    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46952        mem_base = xmlMemBlocks();
46953        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46954        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46955
46956        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
46957        desret_int(ret_val);
46958        call_tests++;
46959        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46960        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46961        xmlResetLastError();
46962        if (mem_base != xmlMemBlocks()) {
46963            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
46964	           xmlMemBlocks() - mem_base);
46965	    test_ret++;
46966            printf(" %d", n_nodes1);
46967            printf(" %d", n_nodes2);
46968            printf("\n");
46969        }
46970    }
46971    }
46972    function_tests++;
46973#endif
46974
46975    return(test_ret);
46976}
46977
46978
46979static int
46980test_xmlXPathIdFunction(void) {
46981    int test_ret = 0;
46982
46983#if defined(LIBXML_XPATH_ENABLED)
46984    int mem_base;
46985    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46986    int n_ctxt;
46987    int nargs; /* the number of arguments */
46988    int n_nargs;
46989
46990    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46991    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46992        mem_base = xmlMemBlocks();
46993        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46994        nargs = gen_int(n_nargs, 1);
46995
46996        xmlXPathIdFunction(ctxt, nargs);
46997        call_tests++;
46998        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46999        des_int(n_nargs, nargs, 1);
47000        xmlResetLastError();
47001        if (mem_base != xmlMemBlocks()) {
47002            printf("Leak of %d blocks found in xmlXPathIdFunction",
47003	           xmlMemBlocks() - mem_base);
47004	    test_ret++;
47005            printf(" %d", n_ctxt);
47006            printf(" %d", n_nargs);
47007            printf("\n");
47008        }
47009    }
47010    }
47011    function_tests++;
47012#endif
47013
47014    return(test_ret);
47015}
47016
47017
47018static int
47019test_xmlXPathIntersection(void) {
47020    int test_ret = 0;
47021
47022#if defined(LIBXML_XPATH_ENABLED)
47023    int mem_base;
47024    xmlNodeSetPtr ret_val;
47025    xmlNodeSetPtr nodes1; /* a node-set */
47026    int n_nodes1;
47027    xmlNodeSetPtr nodes2; /* a node-set */
47028    int n_nodes2;
47029
47030    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47031    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47032        mem_base = xmlMemBlocks();
47033        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47034        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47035
47036        ret_val = xmlXPathIntersection(nodes1, nodes2);
47037        desret_xmlNodeSetPtr(ret_val);
47038        call_tests++;
47039        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47040        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47041        xmlResetLastError();
47042        if (mem_base != xmlMemBlocks()) {
47043            printf("Leak of %d blocks found in xmlXPathIntersection",
47044	           xmlMemBlocks() - mem_base);
47045	    test_ret++;
47046            printf(" %d", n_nodes1);
47047            printf(" %d", n_nodes2);
47048            printf("\n");
47049        }
47050    }
47051    }
47052    function_tests++;
47053#endif
47054
47055    return(test_ret);
47056}
47057
47058
47059static int
47060test_xmlXPathIsNodeType(void) {
47061    int test_ret = 0;
47062
47063#if defined(LIBXML_XPATH_ENABLED)
47064    int mem_base;
47065    int ret_val;
47066    xmlChar * name; /* a name string */
47067    int n_name;
47068
47069    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47070        mem_base = xmlMemBlocks();
47071        name = gen_const_xmlChar_ptr(n_name, 0);
47072
47073        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47074        desret_int(ret_val);
47075        call_tests++;
47076        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47077        xmlResetLastError();
47078        if (mem_base != xmlMemBlocks()) {
47079            printf("Leak of %d blocks found in xmlXPathIsNodeType",
47080	           xmlMemBlocks() - mem_base);
47081	    test_ret++;
47082            printf(" %d", n_name);
47083            printf("\n");
47084        }
47085    }
47086    function_tests++;
47087#endif
47088
47089    return(test_ret);
47090}
47091
47092
47093static int
47094test_xmlXPathLangFunction(void) {
47095    int test_ret = 0;
47096
47097#if defined(LIBXML_XPATH_ENABLED)
47098    int mem_base;
47099    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47100    int n_ctxt;
47101    int nargs; /* the number of arguments */
47102    int n_nargs;
47103
47104    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47105    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47106        mem_base = xmlMemBlocks();
47107        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47108        nargs = gen_int(n_nargs, 1);
47109
47110        xmlXPathLangFunction(ctxt, nargs);
47111        call_tests++;
47112        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47113        des_int(n_nargs, nargs, 1);
47114        xmlResetLastError();
47115        if (mem_base != xmlMemBlocks()) {
47116            printf("Leak of %d blocks found in xmlXPathLangFunction",
47117	           xmlMemBlocks() - mem_base);
47118	    test_ret++;
47119            printf(" %d", n_ctxt);
47120            printf(" %d", n_nargs);
47121            printf("\n");
47122        }
47123    }
47124    }
47125    function_tests++;
47126#endif
47127
47128    return(test_ret);
47129}
47130
47131
47132static int
47133test_xmlXPathLastFunction(void) {
47134    int test_ret = 0;
47135
47136#if defined(LIBXML_XPATH_ENABLED)
47137    int mem_base;
47138    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47139    int n_ctxt;
47140    int nargs; /* the number of arguments */
47141    int n_nargs;
47142
47143    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47144    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47145        mem_base = xmlMemBlocks();
47146        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47147        nargs = gen_int(n_nargs, 1);
47148
47149        xmlXPathLastFunction(ctxt, nargs);
47150        call_tests++;
47151        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47152        des_int(n_nargs, nargs, 1);
47153        xmlResetLastError();
47154        if (mem_base != xmlMemBlocks()) {
47155            printf("Leak of %d blocks found in xmlXPathLastFunction",
47156	           xmlMemBlocks() - mem_base);
47157	    test_ret++;
47158            printf(" %d", n_ctxt);
47159            printf(" %d", n_nargs);
47160            printf("\n");
47161        }
47162    }
47163    }
47164    function_tests++;
47165#endif
47166
47167    return(test_ret);
47168}
47169
47170
47171static int
47172test_xmlXPathLeading(void) {
47173    int test_ret = 0;
47174
47175#if defined(LIBXML_XPATH_ENABLED)
47176    int mem_base;
47177    xmlNodeSetPtr ret_val;
47178    xmlNodeSetPtr nodes1; /* a node-set */
47179    int n_nodes1;
47180    xmlNodeSetPtr nodes2; /* a node-set */
47181    int n_nodes2;
47182
47183    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47184    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47185        mem_base = xmlMemBlocks();
47186        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47187        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47188
47189        ret_val = xmlXPathLeading(nodes1, nodes2);
47190        desret_xmlNodeSetPtr(ret_val);
47191        call_tests++;
47192        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47193        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47194        xmlResetLastError();
47195        if (mem_base != xmlMemBlocks()) {
47196            printf("Leak of %d blocks found in xmlXPathLeading",
47197	           xmlMemBlocks() - mem_base);
47198	    test_ret++;
47199            printf(" %d", n_nodes1);
47200            printf(" %d", n_nodes2);
47201            printf("\n");
47202        }
47203    }
47204    }
47205    function_tests++;
47206#endif
47207
47208    return(test_ret);
47209}
47210
47211
47212static int
47213test_xmlXPathLeadingSorted(void) {
47214    int test_ret = 0;
47215
47216#if defined(LIBXML_XPATH_ENABLED)
47217    int mem_base;
47218    xmlNodeSetPtr ret_val;
47219    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47220    int n_nodes1;
47221    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47222    int n_nodes2;
47223
47224    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47225    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47226        mem_base = xmlMemBlocks();
47227        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47228        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47229
47230        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47231        desret_xmlNodeSetPtr(ret_val);
47232        call_tests++;
47233        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47234        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47235        xmlResetLastError();
47236        if (mem_base != xmlMemBlocks()) {
47237            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47238	           xmlMemBlocks() - mem_base);
47239	    test_ret++;
47240            printf(" %d", n_nodes1);
47241            printf(" %d", n_nodes2);
47242            printf("\n");
47243        }
47244    }
47245    }
47246    function_tests++;
47247#endif
47248
47249    return(test_ret);
47250}
47251
47252
47253static int
47254test_xmlXPathLocalNameFunction(void) {
47255    int test_ret = 0;
47256
47257#if defined(LIBXML_XPATH_ENABLED)
47258    int mem_base;
47259    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47260    int n_ctxt;
47261    int nargs; /* the number of arguments */
47262    int n_nargs;
47263
47264    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47265    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47266        mem_base = xmlMemBlocks();
47267        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47268        nargs = gen_int(n_nargs, 1);
47269
47270        xmlXPathLocalNameFunction(ctxt, nargs);
47271        call_tests++;
47272        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47273        des_int(n_nargs, nargs, 1);
47274        xmlResetLastError();
47275        if (mem_base != xmlMemBlocks()) {
47276            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47277	           xmlMemBlocks() - mem_base);
47278	    test_ret++;
47279            printf(" %d", n_ctxt);
47280            printf(" %d", n_nargs);
47281            printf("\n");
47282        }
47283    }
47284    }
47285    function_tests++;
47286#endif
47287
47288    return(test_ret);
47289}
47290
47291
47292static int
47293test_xmlXPathModValues(void) {
47294    int test_ret = 0;
47295
47296#if defined(LIBXML_XPATH_ENABLED)
47297    int mem_base;
47298    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47299    int n_ctxt;
47300
47301    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47302        mem_base = xmlMemBlocks();
47303        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47304
47305        xmlXPathModValues(ctxt);
47306        call_tests++;
47307        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47308        xmlResetLastError();
47309        if (mem_base != xmlMemBlocks()) {
47310            printf("Leak of %d blocks found in xmlXPathModValues",
47311	           xmlMemBlocks() - mem_base);
47312	    test_ret++;
47313            printf(" %d", n_ctxt);
47314            printf("\n");
47315        }
47316    }
47317    function_tests++;
47318#endif
47319
47320    return(test_ret);
47321}
47322
47323
47324static int
47325test_xmlXPathMultValues(void) {
47326    int test_ret = 0;
47327
47328#if defined(LIBXML_XPATH_ENABLED)
47329    int mem_base;
47330    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47331    int n_ctxt;
47332
47333    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47334        mem_base = xmlMemBlocks();
47335        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47336
47337        xmlXPathMultValues(ctxt);
47338        call_tests++;
47339        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47340        xmlResetLastError();
47341        if (mem_base != xmlMemBlocks()) {
47342            printf("Leak of %d blocks found in xmlXPathMultValues",
47343	           xmlMemBlocks() - mem_base);
47344	    test_ret++;
47345            printf(" %d", n_ctxt);
47346            printf("\n");
47347        }
47348    }
47349    function_tests++;
47350#endif
47351
47352    return(test_ret);
47353}
47354
47355
47356static int
47357test_xmlXPathNamespaceURIFunction(void) {
47358    int test_ret = 0;
47359
47360#if defined(LIBXML_XPATH_ENABLED)
47361    int mem_base;
47362    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47363    int n_ctxt;
47364    int nargs; /* the number of arguments */
47365    int n_nargs;
47366
47367    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47368    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47369        mem_base = xmlMemBlocks();
47370        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47371        nargs = gen_int(n_nargs, 1);
47372
47373        xmlXPathNamespaceURIFunction(ctxt, nargs);
47374        call_tests++;
47375        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47376        des_int(n_nargs, nargs, 1);
47377        xmlResetLastError();
47378        if (mem_base != xmlMemBlocks()) {
47379            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47380	           xmlMemBlocks() - mem_base);
47381	    test_ret++;
47382            printf(" %d", n_ctxt);
47383            printf(" %d", n_nargs);
47384            printf("\n");
47385        }
47386    }
47387    }
47388    function_tests++;
47389#endif
47390
47391    return(test_ret);
47392}
47393
47394
47395static int
47396test_xmlXPathNewBoolean(void) {
47397    int test_ret = 0;
47398
47399#if defined(LIBXML_XPATH_ENABLED)
47400    int mem_base;
47401    xmlXPathObjectPtr ret_val;
47402    int val; /* the boolean value */
47403    int n_val;
47404
47405    for (n_val = 0;n_val < gen_nb_int;n_val++) {
47406        mem_base = xmlMemBlocks();
47407        val = gen_int(n_val, 0);
47408
47409        ret_val = xmlXPathNewBoolean(val);
47410        desret_xmlXPathObjectPtr(ret_val);
47411        call_tests++;
47412        des_int(n_val, val, 0);
47413        xmlResetLastError();
47414        if (mem_base != xmlMemBlocks()) {
47415            printf("Leak of %d blocks found in xmlXPathNewBoolean",
47416	           xmlMemBlocks() - mem_base);
47417	    test_ret++;
47418            printf(" %d", n_val);
47419            printf("\n");
47420        }
47421    }
47422    function_tests++;
47423#endif
47424
47425    return(test_ret);
47426}
47427
47428
47429static int
47430test_xmlXPathNewCString(void) {
47431    int test_ret = 0;
47432
47433#if defined(LIBXML_XPATH_ENABLED)
47434    int mem_base;
47435    xmlXPathObjectPtr ret_val;
47436    char * val; /* the char * value */
47437    int n_val;
47438
47439    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47440        mem_base = xmlMemBlocks();
47441        val = gen_const_char_ptr(n_val, 0);
47442
47443        ret_val = xmlXPathNewCString((const char *)val);
47444        desret_xmlXPathObjectPtr(ret_val);
47445        call_tests++;
47446        des_const_char_ptr(n_val, (const char *)val, 0);
47447        xmlResetLastError();
47448        if (mem_base != xmlMemBlocks()) {
47449            printf("Leak of %d blocks found in xmlXPathNewCString",
47450	           xmlMemBlocks() - mem_base);
47451	    test_ret++;
47452            printf(" %d", n_val);
47453            printf("\n");
47454        }
47455    }
47456    function_tests++;
47457#endif
47458
47459    return(test_ret);
47460}
47461
47462
47463static int
47464test_xmlXPathNewFloat(void) {
47465    int test_ret = 0;
47466
47467#if defined(LIBXML_XPATH_ENABLED)
47468    int mem_base;
47469    xmlXPathObjectPtr ret_val;
47470    double val; /* the double value */
47471    int n_val;
47472
47473    for (n_val = 0;n_val < gen_nb_double;n_val++) {
47474        mem_base = xmlMemBlocks();
47475        val = gen_double(n_val, 0);
47476
47477        ret_val = xmlXPathNewFloat(val);
47478        desret_xmlXPathObjectPtr(ret_val);
47479        call_tests++;
47480        des_double(n_val, val, 0);
47481        xmlResetLastError();
47482        if (mem_base != xmlMemBlocks()) {
47483            printf("Leak of %d blocks found in xmlXPathNewFloat",
47484	           xmlMemBlocks() - mem_base);
47485	    test_ret++;
47486            printf(" %d", n_val);
47487            printf("\n");
47488        }
47489    }
47490    function_tests++;
47491#endif
47492
47493    return(test_ret);
47494}
47495
47496
47497static int
47498test_xmlXPathNewNodeSet(void) {
47499    int test_ret = 0;
47500
47501#if defined(LIBXML_XPATH_ENABLED)
47502    int mem_base;
47503    xmlXPathObjectPtr ret_val;
47504    xmlNodePtr val; /* the NodePtr value */
47505    int n_val;
47506
47507    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47508        mem_base = xmlMemBlocks();
47509        val = gen_xmlNodePtr(n_val, 0);
47510
47511        ret_val = xmlXPathNewNodeSet(val);
47512        desret_xmlXPathObjectPtr(ret_val);
47513        call_tests++;
47514        des_xmlNodePtr(n_val, val, 0);
47515        xmlResetLastError();
47516        if (mem_base != xmlMemBlocks()) {
47517            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47518	           xmlMemBlocks() - mem_base);
47519	    test_ret++;
47520            printf(" %d", n_val);
47521            printf("\n");
47522        }
47523    }
47524    function_tests++;
47525#endif
47526
47527    return(test_ret);
47528}
47529
47530
47531static int
47532test_xmlXPathNewNodeSetList(void) {
47533    int test_ret = 0;
47534
47535#if defined(LIBXML_XPATH_ENABLED)
47536    int mem_base;
47537    xmlXPathObjectPtr ret_val;
47538    xmlNodeSetPtr val; /* an existing NodeSet */
47539    int n_val;
47540
47541    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47542        mem_base = xmlMemBlocks();
47543        val = gen_xmlNodeSetPtr(n_val, 0);
47544
47545        ret_val = xmlXPathNewNodeSetList(val);
47546        desret_xmlXPathObjectPtr(ret_val);
47547        call_tests++;
47548        des_xmlNodeSetPtr(n_val, val, 0);
47549        xmlResetLastError();
47550        if (mem_base != xmlMemBlocks()) {
47551            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47552	           xmlMemBlocks() - mem_base);
47553	    test_ret++;
47554            printf(" %d", n_val);
47555            printf("\n");
47556        }
47557    }
47558    function_tests++;
47559#endif
47560
47561    return(test_ret);
47562}
47563
47564
47565static int
47566test_xmlXPathNewParserContext(void) {
47567    int test_ret = 0;
47568
47569
47570    /* missing type support */
47571    return(test_ret);
47572}
47573
47574
47575static int
47576test_xmlXPathNewString(void) {
47577    int test_ret = 0;
47578
47579#if defined(LIBXML_XPATH_ENABLED)
47580    int mem_base;
47581    xmlXPathObjectPtr ret_val;
47582    xmlChar * val; /* the xmlChar * value */
47583    int n_val;
47584
47585    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47586        mem_base = xmlMemBlocks();
47587        val = gen_const_xmlChar_ptr(n_val, 0);
47588
47589        ret_val = xmlXPathNewString((const xmlChar *)val);
47590        desret_xmlXPathObjectPtr(ret_val);
47591        call_tests++;
47592        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47593        xmlResetLastError();
47594        if (mem_base != xmlMemBlocks()) {
47595            printf("Leak of %d blocks found in xmlXPathNewString",
47596	           xmlMemBlocks() - mem_base);
47597	    test_ret++;
47598            printf(" %d", n_val);
47599            printf("\n");
47600        }
47601    }
47602    function_tests++;
47603#endif
47604
47605    return(test_ret);
47606}
47607
47608
47609static int
47610test_xmlXPathNextAncestor(void) {
47611    int test_ret = 0;
47612
47613#if defined(LIBXML_XPATH_ENABLED)
47614    int mem_base;
47615    xmlNodePtr ret_val;
47616    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47617    int n_ctxt;
47618    xmlNodePtr cur; /* the current node in the traversal */
47619    int n_cur;
47620
47621    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47622    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47623        mem_base = xmlMemBlocks();
47624        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47625        cur = gen_xmlNodePtr(n_cur, 1);
47626
47627        ret_val = xmlXPathNextAncestor(ctxt, cur);
47628        desret_xmlNodePtr(ret_val);
47629        call_tests++;
47630        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47631        des_xmlNodePtr(n_cur, cur, 1);
47632        xmlResetLastError();
47633        if (mem_base != xmlMemBlocks()) {
47634            printf("Leak of %d blocks found in xmlXPathNextAncestor",
47635	           xmlMemBlocks() - mem_base);
47636	    test_ret++;
47637            printf(" %d", n_ctxt);
47638            printf(" %d", n_cur);
47639            printf("\n");
47640        }
47641    }
47642    }
47643    function_tests++;
47644#endif
47645
47646    return(test_ret);
47647}
47648
47649
47650static int
47651test_xmlXPathNextAncestorOrSelf(void) {
47652    int test_ret = 0;
47653
47654#if defined(LIBXML_XPATH_ENABLED)
47655    int mem_base;
47656    xmlNodePtr ret_val;
47657    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47658    int n_ctxt;
47659    xmlNodePtr cur; /* the current node in the traversal */
47660    int n_cur;
47661
47662    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47663    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47664        mem_base = xmlMemBlocks();
47665        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47666        cur = gen_xmlNodePtr(n_cur, 1);
47667
47668        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47669        desret_xmlNodePtr(ret_val);
47670        call_tests++;
47671        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47672        des_xmlNodePtr(n_cur, cur, 1);
47673        xmlResetLastError();
47674        if (mem_base != xmlMemBlocks()) {
47675            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47676	           xmlMemBlocks() - mem_base);
47677	    test_ret++;
47678            printf(" %d", n_ctxt);
47679            printf(" %d", n_cur);
47680            printf("\n");
47681        }
47682    }
47683    }
47684    function_tests++;
47685#endif
47686
47687    return(test_ret);
47688}
47689
47690
47691static int
47692test_xmlXPathNextAttribute(void) {
47693    int test_ret = 0;
47694
47695#if defined(LIBXML_XPATH_ENABLED)
47696    int mem_base;
47697    xmlNodePtr ret_val;
47698    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47699    int n_ctxt;
47700    xmlNodePtr cur; /* the current attribute in the traversal */
47701    int n_cur;
47702
47703    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47704    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47705        mem_base = xmlMemBlocks();
47706        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47707        cur = gen_xmlNodePtr(n_cur, 1);
47708
47709        ret_val = xmlXPathNextAttribute(ctxt, cur);
47710        desret_xmlNodePtr(ret_val);
47711        call_tests++;
47712        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47713        des_xmlNodePtr(n_cur, cur, 1);
47714        xmlResetLastError();
47715        if (mem_base != xmlMemBlocks()) {
47716            printf("Leak of %d blocks found in xmlXPathNextAttribute",
47717	           xmlMemBlocks() - mem_base);
47718	    test_ret++;
47719            printf(" %d", n_ctxt);
47720            printf(" %d", n_cur);
47721            printf("\n");
47722        }
47723    }
47724    }
47725    function_tests++;
47726#endif
47727
47728    return(test_ret);
47729}
47730
47731
47732static int
47733test_xmlXPathNextChild(void) {
47734    int test_ret = 0;
47735
47736#if defined(LIBXML_XPATH_ENABLED)
47737    int mem_base;
47738    xmlNodePtr ret_val;
47739    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47740    int n_ctxt;
47741    xmlNodePtr cur; /* the current node in the traversal */
47742    int n_cur;
47743
47744    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47745    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47746        mem_base = xmlMemBlocks();
47747        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47748        cur = gen_xmlNodePtr(n_cur, 1);
47749
47750        ret_val = xmlXPathNextChild(ctxt, cur);
47751        desret_xmlNodePtr(ret_val);
47752        call_tests++;
47753        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47754        des_xmlNodePtr(n_cur, cur, 1);
47755        xmlResetLastError();
47756        if (mem_base != xmlMemBlocks()) {
47757            printf("Leak of %d blocks found in xmlXPathNextChild",
47758	           xmlMemBlocks() - mem_base);
47759	    test_ret++;
47760            printf(" %d", n_ctxt);
47761            printf(" %d", n_cur);
47762            printf("\n");
47763        }
47764    }
47765    }
47766    function_tests++;
47767#endif
47768
47769    return(test_ret);
47770}
47771
47772
47773static int
47774test_xmlXPathNextDescendant(void) {
47775    int test_ret = 0;
47776
47777#if defined(LIBXML_XPATH_ENABLED)
47778    int mem_base;
47779    xmlNodePtr ret_val;
47780    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47781    int n_ctxt;
47782    xmlNodePtr cur; /* the current node in the traversal */
47783    int n_cur;
47784
47785    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47786    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47787        mem_base = xmlMemBlocks();
47788        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47789        cur = gen_xmlNodePtr(n_cur, 1);
47790
47791        ret_val = xmlXPathNextDescendant(ctxt, cur);
47792        desret_xmlNodePtr(ret_val);
47793        call_tests++;
47794        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47795        des_xmlNodePtr(n_cur, cur, 1);
47796        xmlResetLastError();
47797        if (mem_base != xmlMemBlocks()) {
47798            printf("Leak of %d blocks found in xmlXPathNextDescendant",
47799	           xmlMemBlocks() - mem_base);
47800	    test_ret++;
47801            printf(" %d", n_ctxt);
47802            printf(" %d", n_cur);
47803            printf("\n");
47804        }
47805    }
47806    }
47807    function_tests++;
47808#endif
47809
47810    return(test_ret);
47811}
47812
47813
47814static int
47815test_xmlXPathNextDescendantOrSelf(void) {
47816    int test_ret = 0;
47817
47818#if defined(LIBXML_XPATH_ENABLED)
47819    int mem_base;
47820    xmlNodePtr ret_val;
47821    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47822    int n_ctxt;
47823    xmlNodePtr cur; /* the current node in the traversal */
47824    int n_cur;
47825
47826    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47827    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47828        mem_base = xmlMemBlocks();
47829        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47830        cur = gen_xmlNodePtr(n_cur, 1);
47831
47832        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
47833        desret_xmlNodePtr(ret_val);
47834        call_tests++;
47835        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47836        des_xmlNodePtr(n_cur, cur, 1);
47837        xmlResetLastError();
47838        if (mem_base != xmlMemBlocks()) {
47839            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
47840	           xmlMemBlocks() - mem_base);
47841	    test_ret++;
47842            printf(" %d", n_ctxt);
47843            printf(" %d", n_cur);
47844            printf("\n");
47845        }
47846    }
47847    }
47848    function_tests++;
47849#endif
47850
47851    return(test_ret);
47852}
47853
47854
47855static int
47856test_xmlXPathNextFollowing(void) {
47857    int test_ret = 0;
47858
47859#if defined(LIBXML_XPATH_ENABLED)
47860    int mem_base;
47861    xmlNodePtr ret_val;
47862    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47863    int n_ctxt;
47864    xmlNodePtr cur; /* the current node in the traversal */
47865    int n_cur;
47866
47867    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47868    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47869        mem_base = xmlMemBlocks();
47870        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47871        cur = gen_xmlNodePtr(n_cur, 1);
47872
47873        ret_val = xmlXPathNextFollowing(ctxt, cur);
47874        desret_xmlNodePtr(ret_val);
47875        call_tests++;
47876        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47877        des_xmlNodePtr(n_cur, cur, 1);
47878        xmlResetLastError();
47879        if (mem_base != xmlMemBlocks()) {
47880            printf("Leak of %d blocks found in xmlXPathNextFollowing",
47881	           xmlMemBlocks() - mem_base);
47882	    test_ret++;
47883            printf(" %d", n_ctxt);
47884            printf(" %d", n_cur);
47885            printf("\n");
47886        }
47887    }
47888    }
47889    function_tests++;
47890#endif
47891
47892    return(test_ret);
47893}
47894
47895
47896static int
47897test_xmlXPathNextFollowingSibling(void) {
47898    int test_ret = 0;
47899
47900#if defined(LIBXML_XPATH_ENABLED)
47901    int mem_base;
47902    xmlNodePtr ret_val;
47903    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47904    int n_ctxt;
47905    xmlNodePtr cur; /* the current node in the traversal */
47906    int n_cur;
47907
47908    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47909    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47910        mem_base = xmlMemBlocks();
47911        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47912        cur = gen_xmlNodePtr(n_cur, 1);
47913
47914        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
47915        desret_xmlNodePtr(ret_val);
47916        call_tests++;
47917        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47918        des_xmlNodePtr(n_cur, cur, 1);
47919        xmlResetLastError();
47920        if (mem_base != xmlMemBlocks()) {
47921            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
47922	           xmlMemBlocks() - mem_base);
47923	    test_ret++;
47924            printf(" %d", n_ctxt);
47925            printf(" %d", n_cur);
47926            printf("\n");
47927        }
47928    }
47929    }
47930    function_tests++;
47931#endif
47932
47933    return(test_ret);
47934}
47935
47936
47937static int
47938test_xmlXPathNextNamespace(void) {
47939    int test_ret = 0;
47940
47941#if defined(LIBXML_XPATH_ENABLED)
47942    int mem_base;
47943    xmlNodePtr ret_val;
47944    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47945    int n_ctxt;
47946    xmlNodePtr cur; /* the current attribute in the traversal */
47947    int n_cur;
47948
47949    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47950    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47951        mem_base = xmlMemBlocks();
47952        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47953        cur = gen_xmlNodePtr(n_cur, 1);
47954
47955        ret_val = xmlXPathNextNamespace(ctxt, cur);
47956        desret_xmlNodePtr(ret_val);
47957        call_tests++;
47958        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47959        des_xmlNodePtr(n_cur, cur, 1);
47960        xmlResetLastError();
47961        if (mem_base != xmlMemBlocks()) {
47962            printf("Leak of %d blocks found in xmlXPathNextNamespace",
47963	           xmlMemBlocks() - mem_base);
47964	    test_ret++;
47965            printf(" %d", n_ctxt);
47966            printf(" %d", n_cur);
47967            printf("\n");
47968        }
47969    }
47970    }
47971    function_tests++;
47972#endif
47973
47974    return(test_ret);
47975}
47976
47977
47978static int
47979test_xmlXPathNextParent(void) {
47980    int test_ret = 0;
47981
47982#if defined(LIBXML_XPATH_ENABLED)
47983    int mem_base;
47984    xmlNodePtr ret_val;
47985    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47986    int n_ctxt;
47987    xmlNodePtr cur; /* the current node in the traversal */
47988    int n_cur;
47989
47990    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47991    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47992        mem_base = xmlMemBlocks();
47993        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47994        cur = gen_xmlNodePtr(n_cur, 1);
47995
47996        ret_val = xmlXPathNextParent(ctxt, cur);
47997        desret_xmlNodePtr(ret_val);
47998        call_tests++;
47999        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48000        des_xmlNodePtr(n_cur, cur, 1);
48001        xmlResetLastError();
48002        if (mem_base != xmlMemBlocks()) {
48003            printf("Leak of %d blocks found in xmlXPathNextParent",
48004	           xmlMemBlocks() - mem_base);
48005	    test_ret++;
48006            printf(" %d", n_ctxt);
48007            printf(" %d", n_cur);
48008            printf("\n");
48009        }
48010    }
48011    }
48012    function_tests++;
48013#endif
48014
48015    return(test_ret);
48016}
48017
48018
48019static int
48020test_xmlXPathNextPreceding(void) {
48021    int test_ret = 0;
48022
48023#if defined(LIBXML_XPATH_ENABLED)
48024    int mem_base;
48025    xmlNodePtr ret_val;
48026    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48027    int n_ctxt;
48028    xmlNodePtr cur; /* the current node in the traversal */
48029    int n_cur;
48030
48031    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48032    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48033        mem_base = xmlMemBlocks();
48034        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48035        cur = gen_xmlNodePtr(n_cur, 1);
48036
48037        ret_val = xmlXPathNextPreceding(ctxt, cur);
48038        desret_xmlNodePtr(ret_val);
48039        call_tests++;
48040        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48041        des_xmlNodePtr(n_cur, cur, 1);
48042        xmlResetLastError();
48043        if (mem_base != xmlMemBlocks()) {
48044            printf("Leak of %d blocks found in xmlXPathNextPreceding",
48045	           xmlMemBlocks() - mem_base);
48046	    test_ret++;
48047            printf(" %d", n_ctxt);
48048            printf(" %d", n_cur);
48049            printf("\n");
48050        }
48051    }
48052    }
48053    function_tests++;
48054#endif
48055
48056    return(test_ret);
48057}
48058
48059
48060static int
48061test_xmlXPathNextPrecedingSibling(void) {
48062    int test_ret = 0;
48063
48064#if defined(LIBXML_XPATH_ENABLED)
48065    int mem_base;
48066    xmlNodePtr ret_val;
48067    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48068    int n_ctxt;
48069    xmlNodePtr cur; /* the current node in the traversal */
48070    int n_cur;
48071
48072    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48073    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48074        mem_base = xmlMemBlocks();
48075        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48076        cur = gen_xmlNodePtr(n_cur, 1);
48077
48078        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48079        desret_xmlNodePtr(ret_val);
48080        call_tests++;
48081        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48082        des_xmlNodePtr(n_cur, cur, 1);
48083        xmlResetLastError();
48084        if (mem_base != xmlMemBlocks()) {
48085            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48086	           xmlMemBlocks() - mem_base);
48087	    test_ret++;
48088            printf(" %d", n_ctxt);
48089            printf(" %d", n_cur);
48090            printf("\n");
48091        }
48092    }
48093    }
48094    function_tests++;
48095#endif
48096
48097    return(test_ret);
48098}
48099
48100
48101static int
48102test_xmlXPathNextSelf(void) {
48103    int test_ret = 0;
48104
48105#if defined(LIBXML_XPATH_ENABLED)
48106    int mem_base;
48107    xmlNodePtr ret_val;
48108    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48109    int n_ctxt;
48110    xmlNodePtr cur; /* the current node in the traversal */
48111    int n_cur;
48112
48113    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48114    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48115        mem_base = xmlMemBlocks();
48116        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48117        cur = gen_xmlNodePtr(n_cur, 1);
48118
48119        ret_val = xmlXPathNextSelf(ctxt, cur);
48120        desret_xmlNodePtr(ret_val);
48121        call_tests++;
48122        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48123        des_xmlNodePtr(n_cur, cur, 1);
48124        xmlResetLastError();
48125        if (mem_base != xmlMemBlocks()) {
48126            printf("Leak of %d blocks found in xmlXPathNextSelf",
48127	           xmlMemBlocks() - mem_base);
48128	    test_ret++;
48129            printf(" %d", n_ctxt);
48130            printf(" %d", n_cur);
48131            printf("\n");
48132        }
48133    }
48134    }
48135    function_tests++;
48136#endif
48137
48138    return(test_ret);
48139}
48140
48141
48142static int
48143test_xmlXPathNodeLeading(void) {
48144    int test_ret = 0;
48145
48146#if defined(LIBXML_XPATH_ENABLED)
48147    int mem_base;
48148    xmlNodeSetPtr ret_val;
48149    xmlNodeSetPtr nodes; /* a node-set */
48150    int n_nodes;
48151    xmlNodePtr node; /* a node */
48152    int n_node;
48153
48154    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48155    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48156        mem_base = xmlMemBlocks();
48157        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48158        node = gen_xmlNodePtr(n_node, 1);
48159
48160        ret_val = xmlXPathNodeLeading(nodes, node);
48161        desret_xmlNodeSetPtr(ret_val);
48162        call_tests++;
48163        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48164        des_xmlNodePtr(n_node, node, 1);
48165        xmlResetLastError();
48166        if (mem_base != xmlMemBlocks()) {
48167            printf("Leak of %d blocks found in xmlXPathNodeLeading",
48168	           xmlMemBlocks() - mem_base);
48169	    test_ret++;
48170            printf(" %d", n_nodes);
48171            printf(" %d", n_node);
48172            printf("\n");
48173        }
48174    }
48175    }
48176    function_tests++;
48177#endif
48178
48179    return(test_ret);
48180}
48181
48182
48183static int
48184test_xmlXPathNodeLeadingSorted(void) {
48185    int test_ret = 0;
48186
48187#if defined(LIBXML_XPATH_ENABLED)
48188    int mem_base;
48189    xmlNodeSetPtr ret_val;
48190    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48191    int n_nodes;
48192    xmlNodePtr node; /* a node */
48193    int n_node;
48194
48195    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48196    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48197        mem_base = xmlMemBlocks();
48198        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48199        node = gen_xmlNodePtr(n_node, 1);
48200
48201        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48202        desret_xmlNodeSetPtr(ret_val);
48203        call_tests++;
48204        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48205        des_xmlNodePtr(n_node, node, 1);
48206        xmlResetLastError();
48207        if (mem_base != xmlMemBlocks()) {
48208            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48209	           xmlMemBlocks() - mem_base);
48210	    test_ret++;
48211            printf(" %d", n_nodes);
48212            printf(" %d", n_node);
48213            printf("\n");
48214        }
48215    }
48216    }
48217    function_tests++;
48218#endif
48219
48220    return(test_ret);
48221}
48222
48223
48224static int
48225test_xmlXPathNodeSetAdd(void) {
48226    int test_ret = 0;
48227
48228#if defined(LIBXML_XPATH_ENABLED)
48229    int mem_base;
48230    xmlNodeSetPtr cur; /* the initial node set */
48231    int n_cur;
48232    xmlNodePtr val; /* a new xmlNodePtr */
48233    int n_val;
48234
48235    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48236    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48237        mem_base = xmlMemBlocks();
48238        cur = gen_xmlNodeSetPtr(n_cur, 0);
48239        val = gen_xmlNodePtr(n_val, 1);
48240
48241        xmlXPathNodeSetAdd(cur, val);
48242        call_tests++;
48243        des_xmlNodeSetPtr(n_cur, cur, 0);
48244        des_xmlNodePtr(n_val, val, 1);
48245        xmlResetLastError();
48246        if (mem_base != xmlMemBlocks()) {
48247            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48248	           xmlMemBlocks() - mem_base);
48249	    test_ret++;
48250            printf(" %d", n_cur);
48251            printf(" %d", n_val);
48252            printf("\n");
48253        }
48254    }
48255    }
48256    function_tests++;
48257#endif
48258
48259    return(test_ret);
48260}
48261
48262
48263static int
48264test_xmlXPathNodeSetAddNs(void) {
48265    int test_ret = 0;
48266
48267#if defined(LIBXML_XPATH_ENABLED)
48268    int mem_base;
48269    xmlNodeSetPtr cur; /* the initial node set */
48270    int n_cur;
48271    xmlNodePtr node; /* the hosting node */
48272    int n_node;
48273    xmlNsPtr ns; /* a the namespace node */
48274    int n_ns;
48275
48276    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48277    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48278    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48279        mem_base = xmlMemBlocks();
48280        cur = gen_xmlNodeSetPtr(n_cur, 0);
48281        node = gen_xmlNodePtr(n_node, 1);
48282        ns = gen_xmlNsPtr(n_ns, 2);
48283
48284        xmlXPathNodeSetAddNs(cur, node, ns);
48285        call_tests++;
48286        des_xmlNodeSetPtr(n_cur, cur, 0);
48287        des_xmlNodePtr(n_node, node, 1);
48288        des_xmlNsPtr(n_ns, ns, 2);
48289        xmlResetLastError();
48290        if (mem_base != xmlMemBlocks()) {
48291            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48292	           xmlMemBlocks() - mem_base);
48293	    test_ret++;
48294            printf(" %d", n_cur);
48295            printf(" %d", n_node);
48296            printf(" %d", n_ns);
48297            printf("\n");
48298        }
48299    }
48300    }
48301    }
48302    function_tests++;
48303#endif
48304
48305    return(test_ret);
48306}
48307
48308
48309static int
48310test_xmlXPathNodeSetAddUnique(void) {
48311    int test_ret = 0;
48312
48313#if defined(LIBXML_XPATH_ENABLED)
48314    int mem_base;
48315    xmlNodeSetPtr cur; /* the initial node set */
48316    int n_cur;
48317    xmlNodePtr val; /* a new xmlNodePtr */
48318    int n_val;
48319
48320    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48321    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48322        mem_base = xmlMemBlocks();
48323        cur = gen_xmlNodeSetPtr(n_cur, 0);
48324        val = gen_xmlNodePtr(n_val, 1);
48325
48326        xmlXPathNodeSetAddUnique(cur, val);
48327        call_tests++;
48328        des_xmlNodeSetPtr(n_cur, cur, 0);
48329        des_xmlNodePtr(n_val, val, 1);
48330        xmlResetLastError();
48331        if (mem_base != xmlMemBlocks()) {
48332            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48333	           xmlMemBlocks() - mem_base);
48334	    test_ret++;
48335            printf(" %d", n_cur);
48336            printf(" %d", n_val);
48337            printf("\n");
48338        }
48339    }
48340    }
48341    function_tests++;
48342#endif
48343
48344    return(test_ret);
48345}
48346
48347
48348static int
48349test_xmlXPathNodeSetContains(void) {
48350    int test_ret = 0;
48351
48352#if defined(LIBXML_XPATH_ENABLED)
48353    int mem_base;
48354    int ret_val;
48355    xmlNodeSetPtr cur; /* the node-set */
48356    int n_cur;
48357    xmlNodePtr val; /* the node */
48358    int n_val;
48359
48360    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48361    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48362        mem_base = xmlMemBlocks();
48363        cur = gen_xmlNodeSetPtr(n_cur, 0);
48364        val = gen_xmlNodePtr(n_val, 1);
48365
48366        ret_val = xmlXPathNodeSetContains(cur, val);
48367        desret_int(ret_val);
48368        call_tests++;
48369        des_xmlNodeSetPtr(n_cur, cur, 0);
48370        des_xmlNodePtr(n_val, val, 1);
48371        xmlResetLastError();
48372        if (mem_base != xmlMemBlocks()) {
48373            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48374	           xmlMemBlocks() - mem_base);
48375	    test_ret++;
48376            printf(" %d", n_cur);
48377            printf(" %d", n_val);
48378            printf("\n");
48379        }
48380    }
48381    }
48382    function_tests++;
48383#endif
48384
48385    return(test_ret);
48386}
48387
48388
48389static int
48390test_xmlXPathNodeSetDel(void) {
48391    int test_ret = 0;
48392
48393#if defined(LIBXML_XPATH_ENABLED)
48394    int mem_base;
48395    xmlNodeSetPtr cur; /* the initial node set */
48396    int n_cur;
48397    xmlNodePtr val; /* an xmlNodePtr */
48398    int n_val;
48399
48400    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48401    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48402        mem_base = xmlMemBlocks();
48403        cur = gen_xmlNodeSetPtr(n_cur, 0);
48404        val = gen_xmlNodePtr(n_val, 1);
48405
48406        xmlXPathNodeSetDel(cur, val);
48407        call_tests++;
48408        des_xmlNodeSetPtr(n_cur, cur, 0);
48409        des_xmlNodePtr(n_val, val, 1);
48410        xmlResetLastError();
48411        if (mem_base != xmlMemBlocks()) {
48412            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48413	           xmlMemBlocks() - mem_base);
48414	    test_ret++;
48415            printf(" %d", n_cur);
48416            printf(" %d", n_val);
48417            printf("\n");
48418        }
48419    }
48420    }
48421    function_tests++;
48422#endif
48423
48424    return(test_ret);
48425}
48426
48427
48428static int
48429test_xmlXPathNodeSetMerge(void) {
48430    int test_ret = 0;
48431
48432#if defined(LIBXML_XPATH_ENABLED)
48433    int mem_base;
48434    xmlNodeSetPtr ret_val;
48435    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48436    int n_val1;
48437    xmlNodeSetPtr val2; /* the second NodeSet */
48438    int n_val2;
48439
48440    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48441    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48442        mem_base = xmlMemBlocks();
48443        val1 = gen_xmlNodeSetPtr(n_val1, 0);
48444        val2 = gen_xmlNodeSetPtr(n_val2, 1);
48445
48446        ret_val = xmlXPathNodeSetMerge(val1, val2);
48447        desret_xmlNodeSetPtr(ret_val);
48448        call_tests++;
48449        des_xmlNodeSetPtr(n_val1, val1, 0);
48450        des_xmlNodeSetPtr(n_val2, val2, 1);
48451        xmlResetLastError();
48452        if (mem_base != xmlMemBlocks()) {
48453            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48454	           xmlMemBlocks() - mem_base);
48455	    test_ret++;
48456            printf(" %d", n_val1);
48457            printf(" %d", n_val2);
48458            printf("\n");
48459        }
48460    }
48461    }
48462    function_tests++;
48463#endif
48464
48465    return(test_ret);
48466}
48467
48468
48469static int
48470test_xmlXPathNodeSetRemove(void) {
48471    int test_ret = 0;
48472
48473#if defined(LIBXML_XPATH_ENABLED)
48474    int mem_base;
48475    xmlNodeSetPtr cur; /* the initial node set */
48476    int n_cur;
48477    int val; /* the index to remove */
48478    int n_val;
48479
48480    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48481    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48482        mem_base = xmlMemBlocks();
48483        cur = gen_xmlNodeSetPtr(n_cur, 0);
48484        val = gen_int(n_val, 1);
48485
48486        xmlXPathNodeSetRemove(cur, val);
48487        call_tests++;
48488        des_xmlNodeSetPtr(n_cur, cur, 0);
48489        des_int(n_val, val, 1);
48490        xmlResetLastError();
48491        if (mem_base != xmlMemBlocks()) {
48492            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48493	           xmlMemBlocks() - mem_base);
48494	    test_ret++;
48495            printf(" %d", n_cur);
48496            printf(" %d", n_val);
48497            printf("\n");
48498        }
48499    }
48500    }
48501    function_tests++;
48502#endif
48503
48504    return(test_ret);
48505}
48506
48507
48508static int
48509test_xmlXPathNodeSetSort(void) {
48510    int test_ret = 0;
48511
48512#if defined(LIBXML_XPATH_ENABLED)
48513    int mem_base;
48514    xmlNodeSetPtr set; /* the node set */
48515    int n_set;
48516
48517    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48518        mem_base = xmlMemBlocks();
48519        set = gen_xmlNodeSetPtr(n_set, 0);
48520
48521        xmlXPathNodeSetSort(set);
48522        call_tests++;
48523        des_xmlNodeSetPtr(n_set, set, 0);
48524        xmlResetLastError();
48525        if (mem_base != xmlMemBlocks()) {
48526            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48527	           xmlMemBlocks() - mem_base);
48528	    test_ret++;
48529            printf(" %d", n_set);
48530            printf("\n");
48531        }
48532    }
48533    function_tests++;
48534#endif
48535
48536    return(test_ret);
48537}
48538
48539
48540static int
48541test_xmlXPathNodeTrailing(void) {
48542    int test_ret = 0;
48543
48544#if defined(LIBXML_XPATH_ENABLED)
48545    int mem_base;
48546    xmlNodeSetPtr ret_val;
48547    xmlNodeSetPtr nodes; /* a node-set */
48548    int n_nodes;
48549    xmlNodePtr node; /* a node */
48550    int n_node;
48551
48552    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48553    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48554        mem_base = xmlMemBlocks();
48555        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48556        node = gen_xmlNodePtr(n_node, 1);
48557
48558        ret_val = xmlXPathNodeTrailing(nodes, node);
48559        desret_xmlNodeSetPtr(ret_val);
48560        call_tests++;
48561        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48562        des_xmlNodePtr(n_node, node, 1);
48563        xmlResetLastError();
48564        if (mem_base != xmlMemBlocks()) {
48565            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48566	           xmlMemBlocks() - mem_base);
48567	    test_ret++;
48568            printf(" %d", n_nodes);
48569            printf(" %d", n_node);
48570            printf("\n");
48571        }
48572    }
48573    }
48574    function_tests++;
48575#endif
48576
48577    return(test_ret);
48578}
48579
48580
48581static int
48582test_xmlXPathNodeTrailingSorted(void) {
48583    int test_ret = 0;
48584
48585#if defined(LIBXML_XPATH_ENABLED)
48586    int mem_base;
48587    xmlNodeSetPtr ret_val;
48588    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48589    int n_nodes;
48590    xmlNodePtr node; /* a node */
48591    int n_node;
48592
48593    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48594    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48595        mem_base = xmlMemBlocks();
48596        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48597        node = gen_xmlNodePtr(n_node, 1);
48598
48599        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48600        desret_xmlNodeSetPtr(ret_val);
48601        call_tests++;
48602        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48603        des_xmlNodePtr(n_node, node, 1);
48604        xmlResetLastError();
48605        if (mem_base != xmlMemBlocks()) {
48606            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48607	           xmlMemBlocks() - mem_base);
48608	    test_ret++;
48609            printf(" %d", n_nodes);
48610            printf(" %d", n_node);
48611            printf("\n");
48612        }
48613    }
48614    }
48615    function_tests++;
48616#endif
48617
48618    return(test_ret);
48619}
48620
48621
48622static int
48623test_xmlXPathNormalizeFunction(void) {
48624    int test_ret = 0;
48625
48626#if defined(LIBXML_XPATH_ENABLED)
48627    int mem_base;
48628    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48629    int n_ctxt;
48630    int nargs; /* the number of arguments */
48631    int n_nargs;
48632
48633    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48634    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48635        mem_base = xmlMemBlocks();
48636        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48637        nargs = gen_int(n_nargs, 1);
48638
48639        xmlXPathNormalizeFunction(ctxt, nargs);
48640        call_tests++;
48641        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48642        des_int(n_nargs, nargs, 1);
48643        xmlResetLastError();
48644        if (mem_base != xmlMemBlocks()) {
48645            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48646	           xmlMemBlocks() - mem_base);
48647	    test_ret++;
48648            printf(" %d", n_ctxt);
48649            printf(" %d", n_nargs);
48650            printf("\n");
48651        }
48652    }
48653    }
48654    function_tests++;
48655#endif
48656
48657    return(test_ret);
48658}
48659
48660
48661static int
48662test_xmlXPathNotEqualValues(void) {
48663    int test_ret = 0;
48664
48665#if defined(LIBXML_XPATH_ENABLED)
48666    int mem_base;
48667    int ret_val;
48668    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48669    int n_ctxt;
48670
48671    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48672        mem_base = xmlMemBlocks();
48673        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48674
48675        ret_val = xmlXPathNotEqualValues(ctxt);
48676        desret_int(ret_val);
48677        call_tests++;
48678        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48679        xmlResetLastError();
48680        if (mem_base != xmlMemBlocks()) {
48681            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48682	           xmlMemBlocks() - mem_base);
48683	    test_ret++;
48684            printf(" %d", n_ctxt);
48685            printf("\n");
48686        }
48687    }
48688    function_tests++;
48689#endif
48690
48691    return(test_ret);
48692}
48693
48694
48695static int
48696test_xmlXPathNotFunction(void) {
48697    int test_ret = 0;
48698
48699#if defined(LIBXML_XPATH_ENABLED)
48700    int mem_base;
48701    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48702    int n_ctxt;
48703    int nargs; /* the number of arguments */
48704    int n_nargs;
48705
48706    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48707    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48708        mem_base = xmlMemBlocks();
48709        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48710        nargs = gen_int(n_nargs, 1);
48711
48712        xmlXPathNotFunction(ctxt, nargs);
48713        call_tests++;
48714        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48715        des_int(n_nargs, nargs, 1);
48716        xmlResetLastError();
48717        if (mem_base != xmlMemBlocks()) {
48718            printf("Leak of %d blocks found in xmlXPathNotFunction",
48719	           xmlMemBlocks() - mem_base);
48720	    test_ret++;
48721            printf(" %d", n_ctxt);
48722            printf(" %d", n_nargs);
48723            printf("\n");
48724        }
48725    }
48726    }
48727    function_tests++;
48728#endif
48729
48730    return(test_ret);
48731}
48732
48733
48734static int
48735test_xmlXPathNsLookup(void) {
48736    int test_ret = 0;
48737
48738#if defined(LIBXML_XPATH_ENABLED)
48739    int mem_base;
48740    const xmlChar * ret_val;
48741    xmlXPathContextPtr ctxt; /* the XPath context */
48742    int n_ctxt;
48743    xmlChar * prefix; /* the namespace prefix value */
48744    int n_prefix;
48745
48746    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48747    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
48748        mem_base = xmlMemBlocks();
48749        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48750        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
48751
48752        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
48753        desret_const_xmlChar_ptr(ret_val);
48754        call_tests++;
48755        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48756        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
48757        xmlResetLastError();
48758        if (mem_base != xmlMemBlocks()) {
48759            printf("Leak of %d blocks found in xmlXPathNsLookup",
48760	           xmlMemBlocks() - mem_base);
48761	    test_ret++;
48762            printf(" %d", n_ctxt);
48763            printf(" %d", n_prefix);
48764            printf("\n");
48765        }
48766    }
48767    }
48768    function_tests++;
48769#endif
48770
48771    return(test_ret);
48772}
48773
48774
48775static int
48776test_xmlXPathNumberFunction(void) {
48777    int test_ret = 0;
48778
48779#if defined(LIBXML_XPATH_ENABLED)
48780    int mem_base;
48781    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48782    int n_ctxt;
48783    int nargs; /* the number of arguments */
48784    int n_nargs;
48785
48786    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48787    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48788        mem_base = xmlMemBlocks();
48789        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48790        nargs = gen_int(n_nargs, 1);
48791
48792        xmlXPathNumberFunction(ctxt, nargs);
48793        call_tests++;
48794        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48795        des_int(n_nargs, nargs, 1);
48796        xmlResetLastError();
48797        if (mem_base != xmlMemBlocks()) {
48798            printf("Leak of %d blocks found in xmlXPathNumberFunction",
48799	           xmlMemBlocks() - mem_base);
48800	    test_ret++;
48801            printf(" %d", n_ctxt);
48802            printf(" %d", n_nargs);
48803            printf("\n");
48804        }
48805    }
48806    }
48807    function_tests++;
48808#endif
48809
48810    return(test_ret);
48811}
48812
48813
48814static int
48815test_xmlXPathParseNCName(void) {
48816    int test_ret = 0;
48817
48818#if defined(LIBXML_XPATH_ENABLED)
48819    int mem_base;
48820    xmlChar * ret_val;
48821    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48822    int n_ctxt;
48823
48824    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48825        mem_base = xmlMemBlocks();
48826        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48827
48828        ret_val = xmlXPathParseNCName(ctxt);
48829        desret_xmlChar_ptr(ret_val);
48830        call_tests++;
48831        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48832        xmlResetLastError();
48833        if (mem_base != xmlMemBlocks()) {
48834            printf("Leak of %d blocks found in xmlXPathParseNCName",
48835	           xmlMemBlocks() - mem_base);
48836	    test_ret++;
48837            printf(" %d", n_ctxt);
48838            printf("\n");
48839        }
48840    }
48841    function_tests++;
48842#endif
48843
48844    return(test_ret);
48845}
48846
48847
48848static int
48849test_xmlXPathParseName(void) {
48850    int test_ret = 0;
48851
48852#if defined(LIBXML_XPATH_ENABLED)
48853    int mem_base;
48854    xmlChar * ret_val;
48855    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48856    int n_ctxt;
48857
48858    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48859        mem_base = xmlMemBlocks();
48860        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48861
48862        ret_val = xmlXPathParseName(ctxt);
48863        desret_xmlChar_ptr(ret_val);
48864        call_tests++;
48865        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48866        xmlResetLastError();
48867        if (mem_base != xmlMemBlocks()) {
48868            printf("Leak of %d blocks found in xmlXPathParseName",
48869	           xmlMemBlocks() - mem_base);
48870	    test_ret++;
48871            printf(" %d", n_ctxt);
48872            printf("\n");
48873        }
48874    }
48875    function_tests++;
48876#endif
48877
48878    return(test_ret);
48879}
48880
48881
48882static int
48883test_xmlXPathPopBoolean(void) {
48884    int test_ret = 0;
48885
48886#if defined(LIBXML_XPATH_ENABLED)
48887    int mem_base;
48888    int ret_val;
48889    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48890    int n_ctxt;
48891
48892    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48893        mem_base = xmlMemBlocks();
48894        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48895
48896        ret_val = xmlXPathPopBoolean(ctxt);
48897        desret_int(ret_val);
48898        call_tests++;
48899        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48900        xmlResetLastError();
48901        if (mem_base != xmlMemBlocks()) {
48902            printf("Leak of %d blocks found in xmlXPathPopBoolean",
48903	           xmlMemBlocks() - mem_base);
48904	    test_ret++;
48905            printf(" %d", n_ctxt);
48906            printf("\n");
48907        }
48908    }
48909    function_tests++;
48910#endif
48911
48912    return(test_ret);
48913}
48914
48915
48916static int
48917test_xmlXPathPopExternal(void) {
48918    int test_ret = 0;
48919
48920#if defined(LIBXML_XPATH_ENABLED)
48921    int mem_base;
48922    void * ret_val;
48923    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48924    int n_ctxt;
48925
48926    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48927        mem_base = xmlMemBlocks();
48928        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48929
48930        ret_val = xmlXPathPopExternal(ctxt);
48931        desret_void_ptr(ret_val);
48932        call_tests++;
48933        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48934        xmlResetLastError();
48935        if (mem_base != xmlMemBlocks()) {
48936            printf("Leak of %d blocks found in xmlXPathPopExternal",
48937	           xmlMemBlocks() - mem_base);
48938	    test_ret++;
48939            printf(" %d", n_ctxt);
48940            printf("\n");
48941        }
48942    }
48943    function_tests++;
48944#endif
48945
48946    return(test_ret);
48947}
48948
48949
48950static int
48951test_xmlXPathPopNodeSet(void) {
48952    int test_ret = 0;
48953
48954#if defined(LIBXML_XPATH_ENABLED)
48955    int mem_base;
48956    xmlNodeSetPtr ret_val;
48957    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48958    int n_ctxt;
48959
48960    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48961        mem_base = xmlMemBlocks();
48962        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48963
48964        ret_val = xmlXPathPopNodeSet(ctxt);
48965        desret_xmlNodeSetPtr(ret_val);
48966        call_tests++;
48967        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48968        xmlResetLastError();
48969        if (mem_base != xmlMemBlocks()) {
48970            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
48971	           xmlMemBlocks() - mem_base);
48972	    test_ret++;
48973            printf(" %d", n_ctxt);
48974            printf("\n");
48975        }
48976    }
48977    function_tests++;
48978#endif
48979
48980    return(test_ret);
48981}
48982
48983
48984static int
48985test_xmlXPathPopNumber(void) {
48986    int test_ret = 0;
48987
48988#if defined(LIBXML_XPATH_ENABLED)
48989    int mem_base;
48990    double ret_val;
48991    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48992    int n_ctxt;
48993
48994    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48995        mem_base = xmlMemBlocks();
48996        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48997
48998        ret_val = xmlXPathPopNumber(ctxt);
48999        desret_double(ret_val);
49000        call_tests++;
49001        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49002        xmlResetLastError();
49003        if (mem_base != xmlMemBlocks()) {
49004            printf("Leak of %d blocks found in xmlXPathPopNumber",
49005	           xmlMemBlocks() - mem_base);
49006	    test_ret++;
49007            printf(" %d", n_ctxt);
49008            printf("\n");
49009        }
49010    }
49011    function_tests++;
49012#endif
49013
49014    return(test_ret);
49015}
49016
49017
49018static int
49019test_xmlXPathPopString(void) {
49020    int test_ret = 0;
49021
49022#if defined(LIBXML_XPATH_ENABLED)
49023    int mem_base;
49024    xmlChar * ret_val;
49025    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49026    int n_ctxt;
49027
49028    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49029        mem_base = xmlMemBlocks();
49030        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49031
49032        ret_val = xmlXPathPopString(ctxt);
49033        desret_xmlChar_ptr(ret_val);
49034        call_tests++;
49035        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49036        xmlResetLastError();
49037        if (mem_base != xmlMemBlocks()) {
49038            printf("Leak of %d blocks found in xmlXPathPopString",
49039	           xmlMemBlocks() - mem_base);
49040	    test_ret++;
49041            printf(" %d", n_ctxt);
49042            printf("\n");
49043        }
49044    }
49045    function_tests++;
49046#endif
49047
49048    return(test_ret);
49049}
49050
49051
49052static int
49053test_xmlXPathPositionFunction(void) {
49054    int test_ret = 0;
49055
49056#if defined(LIBXML_XPATH_ENABLED)
49057    int mem_base;
49058    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49059    int n_ctxt;
49060    int nargs; /* the number of arguments */
49061    int n_nargs;
49062
49063    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49064    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49065        mem_base = xmlMemBlocks();
49066        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49067        nargs = gen_int(n_nargs, 1);
49068
49069        xmlXPathPositionFunction(ctxt, nargs);
49070        call_tests++;
49071        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49072        des_int(n_nargs, nargs, 1);
49073        xmlResetLastError();
49074        if (mem_base != xmlMemBlocks()) {
49075            printf("Leak of %d blocks found in xmlXPathPositionFunction",
49076	           xmlMemBlocks() - mem_base);
49077	    test_ret++;
49078            printf(" %d", n_ctxt);
49079            printf(" %d", n_nargs);
49080            printf("\n");
49081        }
49082    }
49083    }
49084    function_tests++;
49085#endif
49086
49087    return(test_ret);
49088}
49089
49090
49091static int
49092test_xmlXPathRegisterAllFunctions(void) {
49093    int test_ret = 0;
49094
49095#if defined(LIBXML_XPATH_ENABLED)
49096    int mem_base;
49097    xmlXPathContextPtr ctxt; /* the XPath context */
49098    int n_ctxt;
49099
49100    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49101        mem_base = xmlMemBlocks();
49102        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49103
49104        xmlXPathRegisterAllFunctions(ctxt);
49105        call_tests++;
49106        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49107        xmlResetLastError();
49108        if (mem_base != xmlMemBlocks()) {
49109            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49110	           xmlMemBlocks() - mem_base);
49111	    test_ret++;
49112            printf(" %d", n_ctxt);
49113            printf("\n");
49114        }
49115    }
49116    function_tests++;
49117#endif
49118
49119    return(test_ret);
49120}
49121
49122
49123static int
49124test_xmlXPathRegisterFunc(void) {
49125    int test_ret = 0;
49126
49127
49128    /* missing type support */
49129    return(test_ret);
49130}
49131
49132
49133static int
49134test_xmlXPathRegisterFuncLookup(void) {
49135    int test_ret = 0;
49136
49137
49138    /* missing type support */
49139    return(test_ret);
49140}
49141
49142
49143static int
49144test_xmlXPathRegisterFuncNS(void) {
49145    int test_ret = 0;
49146
49147
49148    /* missing type support */
49149    return(test_ret);
49150}
49151
49152
49153static int
49154test_xmlXPathRegisterNs(void) {
49155    int test_ret = 0;
49156
49157#if defined(LIBXML_XPATH_ENABLED)
49158    int mem_base;
49159    int ret_val;
49160    xmlXPathContextPtr ctxt; /* the XPath context */
49161    int n_ctxt;
49162    xmlChar * prefix; /* the namespace prefix */
49163    int n_prefix;
49164    xmlChar * ns_uri; /* the namespace name */
49165    int n_ns_uri;
49166
49167    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49168    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49169    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49170        mem_base = xmlMemBlocks();
49171        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49172        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49173        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49174
49175        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49176        desret_int(ret_val);
49177        call_tests++;
49178        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49179        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49180        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49181        xmlResetLastError();
49182        if (mem_base != xmlMemBlocks()) {
49183            printf("Leak of %d blocks found in xmlXPathRegisterNs",
49184	           xmlMemBlocks() - mem_base);
49185	    test_ret++;
49186            printf(" %d", n_ctxt);
49187            printf(" %d", n_prefix);
49188            printf(" %d", n_ns_uri);
49189            printf("\n");
49190        }
49191    }
49192    }
49193    }
49194    function_tests++;
49195#endif
49196
49197    return(test_ret);
49198}
49199
49200
49201static int
49202test_xmlXPathRegisterVariable(void) {
49203    int test_ret = 0;
49204
49205#if defined(LIBXML_XPATH_ENABLED)
49206    int mem_base;
49207    int ret_val;
49208    xmlXPathContextPtr ctxt; /* the XPath context */
49209    int n_ctxt;
49210    xmlChar * name; /* the variable name */
49211    int n_name;
49212    xmlXPathObjectPtr value; /* the variable value or NULL */
49213    int n_value;
49214
49215    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49216    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49217    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49218        mem_base = xmlMemBlocks();
49219        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49220        name = gen_const_xmlChar_ptr(n_name, 1);
49221        value = gen_xmlXPathObjectPtr(n_value, 2);
49222
49223        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49224        desret_int(ret_val);
49225        call_tests++;
49226        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49227        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49228        des_xmlXPathObjectPtr(n_value, value, 2);
49229        xmlResetLastError();
49230        if (mem_base != xmlMemBlocks()) {
49231            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49232	           xmlMemBlocks() - mem_base);
49233	    test_ret++;
49234            printf(" %d", n_ctxt);
49235            printf(" %d", n_name);
49236            printf(" %d", n_value);
49237            printf("\n");
49238        }
49239    }
49240    }
49241    }
49242    function_tests++;
49243#endif
49244
49245    return(test_ret);
49246}
49247
49248
49249static int
49250test_xmlXPathRegisterVariableLookup(void) {
49251    int test_ret = 0;
49252
49253
49254    /* missing type support */
49255    return(test_ret);
49256}
49257
49258
49259static int
49260test_xmlXPathRegisterVariableNS(void) {
49261    int test_ret = 0;
49262
49263#if defined(LIBXML_XPATH_ENABLED)
49264    int mem_base;
49265    int ret_val;
49266    xmlXPathContextPtr ctxt; /* the XPath context */
49267    int n_ctxt;
49268    xmlChar * name; /* the variable name */
49269    int n_name;
49270    xmlChar * ns_uri; /* the variable namespace URI */
49271    int n_ns_uri;
49272    xmlXPathObjectPtr value; /* the variable value or NULL */
49273    int n_value;
49274
49275    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49276    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49277    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49278    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49279        mem_base = xmlMemBlocks();
49280        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49281        name = gen_const_xmlChar_ptr(n_name, 1);
49282        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49283        value = gen_xmlXPathObjectPtr(n_value, 3);
49284
49285        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49286        desret_int(ret_val);
49287        call_tests++;
49288        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49289        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49290        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49291        des_xmlXPathObjectPtr(n_value, value, 3);
49292        xmlResetLastError();
49293        if (mem_base != xmlMemBlocks()) {
49294            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49295	           xmlMemBlocks() - mem_base);
49296	    test_ret++;
49297            printf(" %d", n_ctxt);
49298            printf(" %d", n_name);
49299            printf(" %d", n_ns_uri);
49300            printf(" %d", n_value);
49301            printf("\n");
49302        }
49303    }
49304    }
49305    }
49306    }
49307    function_tests++;
49308#endif
49309
49310    return(test_ret);
49311}
49312
49313
49314static int
49315test_xmlXPathRegisteredFuncsCleanup(void) {
49316    int test_ret = 0;
49317
49318#if defined(LIBXML_XPATH_ENABLED)
49319    int mem_base;
49320    xmlXPathContextPtr ctxt; /* the XPath context */
49321    int n_ctxt;
49322
49323    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49324        mem_base = xmlMemBlocks();
49325        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49326
49327        xmlXPathRegisteredFuncsCleanup(ctxt);
49328        call_tests++;
49329        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49330        xmlResetLastError();
49331        if (mem_base != xmlMemBlocks()) {
49332            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49333	           xmlMemBlocks() - mem_base);
49334	    test_ret++;
49335            printf(" %d", n_ctxt);
49336            printf("\n");
49337        }
49338    }
49339    function_tests++;
49340#endif
49341
49342    return(test_ret);
49343}
49344
49345
49346static int
49347test_xmlXPathRegisteredNsCleanup(void) {
49348    int test_ret = 0;
49349
49350#if defined(LIBXML_XPATH_ENABLED)
49351    int mem_base;
49352    xmlXPathContextPtr ctxt; /* the XPath context */
49353    int n_ctxt;
49354
49355    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49356        mem_base = xmlMemBlocks();
49357        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49358
49359        xmlXPathRegisteredNsCleanup(ctxt);
49360        call_tests++;
49361        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49362        xmlResetLastError();
49363        if (mem_base != xmlMemBlocks()) {
49364            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49365	           xmlMemBlocks() - mem_base);
49366	    test_ret++;
49367            printf(" %d", n_ctxt);
49368            printf("\n");
49369        }
49370    }
49371    function_tests++;
49372#endif
49373
49374    return(test_ret);
49375}
49376
49377
49378static int
49379test_xmlXPathRegisteredVariablesCleanup(void) {
49380    int test_ret = 0;
49381
49382#if defined(LIBXML_XPATH_ENABLED)
49383    int mem_base;
49384    xmlXPathContextPtr ctxt; /* the XPath context */
49385    int n_ctxt;
49386
49387    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49388        mem_base = xmlMemBlocks();
49389        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49390
49391        xmlXPathRegisteredVariablesCleanup(ctxt);
49392        call_tests++;
49393        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49394        xmlResetLastError();
49395        if (mem_base != xmlMemBlocks()) {
49396            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49397	           xmlMemBlocks() - mem_base);
49398	    test_ret++;
49399            printf(" %d", n_ctxt);
49400            printf("\n");
49401        }
49402    }
49403    function_tests++;
49404#endif
49405
49406    return(test_ret);
49407}
49408
49409
49410static int
49411test_xmlXPathRoot(void) {
49412    int test_ret = 0;
49413
49414#if defined(LIBXML_XPATH_ENABLED)
49415    int mem_base;
49416    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49417    int n_ctxt;
49418
49419    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49420        mem_base = xmlMemBlocks();
49421        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49422
49423        xmlXPathRoot(ctxt);
49424        call_tests++;
49425        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49426        xmlResetLastError();
49427        if (mem_base != xmlMemBlocks()) {
49428            printf("Leak of %d blocks found in xmlXPathRoot",
49429	           xmlMemBlocks() - mem_base);
49430	    test_ret++;
49431            printf(" %d", n_ctxt);
49432            printf("\n");
49433        }
49434    }
49435    function_tests++;
49436#endif
49437
49438    return(test_ret);
49439}
49440
49441
49442static int
49443test_xmlXPathRoundFunction(void) {
49444    int test_ret = 0;
49445
49446#if defined(LIBXML_XPATH_ENABLED)
49447    int mem_base;
49448    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49449    int n_ctxt;
49450    int nargs; /* the number of arguments */
49451    int n_nargs;
49452
49453    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49454    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49455        mem_base = xmlMemBlocks();
49456        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49457        nargs = gen_int(n_nargs, 1);
49458
49459        xmlXPathRoundFunction(ctxt, nargs);
49460        call_tests++;
49461        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49462        des_int(n_nargs, nargs, 1);
49463        xmlResetLastError();
49464        if (mem_base != xmlMemBlocks()) {
49465            printf("Leak of %d blocks found in xmlXPathRoundFunction",
49466	           xmlMemBlocks() - mem_base);
49467	    test_ret++;
49468            printf(" %d", n_ctxt);
49469            printf(" %d", n_nargs);
49470            printf("\n");
49471        }
49472    }
49473    }
49474    function_tests++;
49475#endif
49476
49477    return(test_ret);
49478}
49479
49480
49481static int
49482test_xmlXPathStartsWithFunction(void) {
49483    int test_ret = 0;
49484
49485#if defined(LIBXML_XPATH_ENABLED)
49486    int mem_base;
49487    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49488    int n_ctxt;
49489    int nargs; /* the number of arguments */
49490    int n_nargs;
49491
49492    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49493    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49494        mem_base = xmlMemBlocks();
49495        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49496        nargs = gen_int(n_nargs, 1);
49497
49498        xmlXPathStartsWithFunction(ctxt, nargs);
49499        call_tests++;
49500        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49501        des_int(n_nargs, nargs, 1);
49502        xmlResetLastError();
49503        if (mem_base != xmlMemBlocks()) {
49504            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49505	           xmlMemBlocks() - mem_base);
49506	    test_ret++;
49507            printf(" %d", n_ctxt);
49508            printf(" %d", n_nargs);
49509            printf("\n");
49510        }
49511    }
49512    }
49513    function_tests++;
49514#endif
49515
49516    return(test_ret);
49517}
49518
49519
49520static int
49521test_xmlXPathStringEvalNumber(void) {
49522    int test_ret = 0;
49523
49524#if defined(LIBXML_XPATH_ENABLED)
49525    int mem_base;
49526    double ret_val;
49527    xmlChar * str; /* A string to scan */
49528    int n_str;
49529
49530    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49531        mem_base = xmlMemBlocks();
49532        str = gen_const_xmlChar_ptr(n_str, 0);
49533
49534        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49535        desret_double(ret_val);
49536        call_tests++;
49537        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49538        xmlResetLastError();
49539        if (mem_base != xmlMemBlocks()) {
49540            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49541	           xmlMemBlocks() - mem_base);
49542	    test_ret++;
49543            printf(" %d", n_str);
49544            printf("\n");
49545        }
49546    }
49547    function_tests++;
49548#endif
49549
49550    return(test_ret);
49551}
49552
49553
49554static int
49555test_xmlXPathStringFunction(void) {
49556    int test_ret = 0;
49557
49558#if defined(LIBXML_XPATH_ENABLED)
49559    int mem_base;
49560    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49561    int n_ctxt;
49562    int nargs; /* the number of arguments */
49563    int n_nargs;
49564
49565    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49566    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49567        mem_base = xmlMemBlocks();
49568        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49569        nargs = gen_int(n_nargs, 1);
49570
49571        xmlXPathStringFunction(ctxt, nargs);
49572        call_tests++;
49573        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49574        des_int(n_nargs, nargs, 1);
49575        xmlResetLastError();
49576        if (mem_base != xmlMemBlocks()) {
49577            printf("Leak of %d blocks found in xmlXPathStringFunction",
49578	           xmlMemBlocks() - mem_base);
49579	    test_ret++;
49580            printf(" %d", n_ctxt);
49581            printf(" %d", n_nargs);
49582            printf("\n");
49583        }
49584    }
49585    }
49586    function_tests++;
49587#endif
49588
49589    return(test_ret);
49590}
49591
49592
49593static int
49594test_xmlXPathStringLengthFunction(void) {
49595    int test_ret = 0;
49596
49597#if defined(LIBXML_XPATH_ENABLED)
49598    int mem_base;
49599    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49600    int n_ctxt;
49601    int nargs; /* the number of arguments */
49602    int n_nargs;
49603
49604    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49605    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49606        mem_base = xmlMemBlocks();
49607        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49608        nargs = gen_int(n_nargs, 1);
49609
49610        xmlXPathStringLengthFunction(ctxt, nargs);
49611        call_tests++;
49612        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49613        des_int(n_nargs, nargs, 1);
49614        xmlResetLastError();
49615        if (mem_base != xmlMemBlocks()) {
49616            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49617	           xmlMemBlocks() - mem_base);
49618	    test_ret++;
49619            printf(" %d", n_ctxt);
49620            printf(" %d", n_nargs);
49621            printf("\n");
49622        }
49623    }
49624    }
49625    function_tests++;
49626#endif
49627
49628    return(test_ret);
49629}
49630
49631
49632static int
49633test_xmlXPathSubValues(void) {
49634    int test_ret = 0;
49635
49636#if defined(LIBXML_XPATH_ENABLED)
49637    int mem_base;
49638    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49639    int n_ctxt;
49640
49641    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49642        mem_base = xmlMemBlocks();
49643        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49644
49645        xmlXPathSubValues(ctxt);
49646        call_tests++;
49647        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49648        xmlResetLastError();
49649        if (mem_base != xmlMemBlocks()) {
49650            printf("Leak of %d blocks found in xmlXPathSubValues",
49651	           xmlMemBlocks() - mem_base);
49652	    test_ret++;
49653            printf(" %d", n_ctxt);
49654            printf("\n");
49655        }
49656    }
49657    function_tests++;
49658#endif
49659
49660    return(test_ret);
49661}
49662
49663
49664static int
49665test_xmlXPathSubstringAfterFunction(void) {
49666    int test_ret = 0;
49667
49668#if defined(LIBXML_XPATH_ENABLED)
49669    int mem_base;
49670    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49671    int n_ctxt;
49672    int nargs; /* the number of arguments */
49673    int n_nargs;
49674
49675    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49676    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49677        mem_base = xmlMemBlocks();
49678        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49679        nargs = gen_int(n_nargs, 1);
49680
49681        xmlXPathSubstringAfterFunction(ctxt, nargs);
49682        call_tests++;
49683        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49684        des_int(n_nargs, nargs, 1);
49685        xmlResetLastError();
49686        if (mem_base != xmlMemBlocks()) {
49687            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
49688	           xmlMemBlocks() - mem_base);
49689	    test_ret++;
49690            printf(" %d", n_ctxt);
49691            printf(" %d", n_nargs);
49692            printf("\n");
49693        }
49694    }
49695    }
49696    function_tests++;
49697#endif
49698
49699    return(test_ret);
49700}
49701
49702
49703static int
49704test_xmlXPathSubstringBeforeFunction(void) {
49705    int test_ret = 0;
49706
49707#if defined(LIBXML_XPATH_ENABLED)
49708    int mem_base;
49709    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49710    int n_ctxt;
49711    int nargs; /* the number of arguments */
49712    int n_nargs;
49713
49714    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49715    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49716        mem_base = xmlMemBlocks();
49717        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49718        nargs = gen_int(n_nargs, 1);
49719
49720        xmlXPathSubstringBeforeFunction(ctxt, nargs);
49721        call_tests++;
49722        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49723        des_int(n_nargs, nargs, 1);
49724        xmlResetLastError();
49725        if (mem_base != xmlMemBlocks()) {
49726            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
49727	           xmlMemBlocks() - mem_base);
49728	    test_ret++;
49729            printf(" %d", n_ctxt);
49730            printf(" %d", n_nargs);
49731            printf("\n");
49732        }
49733    }
49734    }
49735    function_tests++;
49736#endif
49737
49738    return(test_ret);
49739}
49740
49741
49742static int
49743test_xmlXPathSubstringFunction(void) {
49744    int test_ret = 0;
49745
49746#if defined(LIBXML_XPATH_ENABLED)
49747    int mem_base;
49748    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49749    int n_ctxt;
49750    int nargs; /* the number of arguments */
49751    int n_nargs;
49752
49753    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49754    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49755        mem_base = xmlMemBlocks();
49756        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49757        nargs = gen_int(n_nargs, 1);
49758
49759        xmlXPathSubstringFunction(ctxt, nargs);
49760        call_tests++;
49761        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49762        des_int(n_nargs, nargs, 1);
49763        xmlResetLastError();
49764        if (mem_base != xmlMemBlocks()) {
49765            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
49766	           xmlMemBlocks() - mem_base);
49767	    test_ret++;
49768            printf(" %d", n_ctxt);
49769            printf(" %d", n_nargs);
49770            printf("\n");
49771        }
49772    }
49773    }
49774    function_tests++;
49775#endif
49776
49777    return(test_ret);
49778}
49779
49780
49781static int
49782test_xmlXPathSumFunction(void) {
49783    int test_ret = 0;
49784
49785#if defined(LIBXML_XPATH_ENABLED)
49786    int mem_base;
49787    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49788    int n_ctxt;
49789    int nargs; /* the number of arguments */
49790    int n_nargs;
49791
49792    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49793    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49794        mem_base = xmlMemBlocks();
49795        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49796        nargs = gen_int(n_nargs, 1);
49797
49798        xmlXPathSumFunction(ctxt, nargs);
49799        call_tests++;
49800        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49801        des_int(n_nargs, nargs, 1);
49802        xmlResetLastError();
49803        if (mem_base != xmlMemBlocks()) {
49804            printf("Leak of %d blocks found in xmlXPathSumFunction",
49805	           xmlMemBlocks() - mem_base);
49806	    test_ret++;
49807            printf(" %d", n_ctxt);
49808            printf(" %d", n_nargs);
49809            printf("\n");
49810        }
49811    }
49812    }
49813    function_tests++;
49814#endif
49815
49816    return(test_ret);
49817}
49818
49819
49820static int
49821test_xmlXPathTrailing(void) {
49822    int test_ret = 0;
49823
49824#if defined(LIBXML_XPATH_ENABLED)
49825    int mem_base;
49826    xmlNodeSetPtr ret_val;
49827    xmlNodeSetPtr nodes1; /* a node-set */
49828    int n_nodes1;
49829    xmlNodeSetPtr nodes2; /* a node-set */
49830    int n_nodes2;
49831
49832    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49833    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49834        mem_base = xmlMemBlocks();
49835        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49836        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49837
49838        ret_val = xmlXPathTrailing(nodes1, nodes2);
49839        desret_xmlNodeSetPtr(ret_val);
49840        call_tests++;
49841        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49842        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49843        xmlResetLastError();
49844        if (mem_base != xmlMemBlocks()) {
49845            printf("Leak of %d blocks found in xmlXPathTrailing",
49846	           xmlMemBlocks() - mem_base);
49847	    test_ret++;
49848            printf(" %d", n_nodes1);
49849            printf(" %d", n_nodes2);
49850            printf("\n");
49851        }
49852    }
49853    }
49854    function_tests++;
49855#endif
49856
49857    return(test_ret);
49858}
49859
49860
49861static int
49862test_xmlXPathTrailingSorted(void) {
49863    int test_ret = 0;
49864
49865#if defined(LIBXML_XPATH_ENABLED)
49866    int mem_base;
49867    xmlNodeSetPtr ret_val;
49868    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
49869    int n_nodes1;
49870    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
49871    int n_nodes2;
49872
49873    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49874    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49875        mem_base = xmlMemBlocks();
49876        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49877        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49878
49879        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
49880        desret_xmlNodeSetPtr(ret_val);
49881        call_tests++;
49882        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49883        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49884        xmlResetLastError();
49885        if (mem_base != xmlMemBlocks()) {
49886            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
49887	           xmlMemBlocks() - mem_base);
49888	    test_ret++;
49889            printf(" %d", n_nodes1);
49890            printf(" %d", n_nodes2);
49891            printf("\n");
49892        }
49893    }
49894    }
49895    function_tests++;
49896#endif
49897
49898    return(test_ret);
49899}
49900
49901
49902static int
49903test_xmlXPathTranslateFunction(void) {
49904    int test_ret = 0;
49905
49906#if defined(LIBXML_XPATH_ENABLED)
49907    int mem_base;
49908    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49909    int n_ctxt;
49910    int nargs; /* the number of arguments */
49911    int n_nargs;
49912
49913    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49914    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49915        mem_base = xmlMemBlocks();
49916        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49917        nargs = gen_int(n_nargs, 1);
49918
49919        xmlXPathTranslateFunction(ctxt, nargs);
49920        call_tests++;
49921        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49922        des_int(n_nargs, nargs, 1);
49923        xmlResetLastError();
49924        if (mem_base != xmlMemBlocks()) {
49925            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
49926	           xmlMemBlocks() - mem_base);
49927	    test_ret++;
49928            printf(" %d", n_ctxt);
49929            printf(" %d", n_nargs);
49930            printf("\n");
49931        }
49932    }
49933    }
49934    function_tests++;
49935#endif
49936
49937    return(test_ret);
49938}
49939
49940
49941static int
49942test_xmlXPathTrueFunction(void) {
49943    int test_ret = 0;
49944
49945#if defined(LIBXML_XPATH_ENABLED)
49946    int mem_base;
49947    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49948    int n_ctxt;
49949    int nargs; /* the number of arguments */
49950    int n_nargs;
49951
49952    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49953    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49954        mem_base = xmlMemBlocks();
49955        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49956        nargs = gen_int(n_nargs, 1);
49957
49958        xmlXPathTrueFunction(ctxt, nargs);
49959        call_tests++;
49960        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49961        des_int(n_nargs, nargs, 1);
49962        xmlResetLastError();
49963        if (mem_base != xmlMemBlocks()) {
49964            printf("Leak of %d blocks found in xmlXPathTrueFunction",
49965	           xmlMemBlocks() - mem_base);
49966	    test_ret++;
49967            printf(" %d", n_ctxt);
49968            printf(" %d", n_nargs);
49969            printf("\n");
49970        }
49971    }
49972    }
49973    function_tests++;
49974#endif
49975
49976    return(test_ret);
49977}
49978
49979
49980static int
49981test_xmlXPathValueFlipSign(void) {
49982    int test_ret = 0;
49983
49984#if defined(LIBXML_XPATH_ENABLED)
49985    int mem_base;
49986    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49987    int n_ctxt;
49988
49989    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49990        mem_base = xmlMemBlocks();
49991        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49992
49993        xmlXPathValueFlipSign(ctxt);
49994        call_tests++;
49995        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49996        xmlResetLastError();
49997        if (mem_base != xmlMemBlocks()) {
49998            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
49999	           xmlMemBlocks() - mem_base);
50000	    test_ret++;
50001            printf(" %d", n_ctxt);
50002            printf("\n");
50003        }
50004    }
50005    function_tests++;
50006#endif
50007
50008    return(test_ret);
50009}
50010
50011
50012static int
50013test_xmlXPathVariableLookup(void) {
50014    int test_ret = 0;
50015
50016#if defined(LIBXML_XPATH_ENABLED)
50017    int mem_base;
50018    xmlXPathObjectPtr ret_val;
50019    xmlXPathContextPtr ctxt; /* the XPath context */
50020    int n_ctxt;
50021    xmlChar * name; /* the variable name */
50022    int n_name;
50023
50024    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50025    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50026        mem_base = xmlMemBlocks();
50027        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50028        name = gen_const_xmlChar_ptr(n_name, 1);
50029
50030        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50031        desret_xmlXPathObjectPtr(ret_val);
50032        call_tests++;
50033        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50034        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50035        xmlResetLastError();
50036        if (mem_base != xmlMemBlocks()) {
50037            printf("Leak of %d blocks found in xmlXPathVariableLookup",
50038	           xmlMemBlocks() - mem_base);
50039	    test_ret++;
50040            printf(" %d", n_ctxt);
50041            printf(" %d", n_name);
50042            printf("\n");
50043        }
50044    }
50045    }
50046    function_tests++;
50047#endif
50048
50049    return(test_ret);
50050}
50051
50052
50053static int
50054test_xmlXPathVariableLookupNS(void) {
50055    int test_ret = 0;
50056
50057#if defined(LIBXML_XPATH_ENABLED)
50058    int mem_base;
50059    xmlXPathObjectPtr ret_val;
50060    xmlXPathContextPtr ctxt; /* the XPath context */
50061    int n_ctxt;
50062    xmlChar * name; /* the variable name */
50063    int n_name;
50064    xmlChar * ns_uri; /* the variable namespace URI */
50065    int n_ns_uri;
50066
50067    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50068    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50069    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50070        mem_base = xmlMemBlocks();
50071        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50072        name = gen_const_xmlChar_ptr(n_name, 1);
50073        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50074
50075        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50076        desret_xmlXPathObjectPtr(ret_val);
50077        call_tests++;
50078        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50079        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50080        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50081        xmlResetLastError();
50082        if (mem_base != xmlMemBlocks()) {
50083            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50084	           xmlMemBlocks() - mem_base);
50085	    test_ret++;
50086            printf(" %d", n_ctxt);
50087            printf(" %d", n_name);
50088            printf(" %d", n_ns_uri);
50089            printf("\n");
50090        }
50091    }
50092    }
50093    }
50094    function_tests++;
50095#endif
50096
50097    return(test_ret);
50098}
50099
50100
50101static int
50102test_xmlXPathWrapCString(void) {
50103    int test_ret = 0;
50104
50105#if defined(LIBXML_XPATH_ENABLED)
50106    int mem_base;
50107    xmlXPathObjectPtr ret_val;
50108    char * val; /* the char * value */
50109    int n_val;
50110
50111    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50112        mem_base = xmlMemBlocks();
50113        val = gen_char_ptr(n_val, 0);
50114
50115        ret_val = xmlXPathWrapCString(val);
50116        desret_xmlXPathObjectPtr(ret_val);
50117        call_tests++;
50118        des_char_ptr(n_val, val, 0);
50119        xmlResetLastError();
50120        if (mem_base != xmlMemBlocks()) {
50121            printf("Leak of %d blocks found in xmlXPathWrapCString",
50122	           xmlMemBlocks() - mem_base);
50123	    test_ret++;
50124            printf(" %d", n_val);
50125            printf("\n");
50126        }
50127    }
50128    function_tests++;
50129#endif
50130
50131    return(test_ret);
50132}
50133
50134
50135static int
50136test_xmlXPathWrapExternal(void) {
50137    int test_ret = 0;
50138
50139#if defined(LIBXML_XPATH_ENABLED)
50140    int mem_base;
50141    xmlXPathObjectPtr ret_val;
50142    void * val; /* the user data */
50143    int n_val;
50144
50145    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50146        mem_base = xmlMemBlocks();
50147        val = gen_void_ptr(n_val, 0);
50148
50149        ret_val = xmlXPathWrapExternal(val);
50150        desret_xmlXPathObjectPtr(ret_val);
50151        call_tests++;
50152        des_void_ptr(n_val, val, 0);
50153        xmlResetLastError();
50154        if (mem_base != xmlMemBlocks()) {
50155            printf("Leak of %d blocks found in xmlXPathWrapExternal",
50156	           xmlMemBlocks() - mem_base);
50157	    test_ret++;
50158            printf(" %d", n_val);
50159            printf("\n");
50160        }
50161    }
50162    function_tests++;
50163#endif
50164
50165    return(test_ret);
50166}
50167
50168
50169static int
50170test_xmlXPathWrapNodeSet(void) {
50171    int test_ret = 0;
50172
50173#if defined(LIBXML_XPATH_ENABLED)
50174    int mem_base;
50175    xmlXPathObjectPtr ret_val;
50176    xmlNodeSetPtr val; /* the NodePtr value */
50177    int n_val;
50178
50179    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50180        mem_base = xmlMemBlocks();
50181        val = gen_xmlNodeSetPtr(n_val, 0);
50182
50183        ret_val = xmlXPathWrapNodeSet(val);
50184        desret_xmlXPathObjectPtr(ret_val);
50185        call_tests++;
50186        des_xmlNodeSetPtr(n_val, val, 0);
50187        xmlResetLastError();
50188        if (mem_base != xmlMemBlocks()) {
50189            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50190	           xmlMemBlocks() - mem_base);
50191	    test_ret++;
50192            printf(" %d", n_val);
50193            printf("\n");
50194        }
50195    }
50196    function_tests++;
50197#endif
50198
50199    return(test_ret);
50200}
50201
50202
50203static int
50204test_xmlXPatherror(void) {
50205    int test_ret = 0;
50206
50207#if defined(LIBXML_XPATH_ENABLED)
50208    int mem_base;
50209    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50210    int n_ctxt;
50211    const char * file; /* the file name */
50212    int n_file;
50213    int line; /* the line number */
50214    int n_line;
50215    int no; /* the error number */
50216    int n_no;
50217
50218    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50219    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50220    for (n_line = 0;n_line < gen_nb_int;n_line++) {
50221    for (n_no = 0;n_no < gen_nb_int;n_no++) {
50222        mem_base = xmlMemBlocks();
50223        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50224        file = gen_filepath(n_file, 1);
50225        line = gen_int(n_line, 2);
50226        no = gen_int(n_no, 3);
50227
50228        xmlXPatherror(ctxt, file, line, no);
50229        call_tests++;
50230        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50231        des_filepath(n_file, file, 1);
50232        des_int(n_line, line, 2);
50233        des_int(n_no, no, 3);
50234        xmlResetLastError();
50235        if (mem_base != xmlMemBlocks()) {
50236            printf("Leak of %d blocks found in xmlXPatherror",
50237	           xmlMemBlocks() - mem_base);
50238	    test_ret++;
50239            printf(" %d", n_ctxt);
50240            printf(" %d", n_file);
50241            printf(" %d", n_line);
50242            printf(" %d", n_no);
50243            printf("\n");
50244        }
50245    }
50246    }
50247    }
50248    }
50249    function_tests++;
50250#endif
50251
50252    return(test_ret);
50253}
50254
50255static int
50256test_xpathInternals(void) {
50257    int test_ret = 0;
50258
50259    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50260    test_ret += test_valuePop();
50261    test_ret += test_valuePush();
50262    test_ret += test_xmlXPathAddValues();
50263    test_ret += test_xmlXPathBooleanFunction();
50264    test_ret += test_xmlXPathCeilingFunction();
50265    test_ret += test_xmlXPathCompareValues();
50266    test_ret += test_xmlXPathConcatFunction();
50267    test_ret += test_xmlXPathContainsFunction();
50268    test_ret += test_xmlXPathCountFunction();
50269    test_ret += test_xmlXPathDebugDumpCompExpr();
50270    test_ret += test_xmlXPathDebugDumpObject();
50271    test_ret += test_xmlXPathDifference();
50272    test_ret += test_xmlXPathDistinct();
50273    test_ret += test_xmlXPathDistinctSorted();
50274    test_ret += test_xmlXPathDivValues();
50275    test_ret += test_xmlXPathEqualValues();
50276    test_ret += test_xmlXPathErr();
50277    test_ret += test_xmlXPathEvalExpr();
50278    test_ret += test_xmlXPathEvaluatePredicateResult();
50279    test_ret += test_xmlXPathFalseFunction();
50280    test_ret += test_xmlXPathFloorFunction();
50281    test_ret += test_xmlXPathFunctionLookup();
50282    test_ret += test_xmlXPathFunctionLookupNS();
50283    test_ret += test_xmlXPathHasSameNodes();
50284    test_ret += test_xmlXPathIdFunction();
50285    test_ret += test_xmlXPathIntersection();
50286    test_ret += test_xmlXPathIsNodeType();
50287    test_ret += test_xmlXPathLangFunction();
50288    test_ret += test_xmlXPathLastFunction();
50289    test_ret += test_xmlXPathLeading();
50290    test_ret += test_xmlXPathLeadingSorted();
50291    test_ret += test_xmlXPathLocalNameFunction();
50292    test_ret += test_xmlXPathModValues();
50293    test_ret += test_xmlXPathMultValues();
50294    test_ret += test_xmlXPathNamespaceURIFunction();
50295    test_ret += test_xmlXPathNewBoolean();
50296    test_ret += test_xmlXPathNewCString();
50297    test_ret += test_xmlXPathNewFloat();
50298    test_ret += test_xmlXPathNewNodeSet();
50299    test_ret += test_xmlXPathNewNodeSetList();
50300    test_ret += test_xmlXPathNewParserContext();
50301    test_ret += test_xmlXPathNewString();
50302    test_ret += test_xmlXPathNextAncestor();
50303    test_ret += test_xmlXPathNextAncestorOrSelf();
50304    test_ret += test_xmlXPathNextAttribute();
50305    test_ret += test_xmlXPathNextChild();
50306    test_ret += test_xmlXPathNextDescendant();
50307    test_ret += test_xmlXPathNextDescendantOrSelf();
50308    test_ret += test_xmlXPathNextFollowing();
50309    test_ret += test_xmlXPathNextFollowingSibling();
50310    test_ret += test_xmlXPathNextNamespace();
50311    test_ret += test_xmlXPathNextParent();
50312    test_ret += test_xmlXPathNextPreceding();
50313    test_ret += test_xmlXPathNextPrecedingSibling();
50314    test_ret += test_xmlXPathNextSelf();
50315    test_ret += test_xmlXPathNodeLeading();
50316    test_ret += test_xmlXPathNodeLeadingSorted();
50317    test_ret += test_xmlXPathNodeSetAdd();
50318    test_ret += test_xmlXPathNodeSetAddNs();
50319    test_ret += test_xmlXPathNodeSetAddUnique();
50320    test_ret += test_xmlXPathNodeSetContains();
50321    test_ret += test_xmlXPathNodeSetDel();
50322    test_ret += test_xmlXPathNodeSetMerge();
50323    test_ret += test_xmlXPathNodeSetRemove();
50324    test_ret += test_xmlXPathNodeSetSort();
50325    test_ret += test_xmlXPathNodeTrailing();
50326    test_ret += test_xmlXPathNodeTrailingSorted();
50327    test_ret += test_xmlXPathNormalizeFunction();
50328    test_ret += test_xmlXPathNotEqualValues();
50329    test_ret += test_xmlXPathNotFunction();
50330    test_ret += test_xmlXPathNsLookup();
50331    test_ret += test_xmlXPathNumberFunction();
50332    test_ret += test_xmlXPathParseNCName();
50333    test_ret += test_xmlXPathParseName();
50334    test_ret += test_xmlXPathPopBoolean();
50335    test_ret += test_xmlXPathPopExternal();
50336    test_ret += test_xmlXPathPopNodeSet();
50337    test_ret += test_xmlXPathPopNumber();
50338    test_ret += test_xmlXPathPopString();
50339    test_ret += test_xmlXPathPositionFunction();
50340    test_ret += test_xmlXPathRegisterAllFunctions();
50341    test_ret += test_xmlXPathRegisterFunc();
50342    test_ret += test_xmlXPathRegisterFuncLookup();
50343    test_ret += test_xmlXPathRegisterFuncNS();
50344    test_ret += test_xmlXPathRegisterNs();
50345    test_ret += test_xmlXPathRegisterVariable();
50346    test_ret += test_xmlXPathRegisterVariableLookup();
50347    test_ret += test_xmlXPathRegisterVariableNS();
50348    test_ret += test_xmlXPathRegisteredFuncsCleanup();
50349    test_ret += test_xmlXPathRegisteredNsCleanup();
50350    test_ret += test_xmlXPathRegisteredVariablesCleanup();
50351    test_ret += test_xmlXPathRoot();
50352    test_ret += test_xmlXPathRoundFunction();
50353    test_ret += test_xmlXPathStartsWithFunction();
50354    test_ret += test_xmlXPathStringEvalNumber();
50355    test_ret += test_xmlXPathStringFunction();
50356    test_ret += test_xmlXPathStringLengthFunction();
50357    test_ret += test_xmlXPathSubValues();
50358    test_ret += test_xmlXPathSubstringAfterFunction();
50359    test_ret += test_xmlXPathSubstringBeforeFunction();
50360    test_ret += test_xmlXPathSubstringFunction();
50361    test_ret += test_xmlXPathSumFunction();
50362    test_ret += test_xmlXPathTrailing();
50363    test_ret += test_xmlXPathTrailingSorted();
50364    test_ret += test_xmlXPathTranslateFunction();
50365    test_ret += test_xmlXPathTrueFunction();
50366    test_ret += test_xmlXPathValueFlipSign();
50367    test_ret += test_xmlXPathVariableLookup();
50368    test_ret += test_xmlXPathVariableLookupNS();
50369    test_ret += test_xmlXPathWrapCString();
50370    test_ret += test_xmlXPathWrapExternal();
50371    test_ret += test_xmlXPathWrapNodeSet();
50372    test_ret += test_xmlXPatherror();
50373
50374    if (test_ret != 0)
50375	printf("Module xpathInternals: %d errors\n", test_ret);
50376    return(test_ret);
50377}
50378
50379static int
50380test_xmlXPtrBuildNodeList(void) {
50381    int test_ret = 0;
50382
50383#if defined(LIBXML_XPTR_ENABLED)
50384    int mem_base;
50385    xmlNodePtr ret_val;
50386    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50387    int n_obj;
50388
50389    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50390        mem_base = xmlMemBlocks();
50391        obj = gen_xmlXPathObjectPtr(n_obj, 0);
50392
50393        ret_val = xmlXPtrBuildNodeList(obj);
50394        desret_xmlNodePtr(ret_val);
50395        call_tests++;
50396        des_xmlXPathObjectPtr(n_obj, obj, 0);
50397        xmlResetLastError();
50398        if (mem_base != xmlMemBlocks()) {
50399            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50400	           xmlMemBlocks() - mem_base);
50401	    test_ret++;
50402            printf(" %d", n_obj);
50403            printf("\n");
50404        }
50405    }
50406    function_tests++;
50407#endif
50408
50409    return(test_ret);
50410}
50411
50412
50413static int
50414test_xmlXPtrEval(void) {
50415    int test_ret = 0;
50416
50417#if defined(LIBXML_XPTR_ENABLED)
50418    int mem_base;
50419    xmlXPathObjectPtr ret_val;
50420    xmlChar * str; /* the XPointer expression */
50421    int n_str;
50422    xmlXPathContextPtr ctx; /* the XPointer context */
50423    int n_ctx;
50424
50425    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50426    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50427        mem_base = xmlMemBlocks();
50428        str = gen_const_xmlChar_ptr(n_str, 0);
50429        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50430
50431        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50432        desret_xmlXPathObjectPtr(ret_val);
50433        call_tests++;
50434        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50435        des_xmlXPathContextPtr(n_ctx, ctx, 1);
50436        xmlResetLastError();
50437        if (mem_base != xmlMemBlocks()) {
50438            printf("Leak of %d blocks found in xmlXPtrEval",
50439	           xmlMemBlocks() - mem_base);
50440	    test_ret++;
50441            printf(" %d", n_str);
50442            printf(" %d", n_ctx);
50443            printf("\n");
50444        }
50445    }
50446    }
50447    function_tests++;
50448#endif
50449
50450    return(test_ret);
50451}
50452
50453
50454static int
50455test_xmlXPtrEvalRangePredicate(void) {
50456    int test_ret = 0;
50457
50458#if defined(LIBXML_XPTR_ENABLED)
50459    int mem_base;
50460    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50461    int n_ctxt;
50462
50463    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50464        mem_base = xmlMemBlocks();
50465        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50466
50467        xmlXPtrEvalRangePredicate(ctxt);
50468        call_tests++;
50469        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50470        xmlResetLastError();
50471        if (mem_base != xmlMemBlocks()) {
50472            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50473	           xmlMemBlocks() - mem_base);
50474	    test_ret++;
50475            printf(" %d", n_ctxt);
50476            printf("\n");
50477        }
50478    }
50479    function_tests++;
50480#endif
50481
50482    return(test_ret);
50483}
50484
50485#ifdef LIBXML_XPTR_ENABLED
50486
50487#define gen_nb_xmlLocationSetPtr 1
50488static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50489    return(NULL);
50490}
50491static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50492}
50493#endif
50494
50495
50496static int
50497test_xmlXPtrLocationSetAdd(void) {
50498    int test_ret = 0;
50499
50500#if defined(LIBXML_XPTR_ENABLED)
50501    int mem_base;
50502    xmlLocationSetPtr cur; /* the initial range set */
50503    int n_cur;
50504    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50505    int n_val;
50506
50507    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50508    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50509        mem_base = xmlMemBlocks();
50510        cur = gen_xmlLocationSetPtr(n_cur, 0);
50511        val = gen_xmlXPathObjectPtr(n_val, 1);
50512
50513        xmlXPtrLocationSetAdd(cur, val);
50514        call_tests++;
50515        des_xmlLocationSetPtr(n_cur, cur, 0);
50516        des_xmlXPathObjectPtr(n_val, val, 1);
50517        xmlResetLastError();
50518        if (mem_base != xmlMemBlocks()) {
50519            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50520	           xmlMemBlocks() - mem_base);
50521	    test_ret++;
50522            printf(" %d", n_cur);
50523            printf(" %d", n_val);
50524            printf("\n");
50525        }
50526    }
50527    }
50528    function_tests++;
50529#endif
50530
50531    return(test_ret);
50532}
50533
50534
50535static int
50536test_xmlXPtrLocationSetCreate(void) {
50537    int test_ret = 0;
50538
50539
50540    /* missing type support */
50541    return(test_ret);
50542}
50543
50544
50545static int
50546test_xmlXPtrLocationSetDel(void) {
50547    int test_ret = 0;
50548
50549#if defined(LIBXML_XPTR_ENABLED)
50550    int mem_base;
50551    xmlLocationSetPtr cur; /* the initial range set */
50552    int n_cur;
50553    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50554    int n_val;
50555
50556    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50557    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50558        mem_base = xmlMemBlocks();
50559        cur = gen_xmlLocationSetPtr(n_cur, 0);
50560        val = gen_xmlXPathObjectPtr(n_val, 1);
50561
50562        xmlXPtrLocationSetDel(cur, val);
50563        call_tests++;
50564        des_xmlLocationSetPtr(n_cur, cur, 0);
50565        des_xmlXPathObjectPtr(n_val, val, 1);
50566        xmlResetLastError();
50567        if (mem_base != xmlMemBlocks()) {
50568            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50569	           xmlMemBlocks() - mem_base);
50570	    test_ret++;
50571            printf(" %d", n_cur);
50572            printf(" %d", n_val);
50573            printf("\n");
50574        }
50575    }
50576    }
50577    function_tests++;
50578#endif
50579
50580    return(test_ret);
50581}
50582
50583
50584static int
50585test_xmlXPtrLocationSetMerge(void) {
50586    int test_ret = 0;
50587
50588
50589    /* missing type support */
50590    return(test_ret);
50591}
50592
50593
50594static int
50595test_xmlXPtrLocationSetRemove(void) {
50596    int test_ret = 0;
50597
50598#if defined(LIBXML_XPTR_ENABLED)
50599    int mem_base;
50600    xmlLocationSetPtr cur; /* the initial range set */
50601    int n_cur;
50602    int val; /* the index to remove */
50603    int n_val;
50604
50605    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50606    for (n_val = 0;n_val < gen_nb_int;n_val++) {
50607        mem_base = xmlMemBlocks();
50608        cur = gen_xmlLocationSetPtr(n_cur, 0);
50609        val = gen_int(n_val, 1);
50610
50611        xmlXPtrLocationSetRemove(cur, val);
50612        call_tests++;
50613        des_xmlLocationSetPtr(n_cur, cur, 0);
50614        des_int(n_val, val, 1);
50615        xmlResetLastError();
50616        if (mem_base != xmlMemBlocks()) {
50617            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50618	           xmlMemBlocks() - mem_base);
50619	    test_ret++;
50620            printf(" %d", n_cur);
50621            printf(" %d", n_val);
50622            printf("\n");
50623        }
50624    }
50625    }
50626    function_tests++;
50627#endif
50628
50629    return(test_ret);
50630}
50631
50632
50633static int
50634test_xmlXPtrNewCollapsedRange(void) {
50635    int test_ret = 0;
50636
50637#if defined(LIBXML_XPTR_ENABLED)
50638    int mem_base;
50639    xmlXPathObjectPtr ret_val;
50640    xmlNodePtr start; /* the starting and ending node */
50641    int n_start;
50642
50643    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50644        mem_base = xmlMemBlocks();
50645        start = gen_xmlNodePtr(n_start, 0);
50646
50647        ret_val = xmlXPtrNewCollapsedRange(start);
50648        desret_xmlXPathObjectPtr(ret_val);
50649        call_tests++;
50650        des_xmlNodePtr(n_start, start, 0);
50651        xmlResetLastError();
50652        if (mem_base != xmlMemBlocks()) {
50653            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50654	           xmlMemBlocks() - mem_base);
50655	    test_ret++;
50656            printf(" %d", n_start);
50657            printf("\n");
50658        }
50659    }
50660    function_tests++;
50661#endif
50662
50663    return(test_ret);
50664}
50665
50666
50667static int
50668test_xmlXPtrNewContext(void) {
50669    int test_ret = 0;
50670
50671
50672    /* missing type support */
50673    return(test_ret);
50674}
50675
50676
50677static int
50678test_xmlXPtrNewLocationSetNodeSet(void) {
50679    int test_ret = 0;
50680
50681#if defined(LIBXML_XPTR_ENABLED)
50682    int mem_base;
50683    xmlXPathObjectPtr ret_val;
50684    xmlNodeSetPtr set; /* a node set */
50685    int n_set;
50686
50687    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50688        mem_base = xmlMemBlocks();
50689        set = gen_xmlNodeSetPtr(n_set, 0);
50690
50691        ret_val = xmlXPtrNewLocationSetNodeSet(set);
50692        desret_xmlXPathObjectPtr(ret_val);
50693        call_tests++;
50694        des_xmlNodeSetPtr(n_set, set, 0);
50695        xmlResetLastError();
50696        if (mem_base != xmlMemBlocks()) {
50697            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
50698	           xmlMemBlocks() - mem_base);
50699	    test_ret++;
50700            printf(" %d", n_set);
50701            printf("\n");
50702        }
50703    }
50704    function_tests++;
50705#endif
50706
50707    return(test_ret);
50708}
50709
50710
50711static int
50712test_xmlXPtrNewLocationSetNodes(void) {
50713    int test_ret = 0;
50714
50715#if defined(LIBXML_XPTR_ENABLED)
50716    int mem_base;
50717    xmlXPathObjectPtr ret_val;
50718    xmlNodePtr start; /* the start NodePtr value */
50719    int n_start;
50720    xmlNodePtr end; /* the end NodePtr value or NULL */
50721    int n_end;
50722
50723    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50724    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50725        mem_base = xmlMemBlocks();
50726        start = gen_xmlNodePtr(n_start, 0);
50727        end = gen_xmlNodePtr(n_end, 1);
50728
50729        ret_val = xmlXPtrNewLocationSetNodes(start, end);
50730        desret_xmlXPathObjectPtr(ret_val);
50731        call_tests++;
50732        des_xmlNodePtr(n_start, start, 0);
50733        des_xmlNodePtr(n_end, end, 1);
50734        xmlResetLastError();
50735        if (mem_base != xmlMemBlocks()) {
50736            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
50737	           xmlMemBlocks() - mem_base);
50738	    test_ret++;
50739            printf(" %d", n_start);
50740            printf(" %d", n_end);
50741            printf("\n");
50742        }
50743    }
50744    }
50745    function_tests++;
50746#endif
50747
50748    return(test_ret);
50749}
50750
50751
50752static int
50753test_xmlXPtrNewRange(void) {
50754    int test_ret = 0;
50755
50756#if defined(LIBXML_XPTR_ENABLED)
50757    int mem_base;
50758    xmlXPathObjectPtr ret_val;
50759    xmlNodePtr start; /* the starting node */
50760    int n_start;
50761    int startindex; /* the start index */
50762    int n_startindex;
50763    xmlNodePtr end; /* the ending point */
50764    int n_end;
50765    int endindex; /* the ending index */
50766    int n_endindex;
50767
50768    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50769    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
50770    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50771    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
50772        mem_base = xmlMemBlocks();
50773        start = gen_xmlNodePtr(n_start, 0);
50774        startindex = gen_int(n_startindex, 1);
50775        end = gen_xmlNodePtr(n_end, 2);
50776        endindex = gen_int(n_endindex, 3);
50777
50778        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
50779        desret_xmlXPathObjectPtr(ret_val);
50780        call_tests++;
50781        des_xmlNodePtr(n_start, start, 0);
50782        des_int(n_startindex, startindex, 1);
50783        des_xmlNodePtr(n_end, end, 2);
50784        des_int(n_endindex, endindex, 3);
50785        xmlResetLastError();
50786        if (mem_base != xmlMemBlocks()) {
50787            printf("Leak of %d blocks found in xmlXPtrNewRange",
50788	           xmlMemBlocks() - mem_base);
50789	    test_ret++;
50790            printf(" %d", n_start);
50791            printf(" %d", n_startindex);
50792            printf(" %d", n_end);
50793            printf(" %d", n_endindex);
50794            printf("\n");
50795        }
50796    }
50797    }
50798    }
50799    }
50800    function_tests++;
50801#endif
50802
50803    return(test_ret);
50804}
50805
50806
50807static int
50808test_xmlXPtrNewRangeNodeObject(void) {
50809    int test_ret = 0;
50810
50811#if defined(LIBXML_XPTR_ENABLED)
50812    int mem_base;
50813    xmlXPathObjectPtr ret_val;
50814    xmlNodePtr start; /* the starting node */
50815    int n_start;
50816    xmlXPathObjectPtr end; /* the ending object */
50817    int n_end;
50818
50819    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50820    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50821        mem_base = xmlMemBlocks();
50822        start = gen_xmlNodePtr(n_start, 0);
50823        end = gen_xmlXPathObjectPtr(n_end, 1);
50824
50825        ret_val = xmlXPtrNewRangeNodeObject(start, end);
50826        desret_xmlXPathObjectPtr(ret_val);
50827        call_tests++;
50828        des_xmlNodePtr(n_start, start, 0);
50829        des_xmlXPathObjectPtr(n_end, end, 1);
50830        xmlResetLastError();
50831        if (mem_base != xmlMemBlocks()) {
50832            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
50833	           xmlMemBlocks() - mem_base);
50834	    test_ret++;
50835            printf(" %d", n_start);
50836            printf(" %d", n_end);
50837            printf("\n");
50838        }
50839    }
50840    }
50841    function_tests++;
50842#endif
50843
50844    return(test_ret);
50845}
50846
50847
50848static int
50849test_xmlXPtrNewRangeNodePoint(void) {
50850    int test_ret = 0;
50851
50852#if defined(LIBXML_XPTR_ENABLED)
50853    int mem_base;
50854    xmlXPathObjectPtr ret_val;
50855    xmlNodePtr start; /* the starting node */
50856    int n_start;
50857    xmlXPathObjectPtr end; /* the ending point */
50858    int n_end;
50859
50860    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50861    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50862        mem_base = xmlMemBlocks();
50863        start = gen_xmlNodePtr(n_start, 0);
50864        end = gen_xmlXPathObjectPtr(n_end, 1);
50865
50866        ret_val = xmlXPtrNewRangeNodePoint(start, end);
50867        desret_xmlXPathObjectPtr(ret_val);
50868        call_tests++;
50869        des_xmlNodePtr(n_start, start, 0);
50870        des_xmlXPathObjectPtr(n_end, end, 1);
50871        xmlResetLastError();
50872        if (mem_base != xmlMemBlocks()) {
50873            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
50874	           xmlMemBlocks() - mem_base);
50875	    test_ret++;
50876            printf(" %d", n_start);
50877            printf(" %d", n_end);
50878            printf("\n");
50879        }
50880    }
50881    }
50882    function_tests++;
50883#endif
50884
50885    return(test_ret);
50886}
50887
50888
50889static int
50890test_xmlXPtrNewRangeNodes(void) {
50891    int test_ret = 0;
50892
50893#if defined(LIBXML_XPTR_ENABLED)
50894    int mem_base;
50895    xmlXPathObjectPtr ret_val;
50896    xmlNodePtr start; /* the starting node */
50897    int n_start;
50898    xmlNodePtr end; /* the ending node */
50899    int n_end;
50900
50901    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50902    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50903        mem_base = xmlMemBlocks();
50904        start = gen_xmlNodePtr(n_start, 0);
50905        end = gen_xmlNodePtr(n_end, 1);
50906
50907        ret_val = xmlXPtrNewRangeNodes(start, end);
50908        desret_xmlXPathObjectPtr(ret_val);
50909        call_tests++;
50910        des_xmlNodePtr(n_start, start, 0);
50911        des_xmlNodePtr(n_end, end, 1);
50912        xmlResetLastError();
50913        if (mem_base != xmlMemBlocks()) {
50914            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
50915	           xmlMemBlocks() - mem_base);
50916	    test_ret++;
50917            printf(" %d", n_start);
50918            printf(" %d", n_end);
50919            printf("\n");
50920        }
50921    }
50922    }
50923    function_tests++;
50924#endif
50925
50926    return(test_ret);
50927}
50928
50929
50930static int
50931test_xmlXPtrNewRangePointNode(void) {
50932    int test_ret = 0;
50933
50934#if defined(LIBXML_XPTR_ENABLED)
50935    int mem_base;
50936    xmlXPathObjectPtr ret_val;
50937    xmlXPathObjectPtr start; /* the starting point */
50938    int n_start;
50939    xmlNodePtr end; /* the ending node */
50940    int n_end;
50941
50942    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
50943    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50944        mem_base = xmlMemBlocks();
50945        start = gen_xmlXPathObjectPtr(n_start, 0);
50946        end = gen_xmlNodePtr(n_end, 1);
50947
50948        ret_val = xmlXPtrNewRangePointNode(start, end);
50949        desret_xmlXPathObjectPtr(ret_val);
50950        call_tests++;
50951        des_xmlXPathObjectPtr(n_start, start, 0);
50952        des_xmlNodePtr(n_end, end, 1);
50953        xmlResetLastError();
50954        if (mem_base != xmlMemBlocks()) {
50955            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
50956	           xmlMemBlocks() - mem_base);
50957	    test_ret++;
50958            printf(" %d", n_start);
50959            printf(" %d", n_end);
50960            printf("\n");
50961        }
50962    }
50963    }
50964    function_tests++;
50965#endif
50966
50967    return(test_ret);
50968}
50969
50970
50971static int
50972test_xmlXPtrNewRangePoints(void) {
50973    int test_ret = 0;
50974
50975#if defined(LIBXML_XPTR_ENABLED)
50976    int mem_base;
50977    xmlXPathObjectPtr ret_val;
50978    xmlXPathObjectPtr start; /* the starting point */
50979    int n_start;
50980    xmlXPathObjectPtr end; /* the ending point */
50981    int n_end;
50982
50983    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
50984    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50985        mem_base = xmlMemBlocks();
50986        start = gen_xmlXPathObjectPtr(n_start, 0);
50987        end = gen_xmlXPathObjectPtr(n_end, 1);
50988
50989        ret_val = xmlXPtrNewRangePoints(start, end);
50990        desret_xmlXPathObjectPtr(ret_val);
50991        call_tests++;
50992        des_xmlXPathObjectPtr(n_start, start, 0);
50993        des_xmlXPathObjectPtr(n_end, end, 1);
50994        xmlResetLastError();
50995        if (mem_base != xmlMemBlocks()) {
50996            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
50997	           xmlMemBlocks() - mem_base);
50998	    test_ret++;
50999            printf(" %d", n_start);
51000            printf(" %d", n_end);
51001            printf("\n");
51002        }
51003    }
51004    }
51005    function_tests++;
51006#endif
51007
51008    return(test_ret);
51009}
51010
51011
51012static int
51013test_xmlXPtrRangeToFunction(void) {
51014    int test_ret = 0;
51015
51016#if defined(LIBXML_XPTR_ENABLED)
51017    int mem_base;
51018    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51019    int n_ctxt;
51020    int nargs; /* the number of args */
51021    int n_nargs;
51022
51023    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51024    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51025        mem_base = xmlMemBlocks();
51026        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51027        nargs = gen_int(n_nargs, 1);
51028
51029        xmlXPtrRangeToFunction(ctxt, nargs);
51030        call_tests++;
51031        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51032        des_int(n_nargs, nargs, 1);
51033        xmlResetLastError();
51034        if (mem_base != xmlMemBlocks()) {
51035            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51036	           xmlMemBlocks() - mem_base);
51037	    test_ret++;
51038            printf(" %d", n_ctxt);
51039            printf(" %d", n_nargs);
51040            printf("\n");
51041        }
51042    }
51043    }
51044    function_tests++;
51045#endif
51046
51047    return(test_ret);
51048}
51049
51050
51051static int
51052test_xmlXPtrWrapLocationSet(void) {
51053    int test_ret = 0;
51054
51055#if defined(LIBXML_XPTR_ENABLED)
51056    int mem_base;
51057    xmlXPathObjectPtr ret_val;
51058    xmlLocationSetPtr val; /* the LocationSet value */
51059    int n_val;
51060
51061    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51062        mem_base = xmlMemBlocks();
51063        val = gen_xmlLocationSetPtr(n_val, 0);
51064
51065        ret_val = xmlXPtrWrapLocationSet(val);
51066        desret_xmlXPathObjectPtr(ret_val);
51067        call_tests++;
51068        des_xmlLocationSetPtr(n_val, val, 0);
51069        xmlResetLastError();
51070        if (mem_base != xmlMemBlocks()) {
51071            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51072	           xmlMemBlocks() - mem_base);
51073	    test_ret++;
51074            printf(" %d", n_val);
51075            printf("\n");
51076        }
51077    }
51078    function_tests++;
51079#endif
51080
51081    return(test_ret);
51082}
51083
51084static int
51085test_xpointer(void) {
51086    int test_ret = 0;
51087
51088    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51089    test_ret += test_xmlXPtrBuildNodeList();
51090    test_ret += test_xmlXPtrEval();
51091    test_ret += test_xmlXPtrEvalRangePredicate();
51092    test_ret += test_xmlXPtrLocationSetAdd();
51093    test_ret += test_xmlXPtrLocationSetCreate();
51094    test_ret += test_xmlXPtrLocationSetDel();
51095    test_ret += test_xmlXPtrLocationSetMerge();
51096    test_ret += test_xmlXPtrLocationSetRemove();
51097    test_ret += test_xmlXPtrNewCollapsedRange();
51098    test_ret += test_xmlXPtrNewContext();
51099    test_ret += test_xmlXPtrNewLocationSetNodeSet();
51100    test_ret += test_xmlXPtrNewLocationSetNodes();
51101    test_ret += test_xmlXPtrNewRange();
51102    test_ret += test_xmlXPtrNewRangeNodeObject();
51103    test_ret += test_xmlXPtrNewRangeNodePoint();
51104    test_ret += test_xmlXPtrNewRangeNodes();
51105    test_ret += test_xmlXPtrNewRangePointNode();
51106    test_ret += test_xmlXPtrNewRangePoints();
51107    test_ret += test_xmlXPtrRangeToFunction();
51108    test_ret += test_xmlXPtrWrapLocationSet();
51109
51110    if (test_ret != 0)
51111	printf("Module xpointer: %d errors\n", test_ret);
51112    return(test_ret);
51113}
51114static int
51115test_module(const char *module) {
51116    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51117    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51118    if (!strcmp(module, "SAX2")) return(test_SAX2());
51119    if (!strcmp(module, "c14n")) return(test_c14n());
51120    if (!strcmp(module, "catalog")) return(test_catalog());
51121    if (!strcmp(module, "chvalid")) return(test_chvalid());
51122    if (!strcmp(module, "debugXML")) return(test_debugXML());
51123    if (!strcmp(module, "dict")) return(test_dict());
51124    if (!strcmp(module, "encoding")) return(test_encoding());
51125    if (!strcmp(module, "entities")) return(test_entities());
51126    if (!strcmp(module, "hash")) return(test_hash());
51127    if (!strcmp(module, "list")) return(test_list());
51128    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51129    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51130    if (!strcmp(module, "parser")) return(test_parser());
51131    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51132    if (!strcmp(module, "pattern")) return(test_pattern());
51133    if (!strcmp(module, "relaxng")) return(test_relaxng());
51134    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51135    if (!strcmp(module, "schematron")) return(test_schematron());
51136    if (!strcmp(module, "tree")) return(test_tree());
51137    if (!strcmp(module, "uri")) return(test_uri());
51138    if (!strcmp(module, "valid")) return(test_valid());
51139    if (!strcmp(module, "xinclude")) return(test_xinclude());
51140    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51141    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51142    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51143    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51144    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51145    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51146    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51147    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51148    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51149    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51150    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51151    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51152    if (!strcmp(module, "xpath")) return(test_xpath());
51153    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51154    if (!strcmp(module, "xpointer")) return(test_xpointer());
51155    return(0);
51156}
51157