testapi.c revision ccb4d41c13bea3c81cf074ed43b84bd686c7d124
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#include <stdio.h>
12#include <string.h>
13#include <libxml/xmlerror.h>
14#include <libxml/relaxng.h>
15
16static int testlibxml2(void);
17static int test_module(const char *module);
18
19static int generic_errors = 0;
20static int call_tests = 0;
21static int function_tests = 0;
22
23static xmlChar chartab[1024];
24static int inttab[1024];
25static unsigned long longtab[1024];
26
27static xmlDocPtr api_doc = NULL;
28static xmlDtdPtr api_dtd = NULL;
29static xmlNodePtr api_root = NULL;
30static xmlAttrPtr api_attr = NULL;
31static xmlNsPtr api_ns = NULL;
32
33static void
34structured_errors(void *userData ATTRIBUTE_UNUSED,
35                  xmlErrorPtr error ATTRIBUTE_UNUSED) {
36    generic_errors++;
37}
38
39static void
40free_api_doc(void) {
41    xmlFreeDoc(api_doc);
42    api_doc = NULL;
43    api_dtd = NULL;
44    api_root = NULL;
45    api_attr = NULL;
46    api_ns = NULL;
47}
48
49static xmlDocPtr
50get_api_doc(void) {
51    if (api_doc == NULL) {
52        api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
53	api_root = NULL;
54	api_attr = NULL;
55    }
56    return(api_doc);
57}
58
59static xmlDtdPtr
60get_api_dtd(void) {
61    if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
62        get_api_doc();
63	if ((api_doc != NULL) && (api_doc->children != NULL) &&
64	    (api_doc->children->type == XML_DTD_NODE))
65	    api_dtd = (xmlDtdPtr) api_doc->children;
66    }
67    return(api_dtd);
68}
69
70static xmlNodePtr
71get_api_root(void) {
72    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
73        get_api_doc();
74	if ((api_doc != NULL) && (api_doc->children != NULL) &&
75	    (api_doc->children->next != NULL) &&
76	    (api_doc->children->next->type == XML_ELEMENT_NODE))
77	    api_root = api_doc->children->next;
78    }
79    return(api_root);
80}
81
82static xmlNsPtr
83get_api_ns(void) {
84    get_api_root();
85    if (api_root != NULL)
86        api_ns = api_root->nsDef;
87    return(api_ns);
88}
89
90static xmlAttrPtr
91get_api_attr(void) {
92#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
93    static int nr = 0;
94    xmlChar name[20];
95#endif
96
97    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
98        get_api_root();
99    }
100    if (api_root == NULL)
101        return(NULL);
102    if (api_root->properties != NULL) {
103        api_attr = api_root->properties;
104        return(api_root->properties);
105    }
106    api_attr = NULL;
107#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
108    snprintf((char *) name, 20, "foo%d", nr++);
109    api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
110#endif
111    return(api_attr);
112}
113
114static int quiet = 0;
115
116int main(int argc, char **argv) {
117    int ret;
118    int blocks, mem;
119
120    memset(chartab, 0, sizeof(chartab));
121    strncpy((char *) chartab, "  chartab\n", 20);
122    memset(inttab, 0, sizeof(inttab));
123    memset(longtab, 0, sizeof(longtab));
124
125    xmlInitParser();
126#ifdef LIBXML_SCHEMAS_ENABLED
127    xmlRelaxNGInitTypes();
128#endif
129
130    LIBXML_TEST_VERSION
131
132    xmlSetStructuredErrorFunc(NULL, structured_errors);
133
134    if (argc >= 2) {
135        if (!strcmp(argv[1], "-q")) {
136	    quiet = 1;
137	    if (argc >= 3)
138	        ret = test_module(argv[2]);
139	    else
140		ret = testlibxml2();
141        } else {
142	   ret = test_module(argv[1]);
143	}
144    } else
145	ret = testlibxml2();
146
147    xmlCleanupParser();
148    blocks = xmlMemBlocks();
149    mem = xmlMemUsed();
150    if ((blocks != 0) || (mem != 0)) {
151        printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
152    }
153    xmlMemoryDump();
154
155    return (ret != 0);
156}
157
158#include <libxml/HTMLparser.h>
159#include <libxml/HTMLtree.h>
160#include <libxml/catalog.h>
161#include <libxml/chvalid.h>
162#include <libxml/dict.h>
163#include <libxml/encoding.h>
164#include <libxml/entities.h>
165#include <libxml/hash.h>
166#include <libxml/list.h>
167#include <libxml/nanoftp.h>
168#include <libxml/nanohttp.h>
169#include <libxml/parser.h>
170#include <libxml/parserInternals.h>
171#include <libxml/pattern.h>
172#include <libxml/relaxng.h>
173#include <libxml/schemasInternals.h>
174#include <libxml/schematron.h>
175#include <libxml/tree.h>
176#include <libxml/uri.h>
177#include <libxml/valid.h>
178#include <libxml/xinclude.h>
179#include <libxml/xmlIO.h>
180#include <libxml/xmlerror.h>
181#include <libxml/xmlreader.h>
182#include <libxml/xmlsave.h>
183#include <libxml/xmlschemas.h>
184#include <libxml/xmlschemastypes.h>
185#include <libxml/xmlstring.h>
186#include <libxml/xmlwriter.h>
187#include <libxml/xpath.h>
188#include <libxml/xpointer.h>
189#include <libxml/debugXML.h>
190
191/*
192  We manually define xmlErrMemory because it's normal declaration
193  is "hidden" by #ifdef IN_LIBXML
194*/
195void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
196
197/*
198 We need some "remote" addresses, but want to avoid getting into
199 name resolution delays, so we use these
200*/
201#define	REMOTE1GOOD	"http://localhost/"
202#define	REMOTE1BAD	"http://missing. example.org/"
203#define	REMOTE2GOOD	"ftp://localhost/foo"
204
205#define gen_nb_void_ptr 2
206
207static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
208    return(NULL);
209}
210static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
211}
212
213#if 0
214#define gen_nb_const_void_ptr 2
215
216static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
217    if (no == 0) return((const void *) "immutable string");
218    return(NULL);
219}
220static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
221}
222#endif
223
224#define gen_nb_userdata 3
225
226static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
227    if (no == 0) return((void *) &call_tests);
228    if (no == 1) return((void *) -1);
229    return(NULL);
230}
231static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
232}
233
234
235#define gen_nb_int 4
236
237static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
238    if (no == 0) return(0);
239    if (no == 1) return(1);
240    if (no == 2) return(-1);
241    if (no == 3) return(122);
242    return(-1);
243}
244
245static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
246}
247
248#define gen_nb_parseroptions 5
249
250static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
251    if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
252    if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
253    if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
254    if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
255    return(XML_PARSE_SAX1);
256}
257
258static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
259}
260
261#if 0
262#define gen_nb_long 5
263
264static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
265    if (no == 0) return(0);
266    if (no == 1) return(1);
267    if (no == 2) return(-1);
268    if (no == 3) return(122);
269    return(-1);
270}
271
272static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
273}
274#endif
275
276#define gen_nb_xmlChar 4
277
278static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
279    if (no == 0) return('a');
280    if (no == 1) return(' ');
281    if (no == 2) return('�');
282    return(0);
283}
284
285static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
286}
287
288#define gen_nb_unsigned_int 3
289
290static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
291    if (no == 0) return(0);
292    if (no == 1) return(1);
293    if (no == 2) return(122);
294    return(-1);
295}
296
297static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
298}
299
300#define gen_nb_unsigned_long 4
301
302static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
303    if (no == 0) return(0);
304    if (no == 1) return(1);
305    if (no == 2) return(122);
306    return(-1);
307}
308
309static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
310}
311
312#define gen_nb_double 4
313
314static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
315    if (no == 0) return(0);
316    if (no == 1) return(-1.1);
317#if defined(LIBXML_XPATH_ENABLED)
318    if (no == 2) return(xmlXPathNAN);
319#endif
320    return(-1);
321}
322
323static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
324}
325
326#define gen_nb_unsigned_long_ptr 2
327
328static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
329    if (no == 0) return(&longtab[nr]);
330    return(NULL);
331}
332
333static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
334}
335
336#define gen_nb_int_ptr 2
337
338static int *gen_int_ptr(int no, int nr) {
339    if (no == 0) return(&inttab[nr]);
340    return(NULL);
341}
342
343static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
344}
345
346#define gen_nb_const_char_ptr 4
347
348static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
349    if (no == 0) return((char *) "foo");
350    if (no == 1) return((char *) "<foo/>");
351    if (no == 2) return((char *) "test/ent2");
352    return(NULL);
353}
354static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
355}
356
357#define gen_nb_xmlChar_ptr 2
358
359static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
360    if (no == 0) return(&chartab[0]);
361    return(NULL);
362}
363static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
364}
365
366#define gen_nb_FILE_ptr 2
367
368static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
369    if (no == 0) return(fopen("test.out", "a+"));
370    return(NULL);
371}
372static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
373    if (val != NULL) fclose(val);
374}
375
376#define gen_nb_debug_FILE_ptr 2
377static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
378    return(fopen("test.out", "a+"));
379}
380static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
381    if (val != NULL) fclose(val);
382}
383
384#define gen_nb_const_xmlChar_ptr 5
385
386static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
387    if (no == 0) return((xmlChar *) "foo");
388    if (no == 1) return((xmlChar *) "<foo/>");
389    if (no == 2) return((xmlChar *) "n�ne");
390    if (no == 3) return((xmlChar *) " 2ab ");
391    return(NULL);
392}
393static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
394}
395
396#define gen_nb_filepath 8
397
398static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
399    if (no == 0) return("missing.xml");
400    if (no == 1) return("<foo/>");
401    if (no == 2) return("test/ent2");
402    if (no == 3) return("test/valid/REC-xml-19980210.xml");
403    if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
404    if (no == 5) return(REMOTE1GOOD);
405    if (no == 6) return(REMOTE1BAD);
406    return(NULL);
407}
408static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
409}
410
411#define gen_nb_eaten_name 2
412
413static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
414    if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
415    return(NULL);
416}
417static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
418}
419
420#define gen_nb_fileoutput 6
421
422static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
423    if (no == 0) return("/missing.xml");
424    if (no == 1) return("<foo/>");
425    if (no == 2) return(REMOTE2GOOD);
426    if (no == 3) return(REMOTE1GOOD);
427    if (no == 4) return(REMOTE1BAD);
428    return(NULL);
429}
430static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
431}
432
433#define gen_nb_xmlParserCtxtPtr 3
434static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
435    if (no == 0) return(xmlNewParserCtxt());
436    if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
437    return(NULL);
438}
439static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
440    if (val != NULL)
441        xmlFreeParserCtxt(val);
442}
443
444#define gen_nb_xmlSAXHandlerPtr 2
445static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
446#ifdef LIBXML_SAX1_ENABLED
447    if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
448#endif
449    return(NULL);
450}
451static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
452}
453
454#define gen_nb_xmlValidCtxtPtr 2
455static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
456#ifdef LIBXML_VALID_ENABLED
457    if (no == 0) return(xmlNewValidCtxt());
458#endif
459    return(NULL);
460}
461static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
462#ifdef LIBXML_VALID_ENABLED
463    if (val != NULL)
464        xmlFreeValidCtxt(val);
465#endif
466}
467
468#define gen_nb_xmlParserInputBufferPtr 8
469
470static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
471    if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
472    if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
473    if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
474    if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
475    if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
476    if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
477    if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
478    return(NULL);
479}
480static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
481    xmlFreeParserInputBuffer(val);
482}
483
484#define gen_nb_xmlDocPtr 3
485static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
486    if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
487    if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
488    return(NULL);
489}
490static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
491    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
492        xmlFreeDoc(val);
493}
494
495#define gen_nb_xmlAttrPtr 2
496static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
497    if (no == 0) return(get_api_attr());
498    return(NULL);
499}
500static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
501    if (no == 0) free_api_doc();
502}
503
504#define gen_nb_xmlDictPtr 2
505static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
506    if (no == 0) return(xmlDictCreate());
507    return(NULL);
508}
509static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
510    if (val != NULL)
511        xmlDictFree(val);
512}
513
514#define gen_nb_xmlNodePtr 3
515static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
516    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
517    if (no == 1) return(get_api_root());
518    return(NULL);
519/*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
520}
521static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
522    if (no == 1) {
523        free_api_doc();
524    } else if (val != NULL) {
525        xmlUnlinkNode(val);
526        xmlFreeNode(val);
527    }
528}
529
530#define gen_nb_xmlDtdPtr 3
531static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
532    if (no == 0)
533        return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
534    if (no == 1) return(get_api_dtd());
535    return(NULL);
536}
537static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
538    if (no == 1) free_api_doc();
539    else if (val != NULL) {
540        xmlUnlinkNode((xmlNodePtr) val);
541        xmlFreeNode((xmlNodePtr) val);
542    }
543}
544
545#define gen_nb_xmlNsPtr 2
546static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
547    if (no == 0) return(get_api_ns());
548    return(NULL);
549}
550static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
551    if (no == 0) free_api_doc();
552}
553
554#define gen_nb_xmlNodePtr_in 3
555static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
556    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
557    if (no == 0) return(xmlNewText(BAD_CAST "text"));
558    return(NULL);
559}
560static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
561}
562
563#ifdef LIBXML_WRITER_ENABLED
564#define gen_nb_xmlTextWriterPtr 2
565static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
566    if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
567    return(NULL);
568}
569static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
570    if (val != NULL) xmlFreeTextWriter(val);
571}
572#endif
573
574#ifdef LIBXML_READER_ENABLED
575#define gen_nb_xmlTextReaderPtr 4
576static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
577    if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
578    if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
579    if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
580    return(NULL);
581}
582static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
583    if (val != NULL) xmlFreeTextReader(val);
584}
585#endif
586
587#define gen_nb_xmlBufferPtr 3
588static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
589    if (no == 0) return(xmlBufferCreate());
590    if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
591    return(NULL);
592}
593static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
594    if (val != NULL) {
595        xmlBufferFree(val);
596    }
597}
598
599#define gen_nb_xmlListPtr 2
600static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
601    if (no == 0) return(xmlListCreate(NULL, NULL));
602    return(NULL);
603}
604static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
605    if (val != NULL) {
606        xmlListDelete(val);
607    }
608}
609
610#define gen_nb_xmlHashTablePtr 2
611static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
612    if (no == 0) return(xmlHashCreate(10));
613    return(NULL);
614}
615static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
616    if (val != NULL) {
617        xmlHashFree(val, NULL);
618    }
619}
620
621#include <libxml/xpathInternals.h>
622
623#ifdef LIBXML_XPATH_ENABLED
624#define gen_nb_xmlXPathObjectPtr 5
625static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
626    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
627    if (no == 1) return(xmlXPathNewFloat(1.1));
628    if (no == 2) return(xmlXPathNewBoolean(1));
629    if (no == 3) return(xmlXPathNewNodeSet(NULL));
630    return(NULL);
631}
632static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
633    if (val != NULL) {
634        xmlXPathFreeObject(val);
635    }
636}
637#endif
638
639#ifdef LIBXML_OUTPUT_ENABLED
640#define gen_nb_xmlOutputBufferPtr 2
641static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
642    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
643    return(NULL);
644}
645static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
646    if (val != NULL) {
647        xmlOutputBufferClose(val);
648    }
649}
650#endif
651
652#ifdef LIBXML_FTP_ENABLED
653#define gen_nb_xmlNanoFTPCtxtPtr 4
654static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
655    if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
656    if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
657    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
658    return(NULL);
659}
660static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
661    if (val != NULL) {
662        xmlNanoFTPFreeCtxt(val);
663    }
664}
665#endif
666
667#ifdef LIBXML_HTTP_ENABLED
668#define gen_nb_xmlNanoHTTPCtxtPtr 1
669static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
670    if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
671    if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
672    if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
673    return(NULL);
674}
675static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
676    if (val != NULL) {
677	xmlNanoHTTPClose(val);
678    }
679}
680#endif
681
682#define gen_nb_xmlCharEncoding 4
683static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
684    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
685    if (no == 1) return(XML_CHAR_ENCODING_NONE);
686    if (no == 2) return(XML_CHAR_ENCODING_8859_1);
687    return(XML_CHAR_ENCODING_ERROR);
688}
689static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
690}
691
692#define gen_nb_xmlHashDeallocator 2
693static void
694test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
695}
696
697static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
698    if (no == 0) return(test_xmlHashDeallocator);
699    return(NULL);
700}
701static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
702}
703
704
705static void desret_int(int val ATTRIBUTE_UNUSED) {
706}
707static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
708}
709static void desret_long(long val ATTRIBUTE_UNUSED) {
710}
711static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
712}
713static void desret_double(double val ATTRIBUTE_UNUSED) {
714}
715static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
716}
717#if 0
718static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
719}
720#endif
721static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
722}
723static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
724}
725static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
726}
727static void desret_xmlChar_ptr(xmlChar *val) {
728    if (val != NULL)
729	xmlFree(val);
730}
731static void desret_xmlDocPtr(xmlDocPtr val) {
732    if (val != api_doc)
733	xmlFreeDoc(val);
734}
735static void desret_xmlDictPtr(xmlDictPtr val) {
736    xmlDictFree(val);
737}
738#ifdef LIBXML_OUTPUT_ENABLED
739static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
740    xmlOutputBufferClose(val);
741}
742#endif
743#ifdef LIBXML_READER_ENABLED
744static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
745    xmlFreeTextReader(val);
746}
747#endif
748static void desret_xmlNodePtr(xmlNodePtr val) {
749    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
750	xmlUnlinkNode(val);
751	xmlFreeNode(val);
752    }
753}
754static void desret_xmlAttrPtr(xmlAttrPtr val) {
755    if (val != NULL) {
756	xmlUnlinkNode((xmlNodePtr) val);
757	xmlFreeNode((xmlNodePtr) val);
758    }
759}
760static void desret_xmlEntityPtr(xmlEntityPtr val) {
761    if (val != NULL) {
762	xmlUnlinkNode((xmlNodePtr) val);
763	xmlFreeNode((xmlNodePtr) val);
764    }
765}
766static void desret_xmlElementPtr(xmlElementPtr val) {
767    if (val != NULL) {
768	xmlUnlinkNode((xmlNodePtr) val);
769    }
770}
771static void desret_xmlAttributePtr(xmlAttributePtr val) {
772    if (val != NULL) {
773	xmlUnlinkNode((xmlNodePtr) val);
774    }
775}
776static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
777}
778static void desret_xmlDtdPtr(xmlDtdPtr val) {
779    desret_xmlNodePtr((xmlNodePtr)val);
780}
781#ifdef LIBXML_XPATH_ENABLED
782static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
783    xmlXPathFreeObject(val);
784}
785static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
786    xmlXPathFreeNodeSet(val);
787}
788#endif
789static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
790    xmlFreeParserCtxt(val);
791}
792static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
793    xmlFreeParserInputBuffer(val);
794}
795static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
796    xmlFreeInputStream(val);
797}
798#ifdef LIBXML_WRITER_ENABLED
799static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
800    xmlFreeTextWriter(val);
801}
802#endif
803static void desret_xmlBufferPtr(xmlBufferPtr val) {
804    xmlBufferFree(val);
805}
806#ifdef LIBXML_SCHEMAS_ENABLED
807static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
808    xmlSchemaFreeParserCtxt(val);
809}
810static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
811}
812static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
813    xmlRelaxNGFreeParserCtxt(val);
814}
815#endif
816#ifdef LIBXML_HTML_ENABLED
817static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
818}
819#endif
820#ifdef LIBXML_HTTP_ENABLED
821static void desret_xmlNanoHTTPCtxtPtr(void *val) {
822    xmlNanoHTTPClose(val);
823}
824#endif
825#ifdef LIBXML_FTP_ENABLED
826static void desret_xmlNanoFTPCtxtPtr(void *val) {
827    xmlNanoFTPClose(val);
828}
829#endif
830/* cut and pasted from autogenerated to avoid troubles */
831#define gen_nb_const_xmlChar_ptr_ptr 1
832static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
833    return(NULL);
834}
835static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
836}
837
838#define gen_nb_unsigned_char_ptr 1
839static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
840    return(NULL);
841}
842static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
843}
844
845#define gen_nb_const_unsigned_char_ptr 1
846static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
847    return(NULL);
848}
849static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
850}
851
852#ifdef LIBXML_HTML_ENABLED
853#define gen_nb_const_htmlNodePtr 1
854static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
855    return(NULL);
856}
857static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
858}
859#endif
860
861#ifdef LIBXML_HTML_ENABLED
862#define gen_nb_htmlDocPtr 3
863static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
864    if (no == 0) return(htmlNewDoc(NULL, NULL));
865    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
866    return(NULL);
867}
868static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
869    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
870        xmlFreeDoc(val);
871}
872static void desret_htmlDocPtr(htmlDocPtr val) {
873    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
874        xmlFreeDoc(val);
875}
876#define gen_nb_htmlParserCtxtPtr 3
877static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
878    if (no == 0) return(xmlNewParserCtxt());
879    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
880    return(NULL);
881}
882static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
883    if (val != NULL)
884        htmlFreeParserCtxt(val);
885}
886static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
887    if (val != NULL)
888        htmlFreeParserCtxt(val);
889}
890#endif
891
892#ifdef LIBXML_XPATH_ENABLED
893#define gen_nb_xmlNodeSetPtr 1
894static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
895    return(NULL);
896}
897static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
898}
899#endif
900
901#ifdef LIBXML_DEBUG_ENABLED
902#ifdef LIBXML_XPATH_ENABLED
903#define gen_nb_xmlShellCtxtPtr 1
904static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
905    return(NULL);
906}
907static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
908}
909#endif
910#endif
911
912#ifdef LIBXML_PATTERN_ENABLED
913#define gen_nb_xmlPatternPtr 1
914static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
915    return(NULL);
916}
917static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
918}
919#endif
920
921#define gen_nb_xmlElementContentPtr 1
922static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
923    return(NULL);
924}
925static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
926    if (val != NULL)
927        xmlFreeElementContent(val);
928}
929static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
930    if (val != NULL)
931        xmlFreeElementContent(val);
932}
933
934#define gen_nb_xmlParserNodeInfoSeqPtr 1
935static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
936    return(NULL);
937}
938static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
939}
940
941static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
942}
943
944/************************************************************************
945 *									*
946 *   WARNING: end of the manually maintained part of the test code	*
947 *            do not remove or alter the CUT HERE line			*
948 *									*
949 ************************************************************************/
950
951/* CUT HERE: everything below that line is generated */
952#ifdef LIBXML_HTML_ENABLED
953static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
954}
955
956#endif
957
958#define gen_nb_xmlAttributeDefault 4
959static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
960    if (no == 1) return(XML_ATTRIBUTE_FIXED);
961    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
962    if (no == 3) return(XML_ATTRIBUTE_NONE);
963    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
964    return(0);
965}
966
967static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
968}
969
970#define gen_nb_xmlAttributeType 4
971static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
972    if (no == 1) return(XML_ATTRIBUTE_CDATA);
973    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
974    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
975    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
976    return(0);
977}
978
979static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
980}
981
982#define gen_nb_xmlBufferAllocationScheme 3
983static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
984    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
985    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
986    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
987    return(0);
988}
989
990static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
991}
992
993static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
994}
995
996#ifdef LIBXML_CATALOG_ENABLED
997#define gen_nb_xmlCatalogAllow 4
998static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
999    if (no == 1) return(XML_CATA_ALLOW_ALL);
1000    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1001    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1002    if (no == 4) return(XML_CATA_ALLOW_NONE);
1003    return(0);
1004}
1005
1006static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1007}
1008
1009static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1010}
1011
1012#endif
1013
1014#ifdef LIBXML_CATALOG_ENABLED
1015#define gen_nb_xmlCatalogPrefer 3
1016static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1017    if (no == 1) return(XML_CATA_PREFER_NONE);
1018    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1019    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1020    return(0);
1021}
1022
1023static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1024}
1025
1026static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1027}
1028
1029#endif
1030
1031#define gen_nb_xmlElementContentType 4
1032static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1033    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1034    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1035    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1036    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1037    return(0);
1038}
1039
1040static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1041}
1042
1043#define gen_nb_xmlElementTypeVal 4
1044static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1045    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1046    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1047    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1048    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1049    return(0);
1050}
1051
1052static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1053}
1054
1055static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1056}
1057
1058#ifdef LIBXML_SCHEMAS_ENABLED
1059#define gen_nb_xmlSchemaValType 4
1060static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1061    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1062    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1063    if (no == 3) return(XML_SCHEMAS_ANYURI);
1064    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1065    return(0);
1066}
1067
1068static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1069}
1070
1071static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1072}
1073
1074#endif
1075
1076#ifdef LIBXML_SCHEMAS_ENABLED
1077#define gen_nb_xmlSchemaWhitespaceValueType 4
1078static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1079    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1080    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1081    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1082    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1083    return(0);
1084}
1085
1086static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1087}
1088
1089#endif
1090
1091#include <libxml/HTMLparser.h>
1092#include <libxml/HTMLtree.h>
1093#include <libxml/SAX2.h>
1094#include <libxml/c14n.h>
1095#include <libxml/catalog.h>
1096#include <libxml/chvalid.h>
1097#include <libxml/debugXML.h>
1098#include <libxml/dict.h>
1099#include <libxml/encoding.h>
1100#include <libxml/entities.h>
1101#include <libxml/hash.h>
1102#include <libxml/list.h>
1103#include <libxml/nanoftp.h>
1104#include <libxml/nanohttp.h>
1105#include <libxml/parser.h>
1106#include <libxml/parserInternals.h>
1107#include <libxml/pattern.h>
1108#include <libxml/relaxng.h>
1109#include <libxml/schemasInternals.h>
1110#include <libxml/schematron.h>
1111#include <libxml/tree.h>
1112#include <libxml/uri.h>
1113#include <libxml/valid.h>
1114#include <libxml/xinclude.h>
1115#include <libxml/xmlIO.h>
1116#include <libxml/xmlautomata.h>
1117#include <libxml/xmlerror.h>
1118#include <libxml/xmlmodule.h>
1119#include <libxml/xmlreader.h>
1120#include <libxml/xmlregexp.h>
1121#include <libxml/xmlsave.h>
1122#include <libxml/xmlschemas.h>
1123#include <libxml/xmlschemastypes.h>
1124#include <libxml/xmlstring.h>
1125#include <libxml/xmlunicode.h>
1126#include <libxml/xmlwriter.h>
1127#include <libxml/xpath.h>
1128#include <libxml/xpathInternals.h>
1129#include <libxml/xpointer.h>
1130static int test_HTMLparser(void);
1131static int test_HTMLtree(void);
1132static int test_SAX2(void);
1133static int test_c14n(void);
1134static int test_catalog(void);
1135static int test_chvalid(void);
1136static int test_debugXML(void);
1137static int test_dict(void);
1138static int test_encoding(void);
1139static int test_entities(void);
1140static int test_hash(void);
1141static int test_list(void);
1142static int test_nanoftp(void);
1143static int test_nanohttp(void);
1144static int test_parser(void);
1145static int test_parserInternals(void);
1146static int test_pattern(void);
1147static int test_relaxng(void);
1148static int test_schemasInternals(void);
1149static int test_schematron(void);
1150static int test_tree(void);
1151static int test_uri(void);
1152static int test_valid(void);
1153static int test_xinclude(void);
1154static int test_xmlIO(void);
1155static int test_xmlautomata(void);
1156static int test_xmlerror(void);
1157static int test_xmlmodule(void);
1158static int test_xmlreader(void);
1159static int test_xmlregexp(void);
1160static int test_xmlsave(void);
1161static int test_xmlschemas(void);
1162static int test_xmlschemastypes(void);
1163static int test_xmlstring(void);
1164static int test_xmlunicode(void);
1165static int test_xmlwriter(void);
1166static int test_xpath(void);
1167static int test_xpathInternals(void);
1168static int test_xpointer(void);
1169
1170/**
1171 * testlibxml2:
1172 *
1173 * Main entry point of the tester for the full libxml2 module,
1174 * it calls all the tester entry point for each module.
1175 *
1176 * Returns the number of error found
1177 */
1178static int
1179testlibxml2(void)
1180{
1181    int test_ret = 0;
1182
1183    test_ret += test_HTMLparser();
1184    test_ret += test_HTMLtree();
1185    test_ret += test_SAX2();
1186    test_ret += test_c14n();
1187    test_ret += test_catalog();
1188    test_ret += test_chvalid();
1189    test_ret += test_debugXML();
1190    test_ret += test_dict();
1191    test_ret += test_encoding();
1192    test_ret += test_entities();
1193    test_ret += test_hash();
1194    test_ret += test_list();
1195    test_ret += test_nanoftp();
1196    test_ret += test_nanohttp();
1197    test_ret += test_parser();
1198    test_ret += test_parserInternals();
1199    test_ret += test_pattern();
1200    test_ret += test_relaxng();
1201    test_ret += test_schemasInternals();
1202    test_ret += test_schematron();
1203    test_ret += test_tree();
1204    test_ret += test_uri();
1205    test_ret += test_valid();
1206    test_ret += test_xinclude();
1207    test_ret += test_xmlIO();
1208    test_ret += test_xmlautomata();
1209    test_ret += test_xmlerror();
1210    test_ret += test_xmlmodule();
1211    test_ret += test_xmlreader();
1212    test_ret += test_xmlregexp();
1213    test_ret += test_xmlsave();
1214    test_ret += test_xmlschemas();
1215    test_ret += test_xmlschemastypes();
1216    test_ret += test_xmlstring();
1217    test_ret += test_xmlunicode();
1218    test_ret += test_xmlwriter();
1219    test_ret += test_xpath();
1220    test_ret += test_xpathInternals();
1221    test_ret += test_xpointer();
1222
1223    printf("Total: %d functions, %d tests, %d errors\n",
1224           function_tests, call_tests, test_ret);
1225    return(test_ret);
1226}
1227
1228
1229static int
1230test_UTF8ToHtml(void) {
1231    int test_ret = 0;
1232
1233#if defined(LIBXML_HTML_ENABLED)
1234    int mem_base;
1235    int ret_val;
1236    unsigned char * out; /* a pointer to an array of bytes to store the result */
1237    int n_out;
1238    int * outlen; /* the length of @out */
1239    int n_outlen;
1240    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1241    int n_in;
1242    int * inlen; /* the length of @in */
1243    int n_inlen;
1244
1245    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1246    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1247    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1248    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1249        mem_base = xmlMemBlocks();
1250        out = gen_unsigned_char_ptr(n_out, 0);
1251        outlen = gen_int_ptr(n_outlen, 1);
1252        in = gen_const_unsigned_char_ptr(n_in, 2);
1253        inlen = gen_int_ptr(n_inlen, 3);
1254
1255        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1256        desret_int(ret_val);
1257        call_tests++;
1258        des_unsigned_char_ptr(n_out, out, 0);
1259        des_int_ptr(n_outlen, outlen, 1);
1260        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1261        des_int_ptr(n_inlen, inlen, 3);
1262        xmlResetLastError();
1263        if (mem_base != xmlMemBlocks()) {
1264            printf("Leak of %d blocks found in UTF8ToHtml",
1265	           xmlMemBlocks() - mem_base);
1266	    test_ret++;
1267            printf(" %d", n_out);
1268            printf(" %d", n_outlen);
1269            printf(" %d", n_in);
1270            printf(" %d", n_inlen);
1271            printf("\n");
1272        }
1273    }
1274    }
1275    }
1276    }
1277    function_tests++;
1278#endif
1279
1280    return(test_ret);
1281}
1282
1283#ifdef LIBXML_HTML_ENABLED
1284
1285#define gen_nb_const_htmlElemDesc_ptr 1
1286static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1287    return(NULL);
1288}
1289static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1290}
1291#endif
1292
1293
1294static int
1295test_htmlAttrAllowed(void) {
1296    int test_ret = 0;
1297
1298#if defined(LIBXML_HTML_ENABLED)
1299    int mem_base;
1300    htmlStatus ret_val;
1301    htmlElemDesc * elt; /* HTML element */
1302    int n_elt;
1303    xmlChar * attr; /* HTML attribute */
1304    int n_attr;
1305    int legacy; /* whether to allow deprecated attributes */
1306    int n_legacy;
1307
1308    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1309    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1310    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1311        mem_base = xmlMemBlocks();
1312        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1313        attr = gen_const_xmlChar_ptr(n_attr, 1);
1314        legacy = gen_int(n_legacy, 2);
1315
1316        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1317        desret_htmlStatus(ret_val);
1318        call_tests++;
1319        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1320        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1321        des_int(n_legacy, legacy, 2);
1322        xmlResetLastError();
1323        if (mem_base != xmlMemBlocks()) {
1324            printf("Leak of %d blocks found in htmlAttrAllowed",
1325	           xmlMemBlocks() - mem_base);
1326	    test_ret++;
1327            printf(" %d", n_elt);
1328            printf(" %d", n_attr);
1329            printf(" %d", n_legacy);
1330            printf("\n");
1331        }
1332    }
1333    }
1334    }
1335    function_tests++;
1336#endif
1337
1338    return(test_ret);
1339}
1340
1341#ifdef LIBXML_HTML_ENABLED
1342
1343#define gen_nb_htmlNodePtr 1
1344static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1345    return(NULL);
1346}
1347static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1348}
1349#endif
1350
1351
1352static int
1353test_htmlAutoCloseTag(void) {
1354    int test_ret = 0;
1355
1356#if defined(LIBXML_HTML_ENABLED)
1357    int mem_base;
1358    int ret_val;
1359    htmlDocPtr doc; /* the HTML document */
1360    int n_doc;
1361    xmlChar * name; /* The tag name */
1362    int n_name;
1363    htmlNodePtr elem; /* the HTML element */
1364    int n_elem;
1365
1366    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1367    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1368    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1369        mem_base = xmlMemBlocks();
1370        doc = gen_htmlDocPtr(n_doc, 0);
1371        name = gen_const_xmlChar_ptr(n_name, 1);
1372        elem = gen_htmlNodePtr(n_elem, 2);
1373
1374        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1375        desret_int(ret_val);
1376        call_tests++;
1377        des_htmlDocPtr(n_doc, doc, 0);
1378        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1379        des_htmlNodePtr(n_elem, elem, 2);
1380        xmlResetLastError();
1381        if (mem_base != xmlMemBlocks()) {
1382            printf("Leak of %d blocks found in htmlAutoCloseTag",
1383	           xmlMemBlocks() - mem_base);
1384	    test_ret++;
1385            printf(" %d", n_doc);
1386            printf(" %d", n_name);
1387            printf(" %d", n_elem);
1388            printf("\n");
1389        }
1390    }
1391    }
1392    }
1393    function_tests++;
1394#endif
1395
1396    return(test_ret);
1397}
1398
1399
1400static int
1401test_htmlCreateMemoryParserCtxt(void) {
1402    int test_ret = 0;
1403
1404#if defined(LIBXML_HTML_ENABLED)
1405    int mem_base;
1406    htmlParserCtxtPtr ret_val;
1407    char * buffer; /* a pointer to a char array */
1408    int n_buffer;
1409    int size; /* the size of the array */
1410    int n_size;
1411
1412    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1413    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1414        mem_base = xmlMemBlocks();
1415        buffer = gen_const_char_ptr(n_buffer, 0);
1416        size = gen_int(n_size, 1);
1417
1418        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1419        desret_htmlParserCtxtPtr(ret_val);
1420        call_tests++;
1421        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1422        des_int(n_size, size, 1);
1423        xmlResetLastError();
1424        if (mem_base != xmlMemBlocks()) {
1425            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1426	           xmlMemBlocks() - mem_base);
1427	    test_ret++;
1428            printf(" %d", n_buffer);
1429            printf(" %d", n_size);
1430            printf("\n");
1431        }
1432    }
1433    }
1434    function_tests++;
1435#endif
1436
1437    return(test_ret);
1438}
1439
1440#ifdef LIBXML_HTML_ENABLED
1441
1442#define gen_nb_htmlSAXHandlerPtr 1
1443static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1444    return(NULL);
1445}
1446static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1447}
1448#endif
1449
1450
1451static int
1452test_htmlCreatePushParserCtxt(void) {
1453    int test_ret = 0;
1454
1455#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1456    int mem_base;
1457    htmlParserCtxtPtr ret_val;
1458    htmlSAXHandlerPtr sax; /* a SAX handler */
1459    int n_sax;
1460    void * user_data; /* The user data returned on SAX callbacks */
1461    int n_user_data;
1462    char * chunk; /* a pointer to an array of chars */
1463    int n_chunk;
1464    int size; /* number of chars in the array */
1465    int n_size;
1466    const char * filename; /* an optional file name or URI */
1467    int n_filename;
1468    xmlCharEncoding enc; /* an optional encoding */
1469    int n_enc;
1470
1471    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1472    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1473    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1474    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1475    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1476    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1477        mem_base = xmlMemBlocks();
1478        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1479        user_data = gen_userdata(n_user_data, 1);
1480        chunk = gen_const_char_ptr(n_chunk, 2);
1481        size = gen_int(n_size, 3);
1482        filename = gen_fileoutput(n_filename, 4);
1483        enc = gen_xmlCharEncoding(n_enc, 5);
1484
1485        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1486        desret_htmlParserCtxtPtr(ret_val);
1487        call_tests++;
1488        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1489        des_userdata(n_user_data, user_data, 1);
1490        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1491        des_int(n_size, size, 3);
1492        des_fileoutput(n_filename, filename, 4);
1493        des_xmlCharEncoding(n_enc, enc, 5);
1494        xmlResetLastError();
1495        if (mem_base != xmlMemBlocks()) {
1496            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1497	           xmlMemBlocks() - mem_base);
1498	    test_ret++;
1499            printf(" %d", n_sax);
1500            printf(" %d", n_user_data);
1501            printf(" %d", n_chunk);
1502            printf(" %d", n_size);
1503            printf(" %d", n_filename);
1504            printf(" %d", n_enc);
1505            printf("\n");
1506        }
1507    }
1508    }
1509    }
1510    }
1511    }
1512    }
1513    function_tests++;
1514#endif
1515
1516    return(test_ret);
1517}
1518
1519
1520static int
1521test_htmlCtxtReadDoc(void) {
1522    int test_ret = 0;
1523
1524#if defined(LIBXML_HTML_ENABLED)
1525    int mem_base;
1526    htmlDocPtr ret_val;
1527    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1528    int n_ctxt;
1529    xmlChar * cur; /* a pointer to a zero terminated string */
1530    int n_cur;
1531    const char * URL; /* the base URL to use for the document */
1532    int n_URL;
1533    char * encoding; /* the document encoding, or NULL */
1534    int n_encoding;
1535    int options; /* a combination of htmlParserOption(s) */
1536    int n_options;
1537
1538    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1539    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1540    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1541    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1542    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1543        mem_base = xmlMemBlocks();
1544        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1545        cur = gen_const_xmlChar_ptr(n_cur, 1);
1546        URL = gen_filepath(n_URL, 2);
1547        encoding = gen_const_char_ptr(n_encoding, 3);
1548        options = gen_int(n_options, 4);
1549
1550        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1551        desret_htmlDocPtr(ret_val);
1552        call_tests++;
1553        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1554        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1555        des_filepath(n_URL, URL, 2);
1556        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1557        des_int(n_options, options, 4);
1558        xmlResetLastError();
1559        if (mem_base != xmlMemBlocks()) {
1560            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1561	           xmlMemBlocks() - mem_base);
1562	    test_ret++;
1563            printf(" %d", n_ctxt);
1564            printf(" %d", n_cur);
1565            printf(" %d", n_URL);
1566            printf(" %d", n_encoding);
1567            printf(" %d", n_options);
1568            printf("\n");
1569        }
1570    }
1571    }
1572    }
1573    }
1574    }
1575    function_tests++;
1576#endif
1577
1578    return(test_ret);
1579}
1580
1581
1582static int
1583test_htmlCtxtReadFile(void) {
1584    int test_ret = 0;
1585
1586#if defined(LIBXML_HTML_ENABLED)
1587    htmlDocPtr ret_val;
1588    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1589    int n_ctxt;
1590    const char * filename; /* a file or URL */
1591    int n_filename;
1592    char * encoding; /* the document encoding, or NULL */
1593    int n_encoding;
1594    int options; /* a combination of htmlParserOption(s) */
1595    int n_options;
1596
1597    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1598    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1599    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1600    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1601        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1602        filename = gen_filepath(n_filename, 1);
1603        encoding = gen_const_char_ptr(n_encoding, 2);
1604        options = gen_int(n_options, 3);
1605
1606        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1607        desret_htmlDocPtr(ret_val);
1608        call_tests++;
1609        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1610        des_filepath(n_filename, filename, 1);
1611        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1612        des_int(n_options, options, 3);
1613        xmlResetLastError();
1614    }
1615    }
1616    }
1617    }
1618    function_tests++;
1619#endif
1620
1621    return(test_ret);
1622}
1623
1624
1625static int
1626test_htmlCtxtReadMemory(void) {
1627    int test_ret = 0;
1628
1629#if defined(LIBXML_HTML_ENABLED)
1630    int mem_base;
1631    htmlDocPtr ret_val;
1632    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1633    int n_ctxt;
1634    char * buffer; /* a pointer to a char array */
1635    int n_buffer;
1636    int size; /* the size of the array */
1637    int n_size;
1638    const char * URL; /* the base URL to use for the document */
1639    int n_URL;
1640    char * encoding; /* the document encoding, or NULL */
1641    int n_encoding;
1642    int options; /* a combination of htmlParserOption(s) */
1643    int n_options;
1644
1645    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1646    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1647    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1648    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1649    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1650    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1651        mem_base = xmlMemBlocks();
1652        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1653        buffer = gen_const_char_ptr(n_buffer, 1);
1654        size = gen_int(n_size, 2);
1655        URL = gen_filepath(n_URL, 3);
1656        encoding = gen_const_char_ptr(n_encoding, 4);
1657        options = gen_int(n_options, 5);
1658
1659        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1660        desret_htmlDocPtr(ret_val);
1661        call_tests++;
1662        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1663        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1664        des_int(n_size, size, 2);
1665        des_filepath(n_URL, URL, 3);
1666        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1667        des_int(n_options, options, 5);
1668        xmlResetLastError();
1669        if (mem_base != xmlMemBlocks()) {
1670            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1671	           xmlMemBlocks() - mem_base);
1672	    test_ret++;
1673            printf(" %d", n_ctxt);
1674            printf(" %d", n_buffer);
1675            printf(" %d", n_size);
1676            printf(" %d", n_URL);
1677            printf(" %d", n_encoding);
1678            printf(" %d", n_options);
1679            printf("\n");
1680        }
1681    }
1682    }
1683    }
1684    }
1685    }
1686    }
1687    function_tests++;
1688#endif
1689
1690    return(test_ret);
1691}
1692
1693
1694static int
1695test_htmlCtxtReset(void) {
1696    int test_ret = 0;
1697
1698#if defined(LIBXML_HTML_ENABLED)
1699    int mem_base;
1700    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1701    int n_ctxt;
1702
1703    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1704        mem_base = xmlMemBlocks();
1705        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1706
1707        htmlCtxtReset(ctxt);
1708        call_tests++;
1709        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1710        xmlResetLastError();
1711        if (mem_base != xmlMemBlocks()) {
1712            printf("Leak of %d blocks found in htmlCtxtReset",
1713	           xmlMemBlocks() - mem_base);
1714	    test_ret++;
1715            printf(" %d", n_ctxt);
1716            printf("\n");
1717        }
1718    }
1719    function_tests++;
1720#endif
1721
1722    return(test_ret);
1723}
1724
1725
1726static int
1727test_htmlCtxtUseOptions(void) {
1728    int test_ret = 0;
1729
1730#if defined(LIBXML_HTML_ENABLED)
1731    int mem_base;
1732    int ret_val;
1733    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1734    int n_ctxt;
1735    int options; /* a combination of htmlParserOption(s) */
1736    int n_options;
1737
1738    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1739    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1740        mem_base = xmlMemBlocks();
1741        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1742        options = gen_int(n_options, 1);
1743
1744        ret_val = htmlCtxtUseOptions(ctxt, options);
1745        desret_int(ret_val);
1746        call_tests++;
1747        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1748        des_int(n_options, options, 1);
1749        xmlResetLastError();
1750        if (mem_base != xmlMemBlocks()) {
1751            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1752	           xmlMemBlocks() - mem_base);
1753	    test_ret++;
1754            printf(" %d", n_ctxt);
1755            printf(" %d", n_options);
1756            printf("\n");
1757        }
1758    }
1759    }
1760    function_tests++;
1761#endif
1762
1763    return(test_ret);
1764}
1765
1766
1767static int
1768test_htmlElementAllowedHere(void) {
1769    int test_ret = 0;
1770
1771#if defined(LIBXML_HTML_ENABLED)
1772    int mem_base;
1773    int ret_val;
1774    htmlElemDesc * parent; /* HTML parent element */
1775    int n_parent;
1776    xmlChar * elt; /* HTML element */
1777    int n_elt;
1778
1779    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1780    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1781        mem_base = xmlMemBlocks();
1782        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1783        elt = gen_const_xmlChar_ptr(n_elt, 1);
1784
1785        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1786        desret_int(ret_val);
1787        call_tests++;
1788        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1789        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1790        xmlResetLastError();
1791        if (mem_base != xmlMemBlocks()) {
1792            printf("Leak of %d blocks found in htmlElementAllowedHere",
1793	           xmlMemBlocks() - mem_base);
1794	    test_ret++;
1795            printf(" %d", n_parent);
1796            printf(" %d", n_elt);
1797            printf("\n");
1798        }
1799    }
1800    }
1801    function_tests++;
1802#endif
1803
1804    return(test_ret);
1805}
1806
1807
1808static int
1809test_htmlElementStatusHere(void) {
1810    int test_ret = 0;
1811
1812#if defined(LIBXML_HTML_ENABLED)
1813    int mem_base;
1814    htmlStatus ret_val;
1815    htmlElemDesc * parent; /* HTML parent element */
1816    int n_parent;
1817    htmlElemDesc * elt; /* HTML element */
1818    int n_elt;
1819
1820    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1821    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1822        mem_base = xmlMemBlocks();
1823        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1824        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1825
1826        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1827        desret_htmlStatus(ret_val);
1828        call_tests++;
1829        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1830        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1831        xmlResetLastError();
1832        if (mem_base != xmlMemBlocks()) {
1833            printf("Leak of %d blocks found in htmlElementStatusHere",
1834	           xmlMemBlocks() - mem_base);
1835	    test_ret++;
1836            printf(" %d", n_parent);
1837            printf(" %d", n_elt);
1838            printf("\n");
1839        }
1840    }
1841    }
1842    function_tests++;
1843#endif
1844
1845    return(test_ret);
1846}
1847
1848
1849static int
1850test_htmlEncodeEntities(void) {
1851    int test_ret = 0;
1852
1853#if defined(LIBXML_HTML_ENABLED)
1854    int mem_base;
1855    int ret_val;
1856    unsigned char * out; /* a pointer to an array of bytes to store the result */
1857    int n_out;
1858    int * outlen; /* the length of @out */
1859    int n_outlen;
1860    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1861    int n_in;
1862    int * inlen; /* the length of @in */
1863    int n_inlen;
1864    int quoteChar; /* the quote character to escape (' or ") or zero. */
1865    int n_quoteChar;
1866
1867    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1868    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1869    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1870    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1871    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1872        mem_base = xmlMemBlocks();
1873        out = gen_unsigned_char_ptr(n_out, 0);
1874        outlen = gen_int_ptr(n_outlen, 1);
1875        in = gen_const_unsigned_char_ptr(n_in, 2);
1876        inlen = gen_int_ptr(n_inlen, 3);
1877        quoteChar = gen_int(n_quoteChar, 4);
1878
1879        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1880        desret_int(ret_val);
1881        call_tests++;
1882        des_unsigned_char_ptr(n_out, out, 0);
1883        des_int_ptr(n_outlen, outlen, 1);
1884        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1885        des_int_ptr(n_inlen, inlen, 3);
1886        des_int(n_quoteChar, quoteChar, 4);
1887        xmlResetLastError();
1888        if (mem_base != xmlMemBlocks()) {
1889            printf("Leak of %d blocks found in htmlEncodeEntities",
1890	           xmlMemBlocks() - mem_base);
1891	    test_ret++;
1892            printf(" %d", n_out);
1893            printf(" %d", n_outlen);
1894            printf(" %d", n_in);
1895            printf(" %d", n_inlen);
1896            printf(" %d", n_quoteChar);
1897            printf("\n");
1898        }
1899    }
1900    }
1901    }
1902    }
1903    }
1904    function_tests++;
1905#endif
1906
1907    return(test_ret);
1908}
1909
1910
1911static int
1912test_htmlEntityLookup(void) {
1913    int test_ret = 0;
1914
1915#if defined(LIBXML_HTML_ENABLED)
1916    int mem_base;
1917    const htmlEntityDesc * ret_val;
1918    xmlChar * name; /* the entity name */
1919    int n_name;
1920
1921    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1922        mem_base = xmlMemBlocks();
1923        name = gen_const_xmlChar_ptr(n_name, 0);
1924
1925        ret_val = htmlEntityLookup((const xmlChar *)name);
1926        desret_const_htmlEntityDesc_ptr(ret_val);
1927        call_tests++;
1928        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1929        xmlResetLastError();
1930        if (mem_base != xmlMemBlocks()) {
1931            printf("Leak of %d blocks found in htmlEntityLookup",
1932	           xmlMemBlocks() - mem_base);
1933	    test_ret++;
1934            printf(" %d", n_name);
1935            printf("\n");
1936        }
1937    }
1938    function_tests++;
1939#endif
1940
1941    return(test_ret);
1942}
1943
1944
1945static int
1946test_htmlEntityValueLookup(void) {
1947    int test_ret = 0;
1948
1949#if defined(LIBXML_HTML_ENABLED)
1950    int mem_base;
1951    const htmlEntityDesc * ret_val;
1952    unsigned int value; /* the entity's unicode value */
1953    int n_value;
1954
1955    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
1956        mem_base = xmlMemBlocks();
1957        value = gen_unsigned_int(n_value, 0);
1958
1959        ret_val = htmlEntityValueLookup(value);
1960        desret_const_htmlEntityDesc_ptr(ret_val);
1961        call_tests++;
1962        des_unsigned_int(n_value, value, 0);
1963        xmlResetLastError();
1964        if (mem_base != xmlMemBlocks()) {
1965            printf("Leak of %d blocks found in htmlEntityValueLookup",
1966	           xmlMemBlocks() - mem_base);
1967	    test_ret++;
1968            printf(" %d", n_value);
1969            printf("\n");
1970        }
1971    }
1972    function_tests++;
1973#endif
1974
1975    return(test_ret);
1976}
1977
1978
1979static int
1980test_htmlHandleOmittedElem(void) {
1981    int test_ret = 0;
1982
1983#if defined(LIBXML_HTML_ENABLED)
1984    int mem_base;
1985    int ret_val;
1986    int val; /* int 0 or 1 */
1987    int n_val;
1988
1989    for (n_val = 0;n_val < gen_nb_int;n_val++) {
1990        mem_base = xmlMemBlocks();
1991        val = gen_int(n_val, 0);
1992
1993        ret_val = htmlHandleOmittedElem(val);
1994        desret_int(ret_val);
1995        call_tests++;
1996        des_int(n_val, val, 0);
1997        xmlResetLastError();
1998        if (mem_base != xmlMemBlocks()) {
1999            printf("Leak of %d blocks found in htmlHandleOmittedElem",
2000	           xmlMemBlocks() - mem_base);
2001	    test_ret++;
2002            printf(" %d", n_val);
2003            printf("\n");
2004        }
2005    }
2006    function_tests++;
2007#endif
2008
2009    return(test_ret);
2010}
2011
2012
2013static int
2014test_htmlIsAutoClosed(void) {
2015    int test_ret = 0;
2016
2017#if defined(LIBXML_HTML_ENABLED)
2018    int mem_base;
2019    int ret_val;
2020    htmlDocPtr doc; /* the HTML document */
2021    int n_doc;
2022    htmlNodePtr elem; /* the HTML element */
2023    int n_elem;
2024
2025    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2026    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2027        mem_base = xmlMemBlocks();
2028        doc = gen_htmlDocPtr(n_doc, 0);
2029        elem = gen_htmlNodePtr(n_elem, 1);
2030
2031        ret_val = htmlIsAutoClosed(doc, elem);
2032        desret_int(ret_val);
2033        call_tests++;
2034        des_htmlDocPtr(n_doc, doc, 0);
2035        des_htmlNodePtr(n_elem, elem, 1);
2036        xmlResetLastError();
2037        if (mem_base != xmlMemBlocks()) {
2038            printf("Leak of %d blocks found in htmlIsAutoClosed",
2039	           xmlMemBlocks() - mem_base);
2040	    test_ret++;
2041            printf(" %d", n_doc);
2042            printf(" %d", n_elem);
2043            printf("\n");
2044        }
2045    }
2046    }
2047    function_tests++;
2048#endif
2049
2050    return(test_ret);
2051}
2052
2053
2054static int
2055test_htmlIsScriptAttribute(void) {
2056    int test_ret = 0;
2057
2058#if defined(LIBXML_HTML_ENABLED)
2059    int mem_base;
2060    int ret_val;
2061    xmlChar * name; /* an attribute name */
2062    int n_name;
2063
2064    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2065        mem_base = xmlMemBlocks();
2066        name = gen_const_xmlChar_ptr(n_name, 0);
2067
2068        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2069        desret_int(ret_val);
2070        call_tests++;
2071        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2072        xmlResetLastError();
2073        if (mem_base != xmlMemBlocks()) {
2074            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2075	           xmlMemBlocks() - mem_base);
2076	    test_ret++;
2077            printf(" %d", n_name);
2078            printf("\n");
2079        }
2080    }
2081    function_tests++;
2082#endif
2083
2084    return(test_ret);
2085}
2086
2087
2088static int
2089test_htmlNodeStatus(void) {
2090    int test_ret = 0;
2091
2092#if defined(LIBXML_HTML_ENABLED)
2093    int mem_base;
2094    htmlStatus ret_val;
2095    htmlNodePtr node; /* an htmlNodePtr in a tree */
2096    int n_node;
2097    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2098    int n_legacy;
2099
2100    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2101    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2102        mem_base = xmlMemBlocks();
2103        node = gen_const_htmlNodePtr(n_node, 0);
2104        legacy = gen_int(n_legacy, 1);
2105
2106        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2107        desret_htmlStatus(ret_val);
2108        call_tests++;
2109        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2110        des_int(n_legacy, legacy, 1);
2111        xmlResetLastError();
2112        if (mem_base != xmlMemBlocks()) {
2113            printf("Leak of %d blocks found in htmlNodeStatus",
2114	           xmlMemBlocks() - mem_base);
2115	    test_ret++;
2116            printf(" %d", n_node);
2117            printf(" %d", n_legacy);
2118            printf("\n");
2119        }
2120    }
2121    }
2122    function_tests++;
2123#endif
2124
2125    return(test_ret);
2126}
2127
2128
2129static int
2130test_htmlParseCharRef(void) {
2131    int test_ret = 0;
2132
2133#if defined(LIBXML_HTML_ENABLED)
2134    int mem_base;
2135    int ret_val;
2136    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2137    int n_ctxt;
2138
2139    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2140        mem_base = xmlMemBlocks();
2141        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2142
2143        ret_val = htmlParseCharRef(ctxt);
2144        desret_int(ret_val);
2145        call_tests++;
2146        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2147        xmlResetLastError();
2148        if (mem_base != xmlMemBlocks()) {
2149            printf("Leak of %d blocks found in htmlParseCharRef",
2150	           xmlMemBlocks() - mem_base);
2151	    test_ret++;
2152            printf(" %d", n_ctxt);
2153            printf("\n");
2154        }
2155    }
2156    function_tests++;
2157#endif
2158
2159    return(test_ret);
2160}
2161
2162
2163static int
2164test_htmlParseChunk(void) {
2165    int test_ret = 0;
2166
2167#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2168    int mem_base;
2169    int ret_val;
2170    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2171    int n_ctxt;
2172    char * chunk; /* an char array */
2173    int n_chunk;
2174    int size; /* the size in byte of the chunk */
2175    int n_size;
2176    int terminate; /* last chunk indicator */
2177    int n_terminate;
2178
2179    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2180    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2181    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2182    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2183        mem_base = xmlMemBlocks();
2184        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2185        chunk = gen_const_char_ptr(n_chunk, 1);
2186        size = gen_int(n_size, 2);
2187        terminate = gen_int(n_terminate, 3);
2188
2189        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2190        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2191        desret_int(ret_val);
2192        call_tests++;
2193        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2194        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2195        des_int(n_size, size, 2);
2196        des_int(n_terminate, terminate, 3);
2197        xmlResetLastError();
2198        if (mem_base != xmlMemBlocks()) {
2199            printf("Leak of %d blocks found in htmlParseChunk",
2200	           xmlMemBlocks() - mem_base);
2201	    test_ret++;
2202            printf(" %d", n_ctxt);
2203            printf(" %d", n_chunk);
2204            printf(" %d", n_size);
2205            printf(" %d", n_terminate);
2206            printf("\n");
2207        }
2208    }
2209    }
2210    }
2211    }
2212    function_tests++;
2213#endif
2214
2215    return(test_ret);
2216}
2217
2218
2219static int
2220test_htmlParseDoc(void) {
2221    int test_ret = 0;
2222
2223#if defined(LIBXML_HTML_ENABLED)
2224    int mem_base;
2225    htmlDocPtr ret_val;
2226    xmlChar * cur; /* a pointer to an array of xmlChar */
2227    int n_cur;
2228    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2229    int n_encoding;
2230
2231    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2232    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2233        mem_base = xmlMemBlocks();
2234        cur = gen_xmlChar_ptr(n_cur, 0);
2235        encoding = gen_const_char_ptr(n_encoding, 1);
2236
2237        ret_val = htmlParseDoc(cur, (const char *)encoding);
2238        desret_htmlDocPtr(ret_val);
2239        call_tests++;
2240        des_xmlChar_ptr(n_cur, cur, 0);
2241        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2242        xmlResetLastError();
2243        if (mem_base != xmlMemBlocks()) {
2244            printf("Leak of %d blocks found in htmlParseDoc",
2245	           xmlMemBlocks() - mem_base);
2246	    test_ret++;
2247            printf(" %d", n_cur);
2248            printf(" %d", n_encoding);
2249            printf("\n");
2250        }
2251    }
2252    }
2253    function_tests++;
2254#endif
2255
2256    return(test_ret);
2257}
2258
2259
2260static int
2261test_htmlParseDocument(void) {
2262    int test_ret = 0;
2263
2264#if defined(LIBXML_HTML_ENABLED)
2265    int mem_base;
2266    int ret_val;
2267    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2268    int n_ctxt;
2269
2270    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2271        mem_base = xmlMemBlocks();
2272        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2273
2274        ret_val = htmlParseDocument(ctxt);
2275        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2276        desret_int(ret_val);
2277        call_tests++;
2278        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2279        xmlResetLastError();
2280        if (mem_base != xmlMemBlocks()) {
2281            printf("Leak of %d blocks found in htmlParseDocument",
2282	           xmlMemBlocks() - mem_base);
2283	    test_ret++;
2284            printf(" %d", n_ctxt);
2285            printf("\n");
2286        }
2287    }
2288    function_tests++;
2289#endif
2290
2291    return(test_ret);
2292}
2293
2294
2295static int
2296test_htmlParseElement(void) {
2297    int test_ret = 0;
2298
2299#if defined(LIBXML_HTML_ENABLED)
2300    int mem_base;
2301    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2302    int n_ctxt;
2303
2304    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2305        mem_base = xmlMemBlocks();
2306        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2307
2308        htmlParseElement(ctxt);
2309        call_tests++;
2310        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2311        xmlResetLastError();
2312        if (mem_base != xmlMemBlocks()) {
2313            printf("Leak of %d blocks found in htmlParseElement",
2314	           xmlMemBlocks() - mem_base);
2315	    test_ret++;
2316            printf(" %d", n_ctxt);
2317            printf("\n");
2318        }
2319    }
2320    function_tests++;
2321#endif
2322
2323    return(test_ret);
2324}
2325
2326
2327static int
2328test_htmlParseEntityRef(void) {
2329    int test_ret = 0;
2330
2331#if defined(LIBXML_HTML_ENABLED)
2332    int mem_base;
2333    const htmlEntityDesc * ret_val;
2334    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2335    int n_ctxt;
2336    xmlChar ** str; /* location to store the entity name */
2337    int n_str;
2338
2339    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2340    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2341        mem_base = xmlMemBlocks();
2342        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2343        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2344
2345        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2346        desret_const_htmlEntityDesc_ptr(ret_val);
2347        call_tests++;
2348        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2349        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2350        xmlResetLastError();
2351        if (mem_base != xmlMemBlocks()) {
2352            printf("Leak of %d blocks found in htmlParseEntityRef",
2353	           xmlMemBlocks() - mem_base);
2354	    test_ret++;
2355            printf(" %d", n_ctxt);
2356            printf(" %d", n_str);
2357            printf("\n");
2358        }
2359    }
2360    }
2361    function_tests++;
2362#endif
2363
2364    return(test_ret);
2365}
2366
2367
2368static int
2369test_htmlParseFile(void) {
2370    int test_ret = 0;
2371
2372#if defined(LIBXML_HTML_ENABLED)
2373    htmlDocPtr ret_val;
2374    const char * filename; /* the filename */
2375    int n_filename;
2376    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2377    int n_encoding;
2378
2379    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2380    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2381        filename = gen_filepath(n_filename, 0);
2382        encoding = gen_const_char_ptr(n_encoding, 1);
2383
2384        ret_val = htmlParseFile(filename, (const char *)encoding);
2385        desret_htmlDocPtr(ret_val);
2386        call_tests++;
2387        des_filepath(n_filename, filename, 0);
2388        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2389        xmlResetLastError();
2390    }
2391    }
2392    function_tests++;
2393#endif
2394
2395    return(test_ret);
2396}
2397
2398
2399static int
2400test_htmlReadDoc(void) {
2401    int test_ret = 0;
2402
2403#if defined(LIBXML_HTML_ENABLED)
2404    int mem_base;
2405    htmlDocPtr ret_val;
2406    xmlChar * cur; /* a pointer to a zero terminated string */
2407    int n_cur;
2408    const char * URL; /* the base URL to use for the document */
2409    int n_URL;
2410    char * encoding; /* the document encoding, or NULL */
2411    int n_encoding;
2412    int options; /* a combination of htmlParserOption(s) */
2413    int n_options;
2414
2415    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2416    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2417    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2418    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2419        mem_base = xmlMemBlocks();
2420        cur = gen_const_xmlChar_ptr(n_cur, 0);
2421        URL = gen_filepath(n_URL, 1);
2422        encoding = gen_const_char_ptr(n_encoding, 2);
2423        options = gen_int(n_options, 3);
2424
2425        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2426        desret_htmlDocPtr(ret_val);
2427        call_tests++;
2428        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2429        des_filepath(n_URL, URL, 1);
2430        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2431        des_int(n_options, options, 3);
2432        xmlResetLastError();
2433        if (mem_base != xmlMemBlocks()) {
2434            printf("Leak of %d blocks found in htmlReadDoc",
2435	           xmlMemBlocks() - mem_base);
2436	    test_ret++;
2437            printf(" %d", n_cur);
2438            printf(" %d", n_URL);
2439            printf(" %d", n_encoding);
2440            printf(" %d", n_options);
2441            printf("\n");
2442        }
2443    }
2444    }
2445    }
2446    }
2447    function_tests++;
2448#endif
2449
2450    return(test_ret);
2451}
2452
2453
2454static int
2455test_htmlReadFile(void) {
2456    int test_ret = 0;
2457
2458#if defined(LIBXML_HTML_ENABLED)
2459    int mem_base;
2460    htmlDocPtr ret_val;
2461    const char * filename; /* a file or URL */
2462    int n_filename;
2463    char * encoding; /* the document encoding, or NULL */
2464    int n_encoding;
2465    int options; /* a combination of htmlParserOption(s) */
2466    int n_options;
2467
2468    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2469    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2470    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2471        mem_base = xmlMemBlocks();
2472        filename = gen_filepath(n_filename, 0);
2473        encoding = gen_const_char_ptr(n_encoding, 1);
2474        options = gen_int(n_options, 2);
2475
2476        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2477        desret_htmlDocPtr(ret_val);
2478        call_tests++;
2479        des_filepath(n_filename, filename, 0);
2480        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2481        des_int(n_options, options, 2);
2482        xmlResetLastError();
2483        if (mem_base != xmlMemBlocks()) {
2484            printf("Leak of %d blocks found in htmlReadFile",
2485	           xmlMemBlocks() - mem_base);
2486	    test_ret++;
2487            printf(" %d", n_filename);
2488            printf(" %d", n_encoding);
2489            printf(" %d", n_options);
2490            printf("\n");
2491        }
2492    }
2493    }
2494    }
2495    function_tests++;
2496#endif
2497
2498    return(test_ret);
2499}
2500
2501
2502static int
2503test_htmlReadMemory(void) {
2504    int test_ret = 0;
2505
2506#if defined(LIBXML_HTML_ENABLED)
2507    int mem_base;
2508    htmlDocPtr ret_val;
2509    char * buffer; /* a pointer to a char array */
2510    int n_buffer;
2511    int size; /* the size of the array */
2512    int n_size;
2513    const char * URL; /* the base URL to use for the document */
2514    int n_URL;
2515    char * encoding; /* the document encoding, or NULL */
2516    int n_encoding;
2517    int options; /* a combination of htmlParserOption(s) */
2518    int n_options;
2519
2520    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2521    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2522    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2523    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2524    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2525        mem_base = xmlMemBlocks();
2526        buffer = gen_const_char_ptr(n_buffer, 0);
2527        size = gen_int(n_size, 1);
2528        URL = gen_filepath(n_URL, 2);
2529        encoding = gen_const_char_ptr(n_encoding, 3);
2530        options = gen_int(n_options, 4);
2531
2532        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2533        desret_htmlDocPtr(ret_val);
2534        call_tests++;
2535        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2536        des_int(n_size, size, 1);
2537        des_filepath(n_URL, URL, 2);
2538        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2539        des_int(n_options, options, 4);
2540        xmlResetLastError();
2541        if (mem_base != xmlMemBlocks()) {
2542            printf("Leak of %d blocks found in htmlReadMemory",
2543	           xmlMemBlocks() - mem_base);
2544	    test_ret++;
2545            printf(" %d", n_buffer);
2546            printf(" %d", n_size);
2547            printf(" %d", n_URL);
2548            printf(" %d", n_encoding);
2549            printf(" %d", n_options);
2550            printf("\n");
2551        }
2552    }
2553    }
2554    }
2555    }
2556    }
2557    function_tests++;
2558#endif
2559
2560    return(test_ret);
2561}
2562
2563
2564static int
2565test_htmlSAXParseDoc(void) {
2566    int test_ret = 0;
2567
2568#if defined(LIBXML_HTML_ENABLED)
2569    int mem_base;
2570    htmlDocPtr ret_val;
2571    xmlChar * cur; /* a pointer to an array of xmlChar */
2572    int n_cur;
2573    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2574    int n_encoding;
2575    htmlSAXHandlerPtr sax; /* the SAX handler block */
2576    int n_sax;
2577    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2578    int n_userData;
2579
2580    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2581    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2582    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2583    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2584        mem_base = xmlMemBlocks();
2585        cur = gen_xmlChar_ptr(n_cur, 0);
2586        encoding = gen_const_char_ptr(n_encoding, 1);
2587        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2588        userData = gen_userdata(n_userData, 3);
2589
2590        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2591        desret_htmlDocPtr(ret_val);
2592        call_tests++;
2593        des_xmlChar_ptr(n_cur, cur, 0);
2594        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2595        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2596        des_userdata(n_userData, userData, 3);
2597        xmlResetLastError();
2598        if (mem_base != xmlMemBlocks()) {
2599            printf("Leak of %d blocks found in htmlSAXParseDoc",
2600	           xmlMemBlocks() - mem_base);
2601	    test_ret++;
2602            printf(" %d", n_cur);
2603            printf(" %d", n_encoding);
2604            printf(" %d", n_sax);
2605            printf(" %d", n_userData);
2606            printf("\n");
2607        }
2608    }
2609    }
2610    }
2611    }
2612    function_tests++;
2613#endif
2614
2615    return(test_ret);
2616}
2617
2618
2619static int
2620test_htmlSAXParseFile(void) {
2621    int test_ret = 0;
2622
2623#if defined(LIBXML_HTML_ENABLED)
2624    int mem_base;
2625    htmlDocPtr ret_val;
2626    const char * filename; /* the filename */
2627    int n_filename;
2628    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2629    int n_encoding;
2630    htmlSAXHandlerPtr sax; /* the SAX handler block */
2631    int n_sax;
2632    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2633    int n_userData;
2634
2635    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2636    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2637    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2638    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2639        mem_base = xmlMemBlocks();
2640        filename = gen_filepath(n_filename, 0);
2641        encoding = gen_const_char_ptr(n_encoding, 1);
2642        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2643        userData = gen_userdata(n_userData, 3);
2644
2645        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2646        desret_htmlDocPtr(ret_val);
2647        call_tests++;
2648        des_filepath(n_filename, filename, 0);
2649        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2650        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2651        des_userdata(n_userData, userData, 3);
2652        xmlResetLastError();
2653        if (mem_base != xmlMemBlocks()) {
2654            printf("Leak of %d blocks found in htmlSAXParseFile",
2655	           xmlMemBlocks() - mem_base);
2656	    test_ret++;
2657            printf(" %d", n_filename);
2658            printf(" %d", n_encoding);
2659            printf(" %d", n_sax);
2660            printf(" %d", n_userData);
2661            printf("\n");
2662        }
2663    }
2664    }
2665    }
2666    }
2667    function_tests++;
2668#endif
2669
2670    return(test_ret);
2671}
2672
2673
2674static int
2675test_htmlTagLookup(void) {
2676    int test_ret = 0;
2677
2678
2679    /* missing type support */
2680    return(test_ret);
2681}
2682
2683static int
2684test_HTMLparser(void) {
2685    int test_ret = 0;
2686
2687    if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n");
2688    test_ret += test_UTF8ToHtml();
2689    test_ret += test_htmlAttrAllowed();
2690    test_ret += test_htmlAutoCloseTag();
2691    test_ret += test_htmlCreateMemoryParserCtxt();
2692    test_ret += test_htmlCreatePushParserCtxt();
2693    test_ret += test_htmlCtxtReadDoc();
2694    test_ret += test_htmlCtxtReadFile();
2695    test_ret += test_htmlCtxtReadMemory();
2696    test_ret += test_htmlCtxtReset();
2697    test_ret += test_htmlCtxtUseOptions();
2698    test_ret += test_htmlElementAllowedHere();
2699    test_ret += test_htmlElementStatusHere();
2700    test_ret += test_htmlEncodeEntities();
2701    test_ret += test_htmlEntityLookup();
2702    test_ret += test_htmlEntityValueLookup();
2703    test_ret += test_htmlHandleOmittedElem();
2704    test_ret += test_htmlIsAutoClosed();
2705    test_ret += test_htmlIsScriptAttribute();
2706    test_ret += test_htmlNodeStatus();
2707    test_ret += test_htmlParseCharRef();
2708    test_ret += test_htmlParseChunk();
2709    test_ret += test_htmlParseDoc();
2710    test_ret += test_htmlParseDocument();
2711    test_ret += test_htmlParseElement();
2712    test_ret += test_htmlParseEntityRef();
2713    test_ret += test_htmlParseFile();
2714    test_ret += test_htmlReadDoc();
2715    test_ret += test_htmlReadFile();
2716    test_ret += test_htmlReadMemory();
2717    test_ret += test_htmlSAXParseDoc();
2718    test_ret += test_htmlSAXParseFile();
2719    test_ret += test_htmlTagLookup();
2720
2721    if (test_ret != 0)
2722	printf("Module HTMLparser: %d errors\n", test_ret);
2723    return(test_ret);
2724}
2725
2726static int
2727test_htmlDocContentDumpFormatOutput(void) {
2728    int test_ret = 0;
2729
2730#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2731    int mem_base;
2732    xmlOutputBufferPtr buf; /* the HTML buffer output */
2733    int n_buf;
2734    xmlDocPtr cur; /* the document */
2735    int n_cur;
2736    char * encoding; /* the encoding string */
2737    int n_encoding;
2738    int format; /* should formatting spaces been added */
2739    int n_format;
2740
2741    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2742    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2743    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2744    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2745        mem_base = xmlMemBlocks();
2746        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2747        cur = gen_xmlDocPtr(n_cur, 1);
2748        encoding = gen_const_char_ptr(n_encoding, 2);
2749        format = gen_int(n_format, 3);
2750
2751        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2752        call_tests++;
2753        des_xmlOutputBufferPtr(n_buf, buf, 0);
2754        des_xmlDocPtr(n_cur, cur, 1);
2755        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2756        des_int(n_format, format, 3);
2757        xmlResetLastError();
2758        if (mem_base != xmlMemBlocks()) {
2759            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2760	           xmlMemBlocks() - mem_base);
2761	    test_ret++;
2762            printf(" %d", n_buf);
2763            printf(" %d", n_cur);
2764            printf(" %d", n_encoding);
2765            printf(" %d", n_format);
2766            printf("\n");
2767        }
2768    }
2769    }
2770    }
2771    }
2772    function_tests++;
2773#endif
2774
2775    return(test_ret);
2776}
2777
2778
2779static int
2780test_htmlDocContentDumpOutput(void) {
2781    int test_ret = 0;
2782
2783#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2784    int mem_base;
2785    xmlOutputBufferPtr buf; /* the HTML buffer output */
2786    int n_buf;
2787    xmlDocPtr cur; /* the document */
2788    int n_cur;
2789    char * encoding; /* the encoding string */
2790    int n_encoding;
2791
2792    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2793    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2794    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2795        mem_base = xmlMemBlocks();
2796        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2797        cur = gen_xmlDocPtr(n_cur, 1);
2798        encoding = gen_const_char_ptr(n_encoding, 2);
2799
2800        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2801        call_tests++;
2802        des_xmlOutputBufferPtr(n_buf, buf, 0);
2803        des_xmlDocPtr(n_cur, cur, 1);
2804        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2805        xmlResetLastError();
2806        if (mem_base != xmlMemBlocks()) {
2807            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2808	           xmlMemBlocks() - mem_base);
2809	    test_ret++;
2810            printf(" %d", n_buf);
2811            printf(" %d", n_cur);
2812            printf(" %d", n_encoding);
2813            printf("\n");
2814        }
2815    }
2816    }
2817    }
2818    function_tests++;
2819#endif
2820
2821    return(test_ret);
2822}
2823
2824
2825static int
2826test_htmlDocDump(void) {
2827    int test_ret = 0;
2828
2829#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2830    int mem_base;
2831    int ret_val;
2832    FILE * f; /* the FILE* */
2833    int n_f;
2834    xmlDocPtr cur; /* the document */
2835    int n_cur;
2836
2837    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2838    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2839        mem_base = xmlMemBlocks();
2840        f = gen_FILE_ptr(n_f, 0);
2841        cur = gen_xmlDocPtr(n_cur, 1);
2842
2843        ret_val = htmlDocDump(f, cur);
2844        desret_int(ret_val);
2845        call_tests++;
2846        des_FILE_ptr(n_f, f, 0);
2847        des_xmlDocPtr(n_cur, cur, 1);
2848        xmlResetLastError();
2849        if (mem_base != xmlMemBlocks()) {
2850            printf("Leak of %d blocks found in htmlDocDump",
2851	           xmlMemBlocks() - mem_base);
2852	    test_ret++;
2853            printf(" %d", n_f);
2854            printf(" %d", n_cur);
2855            printf("\n");
2856        }
2857    }
2858    }
2859    function_tests++;
2860#endif
2861
2862    return(test_ret);
2863}
2864
2865
2866#define gen_nb_xmlChar_ptr_ptr 1
2867static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2868    return(NULL);
2869}
2870static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2871}
2872
2873static int
2874test_htmlDocDumpMemory(void) {
2875    int test_ret = 0;
2876
2877#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2878    int mem_base;
2879    xmlDocPtr cur; /* the document */
2880    int n_cur;
2881    xmlChar ** mem; /* OUT: the memory pointer */
2882    int n_mem;
2883    int * size; /* OUT: the memory length */
2884    int n_size;
2885
2886    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2887    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2888    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2889        mem_base = xmlMemBlocks();
2890        cur = gen_xmlDocPtr(n_cur, 0);
2891        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2892        size = gen_int_ptr(n_size, 2);
2893
2894        htmlDocDumpMemory(cur, mem, size);
2895        call_tests++;
2896        des_xmlDocPtr(n_cur, cur, 0);
2897        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2898        des_int_ptr(n_size, size, 2);
2899        xmlResetLastError();
2900        if (mem_base != xmlMemBlocks()) {
2901            printf("Leak of %d blocks found in htmlDocDumpMemory",
2902	           xmlMemBlocks() - mem_base);
2903	    test_ret++;
2904            printf(" %d", n_cur);
2905            printf(" %d", n_mem);
2906            printf(" %d", n_size);
2907            printf("\n");
2908        }
2909    }
2910    }
2911    }
2912    function_tests++;
2913#endif
2914
2915    return(test_ret);
2916}
2917
2918
2919static int
2920test_htmlGetMetaEncoding(void) {
2921    int test_ret = 0;
2922
2923#if defined(LIBXML_HTML_ENABLED)
2924    int mem_base;
2925    const xmlChar * ret_val;
2926    htmlDocPtr doc; /* the document */
2927    int n_doc;
2928
2929    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2930        mem_base = xmlMemBlocks();
2931        doc = gen_htmlDocPtr(n_doc, 0);
2932
2933        ret_val = htmlGetMetaEncoding(doc);
2934        desret_const_xmlChar_ptr(ret_val);
2935        call_tests++;
2936        des_htmlDocPtr(n_doc, doc, 0);
2937        xmlResetLastError();
2938        if (mem_base != xmlMemBlocks()) {
2939            printf("Leak of %d blocks found in htmlGetMetaEncoding",
2940	           xmlMemBlocks() - mem_base);
2941	    test_ret++;
2942            printf(" %d", n_doc);
2943            printf("\n");
2944        }
2945    }
2946    function_tests++;
2947#endif
2948
2949    return(test_ret);
2950}
2951
2952
2953static int
2954test_htmlIsBooleanAttr(void) {
2955    int test_ret = 0;
2956
2957#if defined(LIBXML_HTML_ENABLED)
2958    int mem_base;
2959    int ret_val;
2960    xmlChar * name; /* the name of the attribute to check */
2961    int n_name;
2962
2963    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2964        mem_base = xmlMemBlocks();
2965        name = gen_const_xmlChar_ptr(n_name, 0);
2966
2967        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
2968        desret_int(ret_val);
2969        call_tests++;
2970        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2971        xmlResetLastError();
2972        if (mem_base != xmlMemBlocks()) {
2973            printf("Leak of %d blocks found in htmlIsBooleanAttr",
2974	           xmlMemBlocks() - mem_base);
2975	    test_ret++;
2976            printf(" %d", n_name);
2977            printf("\n");
2978        }
2979    }
2980    function_tests++;
2981#endif
2982
2983    return(test_ret);
2984}
2985
2986
2987static int
2988test_htmlNewDoc(void) {
2989    int test_ret = 0;
2990
2991#if defined(LIBXML_HTML_ENABLED)
2992    int mem_base;
2993    htmlDocPtr ret_val;
2994    xmlChar * URI; /* URI for the dtd, or NULL */
2995    int n_URI;
2996    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
2997    int n_ExternalID;
2998
2999    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3000    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3001        mem_base = xmlMemBlocks();
3002        URI = gen_const_xmlChar_ptr(n_URI, 0);
3003        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3004
3005        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3006        desret_htmlDocPtr(ret_val);
3007        call_tests++;
3008        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3009        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3010        xmlResetLastError();
3011        if (mem_base != xmlMemBlocks()) {
3012            printf("Leak of %d blocks found in htmlNewDoc",
3013	           xmlMemBlocks() - mem_base);
3014	    test_ret++;
3015            printf(" %d", n_URI);
3016            printf(" %d", n_ExternalID);
3017            printf("\n");
3018        }
3019    }
3020    }
3021    function_tests++;
3022#endif
3023
3024    return(test_ret);
3025}
3026
3027
3028static int
3029test_htmlNewDocNoDtD(void) {
3030    int test_ret = 0;
3031
3032#if defined(LIBXML_HTML_ENABLED)
3033    int mem_base;
3034    htmlDocPtr ret_val;
3035    xmlChar * URI; /* URI for the dtd, or NULL */
3036    int n_URI;
3037    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3038    int n_ExternalID;
3039
3040    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3041    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3042        mem_base = xmlMemBlocks();
3043        URI = gen_const_xmlChar_ptr(n_URI, 0);
3044        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3045
3046        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3047        desret_htmlDocPtr(ret_val);
3048        call_tests++;
3049        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3050        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3051        xmlResetLastError();
3052        if (mem_base != xmlMemBlocks()) {
3053            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3054	           xmlMemBlocks() - mem_base);
3055	    test_ret++;
3056            printf(" %d", n_URI);
3057            printf(" %d", n_ExternalID);
3058            printf("\n");
3059        }
3060    }
3061    }
3062    function_tests++;
3063#endif
3064
3065    return(test_ret);
3066}
3067
3068
3069static int
3070test_htmlNodeDump(void) {
3071    int test_ret = 0;
3072
3073#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3074    int mem_base;
3075    int ret_val;
3076    xmlBufferPtr buf; /* the HTML buffer output */
3077    int n_buf;
3078    xmlDocPtr doc; /* the document */
3079    int n_doc;
3080    xmlNodePtr cur; /* the current node */
3081    int n_cur;
3082
3083    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3084    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3085    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3086        mem_base = xmlMemBlocks();
3087        buf = gen_xmlBufferPtr(n_buf, 0);
3088        doc = gen_xmlDocPtr(n_doc, 1);
3089        cur = gen_xmlNodePtr(n_cur, 2);
3090
3091        ret_val = htmlNodeDump(buf, doc, cur);
3092        desret_int(ret_val);
3093        call_tests++;
3094        des_xmlBufferPtr(n_buf, buf, 0);
3095        des_xmlDocPtr(n_doc, doc, 1);
3096        des_xmlNodePtr(n_cur, cur, 2);
3097        xmlResetLastError();
3098        if (mem_base != xmlMemBlocks()) {
3099            printf("Leak of %d blocks found in htmlNodeDump",
3100	           xmlMemBlocks() - mem_base);
3101	    test_ret++;
3102            printf(" %d", n_buf);
3103            printf(" %d", n_doc);
3104            printf(" %d", n_cur);
3105            printf("\n");
3106        }
3107    }
3108    }
3109    }
3110    function_tests++;
3111#endif
3112
3113    return(test_ret);
3114}
3115
3116
3117static int
3118test_htmlNodeDumpFile(void) {
3119    int test_ret = 0;
3120
3121#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3122    int mem_base;
3123    FILE * out; /* the FILE pointer */
3124    int n_out;
3125    xmlDocPtr doc; /* the document */
3126    int n_doc;
3127    xmlNodePtr cur; /* the current node */
3128    int n_cur;
3129
3130    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3131    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3132    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3133        mem_base = xmlMemBlocks();
3134        out = gen_FILE_ptr(n_out, 0);
3135        doc = gen_xmlDocPtr(n_doc, 1);
3136        cur = gen_xmlNodePtr(n_cur, 2);
3137
3138        htmlNodeDumpFile(out, doc, cur);
3139        call_tests++;
3140        des_FILE_ptr(n_out, out, 0);
3141        des_xmlDocPtr(n_doc, doc, 1);
3142        des_xmlNodePtr(n_cur, cur, 2);
3143        xmlResetLastError();
3144        if (mem_base != xmlMemBlocks()) {
3145            printf("Leak of %d blocks found in htmlNodeDumpFile",
3146	           xmlMemBlocks() - mem_base);
3147	    test_ret++;
3148            printf(" %d", n_out);
3149            printf(" %d", n_doc);
3150            printf(" %d", n_cur);
3151            printf("\n");
3152        }
3153    }
3154    }
3155    }
3156    function_tests++;
3157#endif
3158
3159    return(test_ret);
3160}
3161
3162
3163static int
3164test_htmlNodeDumpFileFormat(void) {
3165    int test_ret = 0;
3166
3167#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3168    int mem_base;
3169    int ret_val;
3170    FILE * out; /* the FILE pointer */
3171    int n_out;
3172    xmlDocPtr doc; /* the document */
3173    int n_doc;
3174    xmlNodePtr cur; /* the current node */
3175    int n_cur;
3176    char * encoding; /* the document encoding */
3177    int n_encoding;
3178    int format; /* should formatting spaces been added */
3179    int n_format;
3180
3181    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3182    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3183    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3184    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3185    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3186        mem_base = xmlMemBlocks();
3187        out = gen_FILE_ptr(n_out, 0);
3188        doc = gen_xmlDocPtr(n_doc, 1);
3189        cur = gen_xmlNodePtr(n_cur, 2);
3190        encoding = gen_const_char_ptr(n_encoding, 3);
3191        format = gen_int(n_format, 4);
3192
3193        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3194        desret_int(ret_val);
3195        call_tests++;
3196        des_FILE_ptr(n_out, out, 0);
3197        des_xmlDocPtr(n_doc, doc, 1);
3198        des_xmlNodePtr(n_cur, cur, 2);
3199        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3200        des_int(n_format, format, 4);
3201        xmlResetLastError();
3202        if (mem_base != xmlMemBlocks()) {
3203            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3204	           xmlMemBlocks() - mem_base);
3205	    test_ret++;
3206            printf(" %d", n_out);
3207            printf(" %d", n_doc);
3208            printf(" %d", n_cur);
3209            printf(" %d", n_encoding);
3210            printf(" %d", n_format);
3211            printf("\n");
3212        }
3213    }
3214    }
3215    }
3216    }
3217    }
3218    function_tests++;
3219#endif
3220
3221    return(test_ret);
3222}
3223
3224
3225static int
3226test_htmlNodeDumpFormatOutput(void) {
3227    int test_ret = 0;
3228
3229#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3230    int mem_base;
3231    xmlOutputBufferPtr buf; /* the HTML buffer output */
3232    int n_buf;
3233    xmlDocPtr doc; /* the document */
3234    int n_doc;
3235    xmlNodePtr cur; /* the current node */
3236    int n_cur;
3237    char * encoding; /* the encoding string */
3238    int n_encoding;
3239    int format; /* should formatting spaces been added */
3240    int n_format;
3241
3242    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3243    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3244    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3245    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3246    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3247        mem_base = xmlMemBlocks();
3248        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3249        doc = gen_xmlDocPtr(n_doc, 1);
3250        cur = gen_xmlNodePtr(n_cur, 2);
3251        encoding = gen_const_char_ptr(n_encoding, 3);
3252        format = gen_int(n_format, 4);
3253
3254        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3255        call_tests++;
3256        des_xmlOutputBufferPtr(n_buf, buf, 0);
3257        des_xmlDocPtr(n_doc, doc, 1);
3258        des_xmlNodePtr(n_cur, cur, 2);
3259        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3260        des_int(n_format, format, 4);
3261        xmlResetLastError();
3262        if (mem_base != xmlMemBlocks()) {
3263            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3264	           xmlMemBlocks() - mem_base);
3265	    test_ret++;
3266            printf(" %d", n_buf);
3267            printf(" %d", n_doc);
3268            printf(" %d", n_cur);
3269            printf(" %d", n_encoding);
3270            printf(" %d", n_format);
3271            printf("\n");
3272        }
3273    }
3274    }
3275    }
3276    }
3277    }
3278    function_tests++;
3279#endif
3280
3281    return(test_ret);
3282}
3283
3284
3285static int
3286test_htmlNodeDumpOutput(void) {
3287    int test_ret = 0;
3288
3289#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3290    int mem_base;
3291    xmlOutputBufferPtr buf; /* the HTML buffer output */
3292    int n_buf;
3293    xmlDocPtr doc; /* the document */
3294    int n_doc;
3295    xmlNodePtr cur; /* the current node */
3296    int n_cur;
3297    char * encoding; /* the encoding string */
3298    int n_encoding;
3299
3300    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3301    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3302    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3303    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3304        mem_base = xmlMemBlocks();
3305        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3306        doc = gen_xmlDocPtr(n_doc, 1);
3307        cur = gen_xmlNodePtr(n_cur, 2);
3308        encoding = gen_const_char_ptr(n_encoding, 3);
3309
3310        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3311        call_tests++;
3312        des_xmlOutputBufferPtr(n_buf, buf, 0);
3313        des_xmlDocPtr(n_doc, doc, 1);
3314        des_xmlNodePtr(n_cur, cur, 2);
3315        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3316        xmlResetLastError();
3317        if (mem_base != xmlMemBlocks()) {
3318            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3319	           xmlMemBlocks() - mem_base);
3320	    test_ret++;
3321            printf(" %d", n_buf);
3322            printf(" %d", n_doc);
3323            printf(" %d", n_cur);
3324            printf(" %d", n_encoding);
3325            printf("\n");
3326        }
3327    }
3328    }
3329    }
3330    }
3331    function_tests++;
3332#endif
3333
3334    return(test_ret);
3335}
3336
3337
3338static int
3339test_htmlSaveFile(void) {
3340    int test_ret = 0;
3341
3342#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3343    int mem_base;
3344    int ret_val;
3345    const char * filename; /* the filename (or URL) */
3346    int n_filename;
3347    xmlDocPtr cur; /* the document */
3348    int n_cur;
3349
3350    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3351    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3352        mem_base = xmlMemBlocks();
3353        filename = gen_fileoutput(n_filename, 0);
3354        cur = gen_xmlDocPtr(n_cur, 1);
3355
3356        ret_val = htmlSaveFile(filename, cur);
3357        desret_int(ret_val);
3358        call_tests++;
3359        des_fileoutput(n_filename, filename, 0);
3360        des_xmlDocPtr(n_cur, cur, 1);
3361        xmlResetLastError();
3362        if (mem_base != xmlMemBlocks()) {
3363            printf("Leak of %d blocks found in htmlSaveFile",
3364	           xmlMemBlocks() - mem_base);
3365	    test_ret++;
3366            printf(" %d", n_filename);
3367            printf(" %d", n_cur);
3368            printf("\n");
3369        }
3370    }
3371    }
3372    function_tests++;
3373#endif
3374
3375    return(test_ret);
3376}
3377
3378
3379static int
3380test_htmlSaveFileEnc(void) {
3381    int test_ret = 0;
3382
3383#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3384    int mem_base;
3385    int ret_val;
3386    const char * filename; /* the filename */
3387    int n_filename;
3388    xmlDocPtr cur; /* the document */
3389    int n_cur;
3390    char * encoding; /* the document encoding */
3391    int n_encoding;
3392
3393    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3394    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3395    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3396        mem_base = xmlMemBlocks();
3397        filename = gen_fileoutput(n_filename, 0);
3398        cur = gen_xmlDocPtr(n_cur, 1);
3399        encoding = gen_const_char_ptr(n_encoding, 2);
3400
3401        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3402        desret_int(ret_val);
3403        call_tests++;
3404        des_fileoutput(n_filename, filename, 0);
3405        des_xmlDocPtr(n_cur, cur, 1);
3406        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3407        xmlResetLastError();
3408        if (mem_base != xmlMemBlocks()) {
3409            printf("Leak of %d blocks found in htmlSaveFileEnc",
3410	           xmlMemBlocks() - mem_base);
3411	    test_ret++;
3412            printf(" %d", n_filename);
3413            printf(" %d", n_cur);
3414            printf(" %d", n_encoding);
3415            printf("\n");
3416        }
3417    }
3418    }
3419    }
3420    function_tests++;
3421#endif
3422
3423    return(test_ret);
3424}
3425
3426
3427static int
3428test_htmlSaveFileFormat(void) {
3429    int test_ret = 0;
3430
3431#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3432    int mem_base;
3433    int ret_val;
3434    const char * filename; /* the filename */
3435    int n_filename;
3436    xmlDocPtr cur; /* the document */
3437    int n_cur;
3438    char * encoding; /* the document encoding */
3439    int n_encoding;
3440    int format; /* should formatting spaces been added */
3441    int n_format;
3442
3443    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3444    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3445    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3446    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3447        mem_base = xmlMemBlocks();
3448        filename = gen_fileoutput(n_filename, 0);
3449        cur = gen_xmlDocPtr(n_cur, 1);
3450        encoding = gen_const_char_ptr(n_encoding, 2);
3451        format = gen_int(n_format, 3);
3452
3453        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3454        desret_int(ret_val);
3455        call_tests++;
3456        des_fileoutput(n_filename, filename, 0);
3457        des_xmlDocPtr(n_cur, cur, 1);
3458        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3459        des_int(n_format, format, 3);
3460        xmlResetLastError();
3461        if (mem_base != xmlMemBlocks()) {
3462            printf("Leak of %d blocks found in htmlSaveFileFormat",
3463	           xmlMemBlocks() - mem_base);
3464	    test_ret++;
3465            printf(" %d", n_filename);
3466            printf(" %d", n_cur);
3467            printf(" %d", n_encoding);
3468            printf(" %d", n_format);
3469            printf("\n");
3470        }
3471    }
3472    }
3473    }
3474    }
3475    function_tests++;
3476#endif
3477
3478    return(test_ret);
3479}
3480
3481
3482static int
3483test_htmlSetMetaEncoding(void) {
3484    int test_ret = 0;
3485
3486#if defined(LIBXML_HTML_ENABLED)
3487    int mem_base;
3488    int ret_val;
3489    htmlDocPtr doc; /* the document */
3490    int n_doc;
3491    xmlChar * encoding; /* the encoding string */
3492    int n_encoding;
3493
3494    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3495    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3496        mem_base = xmlMemBlocks();
3497        doc = gen_htmlDocPtr(n_doc, 0);
3498        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3499
3500        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3501        desret_int(ret_val);
3502        call_tests++;
3503        des_htmlDocPtr(n_doc, doc, 0);
3504        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3505        xmlResetLastError();
3506        if (mem_base != xmlMemBlocks()) {
3507            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3508	           xmlMemBlocks() - mem_base);
3509	    test_ret++;
3510            printf(" %d", n_doc);
3511            printf(" %d", n_encoding);
3512            printf("\n");
3513        }
3514    }
3515    }
3516    function_tests++;
3517#endif
3518
3519    return(test_ret);
3520}
3521
3522static int
3523test_HTMLtree(void) {
3524    int test_ret = 0;
3525
3526    if (quiet == 0) printf("Testing HTMLtree : 17 of 17 functions ...\n");
3527    test_ret += test_htmlDocContentDumpFormatOutput();
3528    test_ret += test_htmlDocContentDumpOutput();
3529    test_ret += test_htmlDocDump();
3530    test_ret += test_htmlDocDumpMemory();
3531    test_ret += test_htmlGetMetaEncoding();
3532    test_ret += test_htmlIsBooleanAttr();
3533    test_ret += test_htmlNewDoc();
3534    test_ret += test_htmlNewDocNoDtD();
3535    test_ret += test_htmlNodeDump();
3536    test_ret += test_htmlNodeDumpFile();
3537    test_ret += test_htmlNodeDumpFileFormat();
3538    test_ret += test_htmlNodeDumpFormatOutput();
3539    test_ret += test_htmlNodeDumpOutput();
3540    test_ret += test_htmlSaveFile();
3541    test_ret += test_htmlSaveFileEnc();
3542    test_ret += test_htmlSaveFileFormat();
3543    test_ret += test_htmlSetMetaEncoding();
3544
3545    if (test_ret != 0)
3546	printf("Module HTMLtree: %d errors\n", test_ret);
3547    return(test_ret);
3548}
3549
3550static int
3551test_docbDefaultSAXHandlerInit(void) {
3552    int test_ret = 0;
3553
3554#if defined(LIBXML_DOCB_ENABLED)
3555#ifdef LIBXML_DOCB_ENABLED
3556    int mem_base;
3557
3558        mem_base = xmlMemBlocks();
3559
3560        docbDefaultSAXHandlerInit();
3561        call_tests++;
3562        xmlResetLastError();
3563        if (mem_base != xmlMemBlocks()) {
3564            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3565	           xmlMemBlocks() - mem_base);
3566	    test_ret++;
3567            printf("\n");
3568        }
3569    function_tests++;
3570#endif
3571#endif
3572
3573    return(test_ret);
3574}
3575
3576
3577static int
3578test_htmlDefaultSAXHandlerInit(void) {
3579    int test_ret = 0;
3580
3581#if defined(LIBXML_HTML_ENABLED)
3582#ifdef LIBXML_HTML_ENABLED
3583    int mem_base;
3584
3585        mem_base = xmlMemBlocks();
3586
3587        htmlDefaultSAXHandlerInit();
3588        call_tests++;
3589        xmlResetLastError();
3590        if (mem_base != xmlMemBlocks()) {
3591            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3592	           xmlMemBlocks() - mem_base);
3593	    test_ret++;
3594            printf("\n");
3595        }
3596    function_tests++;
3597#endif
3598#endif
3599
3600    return(test_ret);
3601}
3602
3603
3604static int
3605test_xmlDefaultSAXHandlerInit(void) {
3606    int test_ret = 0;
3607
3608    int mem_base;
3609
3610        mem_base = xmlMemBlocks();
3611
3612        xmlDefaultSAXHandlerInit();
3613        call_tests++;
3614        xmlResetLastError();
3615        if (mem_base != xmlMemBlocks()) {
3616            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3617	           xmlMemBlocks() - mem_base);
3618	    test_ret++;
3619            printf("\n");
3620        }
3621    function_tests++;
3622
3623    return(test_ret);
3624}
3625
3626
3627#define gen_nb_xmlEnumerationPtr 1
3628static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3629    return(NULL);
3630}
3631static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3632}
3633
3634static int
3635test_xmlSAX2AttributeDecl(void) {
3636    int test_ret = 0;
3637
3638    int mem_base;
3639    void * ctx; /* the user data (XML parser context) */
3640    int n_ctx;
3641    xmlChar * elem; /* the name of the element */
3642    int n_elem;
3643    xmlChar * fullname; /* the attribute name */
3644    int n_fullname;
3645    int type; /* the attribute type */
3646    int n_type;
3647    int def; /* the type of default value */
3648    int n_def;
3649    xmlChar * defaultValue; /* the attribute default value */
3650    int n_defaultValue;
3651    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3652    int n_tree;
3653
3654    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3655    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3656    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3657    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3658    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3659    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3660    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3661        mem_base = xmlMemBlocks();
3662        ctx = gen_void_ptr(n_ctx, 0);
3663        elem = gen_const_xmlChar_ptr(n_elem, 1);
3664        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3665        type = gen_int(n_type, 3);
3666        def = gen_int(n_def, 4);
3667        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3668        tree = gen_xmlEnumerationPtr(n_tree, 6);
3669
3670        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3671        call_tests++;
3672        des_void_ptr(n_ctx, ctx, 0);
3673        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3674        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3675        des_int(n_type, type, 3);
3676        des_int(n_def, def, 4);
3677        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3678        des_xmlEnumerationPtr(n_tree, tree, 6);
3679        xmlResetLastError();
3680        if (mem_base != xmlMemBlocks()) {
3681            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3682	           xmlMemBlocks() - mem_base);
3683	    test_ret++;
3684            printf(" %d", n_ctx);
3685            printf(" %d", n_elem);
3686            printf(" %d", n_fullname);
3687            printf(" %d", n_type);
3688            printf(" %d", n_def);
3689            printf(" %d", n_defaultValue);
3690            printf(" %d", n_tree);
3691            printf("\n");
3692        }
3693    }
3694    }
3695    }
3696    }
3697    }
3698    }
3699    }
3700    function_tests++;
3701
3702    return(test_ret);
3703}
3704
3705
3706static int
3707test_xmlSAX2CDataBlock(void) {
3708    int test_ret = 0;
3709
3710    int mem_base;
3711    void * ctx; /* the user data (XML parser context) */
3712    int n_ctx;
3713    xmlChar * value; /* The pcdata content */
3714    int n_value;
3715    int len; /* the block length */
3716    int n_len;
3717
3718    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3719    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3720    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3721        mem_base = xmlMemBlocks();
3722        ctx = gen_void_ptr(n_ctx, 0);
3723        value = gen_const_xmlChar_ptr(n_value, 1);
3724        len = gen_int(n_len, 2);
3725
3726        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3727        call_tests++;
3728        des_void_ptr(n_ctx, ctx, 0);
3729        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3730        des_int(n_len, len, 2);
3731        xmlResetLastError();
3732        if (mem_base != xmlMemBlocks()) {
3733            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3734	           xmlMemBlocks() - mem_base);
3735	    test_ret++;
3736            printf(" %d", n_ctx);
3737            printf(" %d", n_value);
3738            printf(" %d", n_len);
3739            printf("\n");
3740        }
3741    }
3742    }
3743    }
3744    function_tests++;
3745
3746    return(test_ret);
3747}
3748
3749
3750static int
3751test_xmlSAX2Characters(void) {
3752    int test_ret = 0;
3753
3754    int mem_base;
3755    void * ctx; /* the user data (XML parser context) */
3756    int n_ctx;
3757    xmlChar * ch; /* a xmlChar string */
3758    int n_ch;
3759    int len; /* the number of xmlChar */
3760    int n_len;
3761
3762    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3763    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3764    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3765        mem_base = xmlMemBlocks();
3766        ctx = gen_void_ptr(n_ctx, 0);
3767        ch = gen_const_xmlChar_ptr(n_ch, 1);
3768        len = gen_int(n_len, 2);
3769
3770        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3771        call_tests++;
3772        des_void_ptr(n_ctx, ctx, 0);
3773        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3774        des_int(n_len, len, 2);
3775        xmlResetLastError();
3776        if (mem_base != xmlMemBlocks()) {
3777            printf("Leak of %d blocks found in xmlSAX2Characters",
3778	           xmlMemBlocks() - mem_base);
3779	    test_ret++;
3780            printf(" %d", n_ctx);
3781            printf(" %d", n_ch);
3782            printf(" %d", n_len);
3783            printf("\n");
3784        }
3785    }
3786    }
3787    }
3788    function_tests++;
3789
3790    return(test_ret);
3791}
3792
3793
3794static int
3795test_xmlSAX2Comment(void) {
3796    int test_ret = 0;
3797
3798    int mem_base;
3799    void * ctx; /* the user data (XML parser context) */
3800    int n_ctx;
3801    xmlChar * value; /* the xmlSAX2Comment content */
3802    int n_value;
3803
3804    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3805    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3806        mem_base = xmlMemBlocks();
3807        ctx = gen_void_ptr(n_ctx, 0);
3808        value = gen_const_xmlChar_ptr(n_value, 1);
3809
3810        xmlSAX2Comment(ctx, (const xmlChar *)value);
3811        call_tests++;
3812        des_void_ptr(n_ctx, ctx, 0);
3813        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3814        xmlResetLastError();
3815        if (mem_base != xmlMemBlocks()) {
3816            printf("Leak of %d blocks found in xmlSAX2Comment",
3817	           xmlMemBlocks() - mem_base);
3818	    test_ret++;
3819            printf(" %d", n_ctx);
3820            printf(" %d", n_value);
3821            printf("\n");
3822        }
3823    }
3824    }
3825    function_tests++;
3826
3827    return(test_ret);
3828}
3829
3830
3831static int
3832test_xmlSAX2ElementDecl(void) {
3833    int test_ret = 0;
3834
3835    int mem_base;
3836    void * ctx; /* the user data (XML parser context) */
3837    int n_ctx;
3838    xmlChar * name; /* the element name */
3839    int n_name;
3840    int type; /* the element type */
3841    int n_type;
3842    xmlElementContentPtr content; /* the element value tree */
3843    int n_content;
3844
3845    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3846    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3847    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3848    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3849        mem_base = xmlMemBlocks();
3850        ctx = gen_void_ptr(n_ctx, 0);
3851        name = gen_const_xmlChar_ptr(n_name, 1);
3852        type = gen_int(n_type, 2);
3853        content = gen_xmlElementContentPtr(n_content, 3);
3854
3855        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3856        call_tests++;
3857        des_void_ptr(n_ctx, ctx, 0);
3858        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3859        des_int(n_type, type, 2);
3860        des_xmlElementContentPtr(n_content, content, 3);
3861        xmlResetLastError();
3862        if (mem_base != xmlMemBlocks()) {
3863            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
3864	           xmlMemBlocks() - mem_base);
3865	    test_ret++;
3866            printf(" %d", n_ctx);
3867            printf(" %d", n_name);
3868            printf(" %d", n_type);
3869            printf(" %d", n_content);
3870            printf("\n");
3871        }
3872    }
3873    }
3874    }
3875    }
3876    function_tests++;
3877
3878    return(test_ret);
3879}
3880
3881
3882static int
3883test_xmlSAX2EndDocument(void) {
3884    int test_ret = 0;
3885
3886    int mem_base;
3887    void * ctx; /* the user data (XML parser context) */
3888    int n_ctx;
3889
3890    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3891        mem_base = xmlMemBlocks();
3892        ctx = gen_void_ptr(n_ctx, 0);
3893
3894        xmlSAX2EndDocument(ctx);
3895        call_tests++;
3896        des_void_ptr(n_ctx, ctx, 0);
3897        xmlResetLastError();
3898        if (mem_base != xmlMemBlocks()) {
3899            printf("Leak of %d blocks found in xmlSAX2EndDocument",
3900	           xmlMemBlocks() - mem_base);
3901	    test_ret++;
3902            printf(" %d", n_ctx);
3903            printf("\n");
3904        }
3905    }
3906    function_tests++;
3907
3908    return(test_ret);
3909}
3910
3911
3912static int
3913test_xmlSAX2EndElement(void) {
3914    int test_ret = 0;
3915
3916#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
3917#ifdef LIBXML_SAX1_ENABLED
3918    int mem_base;
3919    void * ctx; /* the user data (XML parser context) */
3920    int n_ctx;
3921    xmlChar * name; /* The element name */
3922    int n_name;
3923
3924    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3925    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3926        mem_base = xmlMemBlocks();
3927        ctx = gen_void_ptr(n_ctx, 0);
3928        name = gen_const_xmlChar_ptr(n_name, 1);
3929
3930        xmlSAX2EndElement(ctx, (const xmlChar *)name);
3931        call_tests++;
3932        des_void_ptr(n_ctx, ctx, 0);
3933        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3934        xmlResetLastError();
3935        if (mem_base != xmlMemBlocks()) {
3936            printf("Leak of %d blocks found in xmlSAX2EndElement",
3937	           xmlMemBlocks() - mem_base);
3938	    test_ret++;
3939            printf(" %d", n_ctx);
3940            printf(" %d", n_name);
3941            printf("\n");
3942        }
3943    }
3944    }
3945    function_tests++;
3946#endif
3947#endif
3948
3949    return(test_ret);
3950}
3951
3952
3953static int
3954test_xmlSAX2EndElementNs(void) {
3955    int test_ret = 0;
3956
3957    int mem_base;
3958    void * ctx; /* the user data (XML parser context) */
3959    int n_ctx;
3960    xmlChar * localname; /* the local name of the element */
3961    int n_localname;
3962    xmlChar * prefix; /* the element namespace prefix if available */
3963    int n_prefix;
3964    xmlChar * URI; /* the element namespace name if available */
3965    int n_URI;
3966
3967    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3968    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
3969    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
3970    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3971        mem_base = xmlMemBlocks();
3972        ctx = gen_void_ptr(n_ctx, 0);
3973        localname = gen_const_xmlChar_ptr(n_localname, 1);
3974        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
3975        URI = gen_const_xmlChar_ptr(n_URI, 3);
3976
3977        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
3978        call_tests++;
3979        des_void_ptr(n_ctx, ctx, 0);
3980        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
3981        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
3982        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
3983        xmlResetLastError();
3984        if (mem_base != xmlMemBlocks()) {
3985            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
3986	           xmlMemBlocks() - mem_base);
3987	    test_ret++;
3988            printf(" %d", n_ctx);
3989            printf(" %d", n_localname);
3990            printf(" %d", n_prefix);
3991            printf(" %d", n_URI);
3992            printf("\n");
3993        }
3994    }
3995    }
3996    }
3997    }
3998    function_tests++;
3999
4000    return(test_ret);
4001}
4002
4003
4004static int
4005test_xmlSAX2EntityDecl(void) {
4006    int test_ret = 0;
4007
4008    int mem_base;
4009    void * ctx; /* the user data (XML parser context) */
4010    int n_ctx;
4011    xmlChar * name; /* the entity name */
4012    int n_name;
4013    int type; /* the entity type */
4014    int n_type;
4015    xmlChar * publicId; /* The public ID of the entity */
4016    int n_publicId;
4017    xmlChar * systemId; /* The system ID of the entity */
4018    int n_systemId;
4019    xmlChar * content; /* the entity value (without processing). */
4020    int n_content;
4021
4022    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4023    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4024    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4025    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4026    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4027    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4028        mem_base = xmlMemBlocks();
4029        ctx = gen_void_ptr(n_ctx, 0);
4030        name = gen_const_xmlChar_ptr(n_name, 1);
4031        type = gen_int(n_type, 2);
4032        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4033        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4034        content = gen_xmlChar_ptr(n_content, 5);
4035
4036        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4037        call_tests++;
4038        des_void_ptr(n_ctx, ctx, 0);
4039        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4040        des_int(n_type, type, 2);
4041        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4042        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4043        des_xmlChar_ptr(n_content, content, 5);
4044        xmlResetLastError();
4045        if (mem_base != xmlMemBlocks()) {
4046            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4047	           xmlMemBlocks() - mem_base);
4048	    test_ret++;
4049            printf(" %d", n_ctx);
4050            printf(" %d", n_name);
4051            printf(" %d", n_type);
4052            printf(" %d", n_publicId);
4053            printf(" %d", n_systemId);
4054            printf(" %d", n_content);
4055            printf("\n");
4056        }
4057    }
4058    }
4059    }
4060    }
4061    }
4062    }
4063    function_tests++;
4064
4065    return(test_ret);
4066}
4067
4068
4069static int
4070test_xmlSAX2ExternalSubset(void) {
4071    int test_ret = 0;
4072
4073    int mem_base;
4074    void * ctx; /* the user data (XML parser context) */
4075    int n_ctx;
4076    xmlChar * name; /* the root element name */
4077    int n_name;
4078    xmlChar * ExternalID; /* the external ID */
4079    int n_ExternalID;
4080    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4081    int n_SystemID;
4082
4083    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4084    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4085    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4086    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4087        mem_base = xmlMemBlocks();
4088        ctx = gen_void_ptr(n_ctx, 0);
4089        name = gen_const_xmlChar_ptr(n_name, 1);
4090        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4091        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4092
4093        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4094        call_tests++;
4095        des_void_ptr(n_ctx, ctx, 0);
4096        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4097        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4098        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4099        xmlResetLastError();
4100        if (mem_base != xmlMemBlocks()) {
4101            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4102	           xmlMemBlocks() - mem_base);
4103	    test_ret++;
4104            printf(" %d", n_ctx);
4105            printf(" %d", n_name);
4106            printf(" %d", n_ExternalID);
4107            printf(" %d", n_SystemID);
4108            printf("\n");
4109        }
4110    }
4111    }
4112    }
4113    }
4114    function_tests++;
4115
4116    return(test_ret);
4117}
4118
4119
4120static int
4121test_xmlSAX2GetColumnNumber(void) {
4122    int test_ret = 0;
4123
4124    int mem_base;
4125    int ret_val;
4126    void * ctx; /* the user data (XML parser context) */
4127    int n_ctx;
4128
4129    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4130        mem_base = xmlMemBlocks();
4131        ctx = gen_void_ptr(n_ctx, 0);
4132
4133        ret_val = xmlSAX2GetColumnNumber(ctx);
4134        desret_int(ret_val);
4135        call_tests++;
4136        des_void_ptr(n_ctx, ctx, 0);
4137        xmlResetLastError();
4138        if (mem_base != xmlMemBlocks()) {
4139            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4140	           xmlMemBlocks() - mem_base);
4141	    test_ret++;
4142            printf(" %d", n_ctx);
4143            printf("\n");
4144        }
4145    }
4146    function_tests++;
4147
4148    return(test_ret);
4149}
4150
4151
4152static int
4153test_xmlSAX2GetEntity(void) {
4154    int test_ret = 0;
4155
4156    int mem_base;
4157    xmlEntityPtr ret_val;
4158    void * ctx; /* the user data (XML parser context) */
4159    int n_ctx;
4160    xmlChar * name; /* The entity name */
4161    int n_name;
4162
4163    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4164    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4165        mem_base = xmlMemBlocks();
4166        ctx = gen_void_ptr(n_ctx, 0);
4167        name = gen_const_xmlChar_ptr(n_name, 1);
4168
4169        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4170        desret_xmlEntityPtr(ret_val);
4171        call_tests++;
4172        des_void_ptr(n_ctx, ctx, 0);
4173        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4174        xmlResetLastError();
4175        if (mem_base != xmlMemBlocks()) {
4176            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4177	           xmlMemBlocks() - mem_base);
4178	    test_ret++;
4179            printf(" %d", n_ctx);
4180            printf(" %d", n_name);
4181            printf("\n");
4182        }
4183    }
4184    }
4185    function_tests++;
4186
4187    return(test_ret);
4188}
4189
4190
4191static int
4192test_xmlSAX2GetLineNumber(void) {
4193    int test_ret = 0;
4194
4195    int mem_base;
4196    int ret_val;
4197    void * ctx; /* the user data (XML parser context) */
4198    int n_ctx;
4199
4200    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4201        mem_base = xmlMemBlocks();
4202        ctx = gen_void_ptr(n_ctx, 0);
4203
4204        ret_val = xmlSAX2GetLineNumber(ctx);
4205        desret_int(ret_val);
4206        call_tests++;
4207        des_void_ptr(n_ctx, ctx, 0);
4208        xmlResetLastError();
4209        if (mem_base != xmlMemBlocks()) {
4210            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4211	           xmlMemBlocks() - mem_base);
4212	    test_ret++;
4213            printf(" %d", n_ctx);
4214            printf("\n");
4215        }
4216    }
4217    function_tests++;
4218
4219    return(test_ret);
4220}
4221
4222
4223static int
4224test_xmlSAX2GetParameterEntity(void) {
4225    int test_ret = 0;
4226
4227    int mem_base;
4228    xmlEntityPtr ret_val;
4229    void * ctx; /* the user data (XML parser context) */
4230    int n_ctx;
4231    xmlChar * name; /* The entity name */
4232    int n_name;
4233
4234    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4235    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4236        mem_base = xmlMemBlocks();
4237        ctx = gen_void_ptr(n_ctx, 0);
4238        name = gen_const_xmlChar_ptr(n_name, 1);
4239
4240        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4241        desret_xmlEntityPtr(ret_val);
4242        call_tests++;
4243        des_void_ptr(n_ctx, ctx, 0);
4244        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4245        xmlResetLastError();
4246        if (mem_base != xmlMemBlocks()) {
4247            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4248	           xmlMemBlocks() - mem_base);
4249	    test_ret++;
4250            printf(" %d", n_ctx);
4251            printf(" %d", n_name);
4252            printf("\n");
4253        }
4254    }
4255    }
4256    function_tests++;
4257
4258    return(test_ret);
4259}
4260
4261
4262static int
4263test_xmlSAX2GetPublicId(void) {
4264    int test_ret = 0;
4265
4266    int mem_base;
4267    const xmlChar * ret_val;
4268    void * ctx; /* the user data (XML parser context) */
4269    int n_ctx;
4270
4271    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4272        mem_base = xmlMemBlocks();
4273        ctx = gen_void_ptr(n_ctx, 0);
4274
4275        ret_val = xmlSAX2GetPublicId(ctx);
4276        desret_const_xmlChar_ptr(ret_val);
4277        call_tests++;
4278        des_void_ptr(n_ctx, ctx, 0);
4279        xmlResetLastError();
4280        if (mem_base != xmlMemBlocks()) {
4281            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4282	           xmlMemBlocks() - mem_base);
4283	    test_ret++;
4284            printf(" %d", n_ctx);
4285            printf("\n");
4286        }
4287    }
4288    function_tests++;
4289
4290    return(test_ret);
4291}
4292
4293
4294static int
4295test_xmlSAX2GetSystemId(void) {
4296    int test_ret = 0;
4297
4298    int mem_base;
4299    const xmlChar * ret_val;
4300    void * ctx; /* the user data (XML parser context) */
4301    int n_ctx;
4302
4303    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4304        mem_base = xmlMemBlocks();
4305        ctx = gen_void_ptr(n_ctx, 0);
4306
4307        ret_val = xmlSAX2GetSystemId(ctx);
4308        desret_const_xmlChar_ptr(ret_val);
4309        call_tests++;
4310        des_void_ptr(n_ctx, ctx, 0);
4311        xmlResetLastError();
4312        if (mem_base != xmlMemBlocks()) {
4313            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4314	           xmlMemBlocks() - mem_base);
4315	    test_ret++;
4316            printf(" %d", n_ctx);
4317            printf("\n");
4318        }
4319    }
4320    function_tests++;
4321
4322    return(test_ret);
4323}
4324
4325
4326static int
4327test_xmlSAX2HasExternalSubset(void) {
4328    int test_ret = 0;
4329
4330    int mem_base;
4331    int ret_val;
4332    void * ctx; /* the user data (XML parser context) */
4333    int n_ctx;
4334
4335    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4336        mem_base = xmlMemBlocks();
4337        ctx = gen_void_ptr(n_ctx, 0);
4338
4339        ret_val = xmlSAX2HasExternalSubset(ctx);
4340        desret_int(ret_val);
4341        call_tests++;
4342        des_void_ptr(n_ctx, ctx, 0);
4343        xmlResetLastError();
4344        if (mem_base != xmlMemBlocks()) {
4345            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4346	           xmlMemBlocks() - mem_base);
4347	    test_ret++;
4348            printf(" %d", n_ctx);
4349            printf("\n");
4350        }
4351    }
4352    function_tests++;
4353
4354    return(test_ret);
4355}
4356
4357
4358static int
4359test_xmlSAX2HasInternalSubset(void) {
4360    int test_ret = 0;
4361
4362    int mem_base;
4363    int ret_val;
4364    void * ctx; /* the user data (XML parser context) */
4365    int n_ctx;
4366
4367    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4368        mem_base = xmlMemBlocks();
4369        ctx = gen_void_ptr(n_ctx, 0);
4370
4371        ret_val = xmlSAX2HasInternalSubset(ctx);
4372        desret_int(ret_val);
4373        call_tests++;
4374        des_void_ptr(n_ctx, ctx, 0);
4375        xmlResetLastError();
4376        if (mem_base != xmlMemBlocks()) {
4377            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4378	           xmlMemBlocks() - mem_base);
4379	    test_ret++;
4380            printf(" %d", n_ctx);
4381            printf("\n");
4382        }
4383    }
4384    function_tests++;
4385
4386    return(test_ret);
4387}
4388
4389
4390static int
4391test_xmlSAX2IgnorableWhitespace(void) {
4392    int test_ret = 0;
4393
4394    int mem_base;
4395    void * ctx; /* the user data (XML parser context) */
4396    int n_ctx;
4397    xmlChar * ch; /* a xmlChar string */
4398    int n_ch;
4399    int len; /* the number of xmlChar */
4400    int n_len;
4401
4402    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4403    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4404    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4405        mem_base = xmlMemBlocks();
4406        ctx = gen_void_ptr(n_ctx, 0);
4407        ch = gen_const_xmlChar_ptr(n_ch, 1);
4408        len = gen_int(n_len, 2);
4409
4410        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4411        call_tests++;
4412        des_void_ptr(n_ctx, ctx, 0);
4413        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4414        des_int(n_len, len, 2);
4415        xmlResetLastError();
4416        if (mem_base != xmlMemBlocks()) {
4417            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4418	           xmlMemBlocks() - mem_base);
4419	    test_ret++;
4420            printf(" %d", n_ctx);
4421            printf(" %d", n_ch);
4422            printf(" %d", n_len);
4423            printf("\n");
4424        }
4425    }
4426    }
4427    }
4428    function_tests++;
4429
4430    return(test_ret);
4431}
4432
4433
4434#define gen_nb_xmlSAXHandler_ptr 1
4435static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4436    return(NULL);
4437}
4438static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4439}
4440
4441static int
4442test_xmlSAX2InitDefaultSAXHandler(void) {
4443    int test_ret = 0;
4444
4445    int mem_base;
4446    xmlSAXHandler * hdlr; /* the SAX handler */
4447    int n_hdlr;
4448    int warning; /* flag if non-zero sets the handler warning procedure */
4449    int n_warning;
4450
4451    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4452    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4453        mem_base = xmlMemBlocks();
4454        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4455        warning = gen_int(n_warning, 1);
4456
4457        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4458        call_tests++;
4459        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4460        des_int(n_warning, warning, 1);
4461        xmlResetLastError();
4462        if (mem_base != xmlMemBlocks()) {
4463            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4464	           xmlMemBlocks() - mem_base);
4465	    test_ret++;
4466            printf(" %d", n_hdlr);
4467            printf(" %d", n_warning);
4468            printf("\n");
4469        }
4470    }
4471    }
4472    function_tests++;
4473
4474    return(test_ret);
4475}
4476
4477
4478static int
4479test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4480    int test_ret = 0;
4481
4482#if defined(LIBXML_DOCB_ENABLED)
4483    int mem_base;
4484    xmlSAXHandler * hdlr; /* the SAX handler */
4485    int n_hdlr;
4486
4487    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4488        mem_base = xmlMemBlocks();
4489        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4490
4491        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4492        call_tests++;
4493        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4494        xmlResetLastError();
4495        if (mem_base != xmlMemBlocks()) {
4496            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4497	           xmlMemBlocks() - mem_base);
4498	    test_ret++;
4499            printf(" %d", n_hdlr);
4500            printf("\n");
4501        }
4502    }
4503    function_tests++;
4504#endif
4505
4506    return(test_ret);
4507}
4508
4509
4510static int
4511test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4512    int test_ret = 0;
4513
4514#if defined(LIBXML_HTML_ENABLED)
4515    int mem_base;
4516    xmlSAXHandler * hdlr; /* the SAX handler */
4517    int n_hdlr;
4518
4519    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4520        mem_base = xmlMemBlocks();
4521        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4522
4523        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4524        call_tests++;
4525        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4526        xmlResetLastError();
4527        if (mem_base != xmlMemBlocks()) {
4528            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4529	           xmlMemBlocks() - mem_base);
4530	    test_ret++;
4531            printf(" %d", n_hdlr);
4532            printf("\n");
4533        }
4534    }
4535    function_tests++;
4536#endif
4537
4538    return(test_ret);
4539}
4540
4541
4542static int
4543test_xmlSAX2InternalSubset(void) {
4544    int test_ret = 0;
4545
4546    int mem_base;
4547    void * ctx; /* the user data (XML parser context) */
4548    int n_ctx;
4549    xmlChar * name; /* the root element name */
4550    int n_name;
4551    xmlChar * ExternalID; /* the external ID */
4552    int n_ExternalID;
4553    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4554    int n_SystemID;
4555
4556    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4557    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4558    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4559    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4560        mem_base = xmlMemBlocks();
4561        ctx = gen_void_ptr(n_ctx, 0);
4562        name = gen_const_xmlChar_ptr(n_name, 1);
4563        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4564        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4565
4566        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4567        call_tests++;
4568        des_void_ptr(n_ctx, ctx, 0);
4569        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4570        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4571        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4572        xmlResetLastError();
4573        if (mem_base != xmlMemBlocks()) {
4574            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4575	           xmlMemBlocks() - mem_base);
4576	    test_ret++;
4577            printf(" %d", n_ctx);
4578            printf(" %d", n_name);
4579            printf(" %d", n_ExternalID);
4580            printf(" %d", n_SystemID);
4581            printf("\n");
4582        }
4583    }
4584    }
4585    }
4586    }
4587    function_tests++;
4588
4589    return(test_ret);
4590}
4591
4592
4593static int
4594test_xmlSAX2IsStandalone(void) {
4595    int test_ret = 0;
4596
4597    int mem_base;
4598    int ret_val;
4599    void * ctx; /* the user data (XML parser context) */
4600    int n_ctx;
4601
4602    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4603        mem_base = xmlMemBlocks();
4604        ctx = gen_void_ptr(n_ctx, 0);
4605
4606        ret_val = xmlSAX2IsStandalone(ctx);
4607        desret_int(ret_val);
4608        call_tests++;
4609        des_void_ptr(n_ctx, ctx, 0);
4610        xmlResetLastError();
4611        if (mem_base != xmlMemBlocks()) {
4612            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4613	           xmlMemBlocks() - mem_base);
4614	    test_ret++;
4615            printf(" %d", n_ctx);
4616            printf("\n");
4617        }
4618    }
4619    function_tests++;
4620
4621    return(test_ret);
4622}
4623
4624
4625static int
4626test_xmlSAX2NotationDecl(void) {
4627    int test_ret = 0;
4628
4629    int mem_base;
4630    void * ctx; /* the user data (XML parser context) */
4631    int n_ctx;
4632    xmlChar * name; /* The name of the notation */
4633    int n_name;
4634    xmlChar * publicId; /* The public ID of the entity */
4635    int n_publicId;
4636    xmlChar * systemId; /* The system ID of the entity */
4637    int n_systemId;
4638
4639    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4640    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4641    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4642    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4643        mem_base = xmlMemBlocks();
4644        ctx = gen_void_ptr(n_ctx, 0);
4645        name = gen_const_xmlChar_ptr(n_name, 1);
4646        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4647        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4648
4649        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4650        call_tests++;
4651        des_void_ptr(n_ctx, ctx, 0);
4652        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4653        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4654        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4655        xmlResetLastError();
4656        if (mem_base != xmlMemBlocks()) {
4657            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4658	           xmlMemBlocks() - mem_base);
4659	    test_ret++;
4660            printf(" %d", n_ctx);
4661            printf(" %d", n_name);
4662            printf(" %d", n_publicId);
4663            printf(" %d", n_systemId);
4664            printf("\n");
4665        }
4666    }
4667    }
4668    }
4669    }
4670    function_tests++;
4671
4672    return(test_ret);
4673}
4674
4675
4676static int
4677test_xmlSAX2ProcessingInstruction(void) {
4678    int test_ret = 0;
4679
4680    int mem_base;
4681    void * ctx; /* the user data (XML parser context) */
4682    int n_ctx;
4683    xmlChar * target; /* the target name */
4684    int n_target;
4685    xmlChar * data; /* the PI data's */
4686    int n_data;
4687
4688    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4689    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4690    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4691        mem_base = xmlMemBlocks();
4692        ctx = gen_void_ptr(n_ctx, 0);
4693        target = gen_const_xmlChar_ptr(n_target, 1);
4694        data = gen_const_xmlChar_ptr(n_data, 2);
4695
4696        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4697        call_tests++;
4698        des_void_ptr(n_ctx, ctx, 0);
4699        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4700        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4701        xmlResetLastError();
4702        if (mem_base != xmlMemBlocks()) {
4703            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4704	           xmlMemBlocks() - mem_base);
4705	    test_ret++;
4706            printf(" %d", n_ctx);
4707            printf(" %d", n_target);
4708            printf(" %d", n_data);
4709            printf("\n");
4710        }
4711    }
4712    }
4713    }
4714    function_tests++;
4715
4716    return(test_ret);
4717}
4718
4719
4720static int
4721test_xmlSAX2Reference(void) {
4722    int test_ret = 0;
4723
4724    int mem_base;
4725    void * ctx; /* the user data (XML parser context) */
4726    int n_ctx;
4727    xmlChar * name; /* The entity name */
4728    int n_name;
4729
4730    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4731    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4732        mem_base = xmlMemBlocks();
4733        ctx = gen_void_ptr(n_ctx, 0);
4734        name = gen_const_xmlChar_ptr(n_name, 1);
4735
4736        xmlSAX2Reference(ctx, (const xmlChar *)name);
4737        call_tests++;
4738        des_void_ptr(n_ctx, ctx, 0);
4739        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4740        xmlResetLastError();
4741        if (mem_base != xmlMemBlocks()) {
4742            printf("Leak of %d blocks found in xmlSAX2Reference",
4743	           xmlMemBlocks() - mem_base);
4744	    test_ret++;
4745            printf(" %d", n_ctx);
4746            printf(" %d", n_name);
4747            printf("\n");
4748        }
4749    }
4750    }
4751    function_tests++;
4752
4753    return(test_ret);
4754}
4755
4756
4757static int
4758test_xmlSAX2ResolveEntity(void) {
4759    int test_ret = 0;
4760
4761    int mem_base;
4762    xmlParserInputPtr ret_val;
4763    void * ctx; /* the user data (XML parser context) */
4764    int n_ctx;
4765    xmlChar * publicId; /* The public ID of the entity */
4766    int n_publicId;
4767    xmlChar * systemId; /* The system ID of the entity */
4768    int n_systemId;
4769
4770    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4771    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4772    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4773        mem_base = xmlMemBlocks();
4774        ctx = gen_void_ptr(n_ctx, 0);
4775        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4776        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4777
4778        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4779        desret_xmlParserInputPtr(ret_val);
4780        call_tests++;
4781        des_void_ptr(n_ctx, ctx, 0);
4782        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4783        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4784        xmlResetLastError();
4785        if (mem_base != xmlMemBlocks()) {
4786            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4787	           xmlMemBlocks() - mem_base);
4788	    test_ret++;
4789            printf(" %d", n_ctx);
4790            printf(" %d", n_publicId);
4791            printf(" %d", n_systemId);
4792            printf("\n");
4793        }
4794    }
4795    }
4796    }
4797    function_tests++;
4798
4799    return(test_ret);
4800}
4801
4802
4803#define gen_nb_xmlSAXLocatorPtr 1
4804static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4805    return(NULL);
4806}
4807static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4808}
4809
4810static int
4811test_xmlSAX2SetDocumentLocator(void) {
4812    int test_ret = 0;
4813
4814    int mem_base;
4815    void * ctx; /* the user data (XML parser context) */
4816    int n_ctx;
4817    xmlSAXLocatorPtr loc; /* A SAX Locator */
4818    int n_loc;
4819
4820    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4821    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4822        mem_base = xmlMemBlocks();
4823        ctx = gen_void_ptr(n_ctx, 0);
4824        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4825
4826        xmlSAX2SetDocumentLocator(ctx, loc);
4827        call_tests++;
4828        des_void_ptr(n_ctx, ctx, 0);
4829        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4830        xmlResetLastError();
4831        if (mem_base != xmlMemBlocks()) {
4832            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4833	           xmlMemBlocks() - mem_base);
4834	    test_ret++;
4835            printf(" %d", n_ctx);
4836            printf(" %d", n_loc);
4837            printf("\n");
4838        }
4839    }
4840    }
4841    function_tests++;
4842
4843    return(test_ret);
4844}
4845
4846
4847static int
4848test_xmlSAX2StartDocument(void) {
4849    int test_ret = 0;
4850
4851    int mem_base;
4852    void * ctx; /* the user data (XML parser context) */
4853    int n_ctx;
4854
4855    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4856        mem_base = xmlMemBlocks();
4857        ctx = gen_void_ptr(n_ctx, 0);
4858
4859        xmlSAX2StartDocument(ctx);
4860        call_tests++;
4861        des_void_ptr(n_ctx, ctx, 0);
4862        xmlResetLastError();
4863        if (mem_base != xmlMemBlocks()) {
4864            printf("Leak of %d blocks found in xmlSAX2StartDocument",
4865	           xmlMemBlocks() - mem_base);
4866	    test_ret++;
4867            printf(" %d", n_ctx);
4868            printf("\n");
4869        }
4870    }
4871    function_tests++;
4872
4873    return(test_ret);
4874}
4875
4876
4877static int
4878test_xmlSAX2StartElement(void) {
4879    int test_ret = 0;
4880
4881#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
4882#ifdef LIBXML_SAX1_ENABLED
4883    int mem_base;
4884    void * ctx; /* the user data (XML parser context) */
4885    int n_ctx;
4886    xmlChar * fullname; /* The element name, including namespace prefix */
4887    int n_fullname;
4888    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
4889    int n_atts;
4890
4891    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4892    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
4893    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
4894        mem_base = xmlMemBlocks();
4895        ctx = gen_void_ptr(n_ctx, 0);
4896        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
4897        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
4898
4899        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
4900        call_tests++;
4901        des_void_ptr(n_ctx, ctx, 0);
4902        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
4903        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
4904        xmlResetLastError();
4905        if (mem_base != xmlMemBlocks()) {
4906            printf("Leak of %d blocks found in xmlSAX2StartElement",
4907	           xmlMemBlocks() - mem_base);
4908	    test_ret++;
4909            printf(" %d", n_ctx);
4910            printf(" %d", n_fullname);
4911            printf(" %d", n_atts);
4912            printf("\n");
4913        }
4914    }
4915    }
4916    }
4917    function_tests++;
4918#endif
4919#endif
4920
4921    return(test_ret);
4922}
4923
4924
4925static int
4926test_xmlSAX2StartElementNs(void) {
4927    int test_ret = 0;
4928
4929    int mem_base;
4930    void * ctx; /* the user data (XML parser context) */
4931    int n_ctx;
4932    xmlChar * localname; /* the local name of the element */
4933    int n_localname;
4934    xmlChar * prefix; /* the element namespace prefix if available */
4935    int n_prefix;
4936    xmlChar * URI; /* the element namespace name if available */
4937    int n_URI;
4938    int nb_namespaces; /* number of namespace definitions on that node */
4939    int n_nb_namespaces;
4940    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
4941    int n_namespaces;
4942    int nb_attributes; /* the number of attributes on that node */
4943    int n_nb_attributes;
4944    int nb_defaulted; /* the number of defaulted attributes. */
4945    int n_nb_defaulted;
4946    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
4947    int n_attributes;
4948
4949    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4950    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4951    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4952    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4953    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
4954    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
4955    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
4956    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
4957    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
4958        mem_base = xmlMemBlocks();
4959        ctx = gen_void_ptr(n_ctx, 0);
4960        localname = gen_const_xmlChar_ptr(n_localname, 1);
4961        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4962        URI = gen_const_xmlChar_ptr(n_URI, 3);
4963        nb_namespaces = gen_int(n_nb_namespaces, 4);
4964        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
4965        nb_attributes = gen_int(n_nb_attributes, 6);
4966        nb_defaulted = gen_int(n_nb_defaulted, 7);
4967        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
4968
4969        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
4970        call_tests++;
4971        des_void_ptr(n_ctx, ctx, 0);
4972        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4973        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4974        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4975        des_int(n_nb_namespaces, nb_namespaces, 4);
4976        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
4977        des_int(n_nb_attributes, nb_attributes, 6);
4978        des_int(n_nb_defaulted, nb_defaulted, 7);
4979        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
4980        xmlResetLastError();
4981        if (mem_base != xmlMemBlocks()) {
4982            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
4983	           xmlMemBlocks() - mem_base);
4984	    test_ret++;
4985            printf(" %d", n_ctx);
4986            printf(" %d", n_localname);
4987            printf(" %d", n_prefix);
4988            printf(" %d", n_URI);
4989            printf(" %d", n_nb_namespaces);
4990            printf(" %d", n_namespaces);
4991            printf(" %d", n_nb_attributes);
4992            printf(" %d", n_nb_defaulted);
4993            printf(" %d", n_attributes);
4994            printf("\n");
4995        }
4996    }
4997    }
4998    }
4999    }
5000    }
5001    }
5002    }
5003    }
5004    }
5005    function_tests++;
5006
5007    return(test_ret);
5008}
5009
5010
5011static int
5012test_xmlSAX2UnparsedEntityDecl(void) {
5013    int test_ret = 0;
5014
5015    int mem_base;
5016    void * ctx; /* the user data (XML parser context) */
5017    int n_ctx;
5018    xmlChar * name; /* The name of the entity */
5019    int n_name;
5020    xmlChar * publicId; /* The public ID of the entity */
5021    int n_publicId;
5022    xmlChar * systemId; /* The system ID of the entity */
5023    int n_systemId;
5024    xmlChar * notationName; /* the name of the notation */
5025    int n_notationName;
5026
5027    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5028    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5029    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5030    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5031    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5032        mem_base = xmlMemBlocks();
5033        ctx = gen_void_ptr(n_ctx, 0);
5034        name = gen_const_xmlChar_ptr(n_name, 1);
5035        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5036        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5037        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5038
5039        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5040        call_tests++;
5041        des_void_ptr(n_ctx, ctx, 0);
5042        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5043        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5044        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5045        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5046        xmlResetLastError();
5047        if (mem_base != xmlMemBlocks()) {
5048            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5049	           xmlMemBlocks() - mem_base);
5050	    test_ret++;
5051            printf(" %d", n_ctx);
5052            printf(" %d", n_name);
5053            printf(" %d", n_publicId);
5054            printf(" %d", n_systemId);
5055            printf(" %d", n_notationName);
5056            printf("\n");
5057        }
5058    }
5059    }
5060    }
5061    }
5062    }
5063    function_tests++;
5064
5065    return(test_ret);
5066}
5067
5068
5069static int
5070test_xmlSAXDefaultVersion(void) {
5071    int test_ret = 0;
5072
5073#if defined(LIBXML_SAX1_ENABLED)
5074#ifdef LIBXML_SAX1_ENABLED
5075    int mem_base;
5076    int ret_val;
5077    int version; /* the version, 1 or 2 */
5078    int n_version;
5079
5080    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5081        mem_base = xmlMemBlocks();
5082        version = gen_int(n_version, 0);
5083
5084        ret_val = xmlSAXDefaultVersion(version);
5085        desret_int(ret_val);
5086        call_tests++;
5087        des_int(n_version, version, 0);
5088        xmlResetLastError();
5089        if (mem_base != xmlMemBlocks()) {
5090            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5091	           xmlMemBlocks() - mem_base);
5092	    test_ret++;
5093            printf(" %d", n_version);
5094            printf("\n");
5095        }
5096    }
5097    function_tests++;
5098#endif
5099#endif
5100
5101    return(test_ret);
5102}
5103
5104
5105static int
5106test_xmlSAXVersion(void) {
5107    int test_ret = 0;
5108
5109    int mem_base;
5110    int ret_val;
5111    xmlSAXHandler * hdlr; /* the SAX handler */
5112    int n_hdlr;
5113    int version; /* the version, 1 or 2 */
5114    int n_version;
5115
5116    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5117    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5118        mem_base = xmlMemBlocks();
5119        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5120        version = gen_int(n_version, 1);
5121
5122        ret_val = xmlSAXVersion(hdlr, version);
5123        desret_int(ret_val);
5124        call_tests++;
5125        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5126        des_int(n_version, version, 1);
5127        xmlResetLastError();
5128        if (mem_base != xmlMemBlocks()) {
5129            printf("Leak of %d blocks found in xmlSAXVersion",
5130	           xmlMemBlocks() - mem_base);
5131	    test_ret++;
5132            printf(" %d", n_hdlr);
5133            printf(" %d", n_version);
5134            printf("\n");
5135        }
5136    }
5137    }
5138    function_tests++;
5139
5140    return(test_ret);
5141}
5142
5143static int
5144test_SAX2(void) {
5145    int test_ret = 0;
5146
5147    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5148    test_ret += test_docbDefaultSAXHandlerInit();
5149    test_ret += test_htmlDefaultSAXHandlerInit();
5150    test_ret += test_xmlDefaultSAXHandlerInit();
5151    test_ret += test_xmlSAX2AttributeDecl();
5152    test_ret += test_xmlSAX2CDataBlock();
5153    test_ret += test_xmlSAX2Characters();
5154    test_ret += test_xmlSAX2Comment();
5155    test_ret += test_xmlSAX2ElementDecl();
5156    test_ret += test_xmlSAX2EndDocument();
5157    test_ret += test_xmlSAX2EndElement();
5158    test_ret += test_xmlSAX2EndElementNs();
5159    test_ret += test_xmlSAX2EntityDecl();
5160    test_ret += test_xmlSAX2ExternalSubset();
5161    test_ret += test_xmlSAX2GetColumnNumber();
5162    test_ret += test_xmlSAX2GetEntity();
5163    test_ret += test_xmlSAX2GetLineNumber();
5164    test_ret += test_xmlSAX2GetParameterEntity();
5165    test_ret += test_xmlSAX2GetPublicId();
5166    test_ret += test_xmlSAX2GetSystemId();
5167    test_ret += test_xmlSAX2HasExternalSubset();
5168    test_ret += test_xmlSAX2HasInternalSubset();
5169    test_ret += test_xmlSAX2IgnorableWhitespace();
5170    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5171    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5172    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5173    test_ret += test_xmlSAX2InternalSubset();
5174    test_ret += test_xmlSAX2IsStandalone();
5175    test_ret += test_xmlSAX2NotationDecl();
5176    test_ret += test_xmlSAX2ProcessingInstruction();
5177    test_ret += test_xmlSAX2Reference();
5178    test_ret += test_xmlSAX2ResolveEntity();
5179    test_ret += test_xmlSAX2SetDocumentLocator();
5180    test_ret += test_xmlSAX2StartDocument();
5181    test_ret += test_xmlSAX2StartElement();
5182    test_ret += test_xmlSAX2StartElementNs();
5183    test_ret += test_xmlSAX2UnparsedEntityDecl();
5184    test_ret += test_xmlSAXDefaultVersion();
5185    test_ret += test_xmlSAXVersion();
5186
5187    if (test_ret != 0)
5188	printf("Module SAX2: %d errors\n", test_ret);
5189    return(test_ret);
5190}
5191
5192static int
5193test_xmlC14NDocDumpMemory(void) {
5194    int test_ret = 0;
5195
5196#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5197    int mem_base;
5198    int ret_val;
5199    xmlDocPtr doc; /* the XML document for canonization */
5200    int n_doc;
5201    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5202    int n_nodes;
5203    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5204    int n_exclusive;
5205    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) */
5206    int n_inclusive_ns_prefixes;
5207    int with_comments; /* include comments in the result (!=0) or not (==0) */
5208    int n_with_comments;
5209    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 */
5210    int n_doc_txt_ptr;
5211
5212    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5213    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5214    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5215    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5216    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5217    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5218        mem_base = xmlMemBlocks();
5219        doc = gen_xmlDocPtr(n_doc, 0);
5220        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5221        exclusive = gen_int(n_exclusive, 2);
5222        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5223        with_comments = gen_int(n_with_comments, 4);
5224        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5225
5226        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5227        desret_int(ret_val);
5228        call_tests++;
5229        des_xmlDocPtr(n_doc, doc, 0);
5230        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5231        des_int(n_exclusive, exclusive, 2);
5232        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5233        des_int(n_with_comments, with_comments, 4);
5234        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5235        xmlResetLastError();
5236        if (mem_base != xmlMemBlocks()) {
5237            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5238	           xmlMemBlocks() - mem_base);
5239	    test_ret++;
5240            printf(" %d", n_doc);
5241            printf(" %d", n_nodes);
5242            printf(" %d", n_exclusive);
5243            printf(" %d", n_inclusive_ns_prefixes);
5244            printf(" %d", n_with_comments);
5245            printf(" %d", n_doc_txt_ptr);
5246            printf("\n");
5247        }
5248    }
5249    }
5250    }
5251    }
5252    }
5253    }
5254    function_tests++;
5255#endif
5256
5257    return(test_ret);
5258}
5259
5260
5261static int
5262test_xmlC14NDocSave(void) {
5263    int test_ret = 0;
5264
5265#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5266    int mem_base;
5267    int ret_val;
5268    xmlDocPtr doc; /* the XML document for canonization */
5269    int n_doc;
5270    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5271    int n_nodes;
5272    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5273    int n_exclusive;
5274    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) */
5275    int n_inclusive_ns_prefixes;
5276    int with_comments; /* include comments in the result (!=0) or not (==0) */
5277    int n_with_comments;
5278    const char * filename; /* the filename to store canonical XML image */
5279    int n_filename;
5280    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5281    int n_compression;
5282
5283    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5284    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5285    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5286    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5287    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5288    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5289    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5290        mem_base = xmlMemBlocks();
5291        doc = gen_xmlDocPtr(n_doc, 0);
5292        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5293        exclusive = gen_int(n_exclusive, 2);
5294        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5295        with_comments = gen_int(n_with_comments, 4);
5296        filename = gen_fileoutput(n_filename, 5);
5297        compression = gen_int(n_compression, 6);
5298
5299        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5300        desret_int(ret_val);
5301        call_tests++;
5302        des_xmlDocPtr(n_doc, doc, 0);
5303        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5304        des_int(n_exclusive, exclusive, 2);
5305        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5306        des_int(n_with_comments, with_comments, 4);
5307        des_fileoutput(n_filename, filename, 5);
5308        des_int(n_compression, compression, 6);
5309        xmlResetLastError();
5310        if (mem_base != xmlMemBlocks()) {
5311            printf("Leak of %d blocks found in xmlC14NDocSave",
5312	           xmlMemBlocks() - mem_base);
5313	    test_ret++;
5314            printf(" %d", n_doc);
5315            printf(" %d", n_nodes);
5316            printf(" %d", n_exclusive);
5317            printf(" %d", n_inclusive_ns_prefixes);
5318            printf(" %d", n_with_comments);
5319            printf(" %d", n_filename);
5320            printf(" %d", n_compression);
5321            printf("\n");
5322        }
5323    }
5324    }
5325    }
5326    }
5327    }
5328    }
5329    }
5330    function_tests++;
5331#endif
5332
5333    return(test_ret);
5334}
5335
5336
5337static int
5338test_xmlC14NDocSaveTo(void) {
5339    int test_ret = 0;
5340
5341#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5342    int mem_base;
5343    int ret_val;
5344    xmlDocPtr doc; /* the XML document for canonization */
5345    int n_doc;
5346    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5347    int n_nodes;
5348    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5349    int n_exclusive;
5350    xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5351    int n_inclusive_ns_prefixes;
5352    int with_comments; /* include comments in the result (!=0) or not (==0) */
5353    int n_with_comments;
5354    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5355    int n_buf;
5356
5357    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5358    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5359    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5360    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5361    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5362    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5363        mem_base = xmlMemBlocks();
5364        doc = gen_xmlDocPtr(n_doc, 0);
5365        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5366        exclusive = gen_int(n_exclusive, 2);
5367        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5368        with_comments = gen_int(n_with_comments, 4);
5369        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5370
5371        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5372        desret_int(ret_val);
5373        call_tests++;
5374        des_xmlDocPtr(n_doc, doc, 0);
5375        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5376        des_int(n_exclusive, exclusive, 2);
5377        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5378        des_int(n_with_comments, with_comments, 4);
5379        des_xmlOutputBufferPtr(n_buf, buf, 5);
5380        xmlResetLastError();
5381        if (mem_base != xmlMemBlocks()) {
5382            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5383	           xmlMemBlocks() - mem_base);
5384	    test_ret++;
5385            printf(" %d", n_doc);
5386            printf(" %d", n_nodes);
5387            printf(" %d", n_exclusive);
5388            printf(" %d", n_inclusive_ns_prefixes);
5389            printf(" %d", n_with_comments);
5390            printf(" %d", n_buf);
5391            printf("\n");
5392        }
5393    }
5394    }
5395    }
5396    }
5397    }
5398    }
5399    function_tests++;
5400#endif
5401
5402    return(test_ret);
5403}
5404
5405
5406static int
5407test_xmlC14NExecute(void) {
5408    int test_ret = 0;
5409
5410
5411    /* missing type support */
5412    return(test_ret);
5413}
5414
5415static int
5416test_c14n(void) {
5417    int test_ret = 0;
5418
5419    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5420    test_ret += test_xmlC14NDocDumpMemory();
5421    test_ret += test_xmlC14NDocSave();
5422    test_ret += test_xmlC14NDocSaveTo();
5423    test_ret += test_xmlC14NExecute();
5424
5425    if (test_ret != 0)
5426	printf("Module c14n: %d errors\n", test_ret);
5427    return(test_ret);
5428}
5429#ifdef LIBXML_CATALOG_ENABLED
5430
5431#define gen_nb_xmlCatalogPtr 1
5432static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5433    return(NULL);
5434}
5435static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5436}
5437#endif
5438
5439
5440static int
5441test_xmlACatalogAdd(void) {
5442    int test_ret = 0;
5443
5444#if defined(LIBXML_CATALOG_ENABLED)
5445    int mem_base;
5446    int ret_val;
5447    xmlCatalogPtr catal; /* a Catalog */
5448    int n_catal;
5449    xmlChar * type; /* the type of record to add to the catalog */
5450    int n_type;
5451    xmlChar * orig; /* the system, public or prefix to match */
5452    int n_orig;
5453    xmlChar * replace; /* the replacement value for the match */
5454    int n_replace;
5455
5456    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5457    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5458    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5459    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5460        mem_base = xmlMemBlocks();
5461        catal = gen_xmlCatalogPtr(n_catal, 0);
5462        type = gen_const_xmlChar_ptr(n_type, 1);
5463        orig = gen_const_xmlChar_ptr(n_orig, 2);
5464        replace = gen_const_xmlChar_ptr(n_replace, 3);
5465
5466        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5467        desret_int(ret_val);
5468        call_tests++;
5469        des_xmlCatalogPtr(n_catal, catal, 0);
5470        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5471        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5472        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5473        xmlResetLastError();
5474        if (mem_base != xmlMemBlocks()) {
5475            printf("Leak of %d blocks found in xmlACatalogAdd",
5476	           xmlMemBlocks() - mem_base);
5477	    test_ret++;
5478            printf(" %d", n_catal);
5479            printf(" %d", n_type);
5480            printf(" %d", n_orig);
5481            printf(" %d", n_replace);
5482            printf("\n");
5483        }
5484    }
5485    }
5486    }
5487    }
5488    function_tests++;
5489#endif
5490
5491    return(test_ret);
5492}
5493
5494
5495static int
5496test_xmlACatalogDump(void) {
5497    int test_ret = 0;
5498
5499#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5500    int mem_base;
5501    xmlCatalogPtr catal; /* a Catalog */
5502    int n_catal;
5503    FILE * out; /* the file. */
5504    int n_out;
5505
5506    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5507    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5508        mem_base = xmlMemBlocks();
5509        catal = gen_xmlCatalogPtr(n_catal, 0);
5510        out = gen_FILE_ptr(n_out, 1);
5511
5512        xmlACatalogDump(catal, out);
5513        call_tests++;
5514        des_xmlCatalogPtr(n_catal, catal, 0);
5515        des_FILE_ptr(n_out, out, 1);
5516        xmlResetLastError();
5517        if (mem_base != xmlMemBlocks()) {
5518            printf("Leak of %d blocks found in xmlACatalogDump",
5519	           xmlMemBlocks() - mem_base);
5520	    test_ret++;
5521            printf(" %d", n_catal);
5522            printf(" %d", n_out);
5523            printf("\n");
5524        }
5525    }
5526    }
5527    function_tests++;
5528#endif
5529
5530    return(test_ret);
5531}
5532
5533
5534static int
5535test_xmlACatalogRemove(void) {
5536    int test_ret = 0;
5537
5538#if defined(LIBXML_CATALOG_ENABLED)
5539    int mem_base;
5540    int ret_val;
5541    xmlCatalogPtr catal; /* a Catalog */
5542    int n_catal;
5543    xmlChar * value; /* the value to remove */
5544    int n_value;
5545
5546    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5547    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5548        mem_base = xmlMemBlocks();
5549        catal = gen_xmlCatalogPtr(n_catal, 0);
5550        value = gen_const_xmlChar_ptr(n_value, 1);
5551
5552        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5553        desret_int(ret_val);
5554        call_tests++;
5555        des_xmlCatalogPtr(n_catal, catal, 0);
5556        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5557        xmlResetLastError();
5558        if (mem_base != xmlMemBlocks()) {
5559            printf("Leak of %d blocks found in xmlACatalogRemove",
5560	           xmlMemBlocks() - mem_base);
5561	    test_ret++;
5562            printf(" %d", n_catal);
5563            printf(" %d", n_value);
5564            printf("\n");
5565        }
5566    }
5567    }
5568    function_tests++;
5569#endif
5570
5571    return(test_ret);
5572}
5573
5574
5575static int
5576test_xmlACatalogResolve(void) {
5577    int test_ret = 0;
5578
5579#if defined(LIBXML_CATALOG_ENABLED)
5580    int mem_base;
5581    xmlChar * ret_val;
5582    xmlCatalogPtr catal; /* a Catalog */
5583    int n_catal;
5584    xmlChar * pubID; /* the public ID string */
5585    int n_pubID;
5586    xmlChar * sysID; /* the system ID string */
5587    int n_sysID;
5588
5589    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5590    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5591    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5592        mem_base = xmlMemBlocks();
5593        catal = gen_xmlCatalogPtr(n_catal, 0);
5594        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5595        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5596
5597        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5598        desret_xmlChar_ptr(ret_val);
5599        call_tests++;
5600        des_xmlCatalogPtr(n_catal, catal, 0);
5601        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5602        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5603        xmlResetLastError();
5604        if (mem_base != xmlMemBlocks()) {
5605            printf("Leak of %d blocks found in xmlACatalogResolve",
5606	           xmlMemBlocks() - mem_base);
5607	    test_ret++;
5608            printf(" %d", n_catal);
5609            printf(" %d", n_pubID);
5610            printf(" %d", n_sysID);
5611            printf("\n");
5612        }
5613    }
5614    }
5615    }
5616    function_tests++;
5617#endif
5618
5619    return(test_ret);
5620}
5621
5622
5623static int
5624test_xmlACatalogResolvePublic(void) {
5625    int test_ret = 0;
5626
5627#if defined(LIBXML_CATALOG_ENABLED)
5628    int mem_base;
5629    xmlChar * ret_val;
5630    xmlCatalogPtr catal; /* a Catalog */
5631    int n_catal;
5632    xmlChar * pubID; /* the public ID string */
5633    int n_pubID;
5634
5635    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5636    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5637        mem_base = xmlMemBlocks();
5638        catal = gen_xmlCatalogPtr(n_catal, 0);
5639        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5640
5641        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5642        desret_xmlChar_ptr(ret_val);
5643        call_tests++;
5644        des_xmlCatalogPtr(n_catal, catal, 0);
5645        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5646        xmlResetLastError();
5647        if (mem_base != xmlMemBlocks()) {
5648            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5649	           xmlMemBlocks() - mem_base);
5650	    test_ret++;
5651            printf(" %d", n_catal);
5652            printf(" %d", n_pubID);
5653            printf("\n");
5654        }
5655    }
5656    }
5657    function_tests++;
5658#endif
5659
5660    return(test_ret);
5661}
5662
5663
5664static int
5665test_xmlACatalogResolveSystem(void) {
5666    int test_ret = 0;
5667
5668#if defined(LIBXML_CATALOG_ENABLED)
5669    int mem_base;
5670    xmlChar * ret_val;
5671    xmlCatalogPtr catal; /* a Catalog */
5672    int n_catal;
5673    xmlChar * sysID; /* the system ID string */
5674    int n_sysID;
5675
5676    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5677    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5678        mem_base = xmlMemBlocks();
5679        catal = gen_xmlCatalogPtr(n_catal, 0);
5680        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5681
5682        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5683        desret_xmlChar_ptr(ret_val);
5684        call_tests++;
5685        des_xmlCatalogPtr(n_catal, catal, 0);
5686        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5687        xmlResetLastError();
5688        if (mem_base != xmlMemBlocks()) {
5689            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5690	           xmlMemBlocks() - mem_base);
5691	    test_ret++;
5692            printf(" %d", n_catal);
5693            printf(" %d", n_sysID);
5694            printf("\n");
5695        }
5696    }
5697    }
5698    function_tests++;
5699#endif
5700
5701    return(test_ret);
5702}
5703
5704
5705static int
5706test_xmlACatalogResolveURI(void) {
5707    int test_ret = 0;
5708
5709#if defined(LIBXML_CATALOG_ENABLED)
5710    int mem_base;
5711    xmlChar * ret_val;
5712    xmlCatalogPtr catal; /* a Catalog */
5713    int n_catal;
5714    xmlChar * URI; /* the URI */
5715    int n_URI;
5716
5717    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5718    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5719        mem_base = xmlMemBlocks();
5720        catal = gen_xmlCatalogPtr(n_catal, 0);
5721        URI = gen_const_xmlChar_ptr(n_URI, 1);
5722
5723        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5724        desret_xmlChar_ptr(ret_val);
5725        call_tests++;
5726        des_xmlCatalogPtr(n_catal, catal, 0);
5727        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5728        xmlResetLastError();
5729        if (mem_base != xmlMemBlocks()) {
5730            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5731	           xmlMemBlocks() - mem_base);
5732	    test_ret++;
5733            printf(" %d", n_catal);
5734            printf(" %d", n_URI);
5735            printf("\n");
5736        }
5737    }
5738    }
5739    function_tests++;
5740#endif
5741
5742    return(test_ret);
5743}
5744
5745
5746static int
5747test_xmlCatalogAdd(void) {
5748    int test_ret = 0;
5749
5750#if defined(LIBXML_CATALOG_ENABLED)
5751    int mem_base;
5752    int ret_val;
5753    xmlChar * type; /* the type of record to add to the catalog */
5754    int n_type;
5755    xmlChar * orig; /* the system, public or prefix to match */
5756    int n_orig;
5757    xmlChar * replace; /* the replacement value for the match */
5758    int n_replace;
5759
5760    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5761    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5762    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5763        mem_base = xmlMemBlocks();
5764        type = gen_const_xmlChar_ptr(n_type, 0);
5765        orig = gen_const_xmlChar_ptr(n_orig, 1);
5766        replace = gen_const_xmlChar_ptr(n_replace, 2);
5767
5768        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5769        desret_int(ret_val);
5770        call_tests++;
5771        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5772        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5773        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5774        xmlResetLastError();
5775        if (mem_base != xmlMemBlocks()) {
5776            printf("Leak of %d blocks found in xmlCatalogAdd",
5777	           xmlMemBlocks() - mem_base);
5778	    test_ret++;
5779            printf(" %d", n_type);
5780            printf(" %d", n_orig);
5781            printf(" %d", n_replace);
5782            printf("\n");
5783        }
5784    }
5785    }
5786    }
5787    function_tests++;
5788#endif
5789
5790    return(test_ret);
5791}
5792
5793
5794static int
5795test_xmlCatalogCleanup(void) {
5796    int test_ret = 0;
5797
5798#if defined(LIBXML_CATALOG_ENABLED)
5799
5800
5801        xmlCatalogCleanup();
5802        call_tests++;
5803        xmlResetLastError();
5804    function_tests++;
5805#endif
5806
5807    return(test_ret);
5808}
5809
5810
5811static int
5812test_xmlCatalogConvert(void) {
5813    int test_ret = 0;
5814
5815#if defined(LIBXML_CATALOG_ENABLED)
5816    int ret_val;
5817
5818
5819        ret_val = xmlCatalogConvert();
5820        desret_int(ret_val);
5821        call_tests++;
5822        xmlResetLastError();
5823    function_tests++;
5824#endif
5825
5826    return(test_ret);
5827}
5828
5829
5830static int
5831test_xmlCatalogDump(void) {
5832    int test_ret = 0;
5833
5834#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5835    int mem_base;
5836    FILE * out; /* the file. */
5837    int n_out;
5838
5839    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5840        mem_base = xmlMemBlocks();
5841        out = gen_FILE_ptr(n_out, 0);
5842
5843        xmlCatalogDump(out);
5844        call_tests++;
5845        des_FILE_ptr(n_out, out, 0);
5846        xmlResetLastError();
5847        if (mem_base != xmlMemBlocks()) {
5848            printf("Leak of %d blocks found in xmlCatalogDump",
5849	           xmlMemBlocks() - mem_base);
5850	    test_ret++;
5851            printf(" %d", n_out);
5852            printf("\n");
5853        }
5854    }
5855    function_tests++;
5856#endif
5857
5858    return(test_ret);
5859}
5860
5861
5862static int
5863test_xmlCatalogGetDefaults(void) {
5864    int test_ret = 0;
5865
5866#if defined(LIBXML_CATALOG_ENABLED)
5867    int mem_base;
5868    xmlCatalogAllow ret_val;
5869
5870        mem_base = xmlMemBlocks();
5871
5872        ret_val = xmlCatalogGetDefaults();
5873        desret_xmlCatalogAllow(ret_val);
5874        call_tests++;
5875        xmlResetLastError();
5876        if (mem_base != xmlMemBlocks()) {
5877            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
5878	           xmlMemBlocks() - mem_base);
5879	    test_ret++;
5880            printf("\n");
5881        }
5882    function_tests++;
5883#endif
5884
5885    return(test_ret);
5886}
5887
5888
5889static int
5890test_xmlCatalogIsEmpty(void) {
5891    int test_ret = 0;
5892
5893#if defined(LIBXML_CATALOG_ENABLED)
5894    int mem_base;
5895    int ret_val;
5896    xmlCatalogPtr catal; /* should this create an SGML catalog */
5897    int n_catal;
5898
5899    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5900        mem_base = xmlMemBlocks();
5901        catal = gen_xmlCatalogPtr(n_catal, 0);
5902
5903        ret_val = xmlCatalogIsEmpty(catal);
5904        desret_int(ret_val);
5905        call_tests++;
5906        des_xmlCatalogPtr(n_catal, catal, 0);
5907        xmlResetLastError();
5908        if (mem_base != xmlMemBlocks()) {
5909            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
5910	           xmlMemBlocks() - mem_base);
5911	    test_ret++;
5912            printf(" %d", n_catal);
5913            printf("\n");
5914        }
5915    }
5916    function_tests++;
5917#endif
5918
5919    return(test_ret);
5920}
5921
5922
5923static int
5924test_xmlCatalogLocalResolve(void) {
5925    int test_ret = 0;
5926
5927#if defined(LIBXML_CATALOG_ENABLED)
5928    int mem_base;
5929    xmlChar * ret_val;
5930    void * catalogs; /* a document's list of catalogs */
5931    int n_catalogs;
5932    xmlChar * pubID; /* the public ID string */
5933    int n_pubID;
5934    xmlChar * sysID; /* the system ID string */
5935    int n_sysID;
5936
5937    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5938    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5939    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5940        mem_base = xmlMemBlocks();
5941        catalogs = gen_void_ptr(n_catalogs, 0);
5942        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5943        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5944
5945        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
5946        desret_xmlChar_ptr(ret_val);
5947        call_tests++;
5948        des_void_ptr(n_catalogs, catalogs, 0);
5949        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5950        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5951        xmlResetLastError();
5952        if (mem_base != xmlMemBlocks()) {
5953            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
5954	           xmlMemBlocks() - mem_base);
5955	    test_ret++;
5956            printf(" %d", n_catalogs);
5957            printf(" %d", n_pubID);
5958            printf(" %d", n_sysID);
5959            printf("\n");
5960        }
5961    }
5962    }
5963    }
5964    function_tests++;
5965#endif
5966
5967    return(test_ret);
5968}
5969
5970
5971static int
5972test_xmlCatalogLocalResolveURI(void) {
5973    int test_ret = 0;
5974
5975#if defined(LIBXML_CATALOG_ENABLED)
5976    int mem_base;
5977    xmlChar * ret_val;
5978    void * catalogs; /* a document's list of catalogs */
5979    int n_catalogs;
5980    xmlChar * URI; /* the URI */
5981    int n_URI;
5982
5983    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5984    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5985        mem_base = xmlMemBlocks();
5986        catalogs = gen_void_ptr(n_catalogs, 0);
5987        URI = gen_const_xmlChar_ptr(n_URI, 1);
5988
5989        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
5990        desret_xmlChar_ptr(ret_val);
5991        call_tests++;
5992        des_void_ptr(n_catalogs, catalogs, 0);
5993        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5994        xmlResetLastError();
5995        if (mem_base != xmlMemBlocks()) {
5996            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
5997	           xmlMemBlocks() - mem_base);
5998	    test_ret++;
5999            printf(" %d", n_catalogs);
6000            printf(" %d", n_URI);
6001            printf("\n");
6002        }
6003    }
6004    }
6005    function_tests++;
6006#endif
6007
6008    return(test_ret);
6009}
6010
6011
6012static int
6013test_xmlCatalogRemove(void) {
6014    int test_ret = 0;
6015
6016#if defined(LIBXML_CATALOG_ENABLED)
6017    int ret_val;
6018    xmlChar * value; /* the value to remove */
6019    int n_value;
6020
6021    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6022        value = gen_const_xmlChar_ptr(n_value, 0);
6023
6024        ret_val = xmlCatalogRemove((const xmlChar *)value);
6025        desret_int(ret_val);
6026        call_tests++;
6027        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6028        xmlResetLastError();
6029    }
6030    function_tests++;
6031#endif
6032
6033    return(test_ret);
6034}
6035
6036
6037static int
6038test_xmlCatalogResolve(void) {
6039    int test_ret = 0;
6040
6041#if defined(LIBXML_CATALOG_ENABLED)
6042    int mem_base;
6043    xmlChar * ret_val;
6044    xmlChar * pubID; /* the public ID string */
6045    int n_pubID;
6046    xmlChar * sysID; /* the system ID string */
6047    int n_sysID;
6048
6049    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6050    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6051        mem_base = xmlMemBlocks();
6052        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6053        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6054
6055        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6056        desret_xmlChar_ptr(ret_val);
6057        call_tests++;
6058        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6059        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6060        xmlResetLastError();
6061        if (mem_base != xmlMemBlocks()) {
6062            printf("Leak of %d blocks found in xmlCatalogResolve",
6063	           xmlMemBlocks() - mem_base);
6064	    test_ret++;
6065            printf(" %d", n_pubID);
6066            printf(" %d", n_sysID);
6067            printf("\n");
6068        }
6069    }
6070    }
6071    function_tests++;
6072#endif
6073
6074    return(test_ret);
6075}
6076
6077
6078static int
6079test_xmlCatalogResolvePublic(void) {
6080    int test_ret = 0;
6081
6082#if defined(LIBXML_CATALOG_ENABLED)
6083    int mem_base;
6084    xmlChar * ret_val;
6085    xmlChar * pubID; /* the public ID string */
6086    int n_pubID;
6087
6088    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6089        mem_base = xmlMemBlocks();
6090        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6091
6092        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6093        desret_xmlChar_ptr(ret_val);
6094        call_tests++;
6095        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6096        xmlResetLastError();
6097        if (mem_base != xmlMemBlocks()) {
6098            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6099	           xmlMemBlocks() - mem_base);
6100	    test_ret++;
6101            printf(" %d", n_pubID);
6102            printf("\n");
6103        }
6104    }
6105    function_tests++;
6106#endif
6107
6108    return(test_ret);
6109}
6110
6111
6112static int
6113test_xmlCatalogResolveSystem(void) {
6114    int test_ret = 0;
6115
6116#if defined(LIBXML_CATALOG_ENABLED)
6117    int mem_base;
6118    xmlChar * ret_val;
6119    xmlChar * sysID; /* the system ID string */
6120    int n_sysID;
6121
6122    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6123        mem_base = xmlMemBlocks();
6124        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6125
6126        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6127        desret_xmlChar_ptr(ret_val);
6128        call_tests++;
6129        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6130        xmlResetLastError();
6131        if (mem_base != xmlMemBlocks()) {
6132            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6133	           xmlMemBlocks() - mem_base);
6134	    test_ret++;
6135            printf(" %d", n_sysID);
6136            printf("\n");
6137        }
6138    }
6139    function_tests++;
6140#endif
6141
6142    return(test_ret);
6143}
6144
6145
6146static int
6147test_xmlCatalogResolveURI(void) {
6148    int test_ret = 0;
6149
6150#if defined(LIBXML_CATALOG_ENABLED)
6151    int mem_base;
6152    xmlChar * ret_val;
6153    xmlChar * URI; /* the URI */
6154    int n_URI;
6155
6156    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6157        mem_base = xmlMemBlocks();
6158        URI = gen_const_xmlChar_ptr(n_URI, 0);
6159
6160        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6161        desret_xmlChar_ptr(ret_val);
6162        call_tests++;
6163        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6164        xmlResetLastError();
6165        if (mem_base != xmlMemBlocks()) {
6166            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6167	           xmlMemBlocks() - mem_base);
6168	    test_ret++;
6169            printf(" %d", n_URI);
6170            printf("\n");
6171        }
6172    }
6173    function_tests++;
6174#endif
6175
6176    return(test_ret);
6177}
6178
6179
6180static int
6181test_xmlCatalogSetDefaultPrefer(void) {
6182    int test_ret = 0;
6183
6184#if defined(LIBXML_CATALOG_ENABLED)
6185    int mem_base;
6186    xmlCatalogPrefer ret_val;
6187    xmlCatalogPrefer prefer; /* the default preference for delegation */
6188    int n_prefer;
6189
6190    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6191        mem_base = xmlMemBlocks();
6192        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6193
6194        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6195        desret_xmlCatalogPrefer(ret_val);
6196        call_tests++;
6197        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6198        xmlResetLastError();
6199        if (mem_base != xmlMemBlocks()) {
6200            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6201	           xmlMemBlocks() - mem_base);
6202	    test_ret++;
6203            printf(" %d", n_prefer);
6204            printf("\n");
6205        }
6206    }
6207    function_tests++;
6208#endif
6209
6210    return(test_ret);
6211}
6212
6213
6214static int
6215test_xmlCatalogSetDefaults(void) {
6216    int test_ret = 0;
6217
6218#if defined(LIBXML_CATALOG_ENABLED)
6219    int mem_base;
6220    xmlCatalogAllow allow; /* what catalogs should be accepted */
6221    int n_allow;
6222
6223    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6224        mem_base = xmlMemBlocks();
6225        allow = gen_xmlCatalogAllow(n_allow, 0);
6226
6227        xmlCatalogSetDefaults(allow);
6228        call_tests++;
6229        des_xmlCatalogAllow(n_allow, allow, 0);
6230        xmlResetLastError();
6231        if (mem_base != xmlMemBlocks()) {
6232            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6233	           xmlMemBlocks() - mem_base);
6234	    test_ret++;
6235            printf(" %d", n_allow);
6236            printf("\n");
6237        }
6238    }
6239    function_tests++;
6240#endif
6241
6242    return(test_ret);
6243}
6244
6245
6246static int
6247test_xmlConvertSGMLCatalog(void) {
6248    int test_ret = 0;
6249
6250#if defined(LIBXML_CATALOG_ENABLED)
6251    int mem_base;
6252    int ret_val;
6253    xmlCatalogPtr catal; /* the catalog */
6254    int n_catal;
6255
6256    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6257        mem_base = xmlMemBlocks();
6258        catal = gen_xmlCatalogPtr(n_catal, 0);
6259
6260        ret_val = xmlConvertSGMLCatalog(catal);
6261        desret_int(ret_val);
6262        call_tests++;
6263        des_xmlCatalogPtr(n_catal, catal, 0);
6264        xmlResetLastError();
6265        if (mem_base != xmlMemBlocks()) {
6266            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6267	           xmlMemBlocks() - mem_base);
6268	    test_ret++;
6269            printf(" %d", n_catal);
6270            printf("\n");
6271        }
6272    }
6273    function_tests++;
6274#endif
6275
6276    return(test_ret);
6277}
6278
6279
6280static int
6281test_xmlInitializeCatalog(void) {
6282    int test_ret = 0;
6283
6284#if defined(LIBXML_CATALOG_ENABLED)
6285    int mem_base;
6286
6287        mem_base = xmlMemBlocks();
6288
6289        xmlInitializeCatalog();
6290        call_tests++;
6291        xmlResetLastError();
6292        if (mem_base != xmlMemBlocks()) {
6293            printf("Leak of %d blocks found in xmlInitializeCatalog",
6294	           xmlMemBlocks() - mem_base);
6295	    test_ret++;
6296            printf("\n");
6297        }
6298    function_tests++;
6299#endif
6300
6301    return(test_ret);
6302}
6303
6304
6305static int
6306test_xmlLoadACatalog(void) {
6307    int test_ret = 0;
6308
6309
6310    /* missing type support */
6311    return(test_ret);
6312}
6313
6314
6315static int
6316test_xmlLoadCatalog(void) {
6317    int test_ret = 0;
6318
6319#if defined(LIBXML_CATALOG_ENABLED)
6320    int ret_val;
6321    const char * filename; /* a file path */
6322    int n_filename;
6323
6324    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6325        filename = gen_filepath(n_filename, 0);
6326
6327        ret_val = xmlLoadCatalog(filename);
6328        desret_int(ret_val);
6329        call_tests++;
6330        des_filepath(n_filename, filename, 0);
6331        xmlResetLastError();
6332    }
6333    function_tests++;
6334#endif
6335
6336    return(test_ret);
6337}
6338
6339
6340static int
6341test_xmlLoadCatalogs(void) {
6342    int test_ret = 0;
6343
6344#if defined(LIBXML_CATALOG_ENABLED)
6345    char * pathss; /* a list of directories separated by a colon or a space. */
6346    int n_pathss;
6347
6348    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6349        pathss = gen_const_char_ptr(n_pathss, 0);
6350
6351        xmlLoadCatalogs((const char *)pathss);
6352        call_tests++;
6353        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6354        xmlResetLastError();
6355    }
6356    function_tests++;
6357#endif
6358
6359    return(test_ret);
6360}
6361
6362
6363static int
6364test_xmlLoadSGMLSuperCatalog(void) {
6365    int test_ret = 0;
6366
6367
6368    /* missing type support */
6369    return(test_ret);
6370}
6371
6372
6373static int
6374test_xmlNewCatalog(void) {
6375    int test_ret = 0;
6376
6377
6378    /* missing type support */
6379    return(test_ret);
6380}
6381
6382
6383static int
6384test_xmlParseCatalogFile(void) {
6385    int test_ret = 0;
6386
6387#if defined(LIBXML_CATALOG_ENABLED)
6388    int mem_base;
6389    xmlDocPtr ret_val;
6390    const char * filename; /* the filename */
6391    int n_filename;
6392
6393    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6394        mem_base = xmlMemBlocks();
6395        filename = gen_filepath(n_filename, 0);
6396
6397        ret_val = xmlParseCatalogFile(filename);
6398        desret_xmlDocPtr(ret_val);
6399        call_tests++;
6400        des_filepath(n_filename, filename, 0);
6401        xmlResetLastError();
6402        if (mem_base != xmlMemBlocks()) {
6403            printf("Leak of %d blocks found in xmlParseCatalogFile",
6404	           xmlMemBlocks() - mem_base);
6405	    test_ret++;
6406            printf(" %d", n_filename);
6407            printf("\n");
6408        }
6409    }
6410    function_tests++;
6411#endif
6412
6413    return(test_ret);
6414}
6415
6416static int
6417test_catalog(void) {
6418    int test_ret = 0;
6419
6420    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6421    test_ret += test_xmlACatalogAdd();
6422    test_ret += test_xmlACatalogDump();
6423    test_ret += test_xmlACatalogRemove();
6424    test_ret += test_xmlACatalogResolve();
6425    test_ret += test_xmlACatalogResolvePublic();
6426    test_ret += test_xmlACatalogResolveSystem();
6427    test_ret += test_xmlACatalogResolveURI();
6428    test_ret += test_xmlCatalogAdd();
6429    test_ret += test_xmlCatalogCleanup();
6430    test_ret += test_xmlCatalogConvert();
6431    test_ret += test_xmlCatalogDump();
6432    test_ret += test_xmlCatalogGetDefaults();
6433    test_ret += test_xmlCatalogIsEmpty();
6434    test_ret += test_xmlCatalogLocalResolve();
6435    test_ret += test_xmlCatalogLocalResolveURI();
6436    test_ret += test_xmlCatalogRemove();
6437    test_ret += test_xmlCatalogResolve();
6438    test_ret += test_xmlCatalogResolvePublic();
6439    test_ret += test_xmlCatalogResolveSystem();
6440    test_ret += test_xmlCatalogResolveURI();
6441    test_ret += test_xmlCatalogSetDefaultPrefer();
6442    test_ret += test_xmlCatalogSetDefaults();
6443    test_ret += test_xmlConvertSGMLCatalog();
6444    test_ret += test_xmlInitializeCatalog();
6445    test_ret += test_xmlLoadACatalog();
6446    test_ret += test_xmlLoadCatalog();
6447    test_ret += test_xmlLoadCatalogs();
6448    test_ret += test_xmlLoadSGMLSuperCatalog();
6449    test_ret += test_xmlNewCatalog();
6450    test_ret += test_xmlParseCatalogFile();
6451
6452    if (test_ret != 0)
6453	printf("Module catalog: %d errors\n", test_ret);
6454    return(test_ret);
6455}
6456
6457#define gen_nb_const_xmlChRangeGroupPtr 1
6458static xmlChRangeGroupPtr gen_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6459    return(NULL);
6460}
6461static void des_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroupPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6462}
6463
6464static int
6465test_xmlCharInRange(void) {
6466    int test_ret = 0;
6467
6468    int mem_base;
6469    int ret_val;
6470    unsigned int val; /* character to be validated */
6471    int n_val;
6472    xmlChRangeGroupPtr rptr; /* pointer to range to be used to validate */
6473    int n_rptr;
6474
6475    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6476    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroupPtr;n_rptr++) {
6477        mem_base = xmlMemBlocks();
6478        val = gen_unsigned_int(n_val, 0);
6479        rptr = gen_const_xmlChRangeGroupPtr(n_rptr, 1);
6480
6481        ret_val = xmlCharInRange(val, (const xmlChRangeGroupPtr)rptr);
6482        desret_int(ret_val);
6483        call_tests++;
6484        des_unsigned_int(n_val, val, 0);
6485        des_const_xmlChRangeGroupPtr(n_rptr, (const xmlChRangeGroupPtr)rptr, 1);
6486        xmlResetLastError();
6487        if (mem_base != xmlMemBlocks()) {
6488            printf("Leak of %d blocks found in xmlCharInRange",
6489	           xmlMemBlocks() - mem_base);
6490	    test_ret++;
6491            printf(" %d", n_val);
6492            printf(" %d", n_rptr);
6493            printf("\n");
6494        }
6495    }
6496    }
6497    function_tests++;
6498
6499    return(test_ret);
6500}
6501
6502
6503static int
6504test_xmlIsBaseChar(void) {
6505    int test_ret = 0;
6506
6507    int mem_base;
6508    int ret_val;
6509    unsigned int ch; /* character to validate */
6510    int n_ch;
6511
6512    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6513        mem_base = xmlMemBlocks();
6514        ch = gen_unsigned_int(n_ch, 0);
6515
6516        ret_val = xmlIsBaseChar(ch);
6517        desret_int(ret_val);
6518        call_tests++;
6519        des_unsigned_int(n_ch, ch, 0);
6520        xmlResetLastError();
6521        if (mem_base != xmlMemBlocks()) {
6522            printf("Leak of %d blocks found in xmlIsBaseChar",
6523	           xmlMemBlocks() - mem_base);
6524	    test_ret++;
6525            printf(" %d", n_ch);
6526            printf("\n");
6527        }
6528    }
6529    function_tests++;
6530
6531    return(test_ret);
6532}
6533
6534
6535static int
6536test_xmlIsBlank(void) {
6537    int test_ret = 0;
6538
6539    int mem_base;
6540    int ret_val;
6541    unsigned int ch; /* character to validate */
6542    int n_ch;
6543
6544    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6545        mem_base = xmlMemBlocks();
6546        ch = gen_unsigned_int(n_ch, 0);
6547
6548        ret_val = xmlIsBlank(ch);
6549        desret_int(ret_val);
6550        call_tests++;
6551        des_unsigned_int(n_ch, ch, 0);
6552        xmlResetLastError();
6553        if (mem_base != xmlMemBlocks()) {
6554            printf("Leak of %d blocks found in xmlIsBlank",
6555	           xmlMemBlocks() - mem_base);
6556	    test_ret++;
6557            printf(" %d", n_ch);
6558            printf("\n");
6559        }
6560    }
6561    function_tests++;
6562
6563    return(test_ret);
6564}
6565
6566
6567static int
6568test_xmlIsChar(void) {
6569    int test_ret = 0;
6570
6571    int mem_base;
6572    int ret_val;
6573    unsigned int ch; /* character to validate */
6574    int n_ch;
6575
6576    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6577        mem_base = xmlMemBlocks();
6578        ch = gen_unsigned_int(n_ch, 0);
6579
6580        ret_val = xmlIsChar(ch);
6581        desret_int(ret_val);
6582        call_tests++;
6583        des_unsigned_int(n_ch, ch, 0);
6584        xmlResetLastError();
6585        if (mem_base != xmlMemBlocks()) {
6586            printf("Leak of %d blocks found in xmlIsChar",
6587	           xmlMemBlocks() - mem_base);
6588	    test_ret++;
6589            printf(" %d", n_ch);
6590            printf("\n");
6591        }
6592    }
6593    function_tests++;
6594
6595    return(test_ret);
6596}
6597
6598
6599static int
6600test_xmlIsCombining(void) {
6601    int test_ret = 0;
6602
6603    int mem_base;
6604    int ret_val;
6605    unsigned int ch; /* character to validate */
6606    int n_ch;
6607
6608    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6609        mem_base = xmlMemBlocks();
6610        ch = gen_unsigned_int(n_ch, 0);
6611
6612        ret_val = xmlIsCombining(ch);
6613        desret_int(ret_val);
6614        call_tests++;
6615        des_unsigned_int(n_ch, ch, 0);
6616        xmlResetLastError();
6617        if (mem_base != xmlMemBlocks()) {
6618            printf("Leak of %d blocks found in xmlIsCombining",
6619	           xmlMemBlocks() - mem_base);
6620	    test_ret++;
6621            printf(" %d", n_ch);
6622            printf("\n");
6623        }
6624    }
6625    function_tests++;
6626
6627    return(test_ret);
6628}
6629
6630
6631static int
6632test_xmlIsDigit(void) {
6633    int test_ret = 0;
6634
6635    int mem_base;
6636    int ret_val;
6637    unsigned int ch; /* character to validate */
6638    int n_ch;
6639
6640    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6641        mem_base = xmlMemBlocks();
6642        ch = gen_unsigned_int(n_ch, 0);
6643
6644        ret_val = xmlIsDigit(ch);
6645        desret_int(ret_val);
6646        call_tests++;
6647        des_unsigned_int(n_ch, ch, 0);
6648        xmlResetLastError();
6649        if (mem_base != xmlMemBlocks()) {
6650            printf("Leak of %d blocks found in xmlIsDigit",
6651	           xmlMemBlocks() - mem_base);
6652	    test_ret++;
6653            printf(" %d", n_ch);
6654            printf("\n");
6655        }
6656    }
6657    function_tests++;
6658
6659    return(test_ret);
6660}
6661
6662
6663static int
6664test_xmlIsExtender(void) {
6665    int test_ret = 0;
6666
6667    int mem_base;
6668    int ret_val;
6669    unsigned int ch; /* character to validate */
6670    int n_ch;
6671
6672    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6673        mem_base = xmlMemBlocks();
6674        ch = gen_unsigned_int(n_ch, 0);
6675
6676        ret_val = xmlIsExtender(ch);
6677        desret_int(ret_val);
6678        call_tests++;
6679        des_unsigned_int(n_ch, ch, 0);
6680        xmlResetLastError();
6681        if (mem_base != xmlMemBlocks()) {
6682            printf("Leak of %d blocks found in xmlIsExtender",
6683	           xmlMemBlocks() - mem_base);
6684	    test_ret++;
6685            printf(" %d", n_ch);
6686            printf("\n");
6687        }
6688    }
6689    function_tests++;
6690
6691    return(test_ret);
6692}
6693
6694
6695static int
6696test_xmlIsIdeographic(void) {
6697    int test_ret = 0;
6698
6699    int mem_base;
6700    int ret_val;
6701    unsigned int ch; /* character to validate */
6702    int n_ch;
6703
6704    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6705        mem_base = xmlMemBlocks();
6706        ch = gen_unsigned_int(n_ch, 0);
6707
6708        ret_val = xmlIsIdeographic(ch);
6709        desret_int(ret_val);
6710        call_tests++;
6711        des_unsigned_int(n_ch, ch, 0);
6712        xmlResetLastError();
6713        if (mem_base != xmlMemBlocks()) {
6714            printf("Leak of %d blocks found in xmlIsIdeographic",
6715	           xmlMemBlocks() - mem_base);
6716	    test_ret++;
6717            printf(" %d", n_ch);
6718            printf("\n");
6719        }
6720    }
6721    function_tests++;
6722
6723    return(test_ret);
6724}
6725
6726
6727static int
6728test_xmlIsPubidChar(void) {
6729    int test_ret = 0;
6730
6731    int mem_base;
6732    int ret_val;
6733    unsigned int ch; /* character to validate */
6734    int n_ch;
6735
6736    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6737        mem_base = xmlMemBlocks();
6738        ch = gen_unsigned_int(n_ch, 0);
6739
6740        ret_val = xmlIsPubidChar(ch);
6741        desret_int(ret_val);
6742        call_tests++;
6743        des_unsigned_int(n_ch, ch, 0);
6744        xmlResetLastError();
6745        if (mem_base != xmlMemBlocks()) {
6746            printf("Leak of %d blocks found in xmlIsPubidChar",
6747	           xmlMemBlocks() - mem_base);
6748	    test_ret++;
6749            printf(" %d", n_ch);
6750            printf("\n");
6751        }
6752    }
6753    function_tests++;
6754
6755    return(test_ret);
6756}
6757
6758static int
6759test_chvalid(void) {
6760    int test_ret = 0;
6761
6762    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6763    test_ret += test_xmlCharInRange();
6764    test_ret += test_xmlIsBaseChar();
6765    test_ret += test_xmlIsBlank();
6766    test_ret += test_xmlIsChar();
6767    test_ret += test_xmlIsCombining();
6768    test_ret += test_xmlIsDigit();
6769    test_ret += test_xmlIsExtender();
6770    test_ret += test_xmlIsIdeographic();
6771    test_ret += test_xmlIsPubidChar();
6772
6773    if (test_ret != 0)
6774	printf("Module chvalid: %d errors\n", test_ret);
6775    return(test_ret);
6776}
6777
6778static int
6779test_xmlBoolToText(void) {
6780    int test_ret = 0;
6781
6782#if defined(LIBXML_DEBUG_ENABLED)
6783    int mem_base;
6784    const char * ret_val;
6785    int boolval; /* a bool to turn into text */
6786    int n_boolval;
6787
6788    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6789        mem_base = xmlMemBlocks();
6790        boolval = gen_int(n_boolval, 0);
6791
6792        ret_val = xmlBoolToText(boolval);
6793        desret_const_char_ptr(ret_val);
6794        call_tests++;
6795        des_int(n_boolval, boolval, 0);
6796        xmlResetLastError();
6797        if (mem_base != xmlMemBlocks()) {
6798            printf("Leak of %d blocks found in xmlBoolToText",
6799	           xmlMemBlocks() - mem_base);
6800	    test_ret++;
6801            printf(" %d", n_boolval);
6802            printf("\n");
6803        }
6804    }
6805    function_tests++;
6806#endif
6807
6808    return(test_ret);
6809}
6810
6811
6812static int
6813test_xmlDebugCheckDocument(void) {
6814    int test_ret = 0;
6815
6816#if defined(LIBXML_DEBUG_ENABLED)
6817    int mem_base;
6818    int ret_val;
6819    FILE * output; /* the FILE * for the output */
6820    int n_output;
6821    xmlDocPtr doc; /* the document */
6822    int n_doc;
6823
6824    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6825    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6826        mem_base = xmlMemBlocks();
6827        output = gen_debug_FILE_ptr(n_output, 0);
6828        doc = gen_xmlDocPtr(n_doc, 1);
6829
6830        ret_val = xmlDebugCheckDocument(output, doc);
6831        desret_int(ret_val);
6832        call_tests++;
6833        des_debug_FILE_ptr(n_output, output, 0);
6834        des_xmlDocPtr(n_doc, doc, 1);
6835        xmlResetLastError();
6836        if (mem_base != xmlMemBlocks()) {
6837            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6838	           xmlMemBlocks() - mem_base);
6839	    test_ret++;
6840            printf(" %d", n_output);
6841            printf(" %d", n_doc);
6842            printf("\n");
6843        }
6844    }
6845    }
6846    function_tests++;
6847#endif
6848
6849    return(test_ret);
6850}
6851
6852
6853static int
6854test_xmlDebugDumpAttr(void) {
6855    int test_ret = 0;
6856
6857#if defined(LIBXML_DEBUG_ENABLED)
6858    int mem_base;
6859    FILE * output; /* the FILE * for the output */
6860    int n_output;
6861    xmlAttrPtr attr; /* the attribute */
6862    int n_attr;
6863    int depth; /* the indentation level. */
6864    int n_depth;
6865
6866    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6867    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6868    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6869        mem_base = xmlMemBlocks();
6870        output = gen_debug_FILE_ptr(n_output, 0);
6871        attr = gen_xmlAttrPtr(n_attr, 1);
6872        depth = gen_int(n_depth, 2);
6873
6874        xmlDebugDumpAttr(output, attr, depth);
6875        call_tests++;
6876        des_debug_FILE_ptr(n_output, output, 0);
6877        des_xmlAttrPtr(n_attr, attr, 1);
6878        des_int(n_depth, depth, 2);
6879        xmlResetLastError();
6880        if (mem_base != xmlMemBlocks()) {
6881            printf("Leak of %d blocks found in xmlDebugDumpAttr",
6882	           xmlMemBlocks() - mem_base);
6883	    test_ret++;
6884            printf(" %d", n_output);
6885            printf(" %d", n_attr);
6886            printf(" %d", n_depth);
6887            printf("\n");
6888        }
6889    }
6890    }
6891    }
6892    function_tests++;
6893#endif
6894
6895    return(test_ret);
6896}
6897
6898
6899static int
6900test_xmlDebugDumpAttrList(void) {
6901    int test_ret = 0;
6902
6903#if defined(LIBXML_DEBUG_ENABLED)
6904    int mem_base;
6905    FILE * output; /* the FILE * for the output */
6906    int n_output;
6907    xmlAttrPtr attr; /* the attribute list */
6908    int n_attr;
6909    int depth; /* the indentation level. */
6910    int n_depth;
6911
6912    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6913    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6914    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6915        mem_base = xmlMemBlocks();
6916        output = gen_debug_FILE_ptr(n_output, 0);
6917        attr = gen_xmlAttrPtr(n_attr, 1);
6918        depth = gen_int(n_depth, 2);
6919
6920        xmlDebugDumpAttrList(output, attr, depth);
6921        call_tests++;
6922        des_debug_FILE_ptr(n_output, output, 0);
6923        des_xmlAttrPtr(n_attr, attr, 1);
6924        des_int(n_depth, depth, 2);
6925        xmlResetLastError();
6926        if (mem_base != xmlMemBlocks()) {
6927            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
6928	           xmlMemBlocks() - mem_base);
6929	    test_ret++;
6930            printf(" %d", n_output);
6931            printf(" %d", n_attr);
6932            printf(" %d", n_depth);
6933            printf("\n");
6934        }
6935    }
6936    }
6937    }
6938    function_tests++;
6939#endif
6940
6941    return(test_ret);
6942}
6943
6944
6945static int
6946test_xmlDebugDumpDTD(void) {
6947    int test_ret = 0;
6948
6949#if defined(LIBXML_DEBUG_ENABLED)
6950    int mem_base;
6951    FILE * output; /* the FILE * for the output */
6952    int n_output;
6953    xmlDtdPtr dtd; /* the DTD */
6954    int n_dtd;
6955
6956    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6957    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
6958        mem_base = xmlMemBlocks();
6959        output = gen_debug_FILE_ptr(n_output, 0);
6960        dtd = gen_xmlDtdPtr(n_dtd, 1);
6961
6962        xmlDebugDumpDTD(output, dtd);
6963        call_tests++;
6964        des_debug_FILE_ptr(n_output, output, 0);
6965        des_xmlDtdPtr(n_dtd, dtd, 1);
6966        xmlResetLastError();
6967        if (mem_base != xmlMemBlocks()) {
6968            printf("Leak of %d blocks found in xmlDebugDumpDTD",
6969	           xmlMemBlocks() - mem_base);
6970	    test_ret++;
6971            printf(" %d", n_output);
6972            printf(" %d", n_dtd);
6973            printf("\n");
6974        }
6975    }
6976    }
6977    function_tests++;
6978#endif
6979
6980    return(test_ret);
6981}
6982
6983
6984static int
6985test_xmlDebugDumpDocument(void) {
6986    int test_ret = 0;
6987
6988#if defined(LIBXML_DEBUG_ENABLED)
6989    int mem_base;
6990    FILE * output; /* the FILE * for the output */
6991    int n_output;
6992    xmlDocPtr doc; /* the document */
6993    int n_doc;
6994
6995    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6996    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6997        mem_base = xmlMemBlocks();
6998        output = gen_debug_FILE_ptr(n_output, 0);
6999        doc = gen_xmlDocPtr(n_doc, 1);
7000
7001        xmlDebugDumpDocument(output, doc);
7002        call_tests++;
7003        des_debug_FILE_ptr(n_output, output, 0);
7004        des_xmlDocPtr(n_doc, doc, 1);
7005        xmlResetLastError();
7006        if (mem_base != xmlMemBlocks()) {
7007            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7008	           xmlMemBlocks() - mem_base);
7009	    test_ret++;
7010            printf(" %d", n_output);
7011            printf(" %d", n_doc);
7012            printf("\n");
7013        }
7014    }
7015    }
7016    function_tests++;
7017#endif
7018
7019    return(test_ret);
7020}
7021
7022
7023static int
7024test_xmlDebugDumpDocumentHead(void) {
7025    int test_ret = 0;
7026
7027#if defined(LIBXML_DEBUG_ENABLED)
7028    int mem_base;
7029    FILE * output; /* the FILE * for the output */
7030    int n_output;
7031    xmlDocPtr doc; /* the document */
7032    int n_doc;
7033
7034    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7035    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7036        mem_base = xmlMemBlocks();
7037        output = gen_debug_FILE_ptr(n_output, 0);
7038        doc = gen_xmlDocPtr(n_doc, 1);
7039
7040        xmlDebugDumpDocumentHead(output, doc);
7041        call_tests++;
7042        des_debug_FILE_ptr(n_output, output, 0);
7043        des_xmlDocPtr(n_doc, doc, 1);
7044        xmlResetLastError();
7045        if (mem_base != xmlMemBlocks()) {
7046            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7047	           xmlMemBlocks() - mem_base);
7048	    test_ret++;
7049            printf(" %d", n_output);
7050            printf(" %d", n_doc);
7051            printf("\n");
7052        }
7053    }
7054    }
7055    function_tests++;
7056#endif
7057
7058    return(test_ret);
7059}
7060
7061
7062static int
7063test_xmlDebugDumpEntities(void) {
7064    int test_ret = 0;
7065
7066#if defined(LIBXML_DEBUG_ENABLED)
7067    int mem_base;
7068    FILE * output; /* the FILE * for the output */
7069    int n_output;
7070    xmlDocPtr doc; /* the document */
7071    int n_doc;
7072
7073    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7074    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7075        mem_base = xmlMemBlocks();
7076        output = gen_debug_FILE_ptr(n_output, 0);
7077        doc = gen_xmlDocPtr(n_doc, 1);
7078
7079        xmlDebugDumpEntities(output, doc);
7080        call_tests++;
7081        des_debug_FILE_ptr(n_output, output, 0);
7082        des_xmlDocPtr(n_doc, doc, 1);
7083        xmlResetLastError();
7084        if (mem_base != xmlMemBlocks()) {
7085            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7086	           xmlMemBlocks() - mem_base);
7087	    test_ret++;
7088            printf(" %d", n_output);
7089            printf(" %d", n_doc);
7090            printf("\n");
7091        }
7092    }
7093    }
7094    function_tests++;
7095#endif
7096
7097    return(test_ret);
7098}
7099
7100
7101static int
7102test_xmlDebugDumpNode(void) {
7103    int test_ret = 0;
7104
7105#if defined(LIBXML_DEBUG_ENABLED)
7106    int mem_base;
7107    FILE * output; /* the FILE * for the output */
7108    int n_output;
7109    xmlNodePtr node; /* the node */
7110    int n_node;
7111    int depth; /* the indentation level. */
7112    int n_depth;
7113
7114    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7115    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7116    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7117        mem_base = xmlMemBlocks();
7118        output = gen_debug_FILE_ptr(n_output, 0);
7119        node = gen_xmlNodePtr(n_node, 1);
7120        depth = gen_int(n_depth, 2);
7121
7122        xmlDebugDumpNode(output, node, depth);
7123        call_tests++;
7124        des_debug_FILE_ptr(n_output, output, 0);
7125        des_xmlNodePtr(n_node, node, 1);
7126        des_int(n_depth, depth, 2);
7127        xmlResetLastError();
7128        if (mem_base != xmlMemBlocks()) {
7129            printf("Leak of %d blocks found in xmlDebugDumpNode",
7130	           xmlMemBlocks() - mem_base);
7131	    test_ret++;
7132            printf(" %d", n_output);
7133            printf(" %d", n_node);
7134            printf(" %d", n_depth);
7135            printf("\n");
7136        }
7137    }
7138    }
7139    }
7140    function_tests++;
7141#endif
7142
7143    return(test_ret);
7144}
7145
7146
7147static int
7148test_xmlDebugDumpNodeList(void) {
7149    int test_ret = 0;
7150
7151#if defined(LIBXML_DEBUG_ENABLED)
7152    int mem_base;
7153    FILE * output; /* the FILE * for the output */
7154    int n_output;
7155    xmlNodePtr node; /* the node list */
7156    int n_node;
7157    int depth; /* the indentation level. */
7158    int n_depth;
7159
7160    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7161    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7162    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7163        mem_base = xmlMemBlocks();
7164        output = gen_debug_FILE_ptr(n_output, 0);
7165        node = gen_xmlNodePtr(n_node, 1);
7166        depth = gen_int(n_depth, 2);
7167
7168        xmlDebugDumpNodeList(output, node, depth);
7169        call_tests++;
7170        des_debug_FILE_ptr(n_output, output, 0);
7171        des_xmlNodePtr(n_node, node, 1);
7172        des_int(n_depth, depth, 2);
7173        xmlResetLastError();
7174        if (mem_base != xmlMemBlocks()) {
7175            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7176	           xmlMemBlocks() - mem_base);
7177	    test_ret++;
7178            printf(" %d", n_output);
7179            printf(" %d", n_node);
7180            printf(" %d", n_depth);
7181            printf("\n");
7182        }
7183    }
7184    }
7185    }
7186    function_tests++;
7187#endif
7188
7189    return(test_ret);
7190}
7191
7192
7193static int
7194test_xmlDebugDumpOneNode(void) {
7195    int test_ret = 0;
7196
7197#if defined(LIBXML_DEBUG_ENABLED)
7198    int mem_base;
7199    FILE * output; /* the FILE * for the output */
7200    int n_output;
7201    xmlNodePtr node; /* the node */
7202    int n_node;
7203    int depth; /* the indentation level. */
7204    int n_depth;
7205
7206    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7207    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7208    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7209        mem_base = xmlMemBlocks();
7210        output = gen_debug_FILE_ptr(n_output, 0);
7211        node = gen_xmlNodePtr(n_node, 1);
7212        depth = gen_int(n_depth, 2);
7213
7214        xmlDebugDumpOneNode(output, node, depth);
7215        call_tests++;
7216        des_debug_FILE_ptr(n_output, output, 0);
7217        des_xmlNodePtr(n_node, node, 1);
7218        des_int(n_depth, depth, 2);
7219        xmlResetLastError();
7220        if (mem_base != xmlMemBlocks()) {
7221            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7222	           xmlMemBlocks() - mem_base);
7223	    test_ret++;
7224            printf(" %d", n_output);
7225            printf(" %d", n_node);
7226            printf(" %d", n_depth);
7227            printf("\n");
7228        }
7229    }
7230    }
7231    }
7232    function_tests++;
7233#endif
7234
7235    return(test_ret);
7236}
7237
7238
7239static int
7240test_xmlDebugDumpString(void) {
7241    int test_ret = 0;
7242
7243#if defined(LIBXML_DEBUG_ENABLED)
7244    int mem_base;
7245    FILE * output; /* the FILE * for the output */
7246    int n_output;
7247    xmlChar * str; /* the string */
7248    int n_str;
7249
7250    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7251    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7252        mem_base = xmlMemBlocks();
7253        output = gen_debug_FILE_ptr(n_output, 0);
7254        str = gen_const_xmlChar_ptr(n_str, 1);
7255
7256        xmlDebugDumpString(output, (const xmlChar *)str);
7257        call_tests++;
7258        des_debug_FILE_ptr(n_output, output, 0);
7259        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7260        xmlResetLastError();
7261        if (mem_base != xmlMemBlocks()) {
7262            printf("Leak of %d blocks found in xmlDebugDumpString",
7263	           xmlMemBlocks() - mem_base);
7264	    test_ret++;
7265            printf(" %d", n_output);
7266            printf(" %d", n_str);
7267            printf("\n");
7268        }
7269    }
7270    }
7271    function_tests++;
7272#endif
7273
7274    return(test_ret);
7275}
7276
7277
7278static int
7279test_xmlLsCountNode(void) {
7280    int test_ret = 0;
7281
7282#if defined(LIBXML_DEBUG_ENABLED)
7283    int mem_base;
7284    int ret_val;
7285    xmlNodePtr node; /* the node to count */
7286    int n_node;
7287
7288    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7289        mem_base = xmlMemBlocks();
7290        node = gen_xmlNodePtr(n_node, 0);
7291
7292        ret_val = xmlLsCountNode(node);
7293        desret_int(ret_val);
7294        call_tests++;
7295        des_xmlNodePtr(n_node, node, 0);
7296        xmlResetLastError();
7297        if (mem_base != xmlMemBlocks()) {
7298            printf("Leak of %d blocks found in xmlLsCountNode",
7299	           xmlMemBlocks() - mem_base);
7300	    test_ret++;
7301            printf(" %d", n_node);
7302            printf("\n");
7303        }
7304    }
7305    function_tests++;
7306#endif
7307
7308    return(test_ret);
7309}
7310
7311
7312static int
7313test_xmlLsOneNode(void) {
7314    int test_ret = 0;
7315
7316#if defined(LIBXML_DEBUG_ENABLED)
7317    int mem_base;
7318    FILE * output; /* the FILE * for the output */
7319    int n_output;
7320    xmlNodePtr node; /* the node to dump */
7321    int n_node;
7322
7323    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7324    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7325        mem_base = xmlMemBlocks();
7326        output = gen_debug_FILE_ptr(n_output, 0);
7327        node = gen_xmlNodePtr(n_node, 1);
7328
7329        xmlLsOneNode(output, node);
7330        call_tests++;
7331        des_debug_FILE_ptr(n_output, output, 0);
7332        des_xmlNodePtr(n_node, node, 1);
7333        xmlResetLastError();
7334        if (mem_base != xmlMemBlocks()) {
7335            printf("Leak of %d blocks found in xmlLsOneNode",
7336	           xmlMemBlocks() - mem_base);
7337	    test_ret++;
7338            printf(" %d", n_output);
7339            printf(" %d", n_node);
7340            printf("\n");
7341        }
7342    }
7343    }
7344    function_tests++;
7345#endif
7346
7347    return(test_ret);
7348}
7349
7350
7351#define gen_nb_char_ptr 1
7352static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7353    return(NULL);
7354}
7355static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7356}
7357
7358static int
7359test_xmlShell(void) {
7360    int test_ret = 0;
7361
7362
7363    /* missing type support */
7364    return(test_ret);
7365}
7366
7367
7368static int
7369test_xmlShellBase(void) {
7370    int test_ret = 0;
7371
7372#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7373    int mem_base;
7374    int ret_val;
7375    xmlShellCtxtPtr ctxt; /* the shell context */
7376    int n_ctxt;
7377    char * arg; /* unused */
7378    int n_arg;
7379    xmlNodePtr node; /* a node */
7380    int n_node;
7381    xmlNodePtr node2; /* unused */
7382    int n_node2;
7383
7384    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7385    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7386    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7387    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7388        mem_base = xmlMemBlocks();
7389        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7390        arg = gen_char_ptr(n_arg, 1);
7391        node = gen_xmlNodePtr(n_node, 2);
7392        node2 = gen_xmlNodePtr(n_node2, 3);
7393
7394        ret_val = xmlShellBase(ctxt, arg, node, node2);
7395        desret_int(ret_val);
7396        call_tests++;
7397        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7398        des_char_ptr(n_arg, arg, 1);
7399        des_xmlNodePtr(n_node, node, 2);
7400        des_xmlNodePtr(n_node2, node2, 3);
7401        xmlResetLastError();
7402        if (mem_base != xmlMemBlocks()) {
7403            printf("Leak of %d blocks found in xmlShellBase",
7404	           xmlMemBlocks() - mem_base);
7405	    test_ret++;
7406            printf(" %d", n_ctxt);
7407            printf(" %d", n_arg);
7408            printf(" %d", n_node);
7409            printf(" %d", n_node2);
7410            printf("\n");
7411        }
7412    }
7413    }
7414    }
7415    }
7416    function_tests++;
7417#endif
7418
7419    return(test_ret);
7420}
7421
7422
7423static int
7424test_xmlShellCat(void) {
7425    int test_ret = 0;
7426
7427#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7428    int mem_base;
7429    int ret_val;
7430    xmlShellCtxtPtr ctxt; /* the shell context */
7431    int n_ctxt;
7432    char * arg; /* unused */
7433    int n_arg;
7434    xmlNodePtr node; /* a node */
7435    int n_node;
7436    xmlNodePtr node2; /* unused */
7437    int n_node2;
7438
7439    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7440    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7441    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7442    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7443        mem_base = xmlMemBlocks();
7444        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7445        arg = gen_char_ptr(n_arg, 1);
7446        node = gen_xmlNodePtr(n_node, 2);
7447        node2 = gen_xmlNodePtr(n_node2, 3);
7448
7449        ret_val = xmlShellCat(ctxt, arg, node, node2);
7450        desret_int(ret_val);
7451        call_tests++;
7452        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7453        des_char_ptr(n_arg, arg, 1);
7454        des_xmlNodePtr(n_node, node, 2);
7455        des_xmlNodePtr(n_node2, node2, 3);
7456        xmlResetLastError();
7457        if (mem_base != xmlMemBlocks()) {
7458            printf("Leak of %d blocks found in xmlShellCat",
7459	           xmlMemBlocks() - mem_base);
7460	    test_ret++;
7461            printf(" %d", n_ctxt);
7462            printf(" %d", n_arg);
7463            printf(" %d", n_node);
7464            printf(" %d", n_node2);
7465            printf("\n");
7466        }
7467    }
7468    }
7469    }
7470    }
7471    function_tests++;
7472#endif
7473
7474    return(test_ret);
7475}
7476
7477
7478static int
7479test_xmlShellDir(void) {
7480    int test_ret = 0;
7481
7482#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7483    int mem_base;
7484    int ret_val;
7485    xmlShellCtxtPtr ctxt; /* the shell context */
7486    int n_ctxt;
7487    char * arg; /* unused */
7488    int n_arg;
7489    xmlNodePtr node; /* a node */
7490    int n_node;
7491    xmlNodePtr node2; /* unused */
7492    int n_node2;
7493
7494    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7495    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7496    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7497    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7498        mem_base = xmlMemBlocks();
7499        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7500        arg = gen_char_ptr(n_arg, 1);
7501        node = gen_xmlNodePtr(n_node, 2);
7502        node2 = gen_xmlNodePtr(n_node2, 3);
7503
7504        ret_val = xmlShellDir(ctxt, arg, node, node2);
7505        desret_int(ret_val);
7506        call_tests++;
7507        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7508        des_char_ptr(n_arg, arg, 1);
7509        des_xmlNodePtr(n_node, node, 2);
7510        des_xmlNodePtr(n_node2, node2, 3);
7511        xmlResetLastError();
7512        if (mem_base != xmlMemBlocks()) {
7513            printf("Leak of %d blocks found in xmlShellDir",
7514	           xmlMemBlocks() - mem_base);
7515	    test_ret++;
7516            printf(" %d", n_ctxt);
7517            printf(" %d", n_arg);
7518            printf(" %d", n_node);
7519            printf(" %d", n_node2);
7520            printf("\n");
7521        }
7522    }
7523    }
7524    }
7525    }
7526    function_tests++;
7527#endif
7528
7529    return(test_ret);
7530}
7531
7532
7533static int
7534test_xmlShellDu(void) {
7535    int test_ret = 0;
7536
7537#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7538    int mem_base;
7539    int ret_val;
7540    xmlShellCtxtPtr ctxt; /* the shell context */
7541    int n_ctxt;
7542    char * arg; /* unused */
7543    int n_arg;
7544    xmlNodePtr tree; /* a node defining a subtree */
7545    int n_tree;
7546    xmlNodePtr node2; /* unused */
7547    int n_node2;
7548
7549    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7550    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7551    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7552    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7553        mem_base = xmlMemBlocks();
7554        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7555        arg = gen_char_ptr(n_arg, 1);
7556        tree = gen_xmlNodePtr(n_tree, 2);
7557        node2 = gen_xmlNodePtr(n_node2, 3);
7558
7559        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7560        desret_int(ret_val);
7561        call_tests++;
7562        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7563        des_char_ptr(n_arg, arg, 1);
7564        des_xmlNodePtr(n_tree, tree, 2);
7565        des_xmlNodePtr(n_node2, node2, 3);
7566        xmlResetLastError();
7567        if (mem_base != xmlMemBlocks()) {
7568            printf("Leak of %d blocks found in xmlShellDu",
7569	           xmlMemBlocks() - mem_base);
7570	    test_ret++;
7571            printf(" %d", n_ctxt);
7572            printf(" %d", n_arg);
7573            printf(" %d", n_tree);
7574            printf(" %d", n_node2);
7575            printf("\n");
7576        }
7577    }
7578    }
7579    }
7580    }
7581    function_tests++;
7582#endif
7583
7584    return(test_ret);
7585}
7586
7587
7588static int
7589test_xmlShellList(void) {
7590    int test_ret = 0;
7591
7592#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7593    int mem_base;
7594    int ret_val;
7595    xmlShellCtxtPtr ctxt; /* the shell context */
7596    int n_ctxt;
7597    char * arg; /* unused */
7598    int n_arg;
7599    xmlNodePtr node; /* a node */
7600    int n_node;
7601    xmlNodePtr node2; /* unused */
7602    int n_node2;
7603
7604    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7605    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7606    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7607    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7608        mem_base = xmlMemBlocks();
7609        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7610        arg = gen_char_ptr(n_arg, 1);
7611        node = gen_xmlNodePtr(n_node, 2);
7612        node2 = gen_xmlNodePtr(n_node2, 3);
7613
7614        ret_val = xmlShellList(ctxt, arg, node, node2);
7615        desret_int(ret_val);
7616        call_tests++;
7617        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7618        des_char_ptr(n_arg, arg, 1);
7619        des_xmlNodePtr(n_node, node, 2);
7620        des_xmlNodePtr(n_node2, node2, 3);
7621        xmlResetLastError();
7622        if (mem_base != xmlMemBlocks()) {
7623            printf("Leak of %d blocks found in xmlShellList",
7624	           xmlMemBlocks() - mem_base);
7625	    test_ret++;
7626            printf(" %d", n_ctxt);
7627            printf(" %d", n_arg);
7628            printf(" %d", n_node);
7629            printf(" %d", n_node2);
7630            printf("\n");
7631        }
7632    }
7633    }
7634    }
7635    }
7636    function_tests++;
7637#endif
7638
7639    return(test_ret);
7640}
7641
7642
7643static int
7644test_xmlShellLoad(void) {
7645    int test_ret = 0;
7646
7647#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7648    int mem_base;
7649    int ret_val;
7650    xmlShellCtxtPtr ctxt; /* the shell context */
7651    int n_ctxt;
7652    char * filename; /* the file name */
7653    int n_filename;
7654    xmlNodePtr node; /* unused */
7655    int n_node;
7656    xmlNodePtr node2; /* unused */
7657    int n_node2;
7658
7659    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7660    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7661    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7662    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7663        mem_base = xmlMemBlocks();
7664        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7665        filename = gen_char_ptr(n_filename, 1);
7666        node = gen_xmlNodePtr(n_node, 2);
7667        node2 = gen_xmlNodePtr(n_node2, 3);
7668
7669        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7670        desret_int(ret_val);
7671        call_tests++;
7672        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7673        des_char_ptr(n_filename, filename, 1);
7674        des_xmlNodePtr(n_node, node, 2);
7675        des_xmlNodePtr(n_node2, node2, 3);
7676        xmlResetLastError();
7677        if (mem_base != xmlMemBlocks()) {
7678            printf("Leak of %d blocks found in xmlShellLoad",
7679	           xmlMemBlocks() - mem_base);
7680	    test_ret++;
7681            printf(" %d", n_ctxt);
7682            printf(" %d", n_filename);
7683            printf(" %d", n_node);
7684            printf(" %d", n_node2);
7685            printf("\n");
7686        }
7687    }
7688    }
7689    }
7690    }
7691    function_tests++;
7692#endif
7693
7694    return(test_ret);
7695}
7696
7697
7698static int
7699test_xmlShellPrintXPathResult(void) {
7700    int test_ret = 0;
7701
7702#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7703    int mem_base;
7704    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7705    int n_list;
7706
7707    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7708        mem_base = xmlMemBlocks();
7709        list = gen_xmlXPathObjectPtr(n_list, 0);
7710
7711        xmlShellPrintXPathResult(list);
7712        call_tests++;
7713        des_xmlXPathObjectPtr(n_list, list, 0);
7714        xmlResetLastError();
7715        if (mem_base != xmlMemBlocks()) {
7716            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7717	           xmlMemBlocks() - mem_base);
7718	    test_ret++;
7719            printf(" %d", n_list);
7720            printf("\n");
7721        }
7722    }
7723    function_tests++;
7724#endif
7725
7726    return(test_ret);
7727}
7728
7729
7730static int
7731test_xmlShellPwd(void) {
7732    int test_ret = 0;
7733
7734#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7735    int mem_base;
7736    int ret_val;
7737    xmlShellCtxtPtr ctxt; /* the shell context */
7738    int n_ctxt;
7739    char * buffer; /* the output buffer */
7740    int n_buffer;
7741    xmlNodePtr node; /* a node */
7742    int n_node;
7743    xmlNodePtr node2; /* unused */
7744    int n_node2;
7745
7746    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7747    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7748    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7749    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7750        mem_base = xmlMemBlocks();
7751        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7752        buffer = gen_char_ptr(n_buffer, 1);
7753        node = gen_xmlNodePtr(n_node, 2);
7754        node2 = gen_xmlNodePtr(n_node2, 3);
7755
7756        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7757        desret_int(ret_val);
7758        call_tests++;
7759        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7760        des_char_ptr(n_buffer, buffer, 1);
7761        des_xmlNodePtr(n_node, node, 2);
7762        des_xmlNodePtr(n_node2, node2, 3);
7763        xmlResetLastError();
7764        if (mem_base != xmlMemBlocks()) {
7765            printf("Leak of %d blocks found in xmlShellPwd",
7766	           xmlMemBlocks() - mem_base);
7767	    test_ret++;
7768            printf(" %d", n_ctxt);
7769            printf(" %d", n_buffer);
7770            printf(" %d", n_node);
7771            printf(" %d", n_node2);
7772            printf("\n");
7773        }
7774    }
7775    }
7776    }
7777    }
7778    function_tests++;
7779#endif
7780
7781    return(test_ret);
7782}
7783
7784
7785static int
7786test_xmlShellSave(void) {
7787    int test_ret = 0;
7788
7789#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7790    int mem_base;
7791    int ret_val;
7792    xmlShellCtxtPtr ctxt; /* the shell context */
7793    int n_ctxt;
7794    char * filename; /* the file name (optional) */
7795    int n_filename;
7796    xmlNodePtr node; /* unused */
7797    int n_node;
7798    xmlNodePtr node2; /* unused */
7799    int n_node2;
7800
7801    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7802    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7803    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7804    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7805        mem_base = xmlMemBlocks();
7806        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7807        filename = gen_char_ptr(n_filename, 1);
7808        node = gen_xmlNodePtr(n_node, 2);
7809        node2 = gen_xmlNodePtr(n_node2, 3);
7810
7811        ret_val = xmlShellSave(ctxt, filename, node, node2);
7812        desret_int(ret_val);
7813        call_tests++;
7814        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7815        des_char_ptr(n_filename, filename, 1);
7816        des_xmlNodePtr(n_node, node, 2);
7817        des_xmlNodePtr(n_node2, node2, 3);
7818        xmlResetLastError();
7819        if (mem_base != xmlMemBlocks()) {
7820            printf("Leak of %d blocks found in xmlShellSave",
7821	           xmlMemBlocks() - mem_base);
7822	    test_ret++;
7823            printf(" %d", n_ctxt);
7824            printf(" %d", n_filename);
7825            printf(" %d", n_node);
7826            printf(" %d", n_node2);
7827            printf("\n");
7828        }
7829    }
7830    }
7831    }
7832    }
7833    function_tests++;
7834#endif
7835
7836    return(test_ret);
7837}
7838
7839
7840static int
7841test_xmlShellValidate(void) {
7842    int test_ret = 0;
7843
7844#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7845    int mem_base;
7846    int ret_val;
7847    xmlShellCtxtPtr ctxt; /* the shell context */
7848    int n_ctxt;
7849    char * dtd; /* the DTD URI (optional) */
7850    int n_dtd;
7851    xmlNodePtr node; /* unused */
7852    int n_node;
7853    xmlNodePtr node2; /* unused */
7854    int n_node2;
7855
7856    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7857    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7858    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7859    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7860        mem_base = xmlMemBlocks();
7861        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7862        dtd = gen_char_ptr(n_dtd, 1);
7863        node = gen_xmlNodePtr(n_node, 2);
7864        node2 = gen_xmlNodePtr(n_node2, 3);
7865
7866        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
7867        desret_int(ret_val);
7868        call_tests++;
7869        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7870        des_char_ptr(n_dtd, dtd, 1);
7871        des_xmlNodePtr(n_node, node, 2);
7872        des_xmlNodePtr(n_node2, node2, 3);
7873        xmlResetLastError();
7874        if (mem_base != xmlMemBlocks()) {
7875            printf("Leak of %d blocks found in xmlShellValidate",
7876	           xmlMemBlocks() - mem_base);
7877	    test_ret++;
7878            printf(" %d", n_ctxt);
7879            printf(" %d", n_dtd);
7880            printf(" %d", n_node);
7881            printf(" %d", n_node2);
7882            printf("\n");
7883        }
7884    }
7885    }
7886    }
7887    }
7888    function_tests++;
7889#endif
7890
7891    return(test_ret);
7892}
7893
7894
7895static int
7896test_xmlShellWrite(void) {
7897    int test_ret = 0;
7898
7899#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7900    int mem_base;
7901    int ret_val;
7902    xmlShellCtxtPtr ctxt; /* the shell context */
7903    int n_ctxt;
7904    char * filename; /* the file name */
7905    int n_filename;
7906    xmlNodePtr node; /* a node in the tree */
7907    int n_node;
7908    xmlNodePtr node2; /* unused */
7909    int n_node2;
7910
7911    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7912    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7913    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7914    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7915        mem_base = xmlMemBlocks();
7916        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7917        filename = gen_char_ptr(n_filename, 1);
7918        node = gen_xmlNodePtr(n_node, 2);
7919        node2 = gen_xmlNodePtr(n_node2, 3);
7920
7921        ret_val = xmlShellWrite(ctxt, filename, node, node2);
7922        desret_int(ret_val);
7923        call_tests++;
7924        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7925        des_char_ptr(n_filename, filename, 1);
7926        des_xmlNodePtr(n_node, node, 2);
7927        des_xmlNodePtr(n_node2, node2, 3);
7928        xmlResetLastError();
7929        if (mem_base != xmlMemBlocks()) {
7930            printf("Leak of %d blocks found in xmlShellWrite",
7931	           xmlMemBlocks() - mem_base);
7932	    test_ret++;
7933            printf(" %d", n_ctxt);
7934            printf(" %d", n_filename);
7935            printf(" %d", n_node);
7936            printf(" %d", n_node2);
7937            printf("\n");
7938        }
7939    }
7940    }
7941    }
7942    }
7943    function_tests++;
7944#endif
7945
7946    return(test_ret);
7947}
7948
7949static int
7950test_debugXML(void) {
7951    int test_ret = 0;
7952
7953    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
7954    test_ret += test_xmlBoolToText();
7955    test_ret += test_xmlDebugCheckDocument();
7956    test_ret += test_xmlDebugDumpAttr();
7957    test_ret += test_xmlDebugDumpAttrList();
7958    test_ret += test_xmlDebugDumpDTD();
7959    test_ret += test_xmlDebugDumpDocument();
7960    test_ret += test_xmlDebugDumpDocumentHead();
7961    test_ret += test_xmlDebugDumpEntities();
7962    test_ret += test_xmlDebugDumpNode();
7963    test_ret += test_xmlDebugDumpNodeList();
7964    test_ret += test_xmlDebugDumpOneNode();
7965    test_ret += test_xmlDebugDumpString();
7966    test_ret += test_xmlLsCountNode();
7967    test_ret += test_xmlLsOneNode();
7968    test_ret += test_xmlShell();
7969    test_ret += test_xmlShellBase();
7970    test_ret += test_xmlShellCat();
7971    test_ret += test_xmlShellDir();
7972    test_ret += test_xmlShellDu();
7973    test_ret += test_xmlShellList();
7974    test_ret += test_xmlShellLoad();
7975    test_ret += test_xmlShellPrintXPathResult();
7976    test_ret += test_xmlShellPwd();
7977    test_ret += test_xmlShellSave();
7978    test_ret += test_xmlShellValidate();
7979    test_ret += test_xmlShellWrite();
7980
7981    if (test_ret != 0)
7982	printf("Module debugXML: %d errors\n", test_ret);
7983    return(test_ret);
7984}
7985
7986static int
7987test_xmlDictCleanup(void) {
7988    int test_ret = 0;
7989
7990    int mem_base;
7991
7992        mem_base = xmlMemBlocks();
7993
7994        xmlDictCleanup();
7995        call_tests++;
7996        xmlResetLastError();
7997        if (mem_base != xmlMemBlocks()) {
7998            printf("Leak of %d blocks found in xmlDictCleanup",
7999	           xmlMemBlocks() - mem_base);
8000	    test_ret++;
8001            printf("\n");
8002        }
8003    function_tests++;
8004
8005    return(test_ret);
8006}
8007
8008
8009static int
8010test_xmlDictCreate(void) {
8011    int test_ret = 0;
8012
8013    int mem_base;
8014    xmlDictPtr ret_val;
8015
8016        mem_base = xmlMemBlocks();
8017
8018        ret_val = xmlDictCreate();
8019        desret_xmlDictPtr(ret_val);
8020        call_tests++;
8021        xmlResetLastError();
8022        if (mem_base != xmlMemBlocks()) {
8023            printf("Leak of %d blocks found in xmlDictCreate",
8024	           xmlMemBlocks() - mem_base);
8025	    test_ret++;
8026            printf("\n");
8027        }
8028    function_tests++;
8029
8030    return(test_ret);
8031}
8032
8033
8034static int
8035test_xmlDictCreateSub(void) {
8036    int test_ret = 0;
8037
8038    int mem_base;
8039    xmlDictPtr ret_val;
8040    xmlDictPtr sub; /* an existing dictionnary */
8041    int n_sub;
8042
8043    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8044        mem_base = xmlMemBlocks();
8045        sub = gen_xmlDictPtr(n_sub, 0);
8046
8047        ret_val = xmlDictCreateSub(sub);
8048        desret_xmlDictPtr(ret_val);
8049        call_tests++;
8050        des_xmlDictPtr(n_sub, sub, 0);
8051        xmlResetLastError();
8052        if (mem_base != xmlMemBlocks()) {
8053            printf("Leak of %d blocks found in xmlDictCreateSub",
8054	           xmlMemBlocks() - mem_base);
8055	    test_ret++;
8056            printf(" %d", n_sub);
8057            printf("\n");
8058        }
8059    }
8060    function_tests++;
8061
8062    return(test_ret);
8063}
8064
8065
8066static int
8067test_xmlDictExists(void) {
8068    int test_ret = 0;
8069
8070    int mem_base;
8071    const xmlChar * ret_val;
8072    xmlDictPtr dict; /* the dictionnary */
8073    int n_dict;
8074    xmlChar * name; /* the name of the userdata */
8075    int n_name;
8076    int len; /* the length of the name, if -1 it is recomputed */
8077    int n_len;
8078
8079    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8080    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8081    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8082        mem_base = xmlMemBlocks();
8083        dict = gen_xmlDictPtr(n_dict, 0);
8084        name = gen_const_xmlChar_ptr(n_name, 1);
8085        len = gen_int(n_len, 2);
8086
8087        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8088        desret_const_xmlChar_ptr(ret_val);
8089        call_tests++;
8090        des_xmlDictPtr(n_dict, dict, 0);
8091        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8092        des_int(n_len, len, 2);
8093        xmlResetLastError();
8094        if (mem_base != xmlMemBlocks()) {
8095            printf("Leak of %d blocks found in xmlDictExists",
8096	           xmlMemBlocks() - mem_base);
8097	    test_ret++;
8098            printf(" %d", n_dict);
8099            printf(" %d", n_name);
8100            printf(" %d", n_len);
8101            printf("\n");
8102        }
8103    }
8104    }
8105    }
8106    function_tests++;
8107
8108    return(test_ret);
8109}
8110
8111
8112static int
8113test_xmlDictLookup(void) {
8114    int test_ret = 0;
8115
8116    int mem_base;
8117    const xmlChar * ret_val;
8118    xmlDictPtr dict; /* the dictionnary */
8119    int n_dict;
8120    xmlChar * name; /* the name of the userdata */
8121    int n_name;
8122    int len; /* the length of the name, if -1 it is recomputed */
8123    int n_len;
8124
8125    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8126    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8127    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8128        mem_base = xmlMemBlocks();
8129        dict = gen_xmlDictPtr(n_dict, 0);
8130        name = gen_const_xmlChar_ptr(n_name, 1);
8131        len = gen_int(n_len, 2);
8132
8133        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8134        desret_const_xmlChar_ptr(ret_val);
8135        call_tests++;
8136        des_xmlDictPtr(n_dict, dict, 0);
8137        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8138        des_int(n_len, len, 2);
8139        xmlResetLastError();
8140        if (mem_base != xmlMemBlocks()) {
8141            printf("Leak of %d blocks found in xmlDictLookup",
8142	           xmlMemBlocks() - mem_base);
8143	    test_ret++;
8144            printf(" %d", n_dict);
8145            printf(" %d", n_name);
8146            printf(" %d", n_len);
8147            printf("\n");
8148        }
8149    }
8150    }
8151    }
8152    function_tests++;
8153
8154    return(test_ret);
8155}
8156
8157
8158static int
8159test_xmlDictOwns(void) {
8160    int test_ret = 0;
8161
8162    int mem_base;
8163    int ret_val;
8164    xmlDictPtr dict; /* the dictionnary */
8165    int n_dict;
8166    xmlChar * str; /* the string */
8167    int n_str;
8168
8169    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8170    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8171        mem_base = xmlMemBlocks();
8172        dict = gen_xmlDictPtr(n_dict, 0);
8173        str = gen_const_xmlChar_ptr(n_str, 1);
8174
8175        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8176        desret_int(ret_val);
8177        call_tests++;
8178        des_xmlDictPtr(n_dict, dict, 0);
8179        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8180        xmlResetLastError();
8181        if (mem_base != xmlMemBlocks()) {
8182            printf("Leak of %d blocks found in xmlDictOwns",
8183	           xmlMemBlocks() - mem_base);
8184	    test_ret++;
8185            printf(" %d", n_dict);
8186            printf(" %d", n_str);
8187            printf("\n");
8188        }
8189    }
8190    }
8191    function_tests++;
8192
8193    return(test_ret);
8194}
8195
8196
8197static int
8198test_xmlDictQLookup(void) {
8199    int test_ret = 0;
8200
8201    int mem_base;
8202    const xmlChar * ret_val;
8203    xmlDictPtr dict; /* the dictionnary */
8204    int n_dict;
8205    xmlChar * prefix; /* the prefix */
8206    int n_prefix;
8207    xmlChar * name; /* the name */
8208    int n_name;
8209
8210    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8211    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8212    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8213        mem_base = xmlMemBlocks();
8214        dict = gen_xmlDictPtr(n_dict, 0);
8215        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8216        name = gen_const_xmlChar_ptr(n_name, 2);
8217
8218        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8219        desret_const_xmlChar_ptr(ret_val);
8220        call_tests++;
8221        des_xmlDictPtr(n_dict, dict, 0);
8222        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8223        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8224        xmlResetLastError();
8225        if (mem_base != xmlMemBlocks()) {
8226            printf("Leak of %d blocks found in xmlDictQLookup",
8227	           xmlMemBlocks() - mem_base);
8228	    test_ret++;
8229            printf(" %d", n_dict);
8230            printf(" %d", n_prefix);
8231            printf(" %d", n_name);
8232            printf("\n");
8233        }
8234    }
8235    }
8236    }
8237    function_tests++;
8238
8239    return(test_ret);
8240}
8241
8242
8243static int
8244test_xmlDictReference(void) {
8245    int test_ret = 0;
8246
8247    int mem_base;
8248    int ret_val;
8249    xmlDictPtr dict; /* the dictionnary */
8250    int n_dict;
8251
8252    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8253        mem_base = xmlMemBlocks();
8254        dict = gen_xmlDictPtr(n_dict, 0);
8255
8256        ret_val = xmlDictReference(dict);
8257        xmlDictFree(dict);
8258        desret_int(ret_val);
8259        call_tests++;
8260        des_xmlDictPtr(n_dict, dict, 0);
8261        xmlResetLastError();
8262        if (mem_base != xmlMemBlocks()) {
8263            printf("Leak of %d blocks found in xmlDictReference",
8264	           xmlMemBlocks() - mem_base);
8265	    test_ret++;
8266            printf(" %d", n_dict);
8267            printf("\n");
8268        }
8269    }
8270    function_tests++;
8271
8272    return(test_ret);
8273}
8274
8275
8276static int
8277test_xmlDictSize(void) {
8278    int test_ret = 0;
8279
8280    int mem_base;
8281    int ret_val;
8282    xmlDictPtr dict; /* the dictionnary */
8283    int n_dict;
8284
8285    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8286        mem_base = xmlMemBlocks();
8287        dict = gen_xmlDictPtr(n_dict, 0);
8288
8289        ret_val = xmlDictSize(dict);
8290        desret_int(ret_val);
8291        call_tests++;
8292        des_xmlDictPtr(n_dict, dict, 0);
8293        xmlResetLastError();
8294        if (mem_base != xmlMemBlocks()) {
8295            printf("Leak of %d blocks found in xmlDictSize",
8296	           xmlMemBlocks() - mem_base);
8297	    test_ret++;
8298            printf(" %d", n_dict);
8299            printf("\n");
8300        }
8301    }
8302    function_tests++;
8303
8304    return(test_ret);
8305}
8306
8307static int
8308test_dict(void) {
8309    int test_ret = 0;
8310
8311    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8312    test_ret += test_xmlDictCleanup();
8313    test_ret += test_xmlDictCreate();
8314    test_ret += test_xmlDictCreateSub();
8315    test_ret += test_xmlDictExists();
8316    test_ret += test_xmlDictLookup();
8317    test_ret += test_xmlDictOwns();
8318    test_ret += test_xmlDictQLookup();
8319    test_ret += test_xmlDictReference();
8320    test_ret += test_xmlDictSize();
8321
8322    if (test_ret != 0)
8323	printf("Module dict: %d errors\n", test_ret);
8324    return(test_ret);
8325}
8326
8327static int
8328test_UTF8Toisolat1(void) {
8329    int test_ret = 0;
8330
8331#if defined(LIBXML_OUTPUT_ENABLED)
8332#ifdef LIBXML_OUTPUT_ENABLED
8333    int mem_base;
8334    int ret_val;
8335    unsigned char * out; /* a pointer to an array of bytes to store the result */
8336    int n_out;
8337    int * outlen; /* the length of @out */
8338    int n_outlen;
8339    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8340    int n_in;
8341    int * inlen; /* the length of @in */
8342    int n_inlen;
8343
8344    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8345    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8346    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8347    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8348        mem_base = xmlMemBlocks();
8349        out = gen_unsigned_char_ptr(n_out, 0);
8350        outlen = gen_int_ptr(n_outlen, 1);
8351        in = gen_const_unsigned_char_ptr(n_in, 2);
8352        inlen = gen_int_ptr(n_inlen, 3);
8353
8354        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8355        desret_int(ret_val);
8356        call_tests++;
8357        des_unsigned_char_ptr(n_out, out, 0);
8358        des_int_ptr(n_outlen, outlen, 1);
8359        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8360        des_int_ptr(n_inlen, inlen, 3);
8361        xmlResetLastError();
8362        if (mem_base != xmlMemBlocks()) {
8363            printf("Leak of %d blocks found in UTF8Toisolat1",
8364	           xmlMemBlocks() - mem_base);
8365	    test_ret++;
8366            printf(" %d", n_out);
8367            printf(" %d", n_outlen);
8368            printf(" %d", n_in);
8369            printf(" %d", n_inlen);
8370            printf("\n");
8371        }
8372    }
8373    }
8374    }
8375    }
8376    function_tests++;
8377#endif
8378#endif
8379
8380    return(test_ret);
8381}
8382
8383
8384static int
8385test_isolat1ToUTF8(void) {
8386    int test_ret = 0;
8387
8388    int mem_base;
8389    int ret_val;
8390    unsigned char * out; /* a pointer to an array of bytes to store the result */
8391    int n_out;
8392    int * outlen; /* the length of @out */
8393    int n_outlen;
8394    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8395    int n_in;
8396    int * inlen; /* the length of @in */
8397    int n_inlen;
8398
8399    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8400    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8401    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8402    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8403        mem_base = xmlMemBlocks();
8404        out = gen_unsigned_char_ptr(n_out, 0);
8405        outlen = gen_int_ptr(n_outlen, 1);
8406        in = gen_const_unsigned_char_ptr(n_in, 2);
8407        inlen = gen_int_ptr(n_inlen, 3);
8408
8409        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8410        desret_int(ret_val);
8411        call_tests++;
8412        des_unsigned_char_ptr(n_out, out, 0);
8413        des_int_ptr(n_outlen, outlen, 1);
8414        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8415        des_int_ptr(n_inlen, inlen, 3);
8416        xmlResetLastError();
8417        if (mem_base != xmlMemBlocks()) {
8418            printf("Leak of %d blocks found in isolat1ToUTF8",
8419	           xmlMemBlocks() - mem_base);
8420	    test_ret++;
8421            printf(" %d", n_out);
8422            printf(" %d", n_outlen);
8423            printf(" %d", n_in);
8424            printf(" %d", n_inlen);
8425            printf("\n");
8426        }
8427    }
8428    }
8429    }
8430    }
8431    function_tests++;
8432
8433    return(test_ret);
8434}
8435
8436
8437static int
8438test_xmlAddEncodingAlias(void) {
8439    int test_ret = 0;
8440
8441    int ret_val;
8442    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8443    int n_name;
8444    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8445    int n_alias;
8446
8447    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8448    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8449        name = gen_const_char_ptr(n_name, 0);
8450        alias = gen_const_char_ptr(n_alias, 1);
8451
8452        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8453        desret_int(ret_val);
8454        call_tests++;
8455        des_const_char_ptr(n_name, (const char *)name, 0);
8456        des_const_char_ptr(n_alias, (const char *)alias, 1);
8457        xmlResetLastError();
8458    }
8459    }
8460    function_tests++;
8461
8462    return(test_ret);
8463}
8464
8465
8466#define gen_nb_xmlCharEncodingHandler_ptr 1
8467static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8468    return(NULL);
8469}
8470static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8471}
8472
8473static int
8474test_xmlCharEncCloseFunc(void) {
8475    int test_ret = 0;
8476
8477    int mem_base;
8478    int ret_val;
8479    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8480    int n_handler;
8481
8482    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8483        mem_base = xmlMemBlocks();
8484        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8485
8486        ret_val = xmlCharEncCloseFunc(handler);
8487        desret_int(ret_val);
8488        call_tests++;
8489        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8490        xmlResetLastError();
8491        if (mem_base != xmlMemBlocks()) {
8492            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8493	           xmlMemBlocks() - mem_base);
8494	    test_ret++;
8495            printf(" %d", n_handler);
8496            printf("\n");
8497        }
8498    }
8499    function_tests++;
8500
8501    return(test_ret);
8502}
8503
8504
8505static int
8506test_xmlCharEncFirstLine(void) {
8507    int test_ret = 0;
8508
8509    int mem_base;
8510    int ret_val;
8511    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8512    int n_handler;
8513    xmlBufferPtr out; /* an xmlBuffer for the output. */
8514    int n_out;
8515    xmlBufferPtr in; /* an xmlBuffer for the input */
8516    int n_in;
8517
8518    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8519    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8520    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8521        mem_base = xmlMemBlocks();
8522        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8523        out = gen_xmlBufferPtr(n_out, 1);
8524        in = gen_xmlBufferPtr(n_in, 2);
8525
8526        ret_val = xmlCharEncFirstLine(handler, out, in);
8527        desret_int(ret_val);
8528        call_tests++;
8529        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8530        des_xmlBufferPtr(n_out, out, 1);
8531        des_xmlBufferPtr(n_in, in, 2);
8532        xmlResetLastError();
8533        if (mem_base != xmlMemBlocks()) {
8534            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8535	           xmlMemBlocks() - mem_base);
8536	    test_ret++;
8537            printf(" %d", n_handler);
8538            printf(" %d", n_out);
8539            printf(" %d", n_in);
8540            printf("\n");
8541        }
8542    }
8543    }
8544    }
8545    function_tests++;
8546
8547    return(test_ret);
8548}
8549
8550
8551static int
8552test_xmlCharEncInFunc(void) {
8553    int test_ret = 0;
8554
8555    int mem_base;
8556    int ret_val;
8557    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8558    int n_handler;
8559    xmlBufferPtr out; /* an xmlBuffer for the output. */
8560    int n_out;
8561    xmlBufferPtr in; /* an xmlBuffer for the input */
8562    int n_in;
8563
8564    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8565    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8566    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8567        mem_base = xmlMemBlocks();
8568        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8569        out = gen_xmlBufferPtr(n_out, 1);
8570        in = gen_xmlBufferPtr(n_in, 2);
8571
8572        ret_val = xmlCharEncInFunc(handler, out, in);
8573        desret_int(ret_val);
8574        call_tests++;
8575        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8576        des_xmlBufferPtr(n_out, out, 1);
8577        des_xmlBufferPtr(n_in, in, 2);
8578        xmlResetLastError();
8579        if (mem_base != xmlMemBlocks()) {
8580            printf("Leak of %d blocks found in xmlCharEncInFunc",
8581	           xmlMemBlocks() - mem_base);
8582	    test_ret++;
8583            printf(" %d", n_handler);
8584            printf(" %d", n_out);
8585            printf(" %d", n_in);
8586            printf("\n");
8587        }
8588    }
8589    }
8590    }
8591    function_tests++;
8592
8593    return(test_ret);
8594}
8595
8596
8597static int
8598test_xmlCharEncOutFunc(void) {
8599    int test_ret = 0;
8600
8601    int mem_base;
8602    int ret_val;
8603    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8604    int n_handler;
8605    xmlBufferPtr out; /* an xmlBuffer for the output. */
8606    int n_out;
8607    xmlBufferPtr in; /* an xmlBuffer for the input */
8608    int n_in;
8609
8610    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8611    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8612    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8613        mem_base = xmlMemBlocks();
8614        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8615        out = gen_xmlBufferPtr(n_out, 1);
8616        in = gen_xmlBufferPtr(n_in, 2);
8617
8618        ret_val = xmlCharEncOutFunc(handler, out, in);
8619        desret_int(ret_val);
8620        call_tests++;
8621        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8622        des_xmlBufferPtr(n_out, out, 1);
8623        des_xmlBufferPtr(n_in, in, 2);
8624        xmlResetLastError();
8625        if (mem_base != xmlMemBlocks()) {
8626            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8627	           xmlMemBlocks() - mem_base);
8628	    test_ret++;
8629            printf(" %d", n_handler);
8630            printf(" %d", n_out);
8631            printf(" %d", n_in);
8632            printf("\n");
8633        }
8634    }
8635    }
8636    }
8637    function_tests++;
8638
8639    return(test_ret);
8640}
8641
8642
8643static int
8644test_xmlCleanupCharEncodingHandlers(void) {
8645    int test_ret = 0;
8646
8647
8648
8649        xmlCleanupCharEncodingHandlers();
8650        call_tests++;
8651        xmlResetLastError();
8652    function_tests++;
8653
8654    return(test_ret);
8655}
8656
8657
8658static int
8659test_xmlCleanupEncodingAliases(void) {
8660    int test_ret = 0;
8661
8662    int mem_base;
8663
8664        mem_base = xmlMemBlocks();
8665
8666        xmlCleanupEncodingAliases();
8667        call_tests++;
8668        xmlResetLastError();
8669        if (mem_base != xmlMemBlocks()) {
8670            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8671	           xmlMemBlocks() - mem_base);
8672	    test_ret++;
8673            printf("\n");
8674        }
8675    function_tests++;
8676
8677    return(test_ret);
8678}
8679
8680
8681static int
8682test_xmlDelEncodingAlias(void) {
8683    int test_ret = 0;
8684
8685    int mem_base;
8686    int ret_val;
8687    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8688    int n_alias;
8689
8690    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8691        mem_base = xmlMemBlocks();
8692        alias = gen_const_char_ptr(n_alias, 0);
8693
8694        ret_val = xmlDelEncodingAlias((const char *)alias);
8695        desret_int(ret_val);
8696        call_tests++;
8697        des_const_char_ptr(n_alias, (const char *)alias, 0);
8698        xmlResetLastError();
8699        if (mem_base != xmlMemBlocks()) {
8700            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8701	           xmlMemBlocks() - mem_base);
8702	    test_ret++;
8703            printf(" %d", n_alias);
8704            printf("\n");
8705        }
8706    }
8707    function_tests++;
8708
8709    return(test_ret);
8710}
8711
8712
8713static int
8714test_xmlDetectCharEncoding(void) {
8715    int test_ret = 0;
8716
8717    int mem_base;
8718    xmlCharEncoding ret_val;
8719    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). */
8720    int n_in;
8721    int len; /* pointer to the length of the buffer */
8722    int n_len;
8723
8724    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8725    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8726        mem_base = xmlMemBlocks();
8727        in = gen_const_unsigned_char_ptr(n_in, 0);
8728        len = gen_int(n_len, 1);
8729
8730        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8731        desret_xmlCharEncoding(ret_val);
8732        call_tests++;
8733        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8734        des_int(n_len, len, 1);
8735        xmlResetLastError();
8736        if (mem_base != xmlMemBlocks()) {
8737            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8738	           xmlMemBlocks() - mem_base);
8739	    test_ret++;
8740            printf(" %d", n_in);
8741            printf(" %d", n_len);
8742            printf("\n");
8743        }
8744    }
8745    }
8746    function_tests++;
8747
8748    return(test_ret);
8749}
8750
8751
8752static int
8753test_xmlFindCharEncodingHandler(void) {
8754    int test_ret = 0;
8755
8756
8757    /* missing type support */
8758    return(test_ret);
8759}
8760
8761
8762static int
8763test_xmlGetCharEncodingHandler(void) {
8764    int test_ret = 0;
8765
8766
8767    /* missing type support */
8768    return(test_ret);
8769}
8770
8771
8772static int
8773test_xmlGetCharEncodingName(void) {
8774    int test_ret = 0;
8775
8776    int mem_base;
8777    const char * ret_val;
8778    xmlCharEncoding enc; /* the encoding */
8779    int n_enc;
8780
8781    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8782        mem_base = xmlMemBlocks();
8783        enc = gen_xmlCharEncoding(n_enc, 0);
8784
8785        ret_val = xmlGetCharEncodingName(enc);
8786        desret_const_char_ptr(ret_val);
8787        call_tests++;
8788        des_xmlCharEncoding(n_enc, enc, 0);
8789        xmlResetLastError();
8790        if (mem_base != xmlMemBlocks()) {
8791            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8792	           xmlMemBlocks() - mem_base);
8793	    test_ret++;
8794            printf(" %d", n_enc);
8795            printf("\n");
8796        }
8797    }
8798    function_tests++;
8799
8800    return(test_ret);
8801}
8802
8803
8804static int
8805test_xmlGetEncodingAlias(void) {
8806    int test_ret = 0;
8807
8808    int mem_base;
8809    const char * ret_val;
8810    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8811    int n_alias;
8812
8813    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8814        mem_base = xmlMemBlocks();
8815        alias = gen_const_char_ptr(n_alias, 0);
8816
8817        ret_val = xmlGetEncodingAlias((const char *)alias);
8818        desret_const_char_ptr(ret_val);
8819        call_tests++;
8820        des_const_char_ptr(n_alias, (const char *)alias, 0);
8821        xmlResetLastError();
8822        if (mem_base != xmlMemBlocks()) {
8823            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8824	           xmlMemBlocks() - mem_base);
8825	    test_ret++;
8826            printf(" %d", n_alias);
8827            printf("\n");
8828        }
8829    }
8830    function_tests++;
8831
8832    return(test_ret);
8833}
8834
8835
8836static int
8837test_xmlInitCharEncodingHandlers(void) {
8838    int test_ret = 0;
8839
8840
8841
8842        xmlInitCharEncodingHandlers();
8843        call_tests++;
8844        xmlResetLastError();
8845    function_tests++;
8846
8847    return(test_ret);
8848}
8849
8850
8851static int
8852test_xmlNewCharEncodingHandler(void) {
8853    int test_ret = 0;
8854
8855
8856    /* missing type support */
8857    return(test_ret);
8858}
8859
8860
8861static int
8862test_xmlParseCharEncoding(void) {
8863    int test_ret = 0;
8864
8865    int mem_base;
8866    xmlCharEncoding ret_val;
8867    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8868    int n_name;
8869
8870    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8871        mem_base = xmlMemBlocks();
8872        name = gen_const_char_ptr(n_name, 0);
8873
8874        ret_val = xmlParseCharEncoding((const char *)name);
8875        desret_xmlCharEncoding(ret_val);
8876        call_tests++;
8877        des_const_char_ptr(n_name, (const char *)name, 0);
8878        xmlResetLastError();
8879        if (mem_base != xmlMemBlocks()) {
8880            printf("Leak of %d blocks found in xmlParseCharEncoding",
8881	           xmlMemBlocks() - mem_base);
8882	    test_ret++;
8883            printf(" %d", n_name);
8884            printf("\n");
8885        }
8886    }
8887    function_tests++;
8888
8889    return(test_ret);
8890}
8891
8892
8893#define gen_nb_xmlCharEncodingHandlerPtr 1
8894static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8895    return(NULL);
8896}
8897static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8898}
8899
8900static int
8901test_xmlRegisterCharEncodingHandler(void) {
8902    int test_ret = 0;
8903
8904    int mem_base;
8905    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
8906    int n_handler;
8907
8908    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
8909        mem_base = xmlMemBlocks();
8910        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
8911
8912        xmlRegisterCharEncodingHandler(handler);
8913        call_tests++;
8914        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
8915        xmlResetLastError();
8916        if (mem_base != xmlMemBlocks()) {
8917            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
8918	           xmlMemBlocks() - mem_base);
8919	    test_ret++;
8920            printf(" %d", n_handler);
8921            printf("\n");
8922        }
8923    }
8924    function_tests++;
8925
8926    return(test_ret);
8927}
8928
8929static int
8930test_encoding(void) {
8931    int test_ret = 0;
8932
8933    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
8934    test_ret += test_UTF8Toisolat1();
8935    test_ret += test_isolat1ToUTF8();
8936    test_ret += test_xmlAddEncodingAlias();
8937    test_ret += test_xmlCharEncCloseFunc();
8938    test_ret += test_xmlCharEncFirstLine();
8939    test_ret += test_xmlCharEncInFunc();
8940    test_ret += test_xmlCharEncOutFunc();
8941    test_ret += test_xmlCleanupCharEncodingHandlers();
8942    test_ret += test_xmlCleanupEncodingAliases();
8943    test_ret += test_xmlDelEncodingAlias();
8944    test_ret += test_xmlDetectCharEncoding();
8945    test_ret += test_xmlFindCharEncodingHandler();
8946    test_ret += test_xmlGetCharEncodingHandler();
8947    test_ret += test_xmlGetCharEncodingName();
8948    test_ret += test_xmlGetEncodingAlias();
8949    test_ret += test_xmlInitCharEncodingHandlers();
8950    test_ret += test_xmlNewCharEncodingHandler();
8951    test_ret += test_xmlParseCharEncoding();
8952    test_ret += test_xmlRegisterCharEncodingHandler();
8953
8954    if (test_ret != 0)
8955	printf("Module encoding: %d errors\n", test_ret);
8956    return(test_ret);
8957}
8958
8959static int
8960test_xmlAddDocEntity(void) {
8961    int test_ret = 0;
8962
8963    int mem_base;
8964    xmlEntityPtr ret_val;
8965    xmlDocPtr doc; /* the document */
8966    int n_doc;
8967    xmlChar * name; /* the entity name */
8968    int n_name;
8969    int type; /* the entity type XML_xxx_yyy_ENTITY */
8970    int n_type;
8971    xmlChar * ExternalID; /* the entity external ID if available */
8972    int n_ExternalID;
8973    xmlChar * SystemID; /* the entity system ID if available */
8974    int n_SystemID;
8975    xmlChar * content; /* the entity content */
8976    int n_content;
8977
8978    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
8979    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8980    for (n_type = 0;n_type < gen_nb_int;n_type++) {
8981    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
8982    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
8983    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
8984        mem_base = xmlMemBlocks();
8985        doc = gen_xmlDocPtr(n_doc, 0);
8986        name = gen_const_xmlChar_ptr(n_name, 1);
8987        type = gen_int(n_type, 2);
8988        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
8989        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
8990        content = gen_const_xmlChar_ptr(n_content, 5);
8991
8992        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
8993        desret_xmlEntityPtr(ret_val);
8994        call_tests++;
8995        des_xmlDocPtr(n_doc, doc, 0);
8996        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8997        des_int(n_type, type, 2);
8998        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
8999        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9000        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9001        xmlResetLastError();
9002        if (mem_base != xmlMemBlocks()) {
9003            printf("Leak of %d blocks found in xmlAddDocEntity",
9004	           xmlMemBlocks() - mem_base);
9005	    test_ret++;
9006            printf(" %d", n_doc);
9007            printf(" %d", n_name);
9008            printf(" %d", n_type);
9009            printf(" %d", n_ExternalID);
9010            printf(" %d", n_SystemID);
9011            printf(" %d", n_content);
9012            printf("\n");
9013        }
9014    }
9015    }
9016    }
9017    }
9018    }
9019    }
9020    function_tests++;
9021
9022    return(test_ret);
9023}
9024
9025
9026static int
9027test_xmlAddDtdEntity(void) {
9028    int test_ret = 0;
9029
9030    int mem_base;
9031    xmlEntityPtr ret_val;
9032    xmlDocPtr doc; /* the document */
9033    int n_doc;
9034    xmlChar * name; /* the entity name */
9035    int n_name;
9036    int type; /* the entity type XML_xxx_yyy_ENTITY */
9037    int n_type;
9038    xmlChar * ExternalID; /* the entity external ID if available */
9039    int n_ExternalID;
9040    xmlChar * SystemID; /* the entity system ID if available */
9041    int n_SystemID;
9042    xmlChar * content; /* the entity content */
9043    int n_content;
9044
9045    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9046    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9047    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9048    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9049    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9050    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9051        mem_base = xmlMemBlocks();
9052        doc = gen_xmlDocPtr(n_doc, 0);
9053        name = gen_const_xmlChar_ptr(n_name, 1);
9054        type = gen_int(n_type, 2);
9055        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9056        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9057        content = gen_const_xmlChar_ptr(n_content, 5);
9058
9059        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9060        desret_xmlEntityPtr(ret_val);
9061        call_tests++;
9062        des_xmlDocPtr(n_doc, doc, 0);
9063        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9064        des_int(n_type, type, 2);
9065        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9066        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9067        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9068        xmlResetLastError();
9069        if (mem_base != xmlMemBlocks()) {
9070            printf("Leak of %d blocks found in xmlAddDtdEntity",
9071	           xmlMemBlocks() - mem_base);
9072	    test_ret++;
9073            printf(" %d", n_doc);
9074            printf(" %d", n_name);
9075            printf(" %d", n_type);
9076            printf(" %d", n_ExternalID);
9077            printf(" %d", n_SystemID);
9078            printf(" %d", n_content);
9079            printf("\n");
9080        }
9081    }
9082    }
9083    }
9084    }
9085    }
9086    }
9087    function_tests++;
9088
9089    return(test_ret);
9090}
9091
9092
9093static int
9094test_xmlCleanupPredefinedEntities(void) {
9095    int test_ret = 0;
9096
9097#if defined(LIBXML_LEGACY_ENABLED)
9098#ifdef LIBXML_LEGACY_ENABLED
9099    int mem_base;
9100
9101        mem_base = xmlMemBlocks();
9102
9103        xmlCleanupPredefinedEntities();
9104        call_tests++;
9105        xmlResetLastError();
9106        if (mem_base != xmlMemBlocks()) {
9107            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9108	           xmlMemBlocks() - mem_base);
9109	    test_ret++;
9110            printf("\n");
9111        }
9112    function_tests++;
9113#endif
9114#endif
9115
9116    return(test_ret);
9117}
9118
9119
9120#define gen_nb_xmlEntitiesTablePtr 1
9121static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9122    return(NULL);
9123}
9124static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9125}
9126
9127static int
9128test_xmlCopyEntitiesTable(void) {
9129    int test_ret = 0;
9130
9131
9132    /* missing type support */
9133    return(test_ret);
9134}
9135
9136
9137static int
9138test_xmlCreateEntitiesTable(void) {
9139    int test_ret = 0;
9140
9141
9142    /* missing type support */
9143    return(test_ret);
9144}
9145
9146
9147static int
9148test_xmlDumpEntitiesTable(void) {
9149    int test_ret = 0;
9150
9151#if defined(LIBXML_OUTPUT_ENABLED)
9152    int mem_base;
9153    xmlBufferPtr buf; /* An XML buffer. */
9154    int n_buf;
9155    xmlEntitiesTablePtr table; /* An entity table */
9156    int n_table;
9157
9158    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9159    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9160        mem_base = xmlMemBlocks();
9161        buf = gen_xmlBufferPtr(n_buf, 0);
9162        table = gen_xmlEntitiesTablePtr(n_table, 1);
9163
9164        xmlDumpEntitiesTable(buf, table);
9165        call_tests++;
9166        des_xmlBufferPtr(n_buf, buf, 0);
9167        des_xmlEntitiesTablePtr(n_table, table, 1);
9168        xmlResetLastError();
9169        if (mem_base != xmlMemBlocks()) {
9170            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9171	           xmlMemBlocks() - mem_base);
9172	    test_ret++;
9173            printf(" %d", n_buf);
9174            printf(" %d", n_table);
9175            printf("\n");
9176        }
9177    }
9178    }
9179    function_tests++;
9180#endif
9181
9182    return(test_ret);
9183}
9184
9185
9186#define gen_nb_xmlEntityPtr 1
9187static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9188    return(NULL);
9189}
9190static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9191}
9192
9193static int
9194test_xmlDumpEntityDecl(void) {
9195    int test_ret = 0;
9196
9197#if defined(LIBXML_OUTPUT_ENABLED)
9198    int mem_base;
9199    xmlBufferPtr buf; /* An XML buffer. */
9200    int n_buf;
9201    xmlEntityPtr ent; /* An entity table */
9202    int n_ent;
9203
9204    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9205    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9206        mem_base = xmlMemBlocks();
9207        buf = gen_xmlBufferPtr(n_buf, 0);
9208        ent = gen_xmlEntityPtr(n_ent, 1);
9209
9210        xmlDumpEntityDecl(buf, ent);
9211        call_tests++;
9212        des_xmlBufferPtr(n_buf, buf, 0);
9213        des_xmlEntityPtr(n_ent, ent, 1);
9214        xmlResetLastError();
9215        if (mem_base != xmlMemBlocks()) {
9216            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9217	           xmlMemBlocks() - mem_base);
9218	    test_ret++;
9219            printf(" %d", n_buf);
9220            printf(" %d", n_ent);
9221            printf("\n");
9222        }
9223    }
9224    }
9225    function_tests++;
9226#endif
9227
9228    return(test_ret);
9229}
9230
9231
9232static int
9233test_xmlEncodeEntitiesReentrant(void) {
9234    int test_ret = 0;
9235
9236    int mem_base;
9237    xmlChar * ret_val;
9238    xmlDocPtr doc; /* the document containing the string */
9239    int n_doc;
9240    xmlChar * input; /* A string to convert to XML. */
9241    int n_input;
9242
9243    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9244    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9245        mem_base = xmlMemBlocks();
9246        doc = gen_xmlDocPtr(n_doc, 0);
9247        input = gen_const_xmlChar_ptr(n_input, 1);
9248
9249        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9250        desret_xmlChar_ptr(ret_val);
9251        call_tests++;
9252        des_xmlDocPtr(n_doc, doc, 0);
9253        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9254        xmlResetLastError();
9255        if (mem_base != xmlMemBlocks()) {
9256            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9257	           xmlMemBlocks() - mem_base);
9258	    test_ret++;
9259            printf(" %d", n_doc);
9260            printf(" %d", n_input);
9261            printf("\n");
9262        }
9263    }
9264    }
9265    function_tests++;
9266
9267    return(test_ret);
9268}
9269
9270
9271static int
9272test_xmlEncodeSpecialChars(void) {
9273    int test_ret = 0;
9274
9275    int mem_base;
9276    xmlChar * ret_val;
9277    xmlDocPtr doc; /* the document containing the string */
9278    int n_doc;
9279    xmlChar * input; /* A string to convert to XML. */
9280    int n_input;
9281
9282    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9283    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9284        mem_base = xmlMemBlocks();
9285        doc = gen_xmlDocPtr(n_doc, 0);
9286        input = gen_const_xmlChar_ptr(n_input, 1);
9287
9288        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9289        desret_xmlChar_ptr(ret_val);
9290        call_tests++;
9291        des_xmlDocPtr(n_doc, doc, 0);
9292        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9293        xmlResetLastError();
9294        if (mem_base != xmlMemBlocks()) {
9295            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9296	           xmlMemBlocks() - mem_base);
9297	    test_ret++;
9298            printf(" %d", n_doc);
9299            printf(" %d", n_input);
9300            printf("\n");
9301        }
9302    }
9303    }
9304    function_tests++;
9305
9306    return(test_ret);
9307}
9308
9309
9310static int
9311test_xmlGetDocEntity(void) {
9312    int test_ret = 0;
9313
9314    int mem_base;
9315    xmlEntityPtr ret_val;
9316    xmlDocPtr doc; /* the document referencing the entity */
9317    int n_doc;
9318    xmlChar * name; /* the entity name */
9319    int n_name;
9320
9321    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9322    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9323        mem_base = xmlMemBlocks();
9324        doc = gen_xmlDocPtr(n_doc, 0);
9325        name = gen_const_xmlChar_ptr(n_name, 1);
9326
9327        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9328        desret_xmlEntityPtr(ret_val);
9329        call_tests++;
9330        des_xmlDocPtr(n_doc, doc, 0);
9331        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9332        xmlResetLastError();
9333        if (mem_base != xmlMemBlocks()) {
9334            printf("Leak of %d blocks found in xmlGetDocEntity",
9335	           xmlMemBlocks() - mem_base);
9336	    test_ret++;
9337            printf(" %d", n_doc);
9338            printf(" %d", n_name);
9339            printf("\n");
9340        }
9341    }
9342    }
9343    function_tests++;
9344
9345    return(test_ret);
9346}
9347
9348
9349static int
9350test_xmlGetDtdEntity(void) {
9351    int test_ret = 0;
9352
9353    int mem_base;
9354    xmlEntityPtr ret_val;
9355    xmlDocPtr doc; /* the document referencing the entity */
9356    int n_doc;
9357    xmlChar * name; /* the entity name */
9358    int n_name;
9359
9360    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9361    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9362        mem_base = xmlMemBlocks();
9363        doc = gen_xmlDocPtr(n_doc, 0);
9364        name = gen_const_xmlChar_ptr(n_name, 1);
9365
9366        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9367        desret_xmlEntityPtr(ret_val);
9368        call_tests++;
9369        des_xmlDocPtr(n_doc, doc, 0);
9370        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9371        xmlResetLastError();
9372        if (mem_base != xmlMemBlocks()) {
9373            printf("Leak of %d blocks found in xmlGetDtdEntity",
9374	           xmlMemBlocks() - mem_base);
9375	    test_ret++;
9376            printf(" %d", n_doc);
9377            printf(" %d", n_name);
9378            printf("\n");
9379        }
9380    }
9381    }
9382    function_tests++;
9383
9384    return(test_ret);
9385}
9386
9387
9388static int
9389test_xmlGetParameterEntity(void) {
9390    int test_ret = 0;
9391
9392    int mem_base;
9393    xmlEntityPtr ret_val;
9394    xmlDocPtr doc; /* the document referencing the entity */
9395    int n_doc;
9396    xmlChar * name; /* the entity name */
9397    int n_name;
9398
9399    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9400    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9401        mem_base = xmlMemBlocks();
9402        doc = gen_xmlDocPtr(n_doc, 0);
9403        name = gen_const_xmlChar_ptr(n_name, 1);
9404
9405        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9406        desret_xmlEntityPtr(ret_val);
9407        call_tests++;
9408        des_xmlDocPtr(n_doc, doc, 0);
9409        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9410        xmlResetLastError();
9411        if (mem_base != xmlMemBlocks()) {
9412            printf("Leak of %d blocks found in xmlGetParameterEntity",
9413	           xmlMemBlocks() - mem_base);
9414	    test_ret++;
9415            printf(" %d", n_doc);
9416            printf(" %d", n_name);
9417            printf("\n");
9418        }
9419    }
9420    }
9421    function_tests++;
9422
9423    return(test_ret);
9424}
9425
9426
9427static int
9428test_xmlGetPredefinedEntity(void) {
9429    int test_ret = 0;
9430
9431    int mem_base;
9432    xmlEntityPtr ret_val;
9433    xmlChar * name; /* the entity name */
9434    int n_name;
9435
9436    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9437        mem_base = xmlMemBlocks();
9438        name = gen_const_xmlChar_ptr(n_name, 0);
9439
9440        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9441        desret_xmlEntityPtr(ret_val);
9442        call_tests++;
9443        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9444        xmlResetLastError();
9445        if (mem_base != xmlMemBlocks()) {
9446            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9447	           xmlMemBlocks() - mem_base);
9448	    test_ret++;
9449            printf(" %d", n_name);
9450            printf("\n");
9451        }
9452    }
9453    function_tests++;
9454
9455    return(test_ret);
9456}
9457
9458
9459static int
9460test_xmlInitializePredefinedEntities(void) {
9461    int test_ret = 0;
9462
9463#if defined(LIBXML_LEGACY_ENABLED)
9464#ifdef LIBXML_LEGACY_ENABLED
9465    int mem_base;
9466
9467        mem_base = xmlMemBlocks();
9468
9469        xmlInitializePredefinedEntities();
9470        call_tests++;
9471        xmlResetLastError();
9472        if (mem_base != xmlMemBlocks()) {
9473            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9474	           xmlMemBlocks() - mem_base);
9475	    test_ret++;
9476            printf("\n");
9477        }
9478    function_tests++;
9479#endif
9480#endif
9481
9482    return(test_ret);
9483}
9484
9485static int
9486test_entities(void) {
9487    int test_ret = 0;
9488
9489    if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
9490    test_ret += test_xmlAddDocEntity();
9491    test_ret += test_xmlAddDtdEntity();
9492    test_ret += test_xmlCleanupPredefinedEntities();
9493    test_ret += test_xmlCopyEntitiesTable();
9494    test_ret += test_xmlCreateEntitiesTable();
9495    test_ret += test_xmlDumpEntitiesTable();
9496    test_ret += test_xmlDumpEntityDecl();
9497    test_ret += test_xmlEncodeEntitiesReentrant();
9498    test_ret += test_xmlEncodeSpecialChars();
9499    test_ret += test_xmlGetDocEntity();
9500    test_ret += test_xmlGetDtdEntity();
9501    test_ret += test_xmlGetParameterEntity();
9502    test_ret += test_xmlGetPredefinedEntity();
9503    test_ret += test_xmlInitializePredefinedEntities();
9504
9505    if (test_ret != 0)
9506	printf("Module entities: %d errors\n", test_ret);
9507    return(test_ret);
9508}
9509
9510static int
9511test_xmlHashAddEntry(void) {
9512    int test_ret = 0;
9513
9514    int mem_base;
9515    int ret_val;
9516    xmlHashTablePtr table; /* the hash table */
9517    int n_table;
9518    xmlChar * name; /* the name of the userdata */
9519    int n_name;
9520    void * userdata; /* a pointer to the userdata */
9521    int n_userdata;
9522
9523    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9524    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9525    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9526        mem_base = xmlMemBlocks();
9527        table = gen_xmlHashTablePtr(n_table, 0);
9528        name = gen_const_xmlChar_ptr(n_name, 1);
9529        userdata = gen_userdata(n_userdata, 2);
9530
9531        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9532        desret_int(ret_val);
9533        call_tests++;
9534        des_xmlHashTablePtr(n_table, table, 0);
9535        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9536        des_userdata(n_userdata, userdata, 2);
9537        xmlResetLastError();
9538        if (mem_base != xmlMemBlocks()) {
9539            printf("Leak of %d blocks found in xmlHashAddEntry",
9540	           xmlMemBlocks() - mem_base);
9541	    test_ret++;
9542            printf(" %d", n_table);
9543            printf(" %d", n_name);
9544            printf(" %d", n_userdata);
9545            printf("\n");
9546        }
9547    }
9548    }
9549    }
9550    function_tests++;
9551
9552    return(test_ret);
9553}
9554
9555
9556static int
9557test_xmlHashAddEntry2(void) {
9558    int test_ret = 0;
9559
9560    int mem_base;
9561    int ret_val;
9562    xmlHashTablePtr table; /* the hash table */
9563    int n_table;
9564    xmlChar * name; /* the name of the userdata */
9565    int n_name;
9566    xmlChar * name2; /* a second name of the userdata */
9567    int n_name2;
9568    void * userdata; /* a pointer to the userdata */
9569    int n_userdata;
9570
9571    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9572    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9573    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9574    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9575        mem_base = xmlMemBlocks();
9576        table = gen_xmlHashTablePtr(n_table, 0);
9577        name = gen_const_xmlChar_ptr(n_name, 1);
9578        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9579        userdata = gen_userdata(n_userdata, 3);
9580
9581        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9582        desret_int(ret_val);
9583        call_tests++;
9584        des_xmlHashTablePtr(n_table, table, 0);
9585        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9586        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9587        des_userdata(n_userdata, userdata, 3);
9588        xmlResetLastError();
9589        if (mem_base != xmlMemBlocks()) {
9590            printf("Leak of %d blocks found in xmlHashAddEntry2",
9591	           xmlMemBlocks() - mem_base);
9592	    test_ret++;
9593            printf(" %d", n_table);
9594            printf(" %d", n_name);
9595            printf(" %d", n_name2);
9596            printf(" %d", n_userdata);
9597            printf("\n");
9598        }
9599    }
9600    }
9601    }
9602    }
9603    function_tests++;
9604
9605    return(test_ret);
9606}
9607
9608
9609static int
9610test_xmlHashAddEntry3(void) {
9611    int test_ret = 0;
9612
9613    int mem_base;
9614    int ret_val;
9615    xmlHashTablePtr table; /* the hash table */
9616    int n_table;
9617    xmlChar * name; /* the name of the userdata */
9618    int n_name;
9619    xmlChar * name2; /* a second name of the userdata */
9620    int n_name2;
9621    xmlChar * name3; /* a third name of the userdata */
9622    int n_name3;
9623    void * userdata; /* a pointer to the userdata */
9624    int n_userdata;
9625
9626    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9627    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9628    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9629    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9630    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9631        mem_base = xmlMemBlocks();
9632        table = gen_xmlHashTablePtr(n_table, 0);
9633        name = gen_const_xmlChar_ptr(n_name, 1);
9634        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9635        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9636        userdata = gen_userdata(n_userdata, 4);
9637
9638        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9639        desret_int(ret_val);
9640        call_tests++;
9641        des_xmlHashTablePtr(n_table, table, 0);
9642        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9643        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9644        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9645        des_userdata(n_userdata, userdata, 4);
9646        xmlResetLastError();
9647        if (mem_base != xmlMemBlocks()) {
9648            printf("Leak of %d blocks found in xmlHashAddEntry3",
9649	           xmlMemBlocks() - mem_base);
9650	    test_ret++;
9651            printf(" %d", n_table);
9652            printf(" %d", n_name);
9653            printf(" %d", n_name2);
9654            printf(" %d", n_name3);
9655            printf(" %d", n_userdata);
9656            printf("\n");
9657        }
9658    }
9659    }
9660    }
9661    }
9662    }
9663    function_tests++;
9664
9665    return(test_ret);
9666}
9667
9668
9669static int
9670test_xmlHashCopy(void) {
9671    int test_ret = 0;
9672
9673
9674    /* missing type support */
9675    return(test_ret);
9676}
9677
9678
9679static int
9680test_xmlHashCreate(void) {
9681    int test_ret = 0;
9682
9683
9684    /* missing type support */
9685    return(test_ret);
9686}
9687
9688
9689static int
9690test_xmlHashCreateDict(void) {
9691    int test_ret = 0;
9692
9693
9694    /* missing type support */
9695    return(test_ret);
9696}
9697
9698
9699static int
9700test_xmlHashLookup(void) {
9701    int test_ret = 0;
9702
9703    int mem_base;
9704    void * ret_val;
9705    xmlHashTablePtr table; /* the hash table */
9706    int n_table;
9707    xmlChar * name; /* the name of the userdata */
9708    int n_name;
9709
9710    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9711    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9712        mem_base = xmlMemBlocks();
9713        table = gen_xmlHashTablePtr(n_table, 0);
9714        name = gen_const_xmlChar_ptr(n_name, 1);
9715
9716        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9717        desret_void_ptr(ret_val);
9718        call_tests++;
9719        des_xmlHashTablePtr(n_table, table, 0);
9720        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9721        xmlResetLastError();
9722        if (mem_base != xmlMemBlocks()) {
9723            printf("Leak of %d blocks found in xmlHashLookup",
9724	           xmlMemBlocks() - mem_base);
9725	    test_ret++;
9726            printf(" %d", n_table);
9727            printf(" %d", n_name);
9728            printf("\n");
9729        }
9730    }
9731    }
9732    function_tests++;
9733
9734    return(test_ret);
9735}
9736
9737
9738static int
9739test_xmlHashLookup2(void) {
9740    int test_ret = 0;
9741
9742    int mem_base;
9743    void * ret_val;
9744    xmlHashTablePtr table; /* the hash table */
9745    int n_table;
9746    xmlChar * name; /* the name of the userdata */
9747    int n_name;
9748    xmlChar * name2; /* a second name of the userdata */
9749    int n_name2;
9750
9751    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9752    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9753    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9754        mem_base = xmlMemBlocks();
9755        table = gen_xmlHashTablePtr(n_table, 0);
9756        name = gen_const_xmlChar_ptr(n_name, 1);
9757        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9758
9759        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9760        desret_void_ptr(ret_val);
9761        call_tests++;
9762        des_xmlHashTablePtr(n_table, table, 0);
9763        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9764        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9765        xmlResetLastError();
9766        if (mem_base != xmlMemBlocks()) {
9767            printf("Leak of %d blocks found in xmlHashLookup2",
9768	           xmlMemBlocks() - mem_base);
9769	    test_ret++;
9770            printf(" %d", n_table);
9771            printf(" %d", n_name);
9772            printf(" %d", n_name2);
9773            printf("\n");
9774        }
9775    }
9776    }
9777    }
9778    function_tests++;
9779
9780    return(test_ret);
9781}
9782
9783
9784static int
9785test_xmlHashLookup3(void) {
9786    int test_ret = 0;
9787
9788    int mem_base;
9789    void * ret_val;
9790    xmlHashTablePtr table; /* the hash table */
9791    int n_table;
9792    xmlChar * name; /* the name of the userdata */
9793    int n_name;
9794    xmlChar * name2; /* a second name of the userdata */
9795    int n_name2;
9796    xmlChar * name3; /* a third name of the userdata */
9797    int n_name3;
9798
9799    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9800    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9801    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9802    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9803        mem_base = xmlMemBlocks();
9804        table = gen_xmlHashTablePtr(n_table, 0);
9805        name = gen_const_xmlChar_ptr(n_name, 1);
9806        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9807        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9808
9809        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
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        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9815        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9816        xmlResetLastError();
9817        if (mem_base != xmlMemBlocks()) {
9818            printf("Leak of %d blocks found in xmlHashLookup3",
9819	           xmlMemBlocks() - mem_base);
9820	    test_ret++;
9821            printf(" %d", n_table);
9822            printf(" %d", n_name);
9823            printf(" %d", n_name2);
9824            printf(" %d", n_name3);
9825            printf("\n");
9826        }
9827    }
9828    }
9829    }
9830    }
9831    function_tests++;
9832
9833    return(test_ret);
9834}
9835
9836
9837static int
9838test_xmlHashQLookup(void) {
9839    int test_ret = 0;
9840
9841    int mem_base;
9842    void * ret_val;
9843    xmlHashTablePtr table; /* the hash table */
9844    int n_table;
9845    xmlChar * prefix; /* the prefix of the userdata */
9846    int n_prefix;
9847    xmlChar * name; /* the name of the userdata */
9848    int n_name;
9849
9850    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9851    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9852    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9853        mem_base = xmlMemBlocks();
9854        table = gen_xmlHashTablePtr(n_table, 0);
9855        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9856        name = gen_const_xmlChar_ptr(n_name, 2);
9857
9858        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
9859        desret_void_ptr(ret_val);
9860        call_tests++;
9861        des_xmlHashTablePtr(n_table, table, 0);
9862        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9863        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9864        xmlResetLastError();
9865        if (mem_base != xmlMemBlocks()) {
9866            printf("Leak of %d blocks found in xmlHashQLookup",
9867	           xmlMemBlocks() - mem_base);
9868	    test_ret++;
9869            printf(" %d", n_table);
9870            printf(" %d", n_prefix);
9871            printf(" %d", n_name);
9872            printf("\n");
9873        }
9874    }
9875    }
9876    }
9877    function_tests++;
9878
9879    return(test_ret);
9880}
9881
9882
9883static int
9884test_xmlHashQLookup2(void) {
9885    int test_ret = 0;
9886
9887    int mem_base;
9888    void * ret_val;
9889    xmlHashTablePtr table; /* the hash table */
9890    int n_table;
9891    xmlChar * prefix; /* the prefix of the userdata */
9892    int n_prefix;
9893    xmlChar * name; /* the name of the userdata */
9894    int n_name;
9895    xmlChar * prefix2; /* the second prefix of the userdata */
9896    int n_prefix2;
9897    xmlChar * name2; /* a second name of the userdata */
9898    int n_name2;
9899
9900    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9901    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9902    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9903    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9904    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9905        mem_base = xmlMemBlocks();
9906        table = gen_xmlHashTablePtr(n_table, 0);
9907        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9908        name = gen_const_xmlChar_ptr(n_name, 2);
9909        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9910        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9911
9912        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
9913        desret_void_ptr(ret_val);
9914        call_tests++;
9915        des_xmlHashTablePtr(n_table, table, 0);
9916        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9917        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9918        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9919        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9920        xmlResetLastError();
9921        if (mem_base != xmlMemBlocks()) {
9922            printf("Leak of %d blocks found in xmlHashQLookup2",
9923	           xmlMemBlocks() - mem_base);
9924	    test_ret++;
9925            printf(" %d", n_table);
9926            printf(" %d", n_prefix);
9927            printf(" %d", n_name);
9928            printf(" %d", n_prefix2);
9929            printf(" %d", n_name2);
9930            printf("\n");
9931        }
9932    }
9933    }
9934    }
9935    }
9936    }
9937    function_tests++;
9938
9939    return(test_ret);
9940}
9941
9942
9943static int
9944test_xmlHashQLookup3(void) {
9945    int test_ret = 0;
9946
9947    int mem_base;
9948    void * ret_val;
9949    xmlHashTablePtr table; /* the hash table */
9950    int n_table;
9951    xmlChar * prefix; /* the prefix of the userdata */
9952    int n_prefix;
9953    xmlChar * name; /* the name of the userdata */
9954    int n_name;
9955    xmlChar * prefix2; /* the second prefix of the userdata */
9956    int n_prefix2;
9957    xmlChar * name2; /* a second name of the userdata */
9958    int n_name2;
9959    xmlChar * prefix3; /* the third prefix of the userdata */
9960    int n_prefix3;
9961    xmlChar * name3; /* a third name of the userdata */
9962    int n_name3;
9963
9964    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9965    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9966    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9967    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9968    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9969    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
9970    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9971        mem_base = xmlMemBlocks();
9972        table = gen_xmlHashTablePtr(n_table, 0);
9973        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9974        name = gen_const_xmlChar_ptr(n_name, 2);
9975        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9976        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9977        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
9978        name3 = gen_const_xmlChar_ptr(n_name3, 6);
9979
9980        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
9981        desret_void_ptr(ret_val);
9982        call_tests++;
9983        des_xmlHashTablePtr(n_table, table, 0);
9984        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9985        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9986        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9987        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9988        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
9989        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
9990        xmlResetLastError();
9991        if (mem_base != xmlMemBlocks()) {
9992            printf("Leak of %d blocks found in xmlHashQLookup3",
9993	           xmlMemBlocks() - mem_base);
9994	    test_ret++;
9995            printf(" %d", n_table);
9996            printf(" %d", n_prefix);
9997            printf(" %d", n_name);
9998            printf(" %d", n_prefix2);
9999            printf(" %d", n_name2);
10000            printf(" %d", n_prefix3);
10001            printf(" %d", n_name3);
10002            printf("\n");
10003        }
10004    }
10005    }
10006    }
10007    }
10008    }
10009    }
10010    }
10011    function_tests++;
10012
10013    return(test_ret);
10014}
10015
10016
10017static int
10018test_xmlHashRemoveEntry(void) {
10019    int test_ret = 0;
10020
10021    int mem_base;
10022    int ret_val;
10023    xmlHashTablePtr table; /* the hash table */
10024    int n_table;
10025    xmlChar * name; /* the name of the userdata */
10026    int n_name;
10027    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10028    int n_f;
10029
10030    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10031    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10032    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10033        mem_base = xmlMemBlocks();
10034        table = gen_xmlHashTablePtr(n_table, 0);
10035        name = gen_const_xmlChar_ptr(n_name, 1);
10036        f = gen_xmlHashDeallocator(n_f, 2);
10037
10038        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10039        desret_int(ret_val);
10040        call_tests++;
10041        des_xmlHashTablePtr(n_table, table, 0);
10042        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10043        des_xmlHashDeallocator(n_f, f, 2);
10044        xmlResetLastError();
10045        if (mem_base != xmlMemBlocks()) {
10046            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10047	           xmlMemBlocks() - mem_base);
10048	    test_ret++;
10049            printf(" %d", n_table);
10050            printf(" %d", n_name);
10051            printf(" %d", n_f);
10052            printf("\n");
10053        }
10054    }
10055    }
10056    }
10057    function_tests++;
10058
10059    return(test_ret);
10060}
10061
10062
10063static int
10064test_xmlHashRemoveEntry2(void) {
10065    int test_ret = 0;
10066
10067    int mem_base;
10068    int ret_val;
10069    xmlHashTablePtr table; /* the hash table */
10070    int n_table;
10071    xmlChar * name; /* the name of the userdata */
10072    int n_name;
10073    xmlChar * name2; /* a second name of the userdata */
10074    int n_name2;
10075    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10076    int n_f;
10077
10078    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10079    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10080    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10081    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10082        mem_base = xmlMemBlocks();
10083        table = gen_xmlHashTablePtr(n_table, 0);
10084        name = gen_const_xmlChar_ptr(n_name, 1);
10085        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10086        f = gen_xmlHashDeallocator(n_f, 3);
10087
10088        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10089        desret_int(ret_val);
10090        call_tests++;
10091        des_xmlHashTablePtr(n_table, table, 0);
10092        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10093        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10094        des_xmlHashDeallocator(n_f, f, 3);
10095        xmlResetLastError();
10096        if (mem_base != xmlMemBlocks()) {
10097            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10098	           xmlMemBlocks() - mem_base);
10099	    test_ret++;
10100            printf(" %d", n_table);
10101            printf(" %d", n_name);
10102            printf(" %d", n_name2);
10103            printf(" %d", n_f);
10104            printf("\n");
10105        }
10106    }
10107    }
10108    }
10109    }
10110    function_tests++;
10111
10112    return(test_ret);
10113}
10114
10115
10116static int
10117test_xmlHashRemoveEntry3(void) {
10118    int test_ret = 0;
10119
10120    int mem_base;
10121    int ret_val;
10122    xmlHashTablePtr table; /* the hash table */
10123    int n_table;
10124    xmlChar * name; /* the name of the userdata */
10125    int n_name;
10126    xmlChar * name2; /* a second name of the userdata */
10127    int n_name2;
10128    xmlChar * name3; /* a third name of the userdata */
10129    int n_name3;
10130    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10131    int n_f;
10132
10133    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10134    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10135    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10136    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10137    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10138        mem_base = xmlMemBlocks();
10139        table = gen_xmlHashTablePtr(n_table, 0);
10140        name = gen_const_xmlChar_ptr(n_name, 1);
10141        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10142        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10143        f = gen_xmlHashDeallocator(n_f, 4);
10144
10145        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10146        desret_int(ret_val);
10147        call_tests++;
10148        des_xmlHashTablePtr(n_table, table, 0);
10149        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10150        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10151        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10152        des_xmlHashDeallocator(n_f, f, 4);
10153        xmlResetLastError();
10154        if (mem_base != xmlMemBlocks()) {
10155            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10156	           xmlMemBlocks() - mem_base);
10157	    test_ret++;
10158            printf(" %d", n_table);
10159            printf(" %d", n_name);
10160            printf(" %d", n_name2);
10161            printf(" %d", n_name3);
10162            printf(" %d", n_f);
10163            printf("\n");
10164        }
10165    }
10166    }
10167    }
10168    }
10169    }
10170    function_tests++;
10171
10172    return(test_ret);
10173}
10174
10175
10176static int
10177test_xmlHashScan(void) {
10178    int test_ret = 0;
10179
10180
10181    /* missing type support */
10182    return(test_ret);
10183}
10184
10185
10186static int
10187test_xmlHashScan3(void) {
10188    int test_ret = 0;
10189
10190
10191    /* missing type support */
10192    return(test_ret);
10193}
10194
10195
10196static int
10197test_xmlHashScanFull(void) {
10198    int test_ret = 0;
10199
10200
10201    /* missing type support */
10202    return(test_ret);
10203}
10204
10205
10206static int
10207test_xmlHashScanFull3(void) {
10208    int test_ret = 0;
10209
10210
10211    /* missing type support */
10212    return(test_ret);
10213}
10214
10215
10216static int
10217test_xmlHashSize(void) {
10218    int test_ret = 0;
10219
10220    int mem_base;
10221    int ret_val;
10222    xmlHashTablePtr table; /* the hash table */
10223    int n_table;
10224
10225    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10226        mem_base = xmlMemBlocks();
10227        table = gen_xmlHashTablePtr(n_table, 0);
10228
10229        ret_val = xmlHashSize(table);
10230        desret_int(ret_val);
10231        call_tests++;
10232        des_xmlHashTablePtr(n_table, table, 0);
10233        xmlResetLastError();
10234        if (mem_base != xmlMemBlocks()) {
10235            printf("Leak of %d blocks found in xmlHashSize",
10236	           xmlMemBlocks() - mem_base);
10237	    test_ret++;
10238            printf(" %d", n_table);
10239            printf("\n");
10240        }
10241    }
10242    function_tests++;
10243
10244    return(test_ret);
10245}
10246
10247
10248static int
10249test_xmlHashUpdateEntry(void) {
10250    int test_ret = 0;
10251
10252    int mem_base;
10253    int ret_val;
10254    xmlHashTablePtr table; /* the hash table */
10255    int n_table;
10256    xmlChar * name; /* the name of the userdata */
10257    int n_name;
10258    void * userdata; /* a pointer to the userdata */
10259    int n_userdata;
10260    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10261    int n_f;
10262
10263    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10264    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10265    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10266    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10267        mem_base = xmlMemBlocks();
10268        table = gen_xmlHashTablePtr(n_table, 0);
10269        name = gen_const_xmlChar_ptr(n_name, 1);
10270        userdata = gen_userdata(n_userdata, 2);
10271        f = gen_xmlHashDeallocator(n_f, 3);
10272
10273        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10274        desret_int(ret_val);
10275        call_tests++;
10276        des_xmlHashTablePtr(n_table, table, 0);
10277        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10278        des_userdata(n_userdata, userdata, 2);
10279        des_xmlHashDeallocator(n_f, f, 3);
10280        xmlResetLastError();
10281        if (mem_base != xmlMemBlocks()) {
10282            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10283	           xmlMemBlocks() - mem_base);
10284	    test_ret++;
10285            printf(" %d", n_table);
10286            printf(" %d", n_name);
10287            printf(" %d", n_userdata);
10288            printf(" %d", n_f);
10289            printf("\n");
10290        }
10291    }
10292    }
10293    }
10294    }
10295    function_tests++;
10296
10297    return(test_ret);
10298}
10299
10300
10301static int
10302test_xmlHashUpdateEntry2(void) {
10303    int test_ret = 0;
10304
10305    int mem_base;
10306    int ret_val;
10307    xmlHashTablePtr table; /* the hash table */
10308    int n_table;
10309    xmlChar * name; /* the name of the userdata */
10310    int n_name;
10311    xmlChar * name2; /* a second name of the userdata */
10312    int n_name2;
10313    void * userdata; /* a pointer to the userdata */
10314    int n_userdata;
10315    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10316    int n_f;
10317
10318    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10319    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10320    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10321    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10322    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10323        mem_base = xmlMemBlocks();
10324        table = gen_xmlHashTablePtr(n_table, 0);
10325        name = gen_const_xmlChar_ptr(n_name, 1);
10326        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10327        userdata = gen_userdata(n_userdata, 3);
10328        f = gen_xmlHashDeallocator(n_f, 4);
10329
10330        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10331        desret_int(ret_val);
10332        call_tests++;
10333        des_xmlHashTablePtr(n_table, table, 0);
10334        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10335        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10336        des_userdata(n_userdata, userdata, 3);
10337        des_xmlHashDeallocator(n_f, f, 4);
10338        xmlResetLastError();
10339        if (mem_base != xmlMemBlocks()) {
10340            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10341	           xmlMemBlocks() - mem_base);
10342	    test_ret++;
10343            printf(" %d", n_table);
10344            printf(" %d", n_name);
10345            printf(" %d", n_name2);
10346            printf(" %d", n_userdata);
10347            printf(" %d", n_f);
10348            printf("\n");
10349        }
10350    }
10351    }
10352    }
10353    }
10354    }
10355    function_tests++;
10356
10357    return(test_ret);
10358}
10359
10360
10361static int
10362test_xmlHashUpdateEntry3(void) {
10363    int test_ret = 0;
10364
10365    int mem_base;
10366    int ret_val;
10367    xmlHashTablePtr table; /* the hash table */
10368    int n_table;
10369    xmlChar * name; /* the name of the userdata */
10370    int n_name;
10371    xmlChar * name2; /* a second name of the userdata */
10372    int n_name2;
10373    xmlChar * name3; /* a third name of the userdata */
10374    int n_name3;
10375    void * userdata; /* a pointer to the userdata */
10376    int n_userdata;
10377    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10378    int n_f;
10379
10380    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10381    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10382    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10383    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10384    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10385    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10386        mem_base = xmlMemBlocks();
10387        table = gen_xmlHashTablePtr(n_table, 0);
10388        name = gen_const_xmlChar_ptr(n_name, 1);
10389        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10390        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10391        userdata = gen_userdata(n_userdata, 4);
10392        f = gen_xmlHashDeallocator(n_f, 5);
10393
10394        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10395        desret_int(ret_val);
10396        call_tests++;
10397        des_xmlHashTablePtr(n_table, table, 0);
10398        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10399        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10400        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10401        des_userdata(n_userdata, userdata, 4);
10402        des_xmlHashDeallocator(n_f, f, 5);
10403        xmlResetLastError();
10404        if (mem_base != xmlMemBlocks()) {
10405            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10406	           xmlMemBlocks() - mem_base);
10407	    test_ret++;
10408            printf(" %d", n_table);
10409            printf(" %d", n_name);
10410            printf(" %d", n_name2);
10411            printf(" %d", n_name3);
10412            printf(" %d", n_userdata);
10413            printf(" %d", n_f);
10414            printf("\n");
10415        }
10416    }
10417    }
10418    }
10419    }
10420    }
10421    }
10422    function_tests++;
10423
10424    return(test_ret);
10425}
10426
10427static int
10428test_hash(void) {
10429    int test_ret = 0;
10430
10431    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10432    test_ret += test_xmlHashAddEntry();
10433    test_ret += test_xmlHashAddEntry2();
10434    test_ret += test_xmlHashAddEntry3();
10435    test_ret += test_xmlHashCopy();
10436    test_ret += test_xmlHashCreate();
10437    test_ret += test_xmlHashCreateDict();
10438    test_ret += test_xmlHashLookup();
10439    test_ret += test_xmlHashLookup2();
10440    test_ret += test_xmlHashLookup3();
10441    test_ret += test_xmlHashQLookup();
10442    test_ret += test_xmlHashQLookup2();
10443    test_ret += test_xmlHashQLookup3();
10444    test_ret += test_xmlHashRemoveEntry();
10445    test_ret += test_xmlHashRemoveEntry2();
10446    test_ret += test_xmlHashRemoveEntry3();
10447    test_ret += test_xmlHashScan();
10448    test_ret += test_xmlHashScan3();
10449    test_ret += test_xmlHashScanFull();
10450    test_ret += test_xmlHashScanFull3();
10451    test_ret += test_xmlHashSize();
10452    test_ret += test_xmlHashUpdateEntry();
10453    test_ret += test_xmlHashUpdateEntry2();
10454    test_ret += test_xmlHashUpdateEntry3();
10455
10456    if (test_ret != 0)
10457	printf("Module hash: %d errors\n", test_ret);
10458    return(test_ret);
10459}
10460
10461#define gen_nb_xmlLinkPtr 1
10462static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10463    return(NULL);
10464}
10465static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10466}
10467
10468static int
10469test_xmlLinkGetData(void) {
10470    int test_ret = 0;
10471
10472    int mem_base;
10473    void * ret_val;
10474    xmlLinkPtr lk; /* a link */
10475    int n_lk;
10476
10477    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10478        mem_base = xmlMemBlocks();
10479        lk = gen_xmlLinkPtr(n_lk, 0);
10480
10481        ret_val = xmlLinkGetData(lk);
10482        desret_void_ptr(ret_val);
10483        call_tests++;
10484        des_xmlLinkPtr(n_lk, lk, 0);
10485        xmlResetLastError();
10486        if (mem_base != xmlMemBlocks()) {
10487            printf("Leak of %d blocks found in xmlLinkGetData",
10488	           xmlMemBlocks() - mem_base);
10489	    test_ret++;
10490            printf(" %d", n_lk);
10491            printf("\n");
10492        }
10493    }
10494    function_tests++;
10495
10496    return(test_ret);
10497}
10498
10499
10500static int
10501test_xmlListAppend(void) {
10502    int test_ret = 0;
10503
10504    int mem_base;
10505    int ret_val;
10506    xmlListPtr l; /* a list */
10507    int n_l;
10508    void * data; /* the data */
10509    int n_data;
10510
10511    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10512    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10513        mem_base = xmlMemBlocks();
10514        l = gen_xmlListPtr(n_l, 0);
10515        data = gen_userdata(n_data, 1);
10516
10517        ret_val = xmlListAppend(l, data);
10518        desret_int(ret_val);
10519        call_tests++;
10520        des_xmlListPtr(n_l, l, 0);
10521        des_userdata(n_data, data, 1);
10522        xmlResetLastError();
10523        if (mem_base != xmlMemBlocks()) {
10524            printf("Leak of %d blocks found in xmlListAppend",
10525	           xmlMemBlocks() - mem_base);
10526	    test_ret++;
10527            printf(" %d", n_l);
10528            printf(" %d", n_data);
10529            printf("\n");
10530        }
10531    }
10532    }
10533    function_tests++;
10534
10535    return(test_ret);
10536}
10537
10538
10539static int
10540test_xmlListClear(void) {
10541    int test_ret = 0;
10542
10543    int mem_base;
10544    xmlListPtr l; /* a list */
10545    int n_l;
10546
10547    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10548        mem_base = xmlMemBlocks();
10549        l = gen_xmlListPtr(n_l, 0);
10550
10551        xmlListClear(l);
10552        call_tests++;
10553        des_xmlListPtr(n_l, l, 0);
10554        xmlResetLastError();
10555        if (mem_base != xmlMemBlocks()) {
10556            printf("Leak of %d blocks found in xmlListClear",
10557	           xmlMemBlocks() - mem_base);
10558	    test_ret++;
10559            printf(" %d", n_l);
10560            printf("\n");
10561        }
10562    }
10563    function_tests++;
10564
10565    return(test_ret);
10566}
10567
10568
10569#define gen_nb_const_xmlListPtr 1
10570static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10571    return(NULL);
10572}
10573static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10574}
10575
10576static int
10577test_xmlListCopy(void) {
10578    int test_ret = 0;
10579
10580    int mem_base;
10581    int ret_val;
10582    xmlListPtr cur; /* the new list */
10583    int n_cur;
10584    xmlListPtr old; /* the old list */
10585    int n_old;
10586
10587    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10588    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10589        mem_base = xmlMemBlocks();
10590        cur = gen_xmlListPtr(n_cur, 0);
10591        old = gen_const_xmlListPtr(n_old, 1);
10592
10593        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10594        desret_int(ret_val);
10595        call_tests++;
10596        des_xmlListPtr(n_cur, cur, 0);
10597        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10598        xmlResetLastError();
10599        if (mem_base != xmlMemBlocks()) {
10600            printf("Leak of %d blocks found in xmlListCopy",
10601	           xmlMemBlocks() - mem_base);
10602	    test_ret++;
10603            printf(" %d", n_cur);
10604            printf(" %d", n_old);
10605            printf("\n");
10606        }
10607    }
10608    }
10609    function_tests++;
10610
10611    return(test_ret);
10612}
10613
10614
10615static int
10616test_xmlListCreate(void) {
10617    int test_ret = 0;
10618
10619
10620    /* missing type support */
10621    return(test_ret);
10622}
10623
10624
10625static int
10626test_xmlListDup(void) {
10627    int test_ret = 0;
10628
10629
10630    /* missing type support */
10631    return(test_ret);
10632}
10633
10634
10635static int
10636test_xmlListEmpty(void) {
10637    int test_ret = 0;
10638
10639    int mem_base;
10640    int ret_val;
10641    xmlListPtr l; /* a list */
10642    int n_l;
10643
10644    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10645        mem_base = xmlMemBlocks();
10646        l = gen_xmlListPtr(n_l, 0);
10647
10648        ret_val = xmlListEmpty(l);
10649        desret_int(ret_val);
10650        call_tests++;
10651        des_xmlListPtr(n_l, l, 0);
10652        xmlResetLastError();
10653        if (mem_base != xmlMemBlocks()) {
10654            printf("Leak of %d blocks found in xmlListEmpty",
10655	           xmlMemBlocks() - mem_base);
10656	    test_ret++;
10657            printf(" %d", n_l);
10658            printf("\n");
10659        }
10660    }
10661    function_tests++;
10662
10663    return(test_ret);
10664}
10665
10666
10667static int
10668test_xmlListEnd(void) {
10669    int test_ret = 0;
10670
10671
10672    /* missing type support */
10673    return(test_ret);
10674}
10675
10676
10677static int
10678test_xmlListFront(void) {
10679    int test_ret = 0;
10680
10681
10682    /* missing type support */
10683    return(test_ret);
10684}
10685
10686
10687static int
10688test_xmlListInsert(void) {
10689    int test_ret = 0;
10690
10691    int mem_base;
10692    int ret_val;
10693    xmlListPtr l; /* a list */
10694    int n_l;
10695    void * data; /* the data */
10696    int n_data;
10697
10698    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10699    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10700        mem_base = xmlMemBlocks();
10701        l = gen_xmlListPtr(n_l, 0);
10702        data = gen_userdata(n_data, 1);
10703
10704        ret_val = xmlListInsert(l, data);
10705        desret_int(ret_val);
10706        call_tests++;
10707        des_xmlListPtr(n_l, l, 0);
10708        des_userdata(n_data, data, 1);
10709        xmlResetLastError();
10710        if (mem_base != xmlMemBlocks()) {
10711            printf("Leak of %d blocks found in xmlListInsert",
10712	           xmlMemBlocks() - mem_base);
10713	    test_ret++;
10714            printf(" %d", n_l);
10715            printf(" %d", n_data);
10716            printf("\n");
10717        }
10718    }
10719    }
10720    function_tests++;
10721
10722    return(test_ret);
10723}
10724
10725
10726static int
10727test_xmlListMerge(void) {
10728    int test_ret = 0;
10729
10730    int mem_base;
10731    xmlListPtr l1; /* the original list */
10732    int n_l1;
10733    xmlListPtr l2; /* the new list */
10734    int n_l2;
10735
10736    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10737    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10738        mem_base = xmlMemBlocks();
10739        l1 = gen_xmlListPtr(n_l1, 0);
10740        l2 = gen_xmlListPtr(n_l2, 1);
10741
10742        xmlListMerge(l1, l2);
10743        call_tests++;
10744        des_xmlListPtr(n_l1, l1, 0);
10745        des_xmlListPtr(n_l2, l2, 1);
10746        xmlResetLastError();
10747        if (mem_base != xmlMemBlocks()) {
10748            printf("Leak of %d blocks found in xmlListMerge",
10749	           xmlMemBlocks() - mem_base);
10750	    test_ret++;
10751            printf(" %d", n_l1);
10752            printf(" %d", n_l2);
10753            printf("\n");
10754        }
10755    }
10756    }
10757    function_tests++;
10758
10759    return(test_ret);
10760}
10761
10762
10763static int
10764test_xmlListPopBack(void) {
10765    int test_ret = 0;
10766
10767    int mem_base;
10768    xmlListPtr l; /* a list */
10769    int n_l;
10770
10771    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10772        mem_base = xmlMemBlocks();
10773        l = gen_xmlListPtr(n_l, 0);
10774
10775        xmlListPopBack(l);
10776        call_tests++;
10777        des_xmlListPtr(n_l, l, 0);
10778        xmlResetLastError();
10779        if (mem_base != xmlMemBlocks()) {
10780            printf("Leak of %d blocks found in xmlListPopBack",
10781	           xmlMemBlocks() - mem_base);
10782	    test_ret++;
10783            printf(" %d", n_l);
10784            printf("\n");
10785        }
10786    }
10787    function_tests++;
10788
10789    return(test_ret);
10790}
10791
10792
10793static int
10794test_xmlListPopFront(void) {
10795    int test_ret = 0;
10796
10797    int mem_base;
10798    xmlListPtr l; /* a list */
10799    int n_l;
10800
10801    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10802        mem_base = xmlMemBlocks();
10803        l = gen_xmlListPtr(n_l, 0);
10804
10805        xmlListPopFront(l);
10806        call_tests++;
10807        des_xmlListPtr(n_l, l, 0);
10808        xmlResetLastError();
10809        if (mem_base != xmlMemBlocks()) {
10810            printf("Leak of %d blocks found in xmlListPopFront",
10811	           xmlMemBlocks() - mem_base);
10812	    test_ret++;
10813            printf(" %d", n_l);
10814            printf("\n");
10815        }
10816    }
10817    function_tests++;
10818
10819    return(test_ret);
10820}
10821
10822
10823static int
10824test_xmlListPushBack(void) {
10825    int test_ret = 0;
10826
10827    int mem_base;
10828    int ret_val;
10829    xmlListPtr l; /* a list */
10830    int n_l;
10831    void * data; /* new data */
10832    int n_data;
10833
10834    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10835    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10836        mem_base = xmlMemBlocks();
10837        l = gen_xmlListPtr(n_l, 0);
10838        data = gen_userdata(n_data, 1);
10839
10840        ret_val = xmlListPushBack(l, data);
10841        desret_int(ret_val);
10842        call_tests++;
10843        des_xmlListPtr(n_l, l, 0);
10844        des_userdata(n_data, data, 1);
10845        xmlResetLastError();
10846        if (mem_base != xmlMemBlocks()) {
10847            printf("Leak of %d blocks found in xmlListPushBack",
10848	           xmlMemBlocks() - mem_base);
10849	    test_ret++;
10850            printf(" %d", n_l);
10851            printf(" %d", n_data);
10852            printf("\n");
10853        }
10854    }
10855    }
10856    function_tests++;
10857
10858    return(test_ret);
10859}
10860
10861
10862static int
10863test_xmlListPushFront(void) {
10864    int test_ret = 0;
10865
10866    int mem_base;
10867    int ret_val;
10868    xmlListPtr l; /* a list */
10869    int n_l;
10870    void * data; /* new data */
10871    int n_data;
10872
10873    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10874    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10875        mem_base = xmlMemBlocks();
10876        l = gen_xmlListPtr(n_l, 0);
10877        data = gen_userdata(n_data, 1);
10878
10879        ret_val = xmlListPushFront(l, data);
10880        desret_int(ret_val);
10881        call_tests++;
10882        des_xmlListPtr(n_l, l, 0);
10883        des_userdata(n_data, data, 1);
10884        xmlResetLastError();
10885        if (mem_base != xmlMemBlocks()) {
10886            printf("Leak of %d blocks found in xmlListPushFront",
10887	           xmlMemBlocks() - mem_base);
10888	    test_ret++;
10889            printf(" %d", n_l);
10890            printf(" %d", n_data);
10891            printf("\n");
10892        }
10893    }
10894    }
10895    function_tests++;
10896
10897    return(test_ret);
10898}
10899
10900
10901static int
10902test_xmlListRemoveAll(void) {
10903    int test_ret = 0;
10904
10905    int mem_base;
10906    int ret_val;
10907    xmlListPtr l; /* a list */
10908    int n_l;
10909    void * data; /* list data */
10910    int n_data;
10911
10912    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10913    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10914        mem_base = xmlMemBlocks();
10915        l = gen_xmlListPtr(n_l, 0);
10916        data = gen_userdata(n_data, 1);
10917
10918        ret_val = xmlListRemoveAll(l, data);
10919        desret_int(ret_val);
10920        call_tests++;
10921        des_xmlListPtr(n_l, l, 0);
10922        des_userdata(n_data, data, 1);
10923        xmlResetLastError();
10924        if (mem_base != xmlMemBlocks()) {
10925            printf("Leak of %d blocks found in xmlListRemoveAll",
10926	           xmlMemBlocks() - mem_base);
10927	    test_ret++;
10928            printf(" %d", n_l);
10929            printf(" %d", n_data);
10930            printf("\n");
10931        }
10932    }
10933    }
10934    function_tests++;
10935
10936    return(test_ret);
10937}
10938
10939
10940static int
10941test_xmlListRemoveFirst(void) {
10942    int test_ret = 0;
10943
10944    int mem_base;
10945    int ret_val;
10946    xmlListPtr l; /* a list */
10947    int n_l;
10948    void * data; /* list data */
10949    int n_data;
10950
10951    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10952    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10953        mem_base = xmlMemBlocks();
10954        l = gen_xmlListPtr(n_l, 0);
10955        data = gen_userdata(n_data, 1);
10956
10957        ret_val = xmlListRemoveFirst(l, data);
10958        desret_int(ret_val);
10959        call_tests++;
10960        des_xmlListPtr(n_l, l, 0);
10961        des_userdata(n_data, data, 1);
10962        xmlResetLastError();
10963        if (mem_base != xmlMemBlocks()) {
10964            printf("Leak of %d blocks found in xmlListRemoveFirst",
10965	           xmlMemBlocks() - mem_base);
10966	    test_ret++;
10967            printf(" %d", n_l);
10968            printf(" %d", n_data);
10969            printf("\n");
10970        }
10971    }
10972    }
10973    function_tests++;
10974
10975    return(test_ret);
10976}
10977
10978
10979static int
10980test_xmlListRemoveLast(void) {
10981    int test_ret = 0;
10982
10983    int mem_base;
10984    int ret_val;
10985    xmlListPtr l; /* a list */
10986    int n_l;
10987    void * data; /* list data */
10988    int n_data;
10989
10990    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10991    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10992        mem_base = xmlMemBlocks();
10993        l = gen_xmlListPtr(n_l, 0);
10994        data = gen_userdata(n_data, 1);
10995
10996        ret_val = xmlListRemoveLast(l, data);
10997        desret_int(ret_val);
10998        call_tests++;
10999        des_xmlListPtr(n_l, l, 0);
11000        des_userdata(n_data, data, 1);
11001        xmlResetLastError();
11002        if (mem_base != xmlMemBlocks()) {
11003            printf("Leak of %d blocks found in xmlListRemoveLast",
11004	           xmlMemBlocks() - mem_base);
11005	    test_ret++;
11006            printf(" %d", n_l);
11007            printf(" %d", n_data);
11008            printf("\n");
11009        }
11010    }
11011    }
11012    function_tests++;
11013
11014    return(test_ret);
11015}
11016
11017
11018static int
11019test_xmlListReverse(void) {
11020    int test_ret = 0;
11021
11022    int mem_base;
11023    xmlListPtr l; /* a list */
11024    int n_l;
11025
11026    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11027        mem_base = xmlMemBlocks();
11028        l = gen_xmlListPtr(n_l, 0);
11029
11030        xmlListReverse(l);
11031        call_tests++;
11032        des_xmlListPtr(n_l, l, 0);
11033        xmlResetLastError();
11034        if (mem_base != xmlMemBlocks()) {
11035            printf("Leak of %d blocks found in xmlListReverse",
11036	           xmlMemBlocks() - mem_base);
11037	    test_ret++;
11038            printf(" %d", n_l);
11039            printf("\n");
11040        }
11041    }
11042    function_tests++;
11043
11044    return(test_ret);
11045}
11046
11047
11048static int
11049test_xmlListReverseSearch(void) {
11050    int test_ret = 0;
11051
11052    int mem_base;
11053    void * ret_val;
11054    xmlListPtr l; /* a list */
11055    int n_l;
11056    void * data; /* a search value */
11057    int n_data;
11058
11059    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11060    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11061        mem_base = xmlMemBlocks();
11062        l = gen_xmlListPtr(n_l, 0);
11063        data = gen_userdata(n_data, 1);
11064
11065        ret_val = xmlListReverseSearch(l, data);
11066        desret_void_ptr(ret_val);
11067        call_tests++;
11068        des_xmlListPtr(n_l, l, 0);
11069        des_userdata(n_data, data, 1);
11070        xmlResetLastError();
11071        if (mem_base != xmlMemBlocks()) {
11072            printf("Leak of %d blocks found in xmlListReverseSearch",
11073	           xmlMemBlocks() - mem_base);
11074	    test_ret++;
11075            printf(" %d", n_l);
11076            printf(" %d", n_data);
11077            printf("\n");
11078        }
11079    }
11080    }
11081    function_tests++;
11082
11083    return(test_ret);
11084}
11085
11086
11087static int
11088test_xmlListReverseWalk(void) {
11089    int test_ret = 0;
11090
11091
11092    /* missing type support */
11093    return(test_ret);
11094}
11095
11096
11097static int
11098test_xmlListSearch(void) {
11099    int test_ret = 0;
11100
11101    int mem_base;
11102    void * ret_val;
11103    xmlListPtr l; /* a list */
11104    int n_l;
11105    void * data; /* a search value */
11106    int n_data;
11107
11108    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11109    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11110        mem_base = xmlMemBlocks();
11111        l = gen_xmlListPtr(n_l, 0);
11112        data = gen_userdata(n_data, 1);
11113
11114        ret_val = xmlListSearch(l, data);
11115        desret_void_ptr(ret_val);
11116        call_tests++;
11117        des_xmlListPtr(n_l, l, 0);
11118        des_userdata(n_data, data, 1);
11119        xmlResetLastError();
11120        if (mem_base != xmlMemBlocks()) {
11121            printf("Leak of %d blocks found in xmlListSearch",
11122	           xmlMemBlocks() - mem_base);
11123	    test_ret++;
11124            printf(" %d", n_l);
11125            printf(" %d", n_data);
11126            printf("\n");
11127        }
11128    }
11129    }
11130    function_tests++;
11131
11132    return(test_ret);
11133}
11134
11135
11136static int
11137test_xmlListSize(void) {
11138    int test_ret = 0;
11139
11140    int mem_base;
11141    int ret_val;
11142    xmlListPtr l; /* a list */
11143    int n_l;
11144
11145    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11146        mem_base = xmlMemBlocks();
11147        l = gen_xmlListPtr(n_l, 0);
11148
11149        ret_val = xmlListSize(l);
11150        desret_int(ret_val);
11151        call_tests++;
11152        des_xmlListPtr(n_l, l, 0);
11153        xmlResetLastError();
11154        if (mem_base != xmlMemBlocks()) {
11155            printf("Leak of %d blocks found in xmlListSize",
11156	           xmlMemBlocks() - mem_base);
11157	    test_ret++;
11158            printf(" %d", n_l);
11159            printf("\n");
11160        }
11161    }
11162    function_tests++;
11163
11164    return(test_ret);
11165}
11166
11167
11168static int
11169test_xmlListSort(void) {
11170    int test_ret = 0;
11171
11172    int mem_base;
11173    xmlListPtr l; /* a list */
11174    int n_l;
11175
11176    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11177        mem_base = xmlMemBlocks();
11178        l = gen_xmlListPtr(n_l, 0);
11179
11180        xmlListSort(l);
11181        call_tests++;
11182        des_xmlListPtr(n_l, l, 0);
11183        xmlResetLastError();
11184        if (mem_base != xmlMemBlocks()) {
11185            printf("Leak of %d blocks found in xmlListSort",
11186	           xmlMemBlocks() - mem_base);
11187	    test_ret++;
11188            printf(" %d", n_l);
11189            printf("\n");
11190        }
11191    }
11192    function_tests++;
11193
11194    return(test_ret);
11195}
11196
11197
11198static int
11199test_xmlListWalk(void) {
11200    int test_ret = 0;
11201
11202
11203    /* missing type support */
11204    return(test_ret);
11205}
11206
11207static int
11208test_list(void) {
11209    int test_ret = 0;
11210
11211    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11212    test_ret += test_xmlLinkGetData();
11213    test_ret += test_xmlListAppend();
11214    test_ret += test_xmlListClear();
11215    test_ret += test_xmlListCopy();
11216    test_ret += test_xmlListCreate();
11217    test_ret += test_xmlListDup();
11218    test_ret += test_xmlListEmpty();
11219    test_ret += test_xmlListEnd();
11220    test_ret += test_xmlListFront();
11221    test_ret += test_xmlListInsert();
11222    test_ret += test_xmlListMerge();
11223    test_ret += test_xmlListPopBack();
11224    test_ret += test_xmlListPopFront();
11225    test_ret += test_xmlListPushBack();
11226    test_ret += test_xmlListPushFront();
11227    test_ret += test_xmlListRemoveAll();
11228    test_ret += test_xmlListRemoveFirst();
11229    test_ret += test_xmlListRemoveLast();
11230    test_ret += test_xmlListReverse();
11231    test_ret += test_xmlListReverseSearch();
11232    test_ret += test_xmlListReverseWalk();
11233    test_ret += test_xmlListSearch();
11234    test_ret += test_xmlListSize();
11235    test_ret += test_xmlListSort();
11236    test_ret += test_xmlListWalk();
11237
11238    if (test_ret != 0)
11239	printf("Module list: %d errors\n", test_ret);
11240    return(test_ret);
11241}
11242
11243static int
11244test_xmlNanoFTPCheckResponse(void) {
11245    int test_ret = 0;
11246
11247#if defined(LIBXML_FTP_ENABLED)
11248    int mem_base;
11249    int ret_val;
11250    void * ctx; /* an FTP context */
11251    int n_ctx;
11252
11253    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11254        mem_base = xmlMemBlocks();
11255        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11256
11257        ret_val = xmlNanoFTPCheckResponse(ctx);
11258        desret_int(ret_val);
11259        call_tests++;
11260        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11261        xmlResetLastError();
11262        if (mem_base != xmlMemBlocks()) {
11263            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11264	           xmlMemBlocks() - mem_base);
11265	    test_ret++;
11266            printf(" %d", n_ctx);
11267            printf("\n");
11268        }
11269    }
11270    function_tests++;
11271#endif
11272
11273    return(test_ret);
11274}
11275
11276
11277static int
11278test_xmlNanoFTPCleanup(void) {
11279    int test_ret = 0;
11280
11281#if defined(LIBXML_FTP_ENABLED)
11282    int mem_base;
11283
11284        mem_base = xmlMemBlocks();
11285
11286        xmlNanoFTPCleanup();
11287        call_tests++;
11288        xmlResetLastError();
11289        if (mem_base != xmlMemBlocks()) {
11290            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11291	           xmlMemBlocks() - mem_base);
11292	    test_ret++;
11293            printf("\n");
11294        }
11295    function_tests++;
11296#endif
11297
11298    return(test_ret);
11299}
11300
11301
11302static int
11303test_xmlNanoFTPCloseConnection(void) {
11304    int test_ret = 0;
11305
11306#if defined(LIBXML_FTP_ENABLED)
11307    int mem_base;
11308    int ret_val;
11309    void * ctx; /* an FTP context */
11310    int n_ctx;
11311
11312    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11313        mem_base = xmlMemBlocks();
11314        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11315
11316        ret_val = xmlNanoFTPCloseConnection(ctx);
11317        desret_int(ret_val);
11318        call_tests++;
11319        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11320        xmlResetLastError();
11321        if (mem_base != xmlMemBlocks()) {
11322            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11323	           xmlMemBlocks() - mem_base);
11324	    test_ret++;
11325            printf(" %d", n_ctx);
11326            printf("\n");
11327        }
11328    }
11329    function_tests++;
11330#endif
11331
11332    return(test_ret);
11333}
11334
11335
11336static int
11337test_xmlNanoFTPCwd(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    char * directory; /* a directory on the server */
11346    int n_directory;
11347
11348    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11349    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11350        mem_base = xmlMemBlocks();
11351        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11352        directory = gen_const_char_ptr(n_directory, 1);
11353
11354        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11355        desret_int(ret_val);
11356        call_tests++;
11357        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11358        des_const_char_ptr(n_directory, (const char *)directory, 1);
11359        xmlResetLastError();
11360        if (mem_base != xmlMemBlocks()) {
11361            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11362	           xmlMemBlocks() - mem_base);
11363	    test_ret++;
11364            printf(" %d", n_ctx);
11365            printf(" %d", n_directory);
11366            printf("\n");
11367        }
11368    }
11369    }
11370    function_tests++;
11371#endif
11372
11373    return(test_ret);
11374}
11375
11376
11377static int
11378test_xmlNanoFTPDele(void) {
11379    int test_ret = 0;
11380
11381#if defined(LIBXML_FTP_ENABLED)
11382    int mem_base;
11383    int ret_val;
11384    void * ctx; /* an FTP context */
11385    int n_ctx;
11386    const char * file; /* a file or directory on the server */
11387    int n_file;
11388
11389    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11390    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11391        mem_base = xmlMemBlocks();
11392        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11393        file = gen_filepath(n_file, 1);
11394
11395        ret_val = xmlNanoFTPDele(ctx, file);
11396        desret_int(ret_val);
11397        call_tests++;
11398        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11399        des_filepath(n_file, file, 1);
11400        xmlResetLastError();
11401        if (mem_base != xmlMemBlocks()) {
11402            printf("Leak of %d blocks found in xmlNanoFTPDele",
11403	           xmlMemBlocks() - mem_base);
11404	    test_ret++;
11405            printf(" %d", n_ctx);
11406            printf(" %d", n_file);
11407            printf("\n");
11408        }
11409    }
11410    }
11411    function_tests++;
11412#endif
11413
11414    return(test_ret);
11415}
11416
11417
11418static int
11419test_xmlNanoFTPGet(void) {
11420    int test_ret = 0;
11421
11422
11423    /* missing type support */
11424    return(test_ret);
11425}
11426
11427
11428static int
11429test_xmlNanoFTPGetConnection(void) {
11430    int test_ret = 0;
11431
11432#if defined(LIBXML_FTP_ENABLED)
11433    int mem_base;
11434    int ret_val;
11435    void * ctx; /* an FTP context */
11436    int n_ctx;
11437
11438    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11439        mem_base = xmlMemBlocks();
11440        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11441
11442        ret_val = xmlNanoFTPGetConnection(ctx);
11443        desret_int(ret_val);
11444        call_tests++;
11445        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11446        xmlResetLastError();
11447        if (mem_base != xmlMemBlocks()) {
11448            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11449	           xmlMemBlocks() - mem_base);
11450	    test_ret++;
11451            printf(" %d", n_ctx);
11452            printf("\n");
11453        }
11454    }
11455    function_tests++;
11456#endif
11457
11458    return(test_ret);
11459}
11460
11461
11462static int
11463test_xmlNanoFTPGetResponse(void) {
11464    int test_ret = 0;
11465
11466#if defined(LIBXML_FTP_ENABLED)
11467    int mem_base;
11468    int ret_val;
11469    void * ctx; /* an FTP context */
11470    int n_ctx;
11471
11472    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11473        mem_base = xmlMemBlocks();
11474        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11475
11476        ret_val = xmlNanoFTPGetResponse(ctx);
11477        desret_int(ret_val);
11478        call_tests++;
11479        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11480        xmlResetLastError();
11481        if (mem_base != xmlMemBlocks()) {
11482            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11483	           xmlMemBlocks() - mem_base);
11484	    test_ret++;
11485            printf(" %d", n_ctx);
11486            printf("\n");
11487        }
11488    }
11489    function_tests++;
11490#endif
11491
11492    return(test_ret);
11493}
11494
11495
11496static int
11497test_xmlNanoFTPGetSocket(void) {
11498    int test_ret = 0;
11499
11500#if defined(LIBXML_FTP_ENABLED)
11501    int mem_base;
11502    int ret_val;
11503    void * ctx; /* an FTP context */
11504    int n_ctx;
11505    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11506    int n_filename;
11507
11508    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11509    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11510        mem_base = xmlMemBlocks();
11511        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11512        filename = gen_filepath(n_filename, 1);
11513
11514        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11515        desret_int(ret_val);
11516        call_tests++;
11517        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11518        des_filepath(n_filename, filename, 1);
11519        xmlResetLastError();
11520        if (mem_base != xmlMemBlocks()) {
11521            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11522	           xmlMemBlocks() - mem_base);
11523	    test_ret++;
11524            printf(" %d", n_ctx);
11525            printf(" %d", n_filename);
11526            printf("\n");
11527        }
11528    }
11529    }
11530    function_tests++;
11531#endif
11532
11533    return(test_ret);
11534}
11535
11536
11537static int
11538test_xmlNanoFTPInit(void) {
11539    int test_ret = 0;
11540
11541#if defined(LIBXML_FTP_ENABLED)
11542    int mem_base;
11543
11544        mem_base = xmlMemBlocks();
11545
11546        xmlNanoFTPInit();
11547        call_tests++;
11548        xmlResetLastError();
11549        if (mem_base != xmlMemBlocks()) {
11550            printf("Leak of %d blocks found in xmlNanoFTPInit",
11551	           xmlMemBlocks() - mem_base);
11552	    test_ret++;
11553            printf("\n");
11554        }
11555    function_tests++;
11556#endif
11557
11558    return(test_ret);
11559}
11560
11561
11562static int
11563test_xmlNanoFTPList(void) {
11564    int test_ret = 0;
11565
11566
11567    /* missing type support */
11568    return(test_ret);
11569}
11570
11571
11572static int
11573test_xmlNanoFTPNewCtxt(void) {
11574    int test_ret = 0;
11575
11576#if defined(LIBXML_FTP_ENABLED)
11577    int mem_base;
11578    void * ret_val;
11579    const char * URL; /* The URL used to initialize the context */
11580    int n_URL;
11581
11582    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11583        mem_base = xmlMemBlocks();
11584        URL = gen_filepath(n_URL, 0);
11585
11586        ret_val = xmlNanoFTPNewCtxt(URL);
11587        desret_xmlNanoFTPCtxtPtr(ret_val);
11588        call_tests++;
11589        des_filepath(n_URL, URL, 0);
11590        xmlResetLastError();
11591        if (mem_base != xmlMemBlocks()) {
11592            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11593	           xmlMemBlocks() - mem_base);
11594	    test_ret++;
11595            printf(" %d", n_URL);
11596            printf("\n");
11597        }
11598    }
11599    function_tests++;
11600#endif
11601
11602    return(test_ret);
11603}
11604
11605
11606static int
11607test_xmlNanoFTPOpen(void) {
11608    int test_ret = 0;
11609
11610#if defined(LIBXML_FTP_ENABLED)
11611    int mem_base;
11612    void * ret_val;
11613    const char * URL; /* the URL to the resource */
11614    int n_URL;
11615
11616    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11617        mem_base = xmlMemBlocks();
11618        URL = gen_filepath(n_URL, 0);
11619
11620        ret_val = xmlNanoFTPOpen(URL);
11621        desret_xmlNanoFTPCtxtPtr(ret_val);
11622        call_tests++;
11623        des_filepath(n_URL, URL, 0);
11624        xmlResetLastError();
11625        if (mem_base != xmlMemBlocks()) {
11626            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11627	           xmlMemBlocks() - mem_base);
11628	    test_ret++;
11629            printf(" %d", n_URL);
11630            printf("\n");
11631        }
11632    }
11633    function_tests++;
11634#endif
11635
11636    return(test_ret);
11637}
11638
11639
11640static int
11641test_xmlNanoFTPProxy(void) {
11642    int test_ret = 0;
11643
11644#if defined(LIBXML_FTP_ENABLED)
11645    char * host; /* the proxy host name */
11646    int n_host;
11647    int port; /* the proxy port */
11648    int n_port;
11649    char * user; /* the proxy user name */
11650    int n_user;
11651    char * passwd; /* the proxy password */
11652    int n_passwd;
11653    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11654    int n_type;
11655
11656    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11657    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11658    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11659    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11660    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11661        host = gen_const_char_ptr(n_host, 0);
11662        port = gen_int(n_port, 1);
11663        user = gen_const_char_ptr(n_user, 2);
11664        passwd = gen_const_char_ptr(n_passwd, 3);
11665        type = gen_int(n_type, 4);
11666
11667        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11668        call_tests++;
11669        des_const_char_ptr(n_host, (const char *)host, 0);
11670        des_int(n_port, port, 1);
11671        des_const_char_ptr(n_user, (const char *)user, 2);
11672        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11673        des_int(n_type, type, 4);
11674        xmlResetLastError();
11675    }
11676    }
11677    }
11678    }
11679    }
11680    function_tests++;
11681#endif
11682
11683    return(test_ret);
11684}
11685
11686
11687static int
11688test_xmlNanoFTPQuit(void) {
11689    int test_ret = 0;
11690
11691#if defined(LIBXML_FTP_ENABLED)
11692    int mem_base;
11693    int ret_val;
11694    void * ctx; /* an FTP context */
11695    int n_ctx;
11696
11697    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11698        mem_base = xmlMemBlocks();
11699        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11700
11701        ret_val = xmlNanoFTPQuit(ctx);
11702        desret_int(ret_val);
11703        call_tests++;
11704        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11705        xmlResetLastError();
11706        if (mem_base != xmlMemBlocks()) {
11707            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11708	           xmlMemBlocks() - mem_base);
11709	    test_ret++;
11710            printf(" %d", n_ctx);
11711            printf("\n");
11712        }
11713    }
11714    function_tests++;
11715#endif
11716
11717    return(test_ret);
11718}
11719
11720
11721static int
11722test_xmlNanoFTPRead(void) {
11723    int test_ret = 0;
11724
11725#if defined(LIBXML_FTP_ENABLED)
11726    int mem_base;
11727    int ret_val;
11728    void * ctx; /* the FTP context */
11729    int n_ctx;
11730    void * dest; /* a buffer */
11731    int n_dest;
11732    int len; /* the buffer length */
11733    int n_len;
11734
11735    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11736    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11737    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11738        mem_base = xmlMemBlocks();
11739        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11740        dest = gen_void_ptr(n_dest, 1);
11741        len = gen_int(n_len, 2);
11742
11743        ret_val = xmlNanoFTPRead(ctx, dest, len);
11744        desret_int(ret_val);
11745        call_tests++;
11746        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11747        des_void_ptr(n_dest, dest, 1);
11748        des_int(n_len, len, 2);
11749        xmlResetLastError();
11750        if (mem_base != xmlMemBlocks()) {
11751            printf("Leak of %d blocks found in xmlNanoFTPRead",
11752	           xmlMemBlocks() - mem_base);
11753	    test_ret++;
11754            printf(" %d", n_ctx);
11755            printf(" %d", n_dest);
11756            printf(" %d", n_len);
11757            printf("\n");
11758        }
11759    }
11760    }
11761    }
11762    function_tests++;
11763#endif
11764
11765    return(test_ret);
11766}
11767
11768
11769static int
11770test_xmlNanoFTPScanProxy(void) {
11771    int test_ret = 0;
11772
11773#if defined(LIBXML_FTP_ENABLED)
11774    const char * URL; /* The proxy URL used to initialize the proxy context */
11775    int n_URL;
11776
11777    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11778        URL = gen_filepath(n_URL, 0);
11779
11780        xmlNanoFTPScanProxy(URL);
11781        call_tests++;
11782        des_filepath(n_URL, URL, 0);
11783        xmlResetLastError();
11784    }
11785    function_tests++;
11786#endif
11787
11788    return(test_ret);
11789}
11790
11791
11792static int
11793test_xmlNanoFTPUpdateURL(void) {
11794    int test_ret = 0;
11795
11796#if defined(LIBXML_FTP_ENABLED)
11797    int mem_base;
11798    int ret_val;
11799    void * ctx; /* an FTP context */
11800    int n_ctx;
11801    const char * URL; /* The URL used to update the context */
11802    int n_URL;
11803
11804    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11805    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11806        mem_base = xmlMemBlocks();
11807        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11808        URL = gen_filepath(n_URL, 1);
11809
11810        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11811        desret_int(ret_val);
11812        call_tests++;
11813        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11814        des_filepath(n_URL, URL, 1);
11815        xmlResetLastError();
11816        if (mem_base != xmlMemBlocks()) {
11817            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11818	           xmlMemBlocks() - mem_base);
11819	    test_ret++;
11820            printf(" %d", n_ctx);
11821            printf(" %d", n_URL);
11822            printf("\n");
11823        }
11824    }
11825    }
11826    function_tests++;
11827#endif
11828
11829    return(test_ret);
11830}
11831
11832static int
11833test_nanoftp(void) {
11834    int test_ret = 0;
11835
11836    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
11837    test_ret += test_xmlNanoFTPCheckResponse();
11838    test_ret += test_xmlNanoFTPCleanup();
11839    test_ret += test_xmlNanoFTPCloseConnection();
11840    test_ret += test_xmlNanoFTPCwd();
11841    test_ret += test_xmlNanoFTPDele();
11842    test_ret += test_xmlNanoFTPGet();
11843    test_ret += test_xmlNanoFTPGetConnection();
11844    test_ret += test_xmlNanoFTPGetResponse();
11845    test_ret += test_xmlNanoFTPGetSocket();
11846    test_ret += test_xmlNanoFTPInit();
11847    test_ret += test_xmlNanoFTPList();
11848    test_ret += test_xmlNanoFTPNewCtxt();
11849    test_ret += test_xmlNanoFTPOpen();
11850    test_ret += test_xmlNanoFTPProxy();
11851    test_ret += test_xmlNanoFTPQuit();
11852    test_ret += test_xmlNanoFTPRead();
11853    test_ret += test_xmlNanoFTPScanProxy();
11854    test_ret += test_xmlNanoFTPUpdateURL();
11855
11856    if (test_ret != 0)
11857	printf("Module nanoftp: %d errors\n", test_ret);
11858    return(test_ret);
11859}
11860
11861static int
11862test_xmlNanoHTTPAuthHeader(void) {
11863    int test_ret = 0;
11864
11865#if defined(LIBXML_HTTP_ENABLED)
11866    int mem_base;
11867    const char * ret_val;
11868    void * ctx; /* the HTTP context */
11869    int n_ctx;
11870
11871    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11872        mem_base = xmlMemBlocks();
11873        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11874
11875        ret_val = xmlNanoHTTPAuthHeader(ctx);
11876        desret_const_char_ptr(ret_val);
11877        call_tests++;
11878        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11879        xmlResetLastError();
11880        if (mem_base != xmlMemBlocks()) {
11881            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11882	           xmlMemBlocks() - mem_base);
11883	    test_ret++;
11884            printf(" %d", n_ctx);
11885            printf("\n");
11886        }
11887    }
11888    function_tests++;
11889#endif
11890
11891    return(test_ret);
11892}
11893
11894
11895static int
11896test_xmlNanoHTTPCleanup(void) {
11897    int test_ret = 0;
11898
11899#if defined(LIBXML_HTTP_ENABLED)
11900    int mem_base;
11901
11902        mem_base = xmlMemBlocks();
11903
11904        xmlNanoHTTPCleanup();
11905        call_tests++;
11906        xmlResetLastError();
11907        if (mem_base != xmlMemBlocks()) {
11908            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
11909	           xmlMemBlocks() - mem_base);
11910	    test_ret++;
11911            printf("\n");
11912        }
11913    function_tests++;
11914#endif
11915
11916    return(test_ret);
11917}
11918
11919
11920static int
11921test_xmlNanoHTTPContentLength(void) {
11922    int test_ret = 0;
11923
11924#if defined(LIBXML_HTTP_ENABLED)
11925    int mem_base;
11926    int ret_val;
11927    void * ctx; /* the HTTP context */
11928    int n_ctx;
11929
11930    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11931        mem_base = xmlMemBlocks();
11932        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11933
11934        ret_val = xmlNanoHTTPContentLength(ctx);
11935        desret_int(ret_val);
11936        call_tests++;
11937        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11938        xmlResetLastError();
11939        if (mem_base != xmlMemBlocks()) {
11940            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
11941	           xmlMemBlocks() - mem_base);
11942	    test_ret++;
11943            printf(" %d", n_ctx);
11944            printf("\n");
11945        }
11946    }
11947    function_tests++;
11948#endif
11949
11950    return(test_ret);
11951}
11952
11953
11954static int
11955test_xmlNanoHTTPEncoding(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 = xmlNanoHTTPEncoding(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 xmlNanoHTTPEncoding",
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
11988#define gen_nb_char_ptr_ptr 1
11989static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11990    return(NULL);
11991}
11992static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11993}
11994
11995static int
11996test_xmlNanoHTTPFetch(void) {
11997    int test_ret = 0;
11998
11999#if defined(LIBXML_HTTP_ENABLED)
12000    int mem_base;
12001    int ret_val;
12002    const char * URL; /* The URL to load */
12003    int n_URL;
12004    const char * filename; /* the filename where the content should be saved */
12005    int n_filename;
12006    char ** contentType; /* if available the Content-Type information will be returned at that location */
12007    int n_contentType;
12008
12009    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12010    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12011    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12012        mem_base = xmlMemBlocks();
12013        URL = gen_fileoutput(n_URL, 0);
12014        filename = gen_fileoutput(n_filename, 1);
12015        contentType = gen_char_ptr_ptr(n_contentType, 2);
12016
12017        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12018        desret_int(ret_val);
12019        call_tests++;
12020        des_fileoutput(n_URL, URL, 0);
12021        des_fileoutput(n_filename, filename, 1);
12022        des_char_ptr_ptr(n_contentType, contentType, 2);
12023        xmlResetLastError();
12024        if (mem_base != xmlMemBlocks()) {
12025            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12026	           xmlMemBlocks() - mem_base);
12027	    test_ret++;
12028            printf(" %d", n_URL);
12029            printf(" %d", n_filename);
12030            printf(" %d", n_contentType);
12031            printf("\n");
12032        }
12033    }
12034    }
12035    }
12036    function_tests++;
12037#endif
12038
12039    return(test_ret);
12040}
12041
12042
12043static int
12044test_xmlNanoHTTPInit(void) {
12045    int test_ret = 0;
12046
12047#if defined(LIBXML_HTTP_ENABLED)
12048    int mem_base;
12049
12050        mem_base = xmlMemBlocks();
12051
12052        xmlNanoHTTPInit();
12053        call_tests++;
12054        xmlResetLastError();
12055        if (mem_base != xmlMemBlocks()) {
12056            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12057	           xmlMemBlocks() - mem_base);
12058	    test_ret++;
12059            printf("\n");
12060        }
12061    function_tests++;
12062#endif
12063
12064    return(test_ret);
12065}
12066
12067
12068static int
12069test_xmlNanoHTTPMimeType(void) {
12070    int test_ret = 0;
12071
12072#if defined(LIBXML_HTTP_ENABLED)
12073    int mem_base;
12074    const char * ret_val;
12075    void * ctx; /* the HTTP context */
12076    int n_ctx;
12077
12078    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12079        mem_base = xmlMemBlocks();
12080        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12081
12082        ret_val = xmlNanoHTTPMimeType(ctx);
12083        desret_const_char_ptr(ret_val);
12084        call_tests++;
12085        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12086        xmlResetLastError();
12087        if (mem_base != xmlMemBlocks()) {
12088            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12089	           xmlMemBlocks() - mem_base);
12090	    test_ret++;
12091            printf(" %d", n_ctx);
12092            printf("\n");
12093        }
12094    }
12095    function_tests++;
12096#endif
12097
12098    return(test_ret);
12099}
12100
12101
12102static int
12103test_xmlNanoHTTPOpen(void) {
12104    int test_ret = 0;
12105
12106#if defined(LIBXML_HTTP_ENABLED)
12107    int mem_base;
12108    void * ret_val;
12109    const char * URL; /* The URL to load */
12110    int n_URL;
12111    char ** contentType; /* if available the Content-Type information will be returned at that location */
12112    int n_contentType;
12113
12114    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12115    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12116        mem_base = xmlMemBlocks();
12117        URL = gen_filepath(n_URL, 0);
12118        contentType = gen_char_ptr_ptr(n_contentType, 1);
12119
12120        ret_val = xmlNanoHTTPOpen(URL, contentType);
12121        desret_xmlNanoHTTPCtxtPtr(ret_val);
12122        call_tests++;
12123        des_filepath(n_URL, URL, 0);
12124        des_char_ptr_ptr(n_contentType, contentType, 1);
12125        xmlResetLastError();
12126        if (mem_base != xmlMemBlocks()) {
12127            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12128	           xmlMemBlocks() - mem_base);
12129	    test_ret++;
12130            printf(" %d", n_URL);
12131            printf(" %d", n_contentType);
12132            printf("\n");
12133        }
12134    }
12135    }
12136    function_tests++;
12137#endif
12138
12139    return(test_ret);
12140}
12141
12142
12143static int
12144test_xmlNanoHTTPOpenRedir(void) {
12145    int test_ret = 0;
12146
12147#if defined(LIBXML_HTTP_ENABLED)
12148    int mem_base;
12149    void * ret_val;
12150    const char * URL; /* The URL to load */
12151    int n_URL;
12152    char ** contentType; /* if available the Content-Type information will be returned at that location */
12153    int n_contentType;
12154    char ** redir; /* if available the redirected URL will be returned */
12155    int n_redir;
12156
12157    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12158    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12159    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12160        mem_base = xmlMemBlocks();
12161        URL = gen_filepath(n_URL, 0);
12162        contentType = gen_char_ptr_ptr(n_contentType, 1);
12163        redir = gen_char_ptr_ptr(n_redir, 2);
12164
12165        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12166        desret_xmlNanoHTTPCtxtPtr(ret_val);
12167        call_tests++;
12168        des_filepath(n_URL, URL, 0);
12169        des_char_ptr_ptr(n_contentType, contentType, 1);
12170        des_char_ptr_ptr(n_redir, redir, 2);
12171        xmlResetLastError();
12172        if (mem_base != xmlMemBlocks()) {
12173            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12174	           xmlMemBlocks() - mem_base);
12175	    test_ret++;
12176            printf(" %d", n_URL);
12177            printf(" %d", n_contentType);
12178            printf(" %d", n_redir);
12179            printf("\n");
12180        }
12181    }
12182    }
12183    }
12184    function_tests++;
12185#endif
12186
12187    return(test_ret);
12188}
12189
12190
12191static int
12192test_xmlNanoHTTPRead(void) {
12193    int test_ret = 0;
12194
12195#if defined(LIBXML_HTTP_ENABLED)
12196    int mem_base;
12197    int ret_val;
12198    void * ctx; /* the HTTP context */
12199    int n_ctx;
12200    void * dest; /* a buffer */
12201    int n_dest;
12202    int len; /* the buffer length */
12203    int n_len;
12204
12205    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12206    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12207    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12208        mem_base = xmlMemBlocks();
12209        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12210        dest = gen_void_ptr(n_dest, 1);
12211        len = gen_int(n_len, 2);
12212
12213        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12214        desret_int(ret_val);
12215        call_tests++;
12216        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12217        des_void_ptr(n_dest, dest, 1);
12218        des_int(n_len, len, 2);
12219        xmlResetLastError();
12220        if (mem_base != xmlMemBlocks()) {
12221            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12222	           xmlMemBlocks() - mem_base);
12223	    test_ret++;
12224            printf(" %d", n_ctx);
12225            printf(" %d", n_dest);
12226            printf(" %d", n_len);
12227            printf("\n");
12228        }
12229    }
12230    }
12231    }
12232    function_tests++;
12233#endif
12234
12235    return(test_ret);
12236}
12237
12238
12239static int
12240test_xmlNanoHTTPRedir(void) {
12241    int test_ret = 0;
12242
12243
12244    /* missing type support */
12245    return(test_ret);
12246}
12247
12248
12249static int
12250test_xmlNanoHTTPReturnCode(void) {
12251    int test_ret = 0;
12252
12253#if defined(LIBXML_HTTP_ENABLED)
12254    int mem_base;
12255    int ret_val;
12256    void * ctx; /* the HTTP context */
12257    int n_ctx;
12258
12259    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12260        mem_base = xmlMemBlocks();
12261        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12262
12263        ret_val = xmlNanoHTTPReturnCode(ctx);
12264        desret_int(ret_val);
12265        call_tests++;
12266        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12267        xmlResetLastError();
12268        if (mem_base != xmlMemBlocks()) {
12269            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12270	           xmlMemBlocks() - mem_base);
12271	    test_ret++;
12272            printf(" %d", n_ctx);
12273            printf("\n");
12274        }
12275    }
12276    function_tests++;
12277#endif
12278
12279    return(test_ret);
12280}
12281
12282
12283static int
12284test_xmlNanoHTTPSave(void) {
12285    int test_ret = 0;
12286
12287#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12288    int mem_base;
12289    int ret_val;
12290    void * ctxt; /* the HTTP context */
12291    int n_ctxt;
12292    const char * filename; /* the filename where the content should be saved */
12293    int n_filename;
12294
12295    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12296    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12297        mem_base = xmlMemBlocks();
12298        ctxt = gen_void_ptr(n_ctxt, 0);
12299        filename = gen_fileoutput(n_filename, 1);
12300
12301        ret_val = xmlNanoHTTPSave(ctxt, filename);
12302        desret_int(ret_val);
12303        call_tests++;
12304        des_void_ptr(n_ctxt, ctxt, 0);
12305        des_fileoutput(n_filename, filename, 1);
12306        xmlResetLastError();
12307        if (mem_base != xmlMemBlocks()) {
12308            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12309	           xmlMemBlocks() - mem_base);
12310	    test_ret++;
12311            printf(" %d", n_ctxt);
12312            printf(" %d", n_filename);
12313            printf("\n");
12314        }
12315    }
12316    }
12317    function_tests++;
12318#endif
12319
12320    return(test_ret);
12321}
12322
12323
12324static int
12325test_xmlNanoHTTPScanProxy(void) {
12326    int test_ret = 0;
12327
12328#if defined(LIBXML_HTTP_ENABLED)
12329    const char * URL; /* The proxy URL used to initialize the proxy context */
12330    int n_URL;
12331
12332    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12333        URL = gen_filepath(n_URL, 0);
12334
12335        xmlNanoHTTPScanProxy(URL);
12336        call_tests++;
12337        des_filepath(n_URL, URL, 0);
12338        xmlResetLastError();
12339    }
12340    function_tests++;
12341#endif
12342
12343    return(test_ret);
12344}
12345
12346static int
12347test_nanohttp(void) {
12348    int test_ret = 0;
12349
12350    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12351    test_ret += test_xmlNanoHTTPAuthHeader();
12352    test_ret += test_xmlNanoHTTPCleanup();
12353    test_ret += test_xmlNanoHTTPContentLength();
12354    test_ret += test_xmlNanoHTTPEncoding();
12355    test_ret += test_xmlNanoHTTPFetch();
12356    test_ret += test_xmlNanoHTTPInit();
12357    test_ret += test_xmlNanoHTTPMimeType();
12358    test_ret += test_xmlNanoHTTPOpen();
12359    test_ret += test_xmlNanoHTTPOpenRedir();
12360    test_ret += test_xmlNanoHTTPRead();
12361    test_ret += test_xmlNanoHTTPRedir();
12362    test_ret += test_xmlNanoHTTPReturnCode();
12363    test_ret += test_xmlNanoHTTPSave();
12364    test_ret += test_xmlNanoHTTPScanProxy();
12365
12366    if (test_ret != 0)
12367	printf("Module nanohttp: %d errors\n", test_ret);
12368    return(test_ret);
12369}
12370
12371static int
12372test_xmlByteConsumed(void) {
12373    int test_ret = 0;
12374
12375    int mem_base;
12376    long ret_val;
12377    xmlParserCtxtPtr ctxt; /* an XML parser context */
12378    int n_ctxt;
12379
12380    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12381        mem_base = xmlMemBlocks();
12382        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12383
12384        ret_val = xmlByteConsumed(ctxt);
12385        desret_long(ret_val);
12386        call_tests++;
12387        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12388        xmlResetLastError();
12389        if (mem_base != xmlMemBlocks()) {
12390            printf("Leak of %d blocks found in xmlByteConsumed",
12391	           xmlMemBlocks() - mem_base);
12392	    test_ret++;
12393            printf(" %d", n_ctxt);
12394            printf("\n");
12395        }
12396    }
12397    function_tests++;
12398
12399    return(test_ret);
12400}
12401
12402
12403static int
12404test_xmlClearNodeInfoSeq(void) {
12405    int test_ret = 0;
12406
12407    int mem_base;
12408    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12409    int n_seq;
12410
12411    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12412        mem_base = xmlMemBlocks();
12413        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12414
12415        xmlClearNodeInfoSeq(seq);
12416        call_tests++;
12417        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12418        xmlResetLastError();
12419        if (mem_base != xmlMemBlocks()) {
12420            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12421	           xmlMemBlocks() - mem_base);
12422	    test_ret++;
12423            printf(" %d", n_seq);
12424            printf("\n");
12425        }
12426    }
12427    function_tests++;
12428
12429    return(test_ret);
12430}
12431
12432
12433static int
12434test_xmlClearParserCtxt(void) {
12435    int test_ret = 0;
12436
12437    int mem_base;
12438    xmlParserCtxtPtr ctxt; /* an XML parser context */
12439    int n_ctxt;
12440
12441    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12442        mem_base = xmlMemBlocks();
12443        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12444
12445        xmlClearParserCtxt(ctxt);
12446        call_tests++;
12447        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12448        xmlResetLastError();
12449        if (mem_base != xmlMemBlocks()) {
12450            printf("Leak of %d blocks found in xmlClearParserCtxt",
12451	           xmlMemBlocks() - mem_base);
12452	    test_ret++;
12453            printf(" %d", n_ctxt);
12454            printf("\n");
12455        }
12456    }
12457    function_tests++;
12458
12459    return(test_ret);
12460}
12461
12462
12463static int
12464test_xmlCreateDocParserCtxt(void) {
12465    int test_ret = 0;
12466
12467    int mem_base;
12468    xmlParserCtxtPtr ret_val;
12469    xmlChar * cur; /* a pointer to an array of xmlChar */
12470    int n_cur;
12471
12472    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12473        mem_base = xmlMemBlocks();
12474        cur = gen_const_xmlChar_ptr(n_cur, 0);
12475
12476        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12477        desret_xmlParserCtxtPtr(ret_val);
12478        call_tests++;
12479        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12480        xmlResetLastError();
12481        if (mem_base != xmlMemBlocks()) {
12482            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12483	           xmlMemBlocks() - mem_base);
12484	    test_ret++;
12485            printf(" %d", n_cur);
12486            printf("\n");
12487        }
12488    }
12489    function_tests++;
12490
12491    return(test_ret);
12492}
12493
12494
12495static int
12496test_xmlCreatePushParserCtxt(void) {
12497    int test_ret = 0;
12498
12499#if defined(LIBXML_PUSH_ENABLED)
12500    int mem_base;
12501    xmlParserCtxtPtr ret_val;
12502    xmlSAXHandlerPtr sax; /* a SAX handler */
12503    int n_sax;
12504    void * user_data; /* The user data returned on SAX callbacks */
12505    int n_user_data;
12506    char * chunk; /* a pointer to an array of chars */
12507    int n_chunk;
12508    int size; /* number of chars in the array */
12509    int n_size;
12510    const char * filename; /* an optional file name or URI */
12511    int n_filename;
12512
12513    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12514    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12515    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12516    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12517    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12518        mem_base = xmlMemBlocks();
12519        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12520        user_data = gen_userdata(n_user_data, 1);
12521        chunk = gen_const_char_ptr(n_chunk, 2);
12522        size = gen_int(n_size, 3);
12523        filename = gen_fileoutput(n_filename, 4);
12524
12525        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12526        desret_xmlParserCtxtPtr(ret_val);
12527        call_tests++;
12528        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12529        des_userdata(n_user_data, user_data, 1);
12530        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12531        des_int(n_size, size, 3);
12532        des_fileoutput(n_filename, filename, 4);
12533        xmlResetLastError();
12534        if (mem_base != xmlMemBlocks()) {
12535            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12536	           xmlMemBlocks() - mem_base);
12537	    test_ret++;
12538            printf(" %d", n_sax);
12539            printf(" %d", n_user_data);
12540            printf(" %d", n_chunk);
12541            printf(" %d", n_size);
12542            printf(" %d", n_filename);
12543            printf("\n");
12544        }
12545    }
12546    }
12547    }
12548    }
12549    }
12550    function_tests++;
12551#endif
12552
12553    return(test_ret);
12554}
12555
12556
12557static int
12558test_xmlCtxtReadDoc(void) {
12559    int test_ret = 0;
12560
12561    int mem_base;
12562    xmlDocPtr ret_val;
12563    xmlParserCtxtPtr ctxt; /* an XML parser context */
12564    int n_ctxt;
12565    xmlChar * cur; /* a pointer to a zero terminated string */
12566    int n_cur;
12567    const char * URL; /* the base URL to use for the document */
12568    int n_URL;
12569    char * encoding; /* the document encoding, or NULL */
12570    int n_encoding;
12571    int options; /* a combination of xmlParserOption */
12572    int n_options;
12573
12574    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12575    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12576    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12577    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12578    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12579        mem_base = xmlMemBlocks();
12580        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12581        cur = gen_const_xmlChar_ptr(n_cur, 1);
12582        URL = gen_filepath(n_URL, 2);
12583        encoding = gen_const_char_ptr(n_encoding, 3);
12584        options = gen_parseroptions(n_options, 4);
12585
12586        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12587        desret_xmlDocPtr(ret_val);
12588        call_tests++;
12589        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12590        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12591        des_filepath(n_URL, URL, 2);
12592        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12593        des_parseroptions(n_options, options, 4);
12594        xmlResetLastError();
12595        if (mem_base != xmlMemBlocks()) {
12596            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12597	           xmlMemBlocks() - mem_base);
12598	    test_ret++;
12599            printf(" %d", n_ctxt);
12600            printf(" %d", n_cur);
12601            printf(" %d", n_URL);
12602            printf(" %d", n_encoding);
12603            printf(" %d", n_options);
12604            printf("\n");
12605        }
12606    }
12607    }
12608    }
12609    }
12610    }
12611    function_tests++;
12612
12613    return(test_ret);
12614}
12615
12616
12617static int
12618test_xmlCtxtReadFile(void) {
12619    int test_ret = 0;
12620
12621    int mem_base;
12622    xmlDocPtr ret_val;
12623    xmlParserCtxtPtr ctxt; /* an XML parser context */
12624    int n_ctxt;
12625    const char * filename; /* a file or URL */
12626    int n_filename;
12627    char * encoding; /* the document encoding, or NULL */
12628    int n_encoding;
12629    int options; /* a combination of xmlParserOption */
12630    int n_options;
12631
12632    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12633    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12634    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12635    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12636        mem_base = xmlMemBlocks();
12637        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12638        filename = gen_filepath(n_filename, 1);
12639        encoding = gen_const_char_ptr(n_encoding, 2);
12640        options = gen_parseroptions(n_options, 3);
12641
12642        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12643        desret_xmlDocPtr(ret_val);
12644        call_tests++;
12645        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12646        des_filepath(n_filename, filename, 1);
12647        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12648        des_parseroptions(n_options, options, 3);
12649        xmlResetLastError();
12650        if (mem_base != xmlMemBlocks()) {
12651            printf("Leak of %d blocks found in xmlCtxtReadFile",
12652	           xmlMemBlocks() - mem_base);
12653	    test_ret++;
12654            printf(" %d", n_ctxt);
12655            printf(" %d", n_filename);
12656            printf(" %d", n_encoding);
12657            printf(" %d", n_options);
12658            printf("\n");
12659        }
12660    }
12661    }
12662    }
12663    }
12664    function_tests++;
12665
12666    return(test_ret);
12667}
12668
12669
12670static int
12671test_xmlCtxtReadMemory(void) {
12672    int test_ret = 0;
12673
12674    int mem_base;
12675    xmlDocPtr ret_val;
12676    xmlParserCtxtPtr ctxt; /* an XML parser context */
12677    int n_ctxt;
12678    char * buffer; /* a pointer to a char array */
12679    int n_buffer;
12680    int size; /* the size of the array */
12681    int n_size;
12682    const char * URL; /* the base URL to use for the document */
12683    int n_URL;
12684    char * encoding; /* the document encoding, or NULL */
12685    int n_encoding;
12686    int options; /* a combination of xmlParserOption */
12687    int n_options;
12688
12689    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12690    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12691    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12692    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12693    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12694    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12695        mem_base = xmlMemBlocks();
12696        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12697        buffer = gen_const_char_ptr(n_buffer, 1);
12698        size = gen_int(n_size, 2);
12699        URL = gen_filepath(n_URL, 3);
12700        encoding = gen_const_char_ptr(n_encoding, 4);
12701        options = gen_parseroptions(n_options, 5);
12702
12703        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12704        desret_xmlDocPtr(ret_val);
12705        call_tests++;
12706        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12707        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12708        des_int(n_size, size, 2);
12709        des_filepath(n_URL, URL, 3);
12710        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12711        des_parseroptions(n_options, options, 5);
12712        xmlResetLastError();
12713        if (mem_base != xmlMemBlocks()) {
12714            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12715	           xmlMemBlocks() - mem_base);
12716	    test_ret++;
12717            printf(" %d", n_ctxt);
12718            printf(" %d", n_buffer);
12719            printf(" %d", n_size);
12720            printf(" %d", n_URL);
12721            printf(" %d", n_encoding);
12722            printf(" %d", n_options);
12723            printf("\n");
12724        }
12725    }
12726    }
12727    }
12728    }
12729    }
12730    }
12731    function_tests++;
12732
12733    return(test_ret);
12734}
12735
12736
12737static int
12738test_xmlCtxtReset(void) {
12739    int test_ret = 0;
12740
12741    int mem_base;
12742    xmlParserCtxtPtr ctxt; /* an XML parser context */
12743    int n_ctxt;
12744
12745    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12746        mem_base = xmlMemBlocks();
12747        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12748
12749        xmlCtxtReset(ctxt);
12750        call_tests++;
12751        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12752        xmlResetLastError();
12753        if (mem_base != xmlMemBlocks()) {
12754            printf("Leak of %d blocks found in xmlCtxtReset",
12755	           xmlMemBlocks() - mem_base);
12756	    test_ret++;
12757            printf(" %d", n_ctxt);
12758            printf("\n");
12759        }
12760    }
12761    function_tests++;
12762
12763    return(test_ret);
12764}
12765
12766
12767static int
12768test_xmlCtxtResetPush(void) {
12769    int test_ret = 0;
12770
12771    int mem_base;
12772    int ret_val;
12773    xmlParserCtxtPtr ctxt; /* an XML parser context */
12774    int n_ctxt;
12775    char * chunk; /* a pointer to an array of chars */
12776    int n_chunk;
12777    int size; /* number of chars in the array */
12778    int n_size;
12779    const char * filename; /* an optional file name or URI */
12780    int n_filename;
12781    char * encoding; /* the document encoding, or NULL */
12782    int n_encoding;
12783
12784    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12785    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12786    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12787    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12788    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12789        mem_base = xmlMemBlocks();
12790        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12791        chunk = gen_const_char_ptr(n_chunk, 1);
12792        size = gen_int(n_size, 2);
12793        filename = gen_filepath(n_filename, 3);
12794        encoding = gen_const_char_ptr(n_encoding, 4);
12795
12796        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12797        desret_int(ret_val);
12798        call_tests++;
12799        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12800        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12801        des_int(n_size, size, 2);
12802        des_filepath(n_filename, filename, 3);
12803        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12804        xmlResetLastError();
12805        if (mem_base != xmlMemBlocks()) {
12806            printf("Leak of %d blocks found in xmlCtxtResetPush",
12807	           xmlMemBlocks() - mem_base);
12808	    test_ret++;
12809            printf(" %d", n_ctxt);
12810            printf(" %d", n_chunk);
12811            printf(" %d", n_size);
12812            printf(" %d", n_filename);
12813            printf(" %d", n_encoding);
12814            printf("\n");
12815        }
12816    }
12817    }
12818    }
12819    }
12820    }
12821    function_tests++;
12822
12823    return(test_ret);
12824}
12825
12826
12827static int
12828test_xmlCtxtUseOptions(void) {
12829    int test_ret = 0;
12830
12831    int mem_base;
12832    int ret_val;
12833    xmlParserCtxtPtr ctxt; /* an XML parser context */
12834    int n_ctxt;
12835    int options; /* a combination of xmlParserOption */
12836    int n_options;
12837
12838    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12839    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12840        mem_base = xmlMemBlocks();
12841        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12842        options = gen_parseroptions(n_options, 1);
12843
12844        ret_val = xmlCtxtUseOptions(ctxt, options);
12845        desret_int(ret_val);
12846        call_tests++;
12847        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12848        des_parseroptions(n_options, options, 1);
12849        xmlResetLastError();
12850        if (mem_base != xmlMemBlocks()) {
12851            printf("Leak of %d blocks found in xmlCtxtUseOptions",
12852	           xmlMemBlocks() - mem_base);
12853	    test_ret++;
12854            printf(" %d", n_ctxt);
12855            printf(" %d", n_options);
12856            printf("\n");
12857        }
12858    }
12859    }
12860    function_tests++;
12861
12862    return(test_ret);
12863}
12864
12865
12866static int
12867test_xmlGetExternalEntityLoader(void) {
12868    int test_ret = 0;
12869
12870
12871    /* missing type support */
12872    return(test_ret);
12873}
12874
12875
12876static int
12877test_xmlGetFeature(void) {
12878    int test_ret = 0;
12879
12880#if defined(LIBXML_LEGACY_ENABLED)
12881#ifdef LIBXML_LEGACY_ENABLED
12882    int mem_base;
12883    int ret_val;
12884    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
12885    int n_ctxt;
12886    char * name; /* the feature name */
12887    int n_name;
12888    void * result; /* location to store the result */
12889    int n_result;
12890
12891    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12892    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
12893    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
12894        mem_base = xmlMemBlocks();
12895        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12896        name = gen_const_char_ptr(n_name, 1);
12897        result = gen_void_ptr(n_result, 2);
12898
12899        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
12900        desret_int(ret_val);
12901        call_tests++;
12902        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12903        des_const_char_ptr(n_name, (const char *)name, 1);
12904        des_void_ptr(n_result, result, 2);
12905        xmlResetLastError();
12906        if (mem_base != xmlMemBlocks()) {
12907            printf("Leak of %d blocks found in xmlGetFeature",
12908	           xmlMemBlocks() - mem_base);
12909	    test_ret++;
12910            printf(" %d", n_ctxt);
12911            printf(" %d", n_name);
12912            printf(" %d", n_result);
12913            printf("\n");
12914        }
12915    }
12916    }
12917    }
12918    function_tests++;
12919#endif
12920#endif
12921
12922    return(test_ret);
12923}
12924
12925
12926#define gen_nb_const_char_ptr_ptr 1
12927static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12928    return(NULL);
12929}
12930static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12931}
12932
12933static int
12934test_xmlGetFeaturesList(void) {
12935    int test_ret = 0;
12936
12937#if defined(LIBXML_LEGACY_ENABLED)
12938#ifdef LIBXML_LEGACY_ENABLED
12939    int mem_base;
12940    int ret_val;
12941    int * len; /* the length of the features name array (input/output) */
12942    int n_len;
12943    char ** result; /* an array of string to be filled with the features name. */
12944    int n_result;
12945
12946    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
12947    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
12948        mem_base = xmlMemBlocks();
12949        len = gen_int_ptr(n_len, 0);
12950        result = gen_const_char_ptr_ptr(n_result, 1);
12951
12952        ret_val = xmlGetFeaturesList(len, (const char **)result);
12953        desret_int(ret_val);
12954        call_tests++;
12955        des_int_ptr(n_len, len, 0);
12956        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
12957        xmlResetLastError();
12958        if (mem_base != xmlMemBlocks()) {
12959            printf("Leak of %d blocks found in xmlGetFeaturesList",
12960	           xmlMemBlocks() - mem_base);
12961	    test_ret++;
12962            printf(" %d", n_len);
12963            printf(" %d", n_result);
12964            printf("\n");
12965        }
12966    }
12967    }
12968    function_tests++;
12969#endif
12970#endif
12971
12972    return(test_ret);
12973}
12974
12975
12976static int
12977test_xmlIOParseDTD(void) {
12978    int test_ret = 0;
12979
12980#if defined(LIBXML_VALID_ENABLED)
12981#ifdef LIBXML_VALID_ENABLED
12982    int mem_base;
12983    xmlDtdPtr ret_val;
12984    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
12985    int n_sax;
12986    xmlParserInputBufferPtr input; /* an Input Buffer */
12987    int n_input;
12988    xmlCharEncoding enc; /* the charset encoding if known */
12989    int n_enc;
12990
12991    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12992    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
12993    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
12994        mem_base = xmlMemBlocks();
12995        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12996        input = gen_xmlParserInputBufferPtr(n_input, 1);
12997        enc = gen_xmlCharEncoding(n_enc, 2);
12998
12999        ret_val = xmlIOParseDTD(sax, input, enc);
13000        input = NULL;
13001        desret_xmlDtdPtr(ret_val);
13002        call_tests++;
13003        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13004        des_xmlParserInputBufferPtr(n_input, input, 1);
13005        des_xmlCharEncoding(n_enc, enc, 2);
13006        xmlResetLastError();
13007        if (mem_base != xmlMemBlocks()) {
13008            printf("Leak of %d blocks found in xmlIOParseDTD",
13009	           xmlMemBlocks() - mem_base);
13010	    test_ret++;
13011            printf(" %d", n_sax);
13012            printf(" %d", n_input);
13013            printf(" %d", n_enc);
13014            printf("\n");
13015        }
13016    }
13017    }
13018    }
13019    function_tests++;
13020#endif
13021#endif
13022
13023    return(test_ret);
13024}
13025
13026
13027static int
13028test_xmlInitNodeInfoSeq(void) {
13029    int test_ret = 0;
13030
13031    int mem_base;
13032    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13033    int n_seq;
13034
13035    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13036        mem_base = xmlMemBlocks();
13037        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13038
13039        xmlInitNodeInfoSeq(seq);
13040        call_tests++;
13041        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13042        xmlResetLastError();
13043        if (mem_base != xmlMemBlocks()) {
13044            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13045	           xmlMemBlocks() - mem_base);
13046	    test_ret++;
13047            printf(" %d", n_seq);
13048            printf("\n");
13049        }
13050    }
13051    function_tests++;
13052
13053    return(test_ret);
13054}
13055
13056
13057static int
13058test_xmlInitParser(void) {
13059    int test_ret = 0;
13060
13061    int mem_base;
13062
13063        mem_base = xmlMemBlocks();
13064
13065        xmlInitParser();
13066        call_tests++;
13067        xmlResetLastError();
13068        if (mem_base != xmlMemBlocks()) {
13069            printf("Leak of %d blocks found in xmlInitParser",
13070	           xmlMemBlocks() - mem_base);
13071	    test_ret++;
13072            printf("\n");
13073        }
13074    function_tests++;
13075
13076    return(test_ret);
13077}
13078
13079
13080static int
13081test_xmlInitParserCtxt(void) {
13082    int test_ret = 0;
13083
13084    int mem_base;
13085    int ret_val;
13086    xmlParserCtxtPtr ctxt; /* an XML parser context */
13087    int n_ctxt;
13088
13089    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13090        mem_base = xmlMemBlocks();
13091        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13092
13093        ret_val = xmlInitParserCtxt(ctxt);
13094        desret_int(ret_val);
13095        call_tests++;
13096        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13097        xmlResetLastError();
13098        if (mem_base != xmlMemBlocks()) {
13099            printf("Leak of %d blocks found in xmlInitParserCtxt",
13100	           xmlMemBlocks() - mem_base);
13101	    test_ret++;
13102            printf(" %d", n_ctxt);
13103            printf("\n");
13104        }
13105    }
13106    function_tests++;
13107
13108    return(test_ret);
13109}
13110
13111
13112static int
13113test_xmlKeepBlanksDefault(void) {
13114    int test_ret = 0;
13115
13116    int mem_base;
13117    int ret_val;
13118    int val; /* int 0 or 1 */
13119    int n_val;
13120
13121    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13122        mem_base = xmlMemBlocks();
13123        val = gen_int(n_val, 0);
13124
13125        ret_val = xmlKeepBlanksDefault(val);
13126        desret_int(ret_val);
13127        call_tests++;
13128        des_int(n_val, val, 0);
13129        xmlResetLastError();
13130        if (mem_base != xmlMemBlocks()) {
13131            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13132	           xmlMemBlocks() - mem_base);
13133	    test_ret++;
13134            printf(" %d", n_val);
13135            printf("\n");
13136        }
13137    }
13138    function_tests++;
13139
13140    return(test_ret);
13141}
13142
13143
13144static int
13145test_xmlLineNumbersDefault(void) {
13146    int test_ret = 0;
13147
13148    int mem_base;
13149    int ret_val;
13150    int val; /* int 0 or 1 */
13151    int n_val;
13152
13153    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13154        mem_base = xmlMemBlocks();
13155        val = gen_int(n_val, 0);
13156
13157        ret_val = xmlLineNumbersDefault(val);
13158        desret_int(ret_val);
13159        call_tests++;
13160        des_int(n_val, val, 0);
13161        xmlResetLastError();
13162        if (mem_base != xmlMemBlocks()) {
13163            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13164	           xmlMemBlocks() - mem_base);
13165	    test_ret++;
13166            printf(" %d", n_val);
13167            printf("\n");
13168        }
13169    }
13170    function_tests++;
13171
13172    return(test_ret);
13173}
13174
13175
13176static int
13177test_xmlLoadExternalEntity(void) {
13178    int test_ret = 0;
13179
13180    int mem_base;
13181    xmlParserInputPtr ret_val;
13182    const char * URL; /* the URL for the entity to load */
13183    int n_URL;
13184    char * ID; /* the Public ID for the entity to load */
13185    int n_ID;
13186    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13187    int n_ctxt;
13188
13189    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13190    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13191    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13192        mem_base = xmlMemBlocks();
13193        URL = gen_filepath(n_URL, 0);
13194        ID = gen_const_char_ptr(n_ID, 1);
13195        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13196
13197        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13198        desret_xmlParserInputPtr(ret_val);
13199        call_tests++;
13200        des_filepath(n_URL, URL, 0);
13201        des_const_char_ptr(n_ID, (const char *)ID, 1);
13202        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13203        xmlResetLastError();
13204        if (mem_base != xmlMemBlocks()) {
13205            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13206	           xmlMemBlocks() - mem_base);
13207	    test_ret++;
13208            printf(" %d", n_URL);
13209            printf(" %d", n_ID);
13210            printf(" %d", n_ctxt);
13211            printf("\n");
13212        }
13213    }
13214    }
13215    }
13216    function_tests++;
13217
13218    return(test_ret);
13219}
13220
13221
13222static int
13223test_xmlNewIOInputStream(void) {
13224    int test_ret = 0;
13225
13226    int mem_base;
13227    xmlParserInputPtr ret_val;
13228    xmlParserCtxtPtr ctxt; /* an XML parser context */
13229    int n_ctxt;
13230    xmlParserInputBufferPtr input; /* an I/O Input */
13231    int n_input;
13232    xmlCharEncoding enc; /* the charset encoding if known */
13233    int n_enc;
13234
13235    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13236    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13237    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13238        mem_base = xmlMemBlocks();
13239        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13240        input = gen_xmlParserInputBufferPtr(n_input, 1);
13241        enc = gen_xmlCharEncoding(n_enc, 2);
13242
13243        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13244        if (ret_val != NULL) input = NULL;
13245        desret_xmlParserInputPtr(ret_val);
13246        call_tests++;
13247        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13248        des_xmlParserInputBufferPtr(n_input, input, 1);
13249        des_xmlCharEncoding(n_enc, enc, 2);
13250        xmlResetLastError();
13251        if (mem_base != xmlMemBlocks()) {
13252            printf("Leak of %d blocks found in xmlNewIOInputStream",
13253	           xmlMemBlocks() - mem_base);
13254	    test_ret++;
13255            printf(" %d", n_ctxt);
13256            printf(" %d", n_input);
13257            printf(" %d", n_enc);
13258            printf("\n");
13259        }
13260    }
13261    }
13262    }
13263    function_tests++;
13264
13265    return(test_ret);
13266}
13267
13268
13269static int
13270test_xmlNewParserCtxt(void) {
13271    int test_ret = 0;
13272
13273    int mem_base;
13274    xmlParserCtxtPtr ret_val;
13275
13276        mem_base = xmlMemBlocks();
13277
13278        ret_val = xmlNewParserCtxt();
13279        desret_xmlParserCtxtPtr(ret_val);
13280        call_tests++;
13281        xmlResetLastError();
13282        if (mem_base != xmlMemBlocks()) {
13283            printf("Leak of %d blocks found in xmlNewParserCtxt",
13284	           xmlMemBlocks() - mem_base);
13285	    test_ret++;
13286            printf("\n");
13287        }
13288    function_tests++;
13289
13290    return(test_ret);
13291}
13292
13293
13294#define gen_nb_xmlNodePtr_ptr 1
13295static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13296    return(NULL);
13297}
13298static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13299}
13300
13301static int
13302test_xmlParseBalancedChunkMemory(void) {
13303    int test_ret = 0;
13304
13305#if defined(LIBXML_SAX1_ENABLED)
13306#ifdef LIBXML_SAX1_ENABLED
13307    int mem_base;
13308    int ret_val;
13309    xmlDocPtr doc; /* the document the chunk pertains to */
13310    int n_doc;
13311    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13312    int n_sax;
13313    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13314    int n_user_data;
13315    int depth; /* Used for loop detection, use 0 */
13316    int n_depth;
13317    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13318    int n_string;
13319    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13320    int n_lst;
13321
13322    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13323    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13324    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13325    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13326    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13327    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13328        mem_base = xmlMemBlocks();
13329        doc = gen_xmlDocPtr(n_doc, 0);
13330        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13331        user_data = gen_userdata(n_user_data, 2);
13332        depth = gen_int(n_depth, 3);
13333        string = gen_const_xmlChar_ptr(n_string, 4);
13334        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13335
13336#ifdef LIBXML_SAX1_ENABLED
13337        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13338#endif
13339
13340
13341        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13342        desret_int(ret_val);
13343        call_tests++;
13344        des_xmlDocPtr(n_doc, doc, 0);
13345        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13346        des_userdata(n_user_data, user_data, 2);
13347        des_int(n_depth, depth, 3);
13348        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13349        des_xmlNodePtr_ptr(n_lst, lst, 5);
13350        xmlResetLastError();
13351        if (mem_base != xmlMemBlocks()) {
13352            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13353	           xmlMemBlocks() - mem_base);
13354	    test_ret++;
13355            printf(" %d", n_doc);
13356            printf(" %d", n_sax);
13357            printf(" %d", n_user_data);
13358            printf(" %d", n_depth);
13359            printf(" %d", n_string);
13360            printf(" %d", n_lst);
13361            printf("\n");
13362        }
13363    }
13364    }
13365    }
13366    }
13367    }
13368    }
13369    function_tests++;
13370#endif
13371#endif
13372
13373    return(test_ret);
13374}
13375
13376
13377static int
13378test_xmlParseBalancedChunkMemoryRecover(void) {
13379    int test_ret = 0;
13380
13381#if defined(LIBXML_SAX1_ENABLED)
13382#ifdef LIBXML_SAX1_ENABLED
13383    int mem_base;
13384    int ret_val;
13385    xmlDocPtr doc; /* the document the chunk pertains to */
13386    int n_doc;
13387    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13388    int n_sax;
13389    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13390    int n_user_data;
13391    int depth; /* Used for loop detection, use 0 */
13392    int n_depth;
13393    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13394    int n_string;
13395    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13396    int n_lst;
13397    int recover; /* return nodes even if the data is broken (use 0) */
13398    int n_recover;
13399
13400    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13401    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13402    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13403    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13404    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13405    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13406    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13407        mem_base = xmlMemBlocks();
13408        doc = gen_xmlDocPtr(n_doc, 0);
13409        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13410        user_data = gen_userdata(n_user_data, 2);
13411        depth = gen_int(n_depth, 3);
13412        string = gen_const_xmlChar_ptr(n_string, 4);
13413        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13414        recover = gen_int(n_recover, 6);
13415
13416#ifdef LIBXML_SAX1_ENABLED
13417        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13418#endif
13419
13420
13421        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13422        desret_int(ret_val);
13423        call_tests++;
13424        des_xmlDocPtr(n_doc, doc, 0);
13425        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13426        des_userdata(n_user_data, user_data, 2);
13427        des_int(n_depth, depth, 3);
13428        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13429        des_xmlNodePtr_ptr(n_lst, lst, 5);
13430        des_int(n_recover, recover, 6);
13431        xmlResetLastError();
13432        if (mem_base != xmlMemBlocks()) {
13433            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13434	           xmlMemBlocks() - mem_base);
13435	    test_ret++;
13436            printf(" %d", n_doc);
13437            printf(" %d", n_sax);
13438            printf(" %d", n_user_data);
13439            printf(" %d", n_depth);
13440            printf(" %d", n_string);
13441            printf(" %d", n_lst);
13442            printf(" %d", n_recover);
13443            printf("\n");
13444        }
13445    }
13446    }
13447    }
13448    }
13449    }
13450    }
13451    }
13452    function_tests++;
13453#endif
13454#endif
13455
13456    return(test_ret);
13457}
13458
13459
13460static int
13461test_xmlParseChunk(void) {
13462    int test_ret = 0;
13463
13464#if defined(LIBXML_PUSH_ENABLED)
13465    int mem_base;
13466    int ret_val;
13467    xmlParserCtxtPtr ctxt; /* an XML parser context */
13468    int n_ctxt;
13469    char * chunk; /* an char array */
13470    int n_chunk;
13471    int size; /* the size in byte of the chunk */
13472    int n_size;
13473    int terminate; /* last chunk indicator */
13474    int n_terminate;
13475
13476    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13477    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13478    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13479    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13480        mem_base = xmlMemBlocks();
13481        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13482        chunk = gen_const_char_ptr(n_chunk, 1);
13483        size = gen_int(n_size, 2);
13484        terminate = gen_int(n_terminate, 3);
13485
13486        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13487        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13488        desret_int(ret_val);
13489        call_tests++;
13490        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13491        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13492        des_int(n_size, size, 2);
13493        des_int(n_terminate, terminate, 3);
13494        xmlResetLastError();
13495        if (mem_base != xmlMemBlocks()) {
13496            printf("Leak of %d blocks found in xmlParseChunk",
13497	           xmlMemBlocks() - mem_base);
13498	    test_ret++;
13499            printf(" %d", n_ctxt);
13500            printf(" %d", n_chunk);
13501            printf(" %d", n_size);
13502            printf(" %d", n_terminate);
13503            printf("\n");
13504        }
13505    }
13506    }
13507    }
13508    }
13509    function_tests++;
13510#endif
13511
13512    return(test_ret);
13513}
13514
13515
13516static int
13517test_xmlParseCtxtExternalEntity(void) {
13518    int test_ret = 0;
13519
13520    int mem_base;
13521    int ret_val;
13522    xmlParserCtxtPtr ctx; /* the existing parsing context */
13523    int n_ctx;
13524    xmlChar * URL; /* the URL for the entity to load */
13525    int n_URL;
13526    xmlChar * ID; /* the System ID for the entity to load */
13527    int n_ID;
13528    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13529    int n_lst;
13530
13531    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13532    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13533    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13534    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13535        mem_base = xmlMemBlocks();
13536        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13537        URL = gen_const_xmlChar_ptr(n_URL, 1);
13538        ID = gen_const_xmlChar_ptr(n_ID, 2);
13539        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13540
13541        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13542        desret_int(ret_val);
13543        call_tests++;
13544        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13545        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13546        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13547        des_xmlNodePtr_ptr(n_lst, lst, 3);
13548        xmlResetLastError();
13549        if (mem_base != xmlMemBlocks()) {
13550            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13551	           xmlMemBlocks() - mem_base);
13552	    test_ret++;
13553            printf(" %d", n_ctx);
13554            printf(" %d", n_URL);
13555            printf(" %d", n_ID);
13556            printf(" %d", n_lst);
13557            printf("\n");
13558        }
13559    }
13560    }
13561    }
13562    }
13563    function_tests++;
13564
13565    return(test_ret);
13566}
13567
13568
13569static int
13570test_xmlParseDTD(void) {
13571    int test_ret = 0;
13572
13573#if defined(LIBXML_VALID_ENABLED)
13574#ifdef LIBXML_VALID_ENABLED
13575    int mem_base;
13576    xmlDtdPtr ret_val;
13577    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13578    int n_ExternalID;
13579    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13580    int n_SystemID;
13581
13582    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13583    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13584        mem_base = xmlMemBlocks();
13585        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13586        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13587
13588        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13589        desret_xmlDtdPtr(ret_val);
13590        call_tests++;
13591        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13592        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13593        xmlResetLastError();
13594        if (mem_base != xmlMemBlocks()) {
13595            printf("Leak of %d blocks found in xmlParseDTD",
13596	           xmlMemBlocks() - mem_base);
13597	    test_ret++;
13598            printf(" %d", n_ExternalID);
13599            printf(" %d", n_SystemID);
13600            printf("\n");
13601        }
13602    }
13603    }
13604    function_tests++;
13605#endif
13606#endif
13607
13608    return(test_ret);
13609}
13610
13611
13612static int
13613test_xmlParseDoc(void) {
13614    int test_ret = 0;
13615
13616#if defined(LIBXML_SAX1_ENABLED)
13617#ifdef LIBXML_SAX1_ENABLED
13618    int mem_base;
13619    xmlDocPtr ret_val;
13620    xmlChar * cur; /* a pointer to an array of xmlChar */
13621    int n_cur;
13622
13623    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13624        mem_base = xmlMemBlocks();
13625        cur = gen_const_xmlChar_ptr(n_cur, 0);
13626
13627        ret_val = xmlParseDoc((const xmlChar *)cur);
13628        desret_xmlDocPtr(ret_val);
13629        call_tests++;
13630        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13631        xmlResetLastError();
13632        if (mem_base != xmlMemBlocks()) {
13633            printf("Leak of %d blocks found in xmlParseDoc",
13634	           xmlMemBlocks() - mem_base);
13635	    test_ret++;
13636            printf(" %d", n_cur);
13637            printf("\n");
13638        }
13639    }
13640    function_tests++;
13641#endif
13642#endif
13643
13644    return(test_ret);
13645}
13646
13647
13648static int
13649test_xmlParseDocument(void) {
13650    int test_ret = 0;
13651
13652    int mem_base;
13653    int ret_val;
13654    xmlParserCtxtPtr ctxt; /* an XML parser context */
13655    int n_ctxt;
13656
13657    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13658        mem_base = xmlMemBlocks();
13659        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13660
13661        ret_val = xmlParseDocument(ctxt);
13662        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13663        desret_int(ret_val);
13664        call_tests++;
13665        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13666        xmlResetLastError();
13667        if (mem_base != xmlMemBlocks()) {
13668            printf("Leak of %d blocks found in xmlParseDocument",
13669	           xmlMemBlocks() - mem_base);
13670	    test_ret++;
13671            printf(" %d", n_ctxt);
13672            printf("\n");
13673        }
13674    }
13675    function_tests++;
13676
13677    return(test_ret);
13678}
13679
13680
13681static int
13682test_xmlParseEntity(void) {
13683    int test_ret = 0;
13684
13685#if defined(LIBXML_SAX1_ENABLED)
13686#ifdef LIBXML_SAX1_ENABLED
13687    int mem_base;
13688    xmlDocPtr ret_val;
13689    const char * filename; /* the filename */
13690    int n_filename;
13691
13692    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13693        mem_base = xmlMemBlocks();
13694        filename = gen_filepath(n_filename, 0);
13695
13696        ret_val = xmlParseEntity(filename);
13697        desret_xmlDocPtr(ret_val);
13698        call_tests++;
13699        des_filepath(n_filename, filename, 0);
13700        xmlResetLastError();
13701        if (mem_base != xmlMemBlocks()) {
13702            printf("Leak of %d blocks found in xmlParseEntity",
13703	           xmlMemBlocks() - mem_base);
13704	    test_ret++;
13705            printf(" %d", n_filename);
13706            printf("\n");
13707        }
13708    }
13709    function_tests++;
13710#endif
13711#endif
13712
13713    return(test_ret);
13714}
13715
13716
13717static int
13718test_xmlParseExtParsedEnt(void) {
13719    int test_ret = 0;
13720
13721    int mem_base;
13722    int ret_val;
13723    xmlParserCtxtPtr ctxt; /* an XML parser context */
13724    int n_ctxt;
13725
13726    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13727        mem_base = xmlMemBlocks();
13728        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13729
13730        ret_val = xmlParseExtParsedEnt(ctxt);
13731        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13732        desret_int(ret_val);
13733        call_tests++;
13734        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13735        xmlResetLastError();
13736        if (mem_base != xmlMemBlocks()) {
13737            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13738	           xmlMemBlocks() - mem_base);
13739	    test_ret++;
13740            printf(" %d", n_ctxt);
13741            printf("\n");
13742        }
13743    }
13744    function_tests++;
13745
13746    return(test_ret);
13747}
13748
13749
13750static int
13751test_xmlParseExternalEntity(void) {
13752    int test_ret = 0;
13753
13754#if defined(LIBXML_SAX1_ENABLED)
13755#ifdef LIBXML_SAX1_ENABLED
13756    int mem_base;
13757    int ret_val;
13758    xmlDocPtr doc; /* the document the chunk pertains to */
13759    int n_doc;
13760    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13761    int n_sax;
13762    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13763    int n_user_data;
13764    int depth; /* Used for loop detection, use 0 */
13765    int n_depth;
13766    xmlChar * URL; /* the URL for the entity to load */
13767    int n_URL;
13768    xmlChar * ID; /* the System ID for the entity to load */
13769    int n_ID;
13770    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13771    int n_lst;
13772
13773    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13774    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13775    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13776    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13777    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13778    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13779    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13780        mem_base = xmlMemBlocks();
13781        doc = gen_xmlDocPtr(n_doc, 0);
13782        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13783        user_data = gen_userdata(n_user_data, 2);
13784        depth = gen_int(n_depth, 3);
13785        URL = gen_const_xmlChar_ptr(n_URL, 4);
13786        ID = gen_const_xmlChar_ptr(n_ID, 5);
13787        lst = gen_xmlNodePtr_ptr(n_lst, 6);
13788
13789        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13790        desret_int(ret_val);
13791        call_tests++;
13792        des_xmlDocPtr(n_doc, doc, 0);
13793        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13794        des_userdata(n_user_data, user_data, 2);
13795        des_int(n_depth, depth, 3);
13796        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13797        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13798        des_xmlNodePtr_ptr(n_lst, lst, 6);
13799        xmlResetLastError();
13800        if (mem_base != xmlMemBlocks()) {
13801            printf("Leak of %d blocks found in xmlParseExternalEntity",
13802	           xmlMemBlocks() - mem_base);
13803	    test_ret++;
13804            printf(" %d", n_doc);
13805            printf(" %d", n_sax);
13806            printf(" %d", n_user_data);
13807            printf(" %d", n_depth);
13808            printf(" %d", n_URL);
13809            printf(" %d", n_ID);
13810            printf(" %d", n_lst);
13811            printf("\n");
13812        }
13813    }
13814    }
13815    }
13816    }
13817    }
13818    }
13819    }
13820    function_tests++;
13821#endif
13822#endif
13823
13824    return(test_ret);
13825}
13826
13827
13828static int
13829test_xmlParseFile(void) {
13830    int test_ret = 0;
13831
13832#if defined(LIBXML_SAX1_ENABLED)
13833#ifdef LIBXML_SAX1_ENABLED
13834    int mem_base;
13835    xmlDocPtr ret_val;
13836    const char * filename; /* the filename */
13837    int n_filename;
13838
13839    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13840        mem_base = xmlMemBlocks();
13841        filename = gen_filepath(n_filename, 0);
13842
13843        ret_val = xmlParseFile(filename);
13844        desret_xmlDocPtr(ret_val);
13845        call_tests++;
13846        des_filepath(n_filename, filename, 0);
13847        xmlResetLastError();
13848        if (mem_base != xmlMemBlocks()) {
13849            printf("Leak of %d blocks found in xmlParseFile",
13850	           xmlMemBlocks() - mem_base);
13851	    test_ret++;
13852            printf(" %d", n_filename);
13853            printf("\n");
13854        }
13855    }
13856    function_tests++;
13857#endif
13858#endif
13859
13860    return(test_ret);
13861}
13862
13863
13864static int
13865test_xmlParseInNodeContext(void) {
13866    int test_ret = 0;
13867
13868    int mem_base;
13869    xmlParserErrors ret_val;
13870    xmlNodePtr node; /* the context node */
13871    int n_node;
13872    char * data; /* the input string */
13873    int n_data;
13874    int datalen; /* the input string length in bytes */
13875    int n_datalen;
13876    int options; /* a combination of xmlParserOption */
13877    int n_options;
13878    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13879    int n_lst;
13880
13881    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13882    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
13883    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
13884    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13885    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13886        mem_base = xmlMemBlocks();
13887        node = gen_xmlNodePtr(n_node, 0);
13888        data = gen_const_char_ptr(n_data, 1);
13889        datalen = gen_int(n_datalen, 2);
13890        options = gen_parseroptions(n_options, 3);
13891        lst = gen_xmlNodePtr_ptr(n_lst, 4);
13892
13893        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
13894        desret_xmlParserErrors(ret_val);
13895        call_tests++;
13896        des_xmlNodePtr(n_node, node, 0);
13897        des_const_char_ptr(n_data, (const char *)data, 1);
13898        des_int(n_datalen, datalen, 2);
13899        des_parseroptions(n_options, options, 3);
13900        des_xmlNodePtr_ptr(n_lst, lst, 4);
13901        xmlResetLastError();
13902        if (mem_base != xmlMemBlocks()) {
13903            printf("Leak of %d blocks found in xmlParseInNodeContext",
13904	           xmlMemBlocks() - mem_base);
13905	    test_ret++;
13906            printf(" %d", n_node);
13907            printf(" %d", n_data);
13908            printf(" %d", n_datalen);
13909            printf(" %d", n_options);
13910            printf(" %d", n_lst);
13911            printf("\n");
13912        }
13913    }
13914    }
13915    }
13916    }
13917    }
13918    function_tests++;
13919
13920    return(test_ret);
13921}
13922
13923
13924static int
13925test_xmlParseMemory(void) {
13926    int test_ret = 0;
13927
13928#if defined(LIBXML_SAX1_ENABLED)
13929#ifdef LIBXML_SAX1_ENABLED
13930    int mem_base;
13931    xmlDocPtr ret_val;
13932    char * buffer; /* an pointer to a char array */
13933    int n_buffer;
13934    int size; /* the size of the array */
13935    int n_size;
13936
13937    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
13938    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13939        mem_base = xmlMemBlocks();
13940        buffer = gen_const_char_ptr(n_buffer, 0);
13941        size = gen_int(n_size, 1);
13942
13943        ret_val = xmlParseMemory((const char *)buffer, size);
13944        desret_xmlDocPtr(ret_val);
13945        call_tests++;
13946        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
13947        des_int(n_size, size, 1);
13948        xmlResetLastError();
13949        if (mem_base != xmlMemBlocks()) {
13950            printf("Leak of %d blocks found in xmlParseMemory",
13951	           xmlMemBlocks() - mem_base);
13952	    test_ret++;
13953            printf(" %d", n_buffer);
13954            printf(" %d", n_size);
13955            printf("\n");
13956        }
13957    }
13958    }
13959    function_tests++;
13960#endif
13961#endif
13962
13963    return(test_ret);
13964}
13965
13966
13967#define gen_nb_const_xmlParserNodeInfoPtr 1
13968static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13969    return(NULL);
13970}
13971static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13972}
13973
13974static int
13975test_xmlParserAddNodeInfo(void) {
13976    int test_ret = 0;
13977
13978    int mem_base;
13979    xmlParserCtxtPtr ctxt; /* an XML parser context */
13980    int n_ctxt;
13981    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
13982    int n_info;
13983
13984    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13985    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
13986        mem_base = xmlMemBlocks();
13987        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13988        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
13989
13990        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
13991        call_tests++;
13992        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13993        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
13994        xmlResetLastError();
13995        if (mem_base != xmlMemBlocks()) {
13996            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
13997	           xmlMemBlocks() - mem_base);
13998	    test_ret++;
13999            printf(" %d", n_ctxt);
14000            printf(" %d", n_info);
14001            printf("\n");
14002        }
14003    }
14004    }
14005    function_tests++;
14006
14007    return(test_ret);
14008}
14009
14010
14011#define gen_nb_const_xmlParserCtxtPtr 1
14012static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14013    return(NULL);
14014}
14015static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14016}
14017
14018#define gen_nb_const_xmlNodePtr 1
14019static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14020    return(NULL);
14021}
14022static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14023}
14024
14025static int
14026test_xmlParserFindNodeInfo(void) {
14027    int test_ret = 0;
14028
14029    int mem_base;
14030    const xmlParserNodeInfo * ret_val;
14031    xmlParserCtxtPtr ctx; /* an XML parser context */
14032    int n_ctx;
14033    xmlNodePtr node; /* an XML node within the tree */
14034    int n_node;
14035
14036    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14037    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14038        mem_base = xmlMemBlocks();
14039        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14040        node = gen_const_xmlNodePtr(n_node, 1);
14041
14042        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14043        desret_const_xmlParserNodeInfo_ptr(ret_val);
14044        call_tests++;
14045        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14046        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14047        xmlResetLastError();
14048        if (mem_base != xmlMemBlocks()) {
14049            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14050	           xmlMemBlocks() - mem_base);
14051	    test_ret++;
14052            printf(" %d", n_ctx);
14053            printf(" %d", n_node);
14054            printf("\n");
14055        }
14056    }
14057    }
14058    function_tests++;
14059
14060    return(test_ret);
14061}
14062
14063
14064#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14065static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14066    return(NULL);
14067}
14068static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14069}
14070
14071static int
14072test_xmlParserFindNodeInfoIndex(void) {
14073    int test_ret = 0;
14074
14075    int mem_base;
14076    unsigned long ret_val;
14077    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14078    int n_seq;
14079    xmlNodePtr node; /* an XML node pointer */
14080    int n_node;
14081
14082    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14083    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14084        mem_base = xmlMemBlocks();
14085        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14086        node = gen_const_xmlNodePtr(n_node, 1);
14087
14088        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14089        desret_unsigned_long(ret_val);
14090        call_tests++;
14091        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14092        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14093        xmlResetLastError();
14094        if (mem_base != xmlMemBlocks()) {
14095            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14096	           xmlMemBlocks() - mem_base);
14097	    test_ret++;
14098            printf(" %d", n_seq);
14099            printf(" %d", n_node);
14100            printf("\n");
14101        }
14102    }
14103    }
14104    function_tests++;
14105
14106    return(test_ret);
14107}
14108
14109
14110#define gen_nb_xmlParserInputPtr 1
14111static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14112    return(NULL);
14113}
14114static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14115}
14116
14117static int
14118test_xmlParserInputGrow(void) {
14119    int test_ret = 0;
14120
14121    int mem_base;
14122    int ret_val;
14123    xmlParserInputPtr in; /* an XML parser input */
14124    int n_in;
14125    int len; /* an indicative size for the lookahead */
14126    int n_len;
14127
14128    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14129    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14130        mem_base = xmlMemBlocks();
14131        in = gen_xmlParserInputPtr(n_in, 0);
14132        len = gen_int(n_len, 1);
14133
14134        ret_val = xmlParserInputGrow(in, len);
14135        desret_int(ret_val);
14136        call_tests++;
14137        des_xmlParserInputPtr(n_in, in, 0);
14138        des_int(n_len, len, 1);
14139        xmlResetLastError();
14140        if (mem_base != xmlMemBlocks()) {
14141            printf("Leak of %d blocks found in xmlParserInputGrow",
14142	           xmlMemBlocks() - mem_base);
14143	    test_ret++;
14144            printf(" %d", n_in);
14145            printf(" %d", n_len);
14146            printf("\n");
14147        }
14148    }
14149    }
14150    function_tests++;
14151
14152    return(test_ret);
14153}
14154
14155
14156static int
14157test_xmlParserInputRead(void) {
14158    int test_ret = 0;
14159
14160    int mem_base;
14161    int ret_val;
14162    xmlParserInputPtr in; /* an XML parser input */
14163    int n_in;
14164    int len; /* an indicative size for the lookahead */
14165    int n_len;
14166
14167    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14168    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14169        mem_base = xmlMemBlocks();
14170        in = gen_xmlParserInputPtr(n_in, 0);
14171        len = gen_int(n_len, 1);
14172
14173        ret_val = xmlParserInputRead(in, len);
14174        desret_int(ret_val);
14175        call_tests++;
14176        des_xmlParserInputPtr(n_in, in, 0);
14177        des_int(n_len, len, 1);
14178        xmlResetLastError();
14179        if (mem_base != xmlMemBlocks()) {
14180            printf("Leak of %d blocks found in xmlParserInputRead",
14181	           xmlMemBlocks() - mem_base);
14182	    test_ret++;
14183            printf(" %d", n_in);
14184            printf(" %d", n_len);
14185            printf("\n");
14186        }
14187    }
14188    }
14189    function_tests++;
14190
14191    return(test_ret);
14192}
14193
14194
14195static int
14196test_xmlPedanticParserDefault(void) {
14197    int test_ret = 0;
14198
14199    int mem_base;
14200    int ret_val;
14201    int val; /* int 0 or 1 */
14202    int n_val;
14203
14204    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14205        mem_base = xmlMemBlocks();
14206        val = gen_int(n_val, 0);
14207
14208        ret_val = xmlPedanticParserDefault(val);
14209        desret_int(ret_val);
14210        call_tests++;
14211        des_int(n_val, val, 0);
14212        xmlResetLastError();
14213        if (mem_base != xmlMemBlocks()) {
14214            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14215	           xmlMemBlocks() - mem_base);
14216	    test_ret++;
14217            printf(" %d", n_val);
14218            printf("\n");
14219        }
14220    }
14221    function_tests++;
14222
14223    return(test_ret);
14224}
14225
14226
14227static int
14228test_xmlReadDoc(void) {
14229    int test_ret = 0;
14230
14231    int mem_base;
14232    xmlDocPtr ret_val;
14233    xmlChar * cur; /* a pointer to a zero terminated string */
14234    int n_cur;
14235    const char * URL; /* the base URL to use for the document */
14236    int n_URL;
14237    char * encoding; /* the document encoding, or NULL */
14238    int n_encoding;
14239    int options; /* a combination of xmlParserOption */
14240    int n_options;
14241
14242    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14243    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14244    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14245    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14246        mem_base = xmlMemBlocks();
14247        cur = gen_const_xmlChar_ptr(n_cur, 0);
14248        URL = gen_filepath(n_URL, 1);
14249        encoding = gen_const_char_ptr(n_encoding, 2);
14250        options = gen_parseroptions(n_options, 3);
14251
14252        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14253        desret_xmlDocPtr(ret_val);
14254        call_tests++;
14255        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14256        des_filepath(n_URL, URL, 1);
14257        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14258        des_parseroptions(n_options, options, 3);
14259        xmlResetLastError();
14260        if (mem_base != xmlMemBlocks()) {
14261            printf("Leak of %d blocks found in xmlReadDoc",
14262	           xmlMemBlocks() - mem_base);
14263	    test_ret++;
14264            printf(" %d", n_cur);
14265            printf(" %d", n_URL);
14266            printf(" %d", n_encoding);
14267            printf(" %d", n_options);
14268            printf("\n");
14269        }
14270    }
14271    }
14272    }
14273    }
14274    function_tests++;
14275
14276    return(test_ret);
14277}
14278
14279
14280static int
14281test_xmlReadFile(void) {
14282    int test_ret = 0;
14283
14284    int mem_base;
14285    xmlDocPtr ret_val;
14286    const char * filename; /* a file or URL */
14287    int n_filename;
14288    char * encoding; /* the document encoding, or NULL */
14289    int n_encoding;
14290    int options; /* a combination of xmlParserOption */
14291    int n_options;
14292
14293    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14294    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14295    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14296        mem_base = xmlMemBlocks();
14297        filename = gen_filepath(n_filename, 0);
14298        encoding = gen_const_char_ptr(n_encoding, 1);
14299        options = gen_parseroptions(n_options, 2);
14300
14301        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14302        desret_xmlDocPtr(ret_val);
14303        call_tests++;
14304        des_filepath(n_filename, filename, 0);
14305        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14306        des_parseroptions(n_options, options, 2);
14307        xmlResetLastError();
14308        if (mem_base != xmlMemBlocks()) {
14309            printf("Leak of %d blocks found in xmlReadFile",
14310	           xmlMemBlocks() - mem_base);
14311	    test_ret++;
14312            printf(" %d", n_filename);
14313            printf(" %d", n_encoding);
14314            printf(" %d", n_options);
14315            printf("\n");
14316        }
14317    }
14318    }
14319    }
14320    function_tests++;
14321
14322    return(test_ret);
14323}
14324
14325
14326static int
14327test_xmlReadMemory(void) {
14328    int test_ret = 0;
14329
14330    int mem_base;
14331    xmlDocPtr ret_val;
14332    char * buffer; /* a pointer to a char array */
14333    int n_buffer;
14334    int size; /* the size of the array */
14335    int n_size;
14336    const char * URL; /* the base URL to use for the document */
14337    int n_URL;
14338    char * encoding; /* the document encoding, or NULL */
14339    int n_encoding;
14340    int options; /* a combination of xmlParserOption */
14341    int n_options;
14342
14343    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14344    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14345    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14346    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14347    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14348        mem_base = xmlMemBlocks();
14349        buffer = gen_const_char_ptr(n_buffer, 0);
14350        size = gen_int(n_size, 1);
14351        URL = gen_filepath(n_URL, 2);
14352        encoding = gen_const_char_ptr(n_encoding, 3);
14353        options = gen_parseroptions(n_options, 4);
14354
14355        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14356        desret_xmlDocPtr(ret_val);
14357        call_tests++;
14358        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14359        des_int(n_size, size, 1);
14360        des_filepath(n_URL, URL, 2);
14361        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14362        des_parseroptions(n_options, options, 4);
14363        xmlResetLastError();
14364        if (mem_base != xmlMemBlocks()) {
14365            printf("Leak of %d blocks found in xmlReadMemory",
14366	           xmlMemBlocks() - mem_base);
14367	    test_ret++;
14368            printf(" %d", n_buffer);
14369            printf(" %d", n_size);
14370            printf(" %d", n_URL);
14371            printf(" %d", n_encoding);
14372            printf(" %d", n_options);
14373            printf("\n");
14374        }
14375    }
14376    }
14377    }
14378    }
14379    }
14380    function_tests++;
14381
14382    return(test_ret);
14383}
14384
14385
14386static int
14387test_xmlRecoverDoc(void) {
14388    int test_ret = 0;
14389
14390#if defined(LIBXML_SAX1_ENABLED)
14391#ifdef LIBXML_SAX1_ENABLED
14392    int mem_base;
14393    xmlDocPtr ret_val;
14394    xmlChar * cur; /* a pointer to an array of xmlChar */
14395    int n_cur;
14396
14397    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14398        mem_base = xmlMemBlocks();
14399        cur = gen_xmlChar_ptr(n_cur, 0);
14400
14401        ret_val = xmlRecoverDoc(cur);
14402        desret_xmlDocPtr(ret_val);
14403        call_tests++;
14404        des_xmlChar_ptr(n_cur, cur, 0);
14405        xmlResetLastError();
14406        if (mem_base != xmlMemBlocks()) {
14407            printf("Leak of %d blocks found in xmlRecoverDoc",
14408	           xmlMemBlocks() - mem_base);
14409	    test_ret++;
14410            printf(" %d", n_cur);
14411            printf("\n");
14412        }
14413    }
14414    function_tests++;
14415#endif
14416#endif
14417
14418    return(test_ret);
14419}
14420
14421
14422static int
14423test_xmlRecoverFile(void) {
14424    int test_ret = 0;
14425
14426#if defined(LIBXML_SAX1_ENABLED)
14427#ifdef LIBXML_SAX1_ENABLED
14428    int mem_base;
14429    xmlDocPtr ret_val;
14430    const char * filename; /* the filename */
14431    int n_filename;
14432
14433    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14434        mem_base = xmlMemBlocks();
14435        filename = gen_filepath(n_filename, 0);
14436
14437        ret_val = xmlRecoverFile(filename);
14438        desret_xmlDocPtr(ret_val);
14439        call_tests++;
14440        des_filepath(n_filename, filename, 0);
14441        xmlResetLastError();
14442        if (mem_base != xmlMemBlocks()) {
14443            printf("Leak of %d blocks found in xmlRecoverFile",
14444	           xmlMemBlocks() - mem_base);
14445	    test_ret++;
14446            printf(" %d", n_filename);
14447            printf("\n");
14448        }
14449    }
14450    function_tests++;
14451#endif
14452#endif
14453
14454    return(test_ret);
14455}
14456
14457
14458static int
14459test_xmlRecoverMemory(void) {
14460    int test_ret = 0;
14461
14462#if defined(LIBXML_SAX1_ENABLED)
14463#ifdef LIBXML_SAX1_ENABLED
14464    int mem_base;
14465    xmlDocPtr ret_val;
14466    char * buffer; /* an pointer to a char array */
14467    int n_buffer;
14468    int size; /* the size of the array */
14469    int n_size;
14470
14471    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14472    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14473        mem_base = xmlMemBlocks();
14474        buffer = gen_const_char_ptr(n_buffer, 0);
14475        size = gen_int(n_size, 1);
14476
14477        ret_val = xmlRecoverMemory((const char *)buffer, size);
14478        desret_xmlDocPtr(ret_val);
14479        call_tests++;
14480        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14481        des_int(n_size, size, 1);
14482        xmlResetLastError();
14483        if (mem_base != xmlMemBlocks()) {
14484            printf("Leak of %d blocks found in xmlRecoverMemory",
14485	           xmlMemBlocks() - mem_base);
14486	    test_ret++;
14487            printf(" %d", n_buffer);
14488            printf(" %d", n_size);
14489            printf("\n");
14490        }
14491    }
14492    }
14493    function_tests++;
14494#endif
14495#endif
14496
14497    return(test_ret);
14498}
14499
14500
14501static int
14502test_xmlSAXParseDTD(void) {
14503    int test_ret = 0;
14504
14505#if defined(LIBXML_VALID_ENABLED)
14506#ifdef LIBXML_SAX1_ENABLED
14507    int mem_base;
14508    xmlDtdPtr ret_val;
14509    xmlSAXHandlerPtr sax; /* the SAX handler block */
14510    int n_sax;
14511    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14512    int n_ExternalID;
14513    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14514    int n_SystemID;
14515
14516    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14517    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14518    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14519        mem_base = xmlMemBlocks();
14520        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14521        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14522        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14523
14524        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14525        desret_xmlDtdPtr(ret_val);
14526        call_tests++;
14527        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14528        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14529        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14530        xmlResetLastError();
14531        if (mem_base != xmlMemBlocks()) {
14532            printf("Leak of %d blocks found in xmlSAXParseDTD",
14533	           xmlMemBlocks() - mem_base);
14534	    test_ret++;
14535            printf(" %d", n_sax);
14536            printf(" %d", n_ExternalID);
14537            printf(" %d", n_SystemID);
14538            printf("\n");
14539        }
14540    }
14541    }
14542    }
14543    function_tests++;
14544#endif
14545#endif
14546
14547    return(test_ret);
14548}
14549
14550
14551static int
14552test_xmlSAXParseDoc(void) {
14553    int test_ret = 0;
14554
14555#if defined(LIBXML_SAX1_ENABLED)
14556#ifdef LIBXML_SAX1_ENABLED
14557    int mem_base;
14558    xmlDocPtr ret_val;
14559    xmlSAXHandlerPtr sax; /* the SAX handler block */
14560    int n_sax;
14561    xmlChar * cur; /* a pointer to an array of xmlChar */
14562    int n_cur;
14563    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14564    int n_recovery;
14565
14566    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14567    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14568    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14569        mem_base = xmlMemBlocks();
14570        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14571        cur = gen_const_xmlChar_ptr(n_cur, 1);
14572        recovery = gen_int(n_recovery, 2);
14573
14574        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14575        desret_xmlDocPtr(ret_val);
14576        call_tests++;
14577        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14578        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14579        des_int(n_recovery, recovery, 2);
14580        xmlResetLastError();
14581        if (mem_base != xmlMemBlocks()) {
14582            printf("Leak of %d blocks found in xmlSAXParseDoc",
14583	           xmlMemBlocks() - mem_base);
14584	    test_ret++;
14585            printf(" %d", n_sax);
14586            printf(" %d", n_cur);
14587            printf(" %d", n_recovery);
14588            printf("\n");
14589        }
14590    }
14591    }
14592    }
14593    function_tests++;
14594#endif
14595#endif
14596
14597    return(test_ret);
14598}
14599
14600
14601static int
14602test_xmlSAXParseEntity(void) {
14603    int test_ret = 0;
14604
14605#if defined(LIBXML_SAX1_ENABLED)
14606#ifdef LIBXML_SAX1_ENABLED
14607    int mem_base;
14608    xmlDocPtr ret_val;
14609    xmlSAXHandlerPtr sax; /* the SAX handler block */
14610    int n_sax;
14611    const char * filename; /* the filename */
14612    int n_filename;
14613
14614    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14615    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14616        mem_base = xmlMemBlocks();
14617        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14618        filename = gen_filepath(n_filename, 1);
14619
14620        ret_val = xmlSAXParseEntity(sax, filename);
14621        desret_xmlDocPtr(ret_val);
14622        call_tests++;
14623        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14624        des_filepath(n_filename, filename, 1);
14625        xmlResetLastError();
14626        if (mem_base != xmlMemBlocks()) {
14627            printf("Leak of %d blocks found in xmlSAXParseEntity",
14628	           xmlMemBlocks() - mem_base);
14629	    test_ret++;
14630            printf(" %d", n_sax);
14631            printf(" %d", n_filename);
14632            printf("\n");
14633        }
14634    }
14635    }
14636    function_tests++;
14637#endif
14638#endif
14639
14640    return(test_ret);
14641}
14642
14643
14644static int
14645test_xmlSAXParseFile(void) {
14646    int test_ret = 0;
14647
14648#if defined(LIBXML_SAX1_ENABLED)
14649#ifdef LIBXML_SAX1_ENABLED
14650    int mem_base;
14651    xmlDocPtr ret_val;
14652    xmlSAXHandlerPtr sax; /* the SAX handler block */
14653    int n_sax;
14654    const char * filename; /* the filename */
14655    int n_filename;
14656    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14657    int n_recovery;
14658
14659    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14660    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14661    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14662        mem_base = xmlMemBlocks();
14663        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14664        filename = gen_filepath(n_filename, 1);
14665        recovery = gen_int(n_recovery, 2);
14666
14667        ret_val = xmlSAXParseFile(sax, filename, recovery);
14668        desret_xmlDocPtr(ret_val);
14669        call_tests++;
14670        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14671        des_filepath(n_filename, filename, 1);
14672        des_int(n_recovery, recovery, 2);
14673        xmlResetLastError();
14674        if (mem_base != xmlMemBlocks()) {
14675            printf("Leak of %d blocks found in xmlSAXParseFile",
14676	           xmlMemBlocks() - mem_base);
14677	    test_ret++;
14678            printf(" %d", n_sax);
14679            printf(" %d", n_filename);
14680            printf(" %d", n_recovery);
14681            printf("\n");
14682        }
14683    }
14684    }
14685    }
14686    function_tests++;
14687#endif
14688#endif
14689
14690    return(test_ret);
14691}
14692
14693
14694static int
14695test_xmlSAXParseFileWithData(void) {
14696    int test_ret = 0;
14697
14698#if defined(LIBXML_SAX1_ENABLED)
14699#ifdef LIBXML_SAX1_ENABLED
14700    int mem_base;
14701    xmlDocPtr ret_val;
14702    xmlSAXHandlerPtr sax; /* the SAX handler block */
14703    int n_sax;
14704    const char * filename; /* the filename */
14705    int n_filename;
14706    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14707    int n_recovery;
14708    void * data; /* the userdata */
14709    int n_data;
14710
14711    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14712    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14713    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14714    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14715        mem_base = xmlMemBlocks();
14716        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14717        filename = gen_filepath(n_filename, 1);
14718        recovery = gen_int(n_recovery, 2);
14719        data = gen_userdata(n_data, 3);
14720
14721        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14722        desret_xmlDocPtr(ret_val);
14723        call_tests++;
14724        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14725        des_filepath(n_filename, filename, 1);
14726        des_int(n_recovery, recovery, 2);
14727        des_userdata(n_data, data, 3);
14728        xmlResetLastError();
14729        if (mem_base != xmlMemBlocks()) {
14730            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14731	           xmlMemBlocks() - mem_base);
14732	    test_ret++;
14733            printf(" %d", n_sax);
14734            printf(" %d", n_filename);
14735            printf(" %d", n_recovery);
14736            printf(" %d", n_data);
14737            printf("\n");
14738        }
14739    }
14740    }
14741    }
14742    }
14743    function_tests++;
14744#endif
14745#endif
14746
14747    return(test_ret);
14748}
14749
14750
14751static int
14752test_xmlSAXParseMemory(void) {
14753    int test_ret = 0;
14754
14755#if defined(LIBXML_SAX1_ENABLED)
14756#ifdef LIBXML_SAX1_ENABLED
14757    int mem_base;
14758    xmlDocPtr ret_val;
14759    xmlSAXHandlerPtr sax; /* the SAX handler block */
14760    int n_sax;
14761    char * buffer; /* an pointer to a char array */
14762    int n_buffer;
14763    int size; /* the size of the array */
14764    int n_size;
14765    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14766    int n_recovery;
14767
14768    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14769    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14770    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14771    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14772        mem_base = xmlMemBlocks();
14773        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14774        buffer = gen_const_char_ptr(n_buffer, 1);
14775        size = gen_int(n_size, 2);
14776        recovery = gen_int(n_recovery, 3);
14777
14778        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14779        desret_xmlDocPtr(ret_val);
14780        call_tests++;
14781        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14782        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14783        des_int(n_size, size, 2);
14784        des_int(n_recovery, recovery, 3);
14785        xmlResetLastError();
14786        if (mem_base != xmlMemBlocks()) {
14787            printf("Leak of %d blocks found in xmlSAXParseMemory",
14788	           xmlMemBlocks() - mem_base);
14789	    test_ret++;
14790            printf(" %d", n_sax);
14791            printf(" %d", n_buffer);
14792            printf(" %d", n_size);
14793            printf(" %d", n_recovery);
14794            printf("\n");
14795        }
14796    }
14797    }
14798    }
14799    }
14800    function_tests++;
14801#endif
14802#endif
14803
14804    return(test_ret);
14805}
14806
14807
14808static int
14809test_xmlSAXParseMemoryWithData(void) {
14810    int test_ret = 0;
14811
14812#if defined(LIBXML_SAX1_ENABLED)
14813#ifdef LIBXML_SAX1_ENABLED
14814    int mem_base;
14815    xmlDocPtr ret_val;
14816    xmlSAXHandlerPtr sax; /* the SAX handler block */
14817    int n_sax;
14818    char * buffer; /* an pointer to a char array */
14819    int n_buffer;
14820    int size; /* the size of the array */
14821    int n_size;
14822    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14823    int n_recovery;
14824    void * data; /* the userdata */
14825    int n_data;
14826
14827    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14828    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14829    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14830    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14831    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14832        mem_base = xmlMemBlocks();
14833        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14834        buffer = gen_const_char_ptr(n_buffer, 1);
14835        size = gen_int(n_size, 2);
14836        recovery = gen_int(n_recovery, 3);
14837        data = gen_userdata(n_data, 4);
14838
14839        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
14840        desret_xmlDocPtr(ret_val);
14841        call_tests++;
14842        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14843        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14844        des_int(n_size, size, 2);
14845        des_int(n_recovery, recovery, 3);
14846        des_userdata(n_data, data, 4);
14847        xmlResetLastError();
14848        if (mem_base != xmlMemBlocks()) {
14849            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14850	           xmlMemBlocks() - mem_base);
14851	    test_ret++;
14852            printf(" %d", n_sax);
14853            printf(" %d", n_buffer);
14854            printf(" %d", n_size);
14855            printf(" %d", n_recovery);
14856            printf(" %d", n_data);
14857            printf("\n");
14858        }
14859    }
14860    }
14861    }
14862    }
14863    }
14864    function_tests++;
14865#endif
14866#endif
14867
14868    return(test_ret);
14869}
14870
14871
14872static int
14873test_xmlSAXUserParseFile(void) {
14874    int test_ret = 0;
14875
14876#if defined(LIBXML_SAX1_ENABLED)
14877#ifdef LIBXML_SAX1_ENABLED
14878    int mem_base;
14879    int ret_val;
14880    xmlSAXHandlerPtr sax; /* a SAX handler */
14881    int n_sax;
14882    void * user_data; /* The user data returned on SAX callbacks */
14883    int n_user_data;
14884    const char * filename; /* a file name */
14885    int n_filename;
14886
14887    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14888    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14889    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14890        mem_base = xmlMemBlocks();
14891        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14892        user_data = gen_userdata(n_user_data, 1);
14893        filename = gen_filepath(n_filename, 2);
14894
14895#ifdef LIBXML_SAX1_ENABLED
14896        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14897#endif
14898
14899
14900        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
14901        desret_int(ret_val);
14902        call_tests++;
14903        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14904        des_userdata(n_user_data, user_data, 1);
14905        des_filepath(n_filename, filename, 2);
14906        xmlResetLastError();
14907        if (mem_base != xmlMemBlocks()) {
14908            printf("Leak of %d blocks found in xmlSAXUserParseFile",
14909	           xmlMemBlocks() - mem_base);
14910	    test_ret++;
14911            printf(" %d", n_sax);
14912            printf(" %d", n_user_data);
14913            printf(" %d", n_filename);
14914            printf("\n");
14915        }
14916    }
14917    }
14918    }
14919    function_tests++;
14920#endif
14921#endif
14922
14923    return(test_ret);
14924}
14925
14926
14927static int
14928test_xmlSAXUserParseMemory(void) {
14929    int test_ret = 0;
14930
14931#if defined(LIBXML_SAX1_ENABLED)
14932#ifdef LIBXML_SAX1_ENABLED
14933    int mem_base;
14934    int ret_val;
14935    xmlSAXHandlerPtr sax; /* a SAX handler */
14936    int n_sax;
14937    void * user_data; /* The user data returned on SAX callbacks */
14938    int n_user_data;
14939    char * buffer; /* an in-memory XML document input */
14940    int n_buffer;
14941    int size; /* the length of the XML document in bytes */
14942    int n_size;
14943
14944    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14945    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14946    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14947    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14948        mem_base = xmlMemBlocks();
14949        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14950        user_data = gen_userdata(n_user_data, 1);
14951        buffer = gen_const_char_ptr(n_buffer, 2);
14952        size = gen_int(n_size, 3);
14953
14954#ifdef LIBXML_SAX1_ENABLED
14955        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14956#endif
14957
14958
14959        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
14960        desret_int(ret_val);
14961        call_tests++;
14962        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14963        des_userdata(n_user_data, user_data, 1);
14964        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
14965        des_int(n_size, size, 3);
14966        xmlResetLastError();
14967        if (mem_base != xmlMemBlocks()) {
14968            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
14969	           xmlMemBlocks() - mem_base);
14970	    test_ret++;
14971            printf(" %d", n_sax);
14972            printf(" %d", n_user_data);
14973            printf(" %d", n_buffer);
14974            printf(" %d", n_size);
14975            printf("\n");
14976        }
14977    }
14978    }
14979    }
14980    }
14981    function_tests++;
14982#endif
14983#endif
14984
14985    return(test_ret);
14986}
14987
14988
14989static int
14990test_xmlSetExternalEntityLoader(void) {
14991    int test_ret = 0;
14992
14993
14994    /* missing type support */
14995    return(test_ret);
14996}
14997
14998
14999static int
15000test_xmlSetFeature(void) {
15001    int test_ret = 0;
15002
15003#if defined(LIBXML_LEGACY_ENABLED)
15004#ifdef LIBXML_LEGACY_ENABLED
15005    int mem_base;
15006    int ret_val;
15007    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15008    int n_ctxt;
15009    char * name; /* the feature name */
15010    int n_name;
15011    void * value; /* pointer to the location of the new value */
15012    int n_value;
15013
15014    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15015    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15016    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15017        mem_base = xmlMemBlocks();
15018        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15019        name = gen_const_char_ptr(n_name, 1);
15020        value = gen_void_ptr(n_value, 2);
15021
15022        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15023        desret_int(ret_val);
15024        call_tests++;
15025        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15026        des_const_char_ptr(n_name, (const char *)name, 1);
15027        des_void_ptr(n_value, value, 2);
15028        xmlResetLastError();
15029        if (mem_base != xmlMemBlocks()) {
15030            printf("Leak of %d blocks found in xmlSetFeature",
15031	           xmlMemBlocks() - mem_base);
15032	    test_ret++;
15033            printf(" %d", n_ctxt);
15034            printf(" %d", n_name);
15035            printf(" %d", n_value);
15036            printf("\n");
15037        }
15038    }
15039    }
15040    }
15041    function_tests++;
15042#endif
15043#endif
15044
15045    return(test_ret);
15046}
15047
15048
15049static int
15050test_xmlSetupParserForBuffer(void) {
15051    int test_ret = 0;
15052
15053#if defined(LIBXML_SAX1_ENABLED)
15054#ifdef LIBXML_SAX1_ENABLED
15055    int mem_base;
15056    xmlParserCtxtPtr ctxt; /* an XML parser context */
15057    int n_ctxt;
15058    xmlChar * buffer; /* a xmlChar * buffer */
15059    int n_buffer;
15060    const char * filename; /* a file name */
15061    int n_filename;
15062
15063    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15064    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15065    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15066        mem_base = xmlMemBlocks();
15067        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15068        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15069        filename = gen_filepath(n_filename, 2);
15070
15071        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15072        call_tests++;
15073        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15074        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15075        des_filepath(n_filename, filename, 2);
15076        xmlResetLastError();
15077        if (mem_base != xmlMemBlocks()) {
15078            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15079	           xmlMemBlocks() - mem_base);
15080	    test_ret++;
15081            printf(" %d", n_ctxt);
15082            printf(" %d", n_buffer);
15083            printf(" %d", n_filename);
15084            printf("\n");
15085        }
15086    }
15087    }
15088    }
15089    function_tests++;
15090#endif
15091#endif
15092
15093    return(test_ret);
15094}
15095
15096
15097static int
15098test_xmlStopParser(void) {
15099    int test_ret = 0;
15100
15101#ifdef LIBXML_PUSH_ENABLED
15102    int mem_base;
15103    xmlParserCtxtPtr ctxt; /* an XML parser context */
15104    int n_ctxt;
15105
15106    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15107        mem_base = xmlMemBlocks();
15108        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15109
15110        xmlStopParser(ctxt);
15111        call_tests++;
15112        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15113        xmlResetLastError();
15114        if (mem_base != xmlMemBlocks()) {
15115            printf("Leak of %d blocks found in xmlStopParser",
15116	           xmlMemBlocks() - mem_base);
15117	    test_ret++;
15118            printf(" %d", n_ctxt);
15119            printf("\n");
15120        }
15121    }
15122    function_tests++;
15123#endif
15124
15125    return(test_ret);
15126}
15127
15128
15129static int
15130test_xmlSubstituteEntitiesDefault(void) {
15131    int test_ret = 0;
15132
15133    int mem_base;
15134    int ret_val;
15135    int val; /* int 0 or 1 */
15136    int n_val;
15137
15138    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15139        mem_base = xmlMemBlocks();
15140        val = gen_int(n_val, 0);
15141
15142        ret_val = xmlSubstituteEntitiesDefault(val);
15143        desret_int(ret_val);
15144        call_tests++;
15145        des_int(n_val, val, 0);
15146        xmlResetLastError();
15147        if (mem_base != xmlMemBlocks()) {
15148            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15149	           xmlMemBlocks() - mem_base);
15150	    test_ret++;
15151            printf(" %d", n_val);
15152            printf("\n");
15153        }
15154    }
15155    function_tests++;
15156
15157    return(test_ret);
15158}
15159
15160static int
15161test_parser(void) {
15162    int test_ret = 0;
15163
15164    if (quiet == 0) printf("Testing parser : 60 of 69 functions ...\n");
15165    test_ret += test_xmlByteConsumed();
15166    test_ret += test_xmlClearNodeInfoSeq();
15167    test_ret += test_xmlClearParserCtxt();
15168    test_ret += test_xmlCreateDocParserCtxt();
15169    test_ret += test_xmlCreatePushParserCtxt();
15170    test_ret += test_xmlCtxtReadDoc();
15171    test_ret += test_xmlCtxtReadFile();
15172    test_ret += test_xmlCtxtReadMemory();
15173    test_ret += test_xmlCtxtReset();
15174    test_ret += test_xmlCtxtResetPush();
15175    test_ret += test_xmlCtxtUseOptions();
15176    test_ret += test_xmlGetExternalEntityLoader();
15177    test_ret += test_xmlGetFeature();
15178    test_ret += test_xmlGetFeaturesList();
15179    test_ret += test_xmlIOParseDTD();
15180    test_ret += test_xmlInitNodeInfoSeq();
15181    test_ret += test_xmlInitParser();
15182    test_ret += test_xmlInitParserCtxt();
15183    test_ret += test_xmlKeepBlanksDefault();
15184    test_ret += test_xmlLineNumbersDefault();
15185    test_ret += test_xmlLoadExternalEntity();
15186    test_ret += test_xmlNewIOInputStream();
15187    test_ret += test_xmlNewParserCtxt();
15188    test_ret += test_xmlParseBalancedChunkMemory();
15189    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15190    test_ret += test_xmlParseChunk();
15191    test_ret += test_xmlParseCtxtExternalEntity();
15192    test_ret += test_xmlParseDTD();
15193    test_ret += test_xmlParseDoc();
15194    test_ret += test_xmlParseDocument();
15195    test_ret += test_xmlParseEntity();
15196    test_ret += test_xmlParseExtParsedEnt();
15197    test_ret += test_xmlParseExternalEntity();
15198    test_ret += test_xmlParseFile();
15199    test_ret += test_xmlParseInNodeContext();
15200    test_ret += test_xmlParseMemory();
15201    test_ret += test_xmlParserAddNodeInfo();
15202    test_ret += test_xmlParserFindNodeInfo();
15203    test_ret += test_xmlParserFindNodeInfoIndex();
15204    test_ret += test_xmlParserInputGrow();
15205    test_ret += test_xmlParserInputRead();
15206    test_ret += test_xmlPedanticParserDefault();
15207    test_ret += test_xmlReadDoc();
15208    test_ret += test_xmlReadFile();
15209    test_ret += test_xmlReadMemory();
15210    test_ret += test_xmlRecoverDoc();
15211    test_ret += test_xmlRecoverFile();
15212    test_ret += test_xmlRecoverMemory();
15213    test_ret += test_xmlSAXParseDTD();
15214    test_ret += test_xmlSAXParseDoc();
15215    test_ret += test_xmlSAXParseEntity();
15216    test_ret += test_xmlSAXParseFile();
15217    test_ret += test_xmlSAXParseFileWithData();
15218    test_ret += test_xmlSAXParseMemory();
15219    test_ret += test_xmlSAXParseMemoryWithData();
15220    test_ret += test_xmlSAXUserParseFile();
15221    test_ret += test_xmlSAXUserParseMemory();
15222    test_ret += test_xmlSetExternalEntityLoader();
15223    test_ret += test_xmlSetFeature();
15224    test_ret += test_xmlSetupParserForBuffer();
15225    test_ret += test_xmlStopParser();
15226    test_ret += test_xmlSubstituteEntitiesDefault();
15227
15228    if (test_ret != 0)
15229	printf("Module parser: %d errors\n", test_ret);
15230    return(test_ret);
15231}
15232
15233static int
15234test_htmlCreateFileParserCtxt(void) {
15235    int test_ret = 0;
15236
15237#if defined(LIBXML_HTML_ENABLED)
15238    int mem_base;
15239    htmlParserCtxtPtr ret_val;
15240    const char * filename; /* the filename */
15241    int n_filename;
15242    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15243    int n_encoding;
15244
15245    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15246    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15247        mem_base = xmlMemBlocks();
15248        filename = gen_fileoutput(n_filename, 0);
15249        encoding = gen_const_char_ptr(n_encoding, 1);
15250
15251        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15252        desret_htmlParserCtxtPtr(ret_val);
15253        call_tests++;
15254        des_fileoutput(n_filename, filename, 0);
15255        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15256        xmlResetLastError();
15257        if (mem_base != xmlMemBlocks()) {
15258            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15259	           xmlMemBlocks() - mem_base);
15260	    test_ret++;
15261            printf(" %d", n_filename);
15262            printf(" %d", n_encoding);
15263            printf("\n");
15264        }
15265    }
15266    }
15267    function_tests++;
15268#endif
15269
15270    return(test_ret);
15271}
15272
15273
15274static int
15275test_htmlInitAutoClose(void) {
15276    int test_ret = 0;
15277
15278#if defined(LIBXML_HTML_ENABLED)
15279    int mem_base;
15280
15281        mem_base = xmlMemBlocks();
15282
15283        htmlInitAutoClose();
15284        call_tests++;
15285        xmlResetLastError();
15286        if (mem_base != xmlMemBlocks()) {
15287            printf("Leak of %d blocks found in htmlInitAutoClose",
15288	           xmlMemBlocks() - mem_base);
15289	    test_ret++;
15290            printf("\n");
15291        }
15292    function_tests++;
15293#endif
15294
15295    return(test_ret);
15296}
15297
15298
15299static int
15300test_inputPop(void) {
15301    int test_ret = 0;
15302
15303    int mem_base;
15304    xmlParserInputPtr ret_val;
15305    xmlParserCtxtPtr ctxt; /* an XML parser context */
15306    int n_ctxt;
15307
15308    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15309        mem_base = xmlMemBlocks();
15310        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15311
15312        ret_val = inputPop(ctxt);
15313        desret_xmlParserInputPtr(ret_val);
15314        call_tests++;
15315        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15316        xmlResetLastError();
15317        if (mem_base != xmlMemBlocks()) {
15318            printf("Leak of %d blocks found in inputPop",
15319	           xmlMemBlocks() - mem_base);
15320	    test_ret++;
15321            printf(" %d", n_ctxt);
15322            printf("\n");
15323        }
15324    }
15325    function_tests++;
15326
15327    return(test_ret);
15328}
15329
15330
15331static int
15332test_inputPush(void) {
15333    int test_ret = 0;
15334
15335    int mem_base;
15336    int ret_val;
15337    xmlParserCtxtPtr ctxt; /* an XML parser context */
15338    int n_ctxt;
15339    xmlParserInputPtr value; /* the parser input */
15340    int n_value;
15341
15342    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15343    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15344        mem_base = xmlMemBlocks();
15345        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15346        value = gen_xmlParserInputPtr(n_value, 1);
15347
15348        ret_val = inputPush(ctxt, value);
15349        desret_int(ret_val);
15350        call_tests++;
15351        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15352        des_xmlParserInputPtr(n_value, value, 1);
15353        xmlResetLastError();
15354        if (mem_base != xmlMemBlocks()) {
15355            printf("Leak of %d blocks found in inputPush",
15356	           xmlMemBlocks() - mem_base);
15357	    test_ret++;
15358            printf(" %d", n_ctxt);
15359            printf(" %d", n_value);
15360            printf("\n");
15361        }
15362    }
15363    }
15364    function_tests++;
15365
15366    return(test_ret);
15367}
15368
15369
15370static int
15371test_namePop(void) {
15372    int test_ret = 0;
15373
15374    int mem_base;
15375    const xmlChar * ret_val;
15376    xmlParserCtxtPtr ctxt; /* an XML parser context */
15377    int n_ctxt;
15378
15379    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15380        mem_base = xmlMemBlocks();
15381        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15382
15383        ret_val = namePop(ctxt);
15384        desret_const_xmlChar_ptr(ret_val);
15385        call_tests++;
15386        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15387        xmlResetLastError();
15388        if (mem_base != xmlMemBlocks()) {
15389            printf("Leak of %d blocks found in namePop",
15390	           xmlMemBlocks() - mem_base);
15391	    test_ret++;
15392            printf(" %d", n_ctxt);
15393            printf("\n");
15394        }
15395    }
15396    function_tests++;
15397
15398    return(test_ret);
15399}
15400
15401
15402static int
15403test_namePush(void) {
15404    int test_ret = 0;
15405
15406    int mem_base;
15407    int ret_val;
15408    xmlParserCtxtPtr ctxt; /* an XML parser context */
15409    int n_ctxt;
15410    xmlChar * value; /* the element name */
15411    int n_value;
15412
15413    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15414    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15415        mem_base = xmlMemBlocks();
15416        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15417        value = gen_const_xmlChar_ptr(n_value, 1);
15418
15419        ret_val = namePush(ctxt, (const xmlChar *)value);
15420        desret_int(ret_val);
15421        call_tests++;
15422        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15423        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15424        xmlResetLastError();
15425        if (mem_base != xmlMemBlocks()) {
15426            printf("Leak of %d blocks found in namePush",
15427	           xmlMemBlocks() - mem_base);
15428	    test_ret++;
15429            printf(" %d", n_ctxt);
15430            printf(" %d", n_value);
15431            printf("\n");
15432        }
15433    }
15434    }
15435    function_tests++;
15436
15437    return(test_ret);
15438}
15439
15440
15441static int
15442test_nodePop(void) {
15443    int test_ret = 0;
15444
15445    int mem_base;
15446    xmlNodePtr ret_val;
15447    xmlParserCtxtPtr ctxt; /* an XML parser context */
15448    int n_ctxt;
15449
15450    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15451        mem_base = xmlMemBlocks();
15452        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15453
15454        ret_val = nodePop(ctxt);
15455        desret_xmlNodePtr(ret_val);
15456        call_tests++;
15457        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15458        xmlResetLastError();
15459        if (mem_base != xmlMemBlocks()) {
15460            printf("Leak of %d blocks found in nodePop",
15461	           xmlMemBlocks() - mem_base);
15462	    test_ret++;
15463            printf(" %d", n_ctxt);
15464            printf("\n");
15465        }
15466    }
15467    function_tests++;
15468
15469    return(test_ret);
15470}
15471
15472
15473static int
15474test_nodePush(void) {
15475    int test_ret = 0;
15476
15477    int mem_base;
15478    int ret_val;
15479    xmlParserCtxtPtr ctxt; /* an XML parser context */
15480    int n_ctxt;
15481    xmlNodePtr value; /* the element node */
15482    int n_value;
15483
15484    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15485    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15486        mem_base = xmlMemBlocks();
15487        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15488        value = gen_xmlNodePtr(n_value, 1);
15489
15490        ret_val = nodePush(ctxt, value);
15491        desret_int(ret_val);
15492        call_tests++;
15493        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15494        des_xmlNodePtr(n_value, value, 1);
15495        xmlResetLastError();
15496        if (mem_base != xmlMemBlocks()) {
15497            printf("Leak of %d blocks found in nodePush",
15498	           xmlMemBlocks() - mem_base);
15499	    test_ret++;
15500            printf(" %d", n_ctxt);
15501            printf(" %d", n_value);
15502            printf("\n");
15503        }
15504    }
15505    }
15506    function_tests++;
15507
15508    return(test_ret);
15509}
15510
15511
15512static int
15513test_xmlCheckLanguageID(void) {
15514    int test_ret = 0;
15515
15516    int mem_base;
15517    int ret_val;
15518    xmlChar * lang; /* pointer to the string value */
15519    int n_lang;
15520
15521    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15522        mem_base = xmlMemBlocks();
15523        lang = gen_const_xmlChar_ptr(n_lang, 0);
15524
15525        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15526        desret_int(ret_val);
15527        call_tests++;
15528        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15529        xmlResetLastError();
15530        if (mem_base != xmlMemBlocks()) {
15531            printf("Leak of %d blocks found in xmlCheckLanguageID",
15532	           xmlMemBlocks() - mem_base);
15533	    test_ret++;
15534            printf(" %d", n_lang);
15535            printf("\n");
15536        }
15537    }
15538    function_tests++;
15539
15540    return(test_ret);
15541}
15542
15543
15544static int
15545test_xmlCopyChar(void) {
15546    int test_ret = 0;
15547
15548    int mem_base;
15549    int ret_val;
15550    int len; /* Ignored, compatibility */
15551    int n_len;
15552    xmlChar * out; /* pointer to an array of xmlChar */
15553    int n_out;
15554    int val; /* the char value */
15555    int n_val;
15556
15557    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15558    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15559    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15560        mem_base = xmlMemBlocks();
15561        len = gen_int(n_len, 0);
15562        out = gen_xmlChar_ptr(n_out, 1);
15563        val = gen_int(n_val, 2);
15564
15565        ret_val = xmlCopyChar(len, out, val);
15566        desret_int(ret_val);
15567        call_tests++;
15568        des_int(n_len, len, 0);
15569        des_xmlChar_ptr(n_out, out, 1);
15570        des_int(n_val, val, 2);
15571        xmlResetLastError();
15572        if (mem_base != xmlMemBlocks()) {
15573            printf("Leak of %d blocks found in xmlCopyChar",
15574	           xmlMemBlocks() - mem_base);
15575	    test_ret++;
15576            printf(" %d", n_len);
15577            printf(" %d", n_out);
15578            printf(" %d", n_val);
15579            printf("\n");
15580        }
15581    }
15582    }
15583    }
15584    function_tests++;
15585
15586    return(test_ret);
15587}
15588
15589
15590static int
15591test_xmlCopyCharMultiByte(void) {
15592    int test_ret = 0;
15593
15594    int mem_base;
15595    int ret_val;
15596    xmlChar * out; /* pointer to an array of xmlChar */
15597    int n_out;
15598    int val; /* the char value */
15599    int n_val;
15600
15601    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15602    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15603        mem_base = xmlMemBlocks();
15604        out = gen_xmlChar_ptr(n_out, 0);
15605        val = gen_int(n_val, 1);
15606
15607        ret_val = xmlCopyCharMultiByte(out, val);
15608        desret_int(ret_val);
15609        call_tests++;
15610        des_xmlChar_ptr(n_out, out, 0);
15611        des_int(n_val, val, 1);
15612        xmlResetLastError();
15613        if (mem_base != xmlMemBlocks()) {
15614            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15615	           xmlMemBlocks() - mem_base);
15616	    test_ret++;
15617            printf(" %d", n_out);
15618            printf(" %d", n_val);
15619            printf("\n");
15620        }
15621    }
15622    }
15623    function_tests++;
15624
15625    return(test_ret);
15626}
15627
15628
15629static int
15630test_xmlCreateEntityParserCtxt(void) {
15631    int test_ret = 0;
15632
15633    int mem_base;
15634    xmlParserCtxtPtr ret_val;
15635    xmlChar * URL; /* the entity URL */
15636    int n_URL;
15637    xmlChar * ID; /* the entity PUBLIC ID */
15638    int n_ID;
15639    xmlChar * base; /* a possible base for the target URI */
15640    int n_base;
15641
15642    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15643    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15644    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15645        mem_base = xmlMemBlocks();
15646        URL = gen_const_xmlChar_ptr(n_URL, 0);
15647        ID = gen_const_xmlChar_ptr(n_ID, 1);
15648        base = gen_const_xmlChar_ptr(n_base, 2);
15649
15650        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15651        desret_xmlParserCtxtPtr(ret_val);
15652        call_tests++;
15653        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15654        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15655        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15656        xmlResetLastError();
15657        if (mem_base != xmlMemBlocks()) {
15658            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15659	           xmlMemBlocks() - mem_base);
15660	    test_ret++;
15661            printf(" %d", n_URL);
15662            printf(" %d", n_ID);
15663            printf(" %d", n_base);
15664            printf("\n");
15665        }
15666    }
15667    }
15668    }
15669    function_tests++;
15670
15671    return(test_ret);
15672}
15673
15674
15675static int
15676test_xmlCreateFileParserCtxt(void) {
15677    int test_ret = 0;
15678
15679    int mem_base;
15680    xmlParserCtxtPtr ret_val;
15681    const char * filename; /* the filename */
15682    int n_filename;
15683
15684    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15685        mem_base = xmlMemBlocks();
15686        filename = gen_fileoutput(n_filename, 0);
15687
15688        ret_val = xmlCreateFileParserCtxt(filename);
15689        desret_xmlParserCtxtPtr(ret_val);
15690        call_tests++;
15691        des_fileoutput(n_filename, filename, 0);
15692        xmlResetLastError();
15693        if (mem_base != xmlMemBlocks()) {
15694            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15695	           xmlMemBlocks() - mem_base);
15696	    test_ret++;
15697            printf(" %d", n_filename);
15698            printf("\n");
15699        }
15700    }
15701    function_tests++;
15702
15703    return(test_ret);
15704}
15705
15706
15707static int
15708test_xmlCreateMemoryParserCtxt(void) {
15709    int test_ret = 0;
15710
15711    int mem_base;
15712    xmlParserCtxtPtr ret_val;
15713    char * buffer; /* a pointer to a char array */
15714    int n_buffer;
15715    int size; /* the size of the array */
15716    int n_size;
15717
15718    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15719    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15720        mem_base = xmlMemBlocks();
15721        buffer = gen_const_char_ptr(n_buffer, 0);
15722        size = gen_int(n_size, 1);
15723
15724        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15725        desret_xmlParserCtxtPtr(ret_val);
15726        call_tests++;
15727        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15728        des_int(n_size, size, 1);
15729        xmlResetLastError();
15730        if (mem_base != xmlMemBlocks()) {
15731            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15732	           xmlMemBlocks() - mem_base);
15733	    test_ret++;
15734            printf(" %d", n_buffer);
15735            printf(" %d", n_size);
15736            printf("\n");
15737        }
15738    }
15739    }
15740    function_tests++;
15741
15742    return(test_ret);
15743}
15744
15745
15746static int
15747test_xmlCreateURLParserCtxt(void) {
15748    int test_ret = 0;
15749
15750    int mem_base;
15751    xmlParserCtxtPtr ret_val;
15752    const char * filename; /* the filename or URL */
15753    int n_filename;
15754    int options; /* a combination of xmlParserOption */
15755    int n_options;
15756
15757    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15758    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15759        mem_base = xmlMemBlocks();
15760        filename = gen_fileoutput(n_filename, 0);
15761        options = gen_int(n_options, 1);
15762
15763        ret_val = xmlCreateURLParserCtxt(filename, options);
15764        desret_xmlParserCtxtPtr(ret_val);
15765        call_tests++;
15766        des_fileoutput(n_filename, filename, 0);
15767        des_int(n_options, options, 1);
15768        xmlResetLastError();
15769        if (mem_base != xmlMemBlocks()) {
15770            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15771	           xmlMemBlocks() - mem_base);
15772	    test_ret++;
15773            printf(" %d", n_filename);
15774            printf(" %d", n_options);
15775            printf("\n");
15776        }
15777    }
15778    }
15779    function_tests++;
15780
15781    return(test_ret);
15782}
15783
15784
15785static int
15786test_xmlCurrentChar(void) {
15787    int test_ret = 0;
15788
15789    int mem_base;
15790    int ret_val;
15791    xmlParserCtxtPtr ctxt; /* the XML parser context */
15792    int n_ctxt;
15793    int * len; /* pointer to the length of the char read */
15794    int n_len;
15795
15796    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15797    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15798        mem_base = xmlMemBlocks();
15799        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15800        len = gen_int_ptr(n_len, 1);
15801
15802        ret_val = xmlCurrentChar(ctxt, len);
15803        desret_int(ret_val);
15804        call_tests++;
15805        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15806        des_int_ptr(n_len, len, 1);
15807        xmlResetLastError();
15808        if (mem_base != xmlMemBlocks()) {
15809            printf("Leak of %d blocks found in xmlCurrentChar",
15810	           xmlMemBlocks() - mem_base);
15811	    test_ret++;
15812            printf(" %d", n_ctxt);
15813            printf(" %d", n_len);
15814            printf("\n");
15815        }
15816    }
15817    }
15818    function_tests++;
15819
15820    return(test_ret);
15821}
15822
15823
15824static int
15825test_xmlErrMemory(void) {
15826    int test_ret = 0;
15827
15828    int mem_base;
15829    xmlParserCtxtPtr ctxt; /* an XML parser context */
15830    int n_ctxt;
15831    char * extra; /* extra informations */
15832    int n_extra;
15833
15834    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15835    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15836        mem_base = xmlMemBlocks();
15837        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15838        extra = gen_const_char_ptr(n_extra, 1);
15839
15840        xmlErrMemory(ctxt, (const char *)extra);
15841        call_tests++;
15842        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15843        des_const_char_ptr(n_extra, (const char *)extra, 1);
15844        xmlResetLastError();
15845        if (mem_base != xmlMemBlocks()) {
15846            printf("Leak of %d blocks found in xmlErrMemory",
15847	           xmlMemBlocks() - mem_base);
15848	    test_ret++;
15849            printf(" %d", n_ctxt);
15850            printf(" %d", n_extra);
15851            printf("\n");
15852        }
15853    }
15854    }
15855    function_tests++;
15856
15857    return(test_ret);
15858}
15859
15860
15861static int
15862test_xmlIsLetter(void) {
15863    int test_ret = 0;
15864
15865    int mem_base;
15866    int ret_val;
15867    int c; /* an unicode character (int) */
15868    int n_c;
15869
15870    for (n_c = 0;n_c < gen_nb_int;n_c++) {
15871        mem_base = xmlMemBlocks();
15872        c = gen_int(n_c, 0);
15873
15874        ret_val = xmlIsLetter(c);
15875        desret_int(ret_val);
15876        call_tests++;
15877        des_int(n_c, c, 0);
15878        xmlResetLastError();
15879        if (mem_base != xmlMemBlocks()) {
15880            printf("Leak of %d blocks found in xmlIsLetter",
15881	           xmlMemBlocks() - mem_base);
15882	    test_ret++;
15883            printf(" %d", n_c);
15884            printf("\n");
15885        }
15886    }
15887    function_tests++;
15888
15889    return(test_ret);
15890}
15891
15892
15893static int
15894test_xmlNewEntityInputStream(void) {
15895    int test_ret = 0;
15896
15897    int mem_base;
15898    xmlParserInputPtr ret_val;
15899    xmlParserCtxtPtr ctxt; /* an XML parser context */
15900    int n_ctxt;
15901    xmlEntityPtr entity; /* an Entity pointer */
15902    int n_entity;
15903
15904    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15905    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
15906        mem_base = xmlMemBlocks();
15907        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15908        entity = gen_xmlEntityPtr(n_entity, 1);
15909
15910        ret_val = xmlNewEntityInputStream(ctxt, entity);
15911        desret_xmlParserInputPtr(ret_val);
15912        call_tests++;
15913        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15914        des_xmlEntityPtr(n_entity, entity, 1);
15915        xmlResetLastError();
15916        if (mem_base != xmlMemBlocks()) {
15917            printf("Leak of %d blocks found in xmlNewEntityInputStream",
15918	           xmlMemBlocks() - mem_base);
15919	    test_ret++;
15920            printf(" %d", n_ctxt);
15921            printf(" %d", n_entity);
15922            printf("\n");
15923        }
15924    }
15925    }
15926    function_tests++;
15927
15928    return(test_ret);
15929}
15930
15931
15932static int
15933test_xmlNewInputFromFile(void) {
15934    int test_ret = 0;
15935
15936    int mem_base;
15937    xmlParserInputPtr ret_val;
15938    xmlParserCtxtPtr ctxt; /* an XML parser context */
15939    int n_ctxt;
15940    const char * filename; /* the filename to use as entity */
15941    int n_filename;
15942
15943    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15944    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15945        mem_base = xmlMemBlocks();
15946        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15947        filename = gen_filepath(n_filename, 1);
15948
15949        ret_val = xmlNewInputFromFile(ctxt, filename);
15950        desret_xmlParserInputPtr(ret_val);
15951        call_tests++;
15952        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15953        des_filepath(n_filename, filename, 1);
15954        xmlResetLastError();
15955        if (mem_base != xmlMemBlocks()) {
15956            printf("Leak of %d blocks found in xmlNewInputFromFile",
15957	           xmlMemBlocks() - mem_base);
15958	    test_ret++;
15959            printf(" %d", n_ctxt);
15960            printf(" %d", n_filename);
15961            printf("\n");
15962        }
15963    }
15964    }
15965    function_tests++;
15966
15967    return(test_ret);
15968}
15969
15970
15971static int
15972test_xmlNewInputStream(void) {
15973    int test_ret = 0;
15974
15975    int mem_base;
15976    xmlParserInputPtr ret_val;
15977    xmlParserCtxtPtr ctxt; /* an XML parser context */
15978    int n_ctxt;
15979
15980    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15981        mem_base = xmlMemBlocks();
15982        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15983
15984        ret_val = xmlNewInputStream(ctxt);
15985        desret_xmlParserInputPtr(ret_val);
15986        call_tests++;
15987        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15988        xmlResetLastError();
15989        if (mem_base != xmlMemBlocks()) {
15990            printf("Leak of %d blocks found in xmlNewInputStream",
15991	           xmlMemBlocks() - mem_base);
15992	    test_ret++;
15993            printf(" %d", n_ctxt);
15994            printf("\n");
15995        }
15996    }
15997    function_tests++;
15998
15999    return(test_ret);
16000}
16001
16002
16003static int
16004test_xmlNewStringInputStream(void) {
16005    int test_ret = 0;
16006
16007    int mem_base;
16008    xmlParserInputPtr ret_val;
16009    xmlParserCtxtPtr ctxt; /* an XML parser context */
16010    int n_ctxt;
16011    xmlChar * buffer; /* an memory buffer */
16012    int n_buffer;
16013
16014    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16015    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16016        mem_base = xmlMemBlocks();
16017        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16018        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16019
16020        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16021        desret_xmlParserInputPtr(ret_val);
16022        call_tests++;
16023        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16024        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16025        xmlResetLastError();
16026        if (mem_base != xmlMemBlocks()) {
16027            printf("Leak of %d blocks found in xmlNewStringInputStream",
16028	           xmlMemBlocks() - mem_base);
16029	    test_ret++;
16030            printf(" %d", n_ctxt);
16031            printf(" %d", n_buffer);
16032            printf("\n");
16033        }
16034    }
16035    }
16036    function_tests++;
16037
16038    return(test_ret);
16039}
16040
16041
16042static int
16043test_xmlNextChar(void) {
16044    int test_ret = 0;
16045
16046    int mem_base;
16047    xmlParserCtxtPtr ctxt; /* the XML parser context */
16048    int n_ctxt;
16049
16050    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16051        mem_base = xmlMemBlocks();
16052        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16053
16054        xmlNextChar(ctxt);
16055        call_tests++;
16056        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16057        xmlResetLastError();
16058        if (mem_base != xmlMemBlocks()) {
16059            printf("Leak of %d blocks found in xmlNextChar",
16060	           xmlMemBlocks() - mem_base);
16061	    test_ret++;
16062            printf(" %d", n_ctxt);
16063            printf("\n");
16064        }
16065    }
16066    function_tests++;
16067
16068    return(test_ret);
16069}
16070
16071
16072static int
16073test_xmlParserInputShrink(void) {
16074    int test_ret = 0;
16075
16076    int mem_base;
16077    xmlParserInputPtr in; /* an XML parser input */
16078    int n_in;
16079
16080    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16081        mem_base = xmlMemBlocks();
16082        in = gen_xmlParserInputPtr(n_in, 0);
16083
16084        xmlParserInputShrink(in);
16085        call_tests++;
16086        des_xmlParserInputPtr(n_in, in, 0);
16087        xmlResetLastError();
16088        if (mem_base != xmlMemBlocks()) {
16089            printf("Leak of %d blocks found in xmlParserInputShrink",
16090	           xmlMemBlocks() - mem_base);
16091	    test_ret++;
16092            printf(" %d", n_in);
16093            printf("\n");
16094        }
16095    }
16096    function_tests++;
16097
16098    return(test_ret);
16099}
16100
16101
16102static int
16103test_xmlPopInput(void) {
16104    int test_ret = 0;
16105
16106    int mem_base;
16107    xmlChar ret_val;
16108    xmlParserCtxtPtr ctxt; /* an XML parser context */
16109    int n_ctxt;
16110
16111    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16112        mem_base = xmlMemBlocks();
16113        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16114
16115        ret_val = xmlPopInput(ctxt);
16116        desret_xmlChar(ret_val);
16117        call_tests++;
16118        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16119        xmlResetLastError();
16120        if (mem_base != xmlMemBlocks()) {
16121            printf("Leak of %d blocks found in xmlPopInput",
16122	           xmlMemBlocks() - mem_base);
16123	    test_ret++;
16124            printf(" %d", n_ctxt);
16125            printf("\n");
16126        }
16127    }
16128    function_tests++;
16129
16130    return(test_ret);
16131}
16132
16133
16134static int
16135test_xmlPushInput(void) {
16136    int test_ret = 0;
16137
16138    int mem_base;
16139    xmlParserCtxtPtr ctxt; /* an XML parser context */
16140    int n_ctxt;
16141    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16142    int n_input;
16143
16144    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16145    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16146        mem_base = xmlMemBlocks();
16147        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16148        input = gen_xmlParserInputPtr(n_input, 1);
16149
16150        xmlPushInput(ctxt, input);
16151        call_tests++;
16152        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16153        des_xmlParserInputPtr(n_input, input, 1);
16154        xmlResetLastError();
16155        if (mem_base != xmlMemBlocks()) {
16156            printf("Leak of %d blocks found in xmlPushInput",
16157	           xmlMemBlocks() - mem_base);
16158	    test_ret++;
16159            printf(" %d", n_ctxt);
16160            printf(" %d", n_input);
16161            printf("\n");
16162        }
16163    }
16164    }
16165    function_tests++;
16166
16167    return(test_ret);
16168}
16169
16170
16171static int
16172test_xmlSetEntityReferenceFunc(void) {
16173    int test_ret = 0;
16174
16175
16176    /* missing type support */
16177    return(test_ret);
16178}
16179
16180
16181static int
16182test_xmlSplitQName(void) {
16183    int test_ret = 0;
16184
16185    int mem_base;
16186    xmlChar * ret_val;
16187    xmlParserCtxtPtr ctxt; /* an XML parser context */
16188    int n_ctxt;
16189    xmlChar * name; /* an XML parser context */
16190    int n_name;
16191    xmlChar ** prefix; /* a xmlChar ** */
16192    int n_prefix;
16193
16194    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16195    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16196    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16197        mem_base = xmlMemBlocks();
16198        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16199        name = gen_const_xmlChar_ptr(n_name, 1);
16200        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16201
16202        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16203        desret_xmlChar_ptr(ret_val);
16204        call_tests++;
16205        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16206        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16207        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16208        xmlResetLastError();
16209        if (mem_base != xmlMemBlocks()) {
16210            printf("Leak of %d blocks found in xmlSplitQName",
16211	           xmlMemBlocks() - mem_base);
16212	    test_ret++;
16213            printf(" %d", n_ctxt);
16214            printf(" %d", n_name);
16215            printf(" %d", n_prefix);
16216            printf("\n");
16217        }
16218    }
16219    }
16220    }
16221    function_tests++;
16222
16223    return(test_ret);
16224}
16225
16226
16227static int
16228test_xmlStringCurrentChar(void) {
16229    int test_ret = 0;
16230
16231    int mem_base;
16232    int ret_val;
16233    xmlParserCtxtPtr ctxt; /* the XML parser context */
16234    int n_ctxt;
16235    xmlChar * cur; /* pointer to the beginning of the char */
16236    int n_cur;
16237    int * len; /* pointer to the length of the char read */
16238    int n_len;
16239
16240    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16241    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16242    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16243        mem_base = xmlMemBlocks();
16244        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16245        cur = gen_const_xmlChar_ptr(n_cur, 1);
16246        len = gen_int_ptr(n_len, 2);
16247
16248        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16249        desret_int(ret_val);
16250        call_tests++;
16251        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16252        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16253        des_int_ptr(n_len, len, 2);
16254        xmlResetLastError();
16255        if (mem_base != xmlMemBlocks()) {
16256            printf("Leak of %d blocks found in xmlStringCurrentChar",
16257	           xmlMemBlocks() - mem_base);
16258	    test_ret++;
16259            printf(" %d", n_ctxt);
16260            printf(" %d", n_cur);
16261            printf(" %d", n_len);
16262            printf("\n");
16263        }
16264    }
16265    }
16266    }
16267    function_tests++;
16268
16269    return(test_ret);
16270}
16271
16272
16273static int
16274test_xmlStringDecodeEntities(void) {
16275    int test_ret = 0;
16276
16277    int mem_base;
16278    xmlChar * ret_val;
16279    xmlParserCtxtPtr ctxt; /* the parser context */
16280    int n_ctxt;
16281    xmlChar * str; /* the input string */
16282    int n_str;
16283    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16284    int n_what;
16285    xmlChar end; /* an end marker xmlChar, 0 if none */
16286    int n_end;
16287    xmlChar end2; /* an end marker xmlChar, 0 if none */
16288    int n_end2;
16289    xmlChar end3; /* an end marker xmlChar, 0 if none */
16290    int n_end3;
16291
16292    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16293    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16294    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16295    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16296    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16297    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16298        mem_base = xmlMemBlocks();
16299        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16300        str = gen_const_xmlChar_ptr(n_str, 1);
16301        what = gen_int(n_what, 2);
16302        end = gen_xmlChar(n_end, 3);
16303        end2 = gen_xmlChar(n_end2, 4);
16304        end3 = gen_xmlChar(n_end3, 5);
16305
16306        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16307        desret_xmlChar_ptr(ret_val);
16308        call_tests++;
16309        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16310        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16311        des_int(n_what, what, 2);
16312        des_xmlChar(n_end, end, 3);
16313        des_xmlChar(n_end2, end2, 4);
16314        des_xmlChar(n_end3, end3, 5);
16315        xmlResetLastError();
16316        if (mem_base != xmlMemBlocks()) {
16317            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16318	           xmlMemBlocks() - mem_base);
16319	    test_ret++;
16320            printf(" %d", n_ctxt);
16321            printf(" %d", n_str);
16322            printf(" %d", n_what);
16323            printf(" %d", n_end);
16324            printf(" %d", n_end2);
16325            printf(" %d", n_end3);
16326            printf("\n");
16327        }
16328    }
16329    }
16330    }
16331    }
16332    }
16333    }
16334    function_tests++;
16335
16336    return(test_ret);
16337}
16338
16339
16340static int
16341test_xmlStringLenDecodeEntities(void) {
16342    int test_ret = 0;
16343
16344    int mem_base;
16345    xmlChar * ret_val;
16346    xmlParserCtxtPtr ctxt; /* the parser context */
16347    int n_ctxt;
16348    xmlChar * str; /* the input string */
16349    int n_str;
16350    int len; /* the string length */
16351    int n_len;
16352    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16353    int n_what;
16354    xmlChar end; /* an end marker xmlChar, 0 if none */
16355    int n_end;
16356    xmlChar end2; /* an end marker xmlChar, 0 if none */
16357    int n_end2;
16358    xmlChar end3; /* an end marker xmlChar, 0 if none */
16359    int n_end3;
16360
16361    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16362    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16363    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16364    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16365    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16366    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16367    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16368        mem_base = xmlMemBlocks();
16369        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16370        str = gen_const_xmlChar_ptr(n_str, 1);
16371        len = gen_int(n_len, 2);
16372        what = gen_int(n_what, 3);
16373        end = gen_xmlChar(n_end, 4);
16374        end2 = gen_xmlChar(n_end2, 5);
16375        end3 = gen_xmlChar(n_end3, 6);
16376
16377        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16378        desret_xmlChar_ptr(ret_val);
16379        call_tests++;
16380        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16381        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16382        des_int(n_len, len, 2);
16383        des_int(n_what, what, 3);
16384        des_xmlChar(n_end, end, 4);
16385        des_xmlChar(n_end2, end2, 5);
16386        des_xmlChar(n_end3, end3, 6);
16387        xmlResetLastError();
16388        if (mem_base != xmlMemBlocks()) {
16389            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16390	           xmlMemBlocks() - mem_base);
16391	    test_ret++;
16392            printf(" %d", n_ctxt);
16393            printf(" %d", n_str);
16394            printf(" %d", n_len);
16395            printf(" %d", n_what);
16396            printf(" %d", n_end);
16397            printf(" %d", n_end2);
16398            printf(" %d", n_end3);
16399            printf("\n");
16400        }
16401    }
16402    }
16403    }
16404    }
16405    }
16406    }
16407    }
16408    function_tests++;
16409
16410    return(test_ret);
16411}
16412
16413
16414static int
16415test_xmlSwitchEncoding(void) {
16416    int test_ret = 0;
16417
16418    int mem_base;
16419    int ret_val;
16420    xmlParserCtxtPtr ctxt; /* the parser context */
16421    int n_ctxt;
16422    xmlCharEncoding enc; /* the encoding value (number) */
16423    int n_enc;
16424
16425    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16426    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16427        mem_base = xmlMemBlocks();
16428        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16429        enc = gen_xmlCharEncoding(n_enc, 1);
16430
16431        ret_val = xmlSwitchEncoding(ctxt, enc);
16432        desret_int(ret_val);
16433        call_tests++;
16434        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16435        des_xmlCharEncoding(n_enc, enc, 1);
16436        xmlResetLastError();
16437        if (mem_base != xmlMemBlocks()) {
16438            printf("Leak of %d blocks found in xmlSwitchEncoding",
16439	           xmlMemBlocks() - mem_base);
16440	    test_ret++;
16441            printf(" %d", n_ctxt);
16442            printf(" %d", n_enc);
16443            printf("\n");
16444        }
16445    }
16446    }
16447    function_tests++;
16448
16449    return(test_ret);
16450}
16451
16452
16453static int
16454test_xmlSwitchInputEncoding(void) {
16455    int test_ret = 0;
16456
16457    int mem_base;
16458    int ret_val;
16459    xmlParserCtxtPtr ctxt; /* the parser context */
16460    int n_ctxt;
16461    xmlParserInputPtr input; /* the input stream */
16462    int n_input;
16463    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16464    int n_handler;
16465
16466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16467    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16468    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16469        mem_base = xmlMemBlocks();
16470        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16471        input = gen_xmlParserInputPtr(n_input, 1);
16472        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16473
16474        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16475        desret_int(ret_val);
16476        call_tests++;
16477        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16478        des_xmlParserInputPtr(n_input, input, 1);
16479        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16480        xmlResetLastError();
16481        if (mem_base != xmlMemBlocks()) {
16482            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16483	           xmlMemBlocks() - mem_base);
16484	    test_ret++;
16485            printf(" %d", n_ctxt);
16486            printf(" %d", n_input);
16487            printf(" %d", n_handler);
16488            printf("\n");
16489        }
16490    }
16491    }
16492    }
16493    function_tests++;
16494
16495    return(test_ret);
16496}
16497
16498
16499static int
16500test_xmlSwitchToEncoding(void) {
16501    int test_ret = 0;
16502
16503    int mem_base;
16504    int ret_val;
16505    xmlParserCtxtPtr ctxt; /* the parser context */
16506    int n_ctxt;
16507    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16508    int n_handler;
16509
16510    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16511    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16512        mem_base = xmlMemBlocks();
16513        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16514        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16515
16516        ret_val = xmlSwitchToEncoding(ctxt, handler);
16517        desret_int(ret_val);
16518        call_tests++;
16519        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16520        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16521        xmlResetLastError();
16522        if (mem_base != xmlMemBlocks()) {
16523            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16524	           xmlMemBlocks() - mem_base);
16525	    test_ret++;
16526            printf(" %d", n_ctxt);
16527            printf(" %d", n_handler);
16528            printf("\n");
16529        }
16530    }
16531    }
16532    function_tests++;
16533
16534    return(test_ret);
16535}
16536
16537static int
16538test_parserInternals(void) {
16539    int test_ret = 0;
16540
16541    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16542    test_ret += test_htmlCreateFileParserCtxt();
16543    test_ret += test_htmlInitAutoClose();
16544    test_ret += test_inputPop();
16545    test_ret += test_inputPush();
16546    test_ret += test_namePop();
16547    test_ret += test_namePush();
16548    test_ret += test_nodePop();
16549    test_ret += test_nodePush();
16550    test_ret += test_xmlCheckLanguageID();
16551    test_ret += test_xmlCopyChar();
16552    test_ret += test_xmlCopyCharMultiByte();
16553    test_ret += test_xmlCreateEntityParserCtxt();
16554    test_ret += test_xmlCreateFileParserCtxt();
16555    test_ret += test_xmlCreateMemoryParserCtxt();
16556    test_ret += test_xmlCreateURLParserCtxt();
16557    test_ret += test_xmlCurrentChar();
16558    test_ret += test_xmlErrMemory();
16559    test_ret += test_xmlIsLetter();
16560    test_ret += test_xmlNewEntityInputStream();
16561    test_ret += test_xmlNewInputFromFile();
16562    test_ret += test_xmlNewInputStream();
16563    test_ret += test_xmlNewStringInputStream();
16564    test_ret += test_xmlNextChar();
16565    test_ret += test_xmlParserInputShrink();
16566    test_ret += test_xmlPopInput();
16567    test_ret += test_xmlPushInput();
16568    test_ret += test_xmlSetEntityReferenceFunc();
16569    test_ret += test_xmlSplitQName();
16570    test_ret += test_xmlStringCurrentChar();
16571    test_ret += test_xmlStringDecodeEntities();
16572    test_ret += test_xmlStringLenDecodeEntities();
16573    test_ret += test_xmlSwitchEncoding();
16574    test_ret += test_xmlSwitchInputEncoding();
16575    test_ret += test_xmlSwitchToEncoding();
16576
16577    if (test_ret != 0)
16578	printf("Module parserInternals: %d errors\n", test_ret);
16579    return(test_ret);
16580}
16581
16582static int
16583test_xmlPatternFromRoot(void) {
16584    int test_ret = 0;
16585
16586#if defined(LIBXML_PATTERN_ENABLED)
16587    int mem_base;
16588    int ret_val;
16589    xmlPatternPtr comp; /* the precompiled pattern */
16590    int n_comp;
16591
16592    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16593        mem_base = xmlMemBlocks();
16594        comp = gen_xmlPatternPtr(n_comp, 0);
16595
16596        ret_val = xmlPatternFromRoot(comp);
16597        desret_int(ret_val);
16598        call_tests++;
16599        des_xmlPatternPtr(n_comp, comp, 0);
16600        xmlResetLastError();
16601        if (mem_base != xmlMemBlocks()) {
16602            printf("Leak of %d blocks found in xmlPatternFromRoot",
16603	           xmlMemBlocks() - mem_base);
16604	    test_ret++;
16605            printf(" %d", n_comp);
16606            printf("\n");
16607        }
16608    }
16609    function_tests++;
16610#endif
16611
16612    return(test_ret);
16613}
16614
16615
16616static int
16617test_xmlPatternGetStreamCtxt(void) {
16618    int test_ret = 0;
16619
16620
16621    /* missing type support */
16622    return(test_ret);
16623}
16624
16625
16626static int
16627test_xmlPatternMatch(void) {
16628    int test_ret = 0;
16629
16630#if defined(LIBXML_PATTERN_ENABLED)
16631    int mem_base;
16632    int ret_val;
16633    xmlPatternPtr comp; /* the precompiled pattern */
16634    int n_comp;
16635    xmlNodePtr node; /* a node */
16636    int n_node;
16637
16638    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16639    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16640        mem_base = xmlMemBlocks();
16641        comp = gen_xmlPatternPtr(n_comp, 0);
16642        node = gen_xmlNodePtr(n_node, 1);
16643
16644        ret_val = xmlPatternMatch(comp, node);
16645        desret_int(ret_val);
16646        call_tests++;
16647        des_xmlPatternPtr(n_comp, comp, 0);
16648        des_xmlNodePtr(n_node, node, 1);
16649        xmlResetLastError();
16650        if (mem_base != xmlMemBlocks()) {
16651            printf("Leak of %d blocks found in xmlPatternMatch",
16652	           xmlMemBlocks() - mem_base);
16653	    test_ret++;
16654            printf(" %d", n_comp);
16655            printf(" %d", n_node);
16656            printf("\n");
16657        }
16658    }
16659    }
16660    function_tests++;
16661#endif
16662
16663    return(test_ret);
16664}
16665
16666
16667static int
16668test_xmlPatternMaxDepth(void) {
16669    int test_ret = 0;
16670
16671#if defined(LIBXML_PATTERN_ENABLED)
16672    int mem_base;
16673    int ret_val;
16674    xmlPatternPtr comp; /* the precompiled pattern */
16675    int n_comp;
16676
16677    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16678        mem_base = xmlMemBlocks();
16679        comp = gen_xmlPatternPtr(n_comp, 0);
16680
16681        ret_val = xmlPatternMaxDepth(comp);
16682        desret_int(ret_val);
16683        call_tests++;
16684        des_xmlPatternPtr(n_comp, comp, 0);
16685        xmlResetLastError();
16686        if (mem_base != xmlMemBlocks()) {
16687            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16688	           xmlMemBlocks() - mem_base);
16689	    test_ret++;
16690            printf(" %d", n_comp);
16691            printf("\n");
16692        }
16693    }
16694    function_tests++;
16695#endif
16696
16697    return(test_ret);
16698}
16699
16700
16701static int
16702test_xmlPatternStreamable(void) {
16703    int test_ret = 0;
16704
16705#if defined(LIBXML_PATTERN_ENABLED)
16706    int mem_base;
16707    int ret_val;
16708    xmlPatternPtr comp; /* the precompiled pattern */
16709    int n_comp;
16710
16711    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16712        mem_base = xmlMemBlocks();
16713        comp = gen_xmlPatternPtr(n_comp, 0);
16714
16715        ret_val = xmlPatternStreamable(comp);
16716        desret_int(ret_val);
16717        call_tests++;
16718        des_xmlPatternPtr(n_comp, comp, 0);
16719        xmlResetLastError();
16720        if (mem_base != xmlMemBlocks()) {
16721            printf("Leak of %d blocks found in xmlPatternStreamable",
16722	           xmlMemBlocks() - mem_base);
16723	    test_ret++;
16724            printf(" %d", n_comp);
16725            printf("\n");
16726        }
16727    }
16728    function_tests++;
16729#endif
16730
16731    return(test_ret);
16732}
16733
16734
16735static int
16736test_xmlPatterncompile(void) {
16737    int test_ret = 0;
16738
16739
16740    /* missing type support */
16741    return(test_ret);
16742}
16743
16744#ifdef LIBXML_PATTERN_ENABLED
16745
16746#define gen_nb_xmlStreamCtxtPtr 1
16747static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16748    return(NULL);
16749}
16750static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16751}
16752#endif
16753
16754
16755static int
16756test_xmlStreamPop(void) {
16757    int test_ret = 0;
16758
16759#if defined(LIBXML_PATTERN_ENABLED)
16760    int mem_base;
16761    int ret_val;
16762    xmlStreamCtxtPtr stream; /* the stream context */
16763    int n_stream;
16764
16765    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16766        mem_base = xmlMemBlocks();
16767        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16768
16769        ret_val = xmlStreamPop(stream);
16770        desret_int(ret_val);
16771        call_tests++;
16772        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16773        xmlResetLastError();
16774        if (mem_base != xmlMemBlocks()) {
16775            printf("Leak of %d blocks found in xmlStreamPop",
16776	           xmlMemBlocks() - mem_base);
16777	    test_ret++;
16778            printf(" %d", n_stream);
16779            printf("\n");
16780        }
16781    }
16782    function_tests++;
16783#endif
16784
16785    return(test_ret);
16786}
16787
16788
16789static int
16790test_xmlStreamPush(void) {
16791    int test_ret = 0;
16792
16793#if defined(LIBXML_PATTERN_ENABLED)
16794    int mem_base;
16795    int ret_val;
16796    xmlStreamCtxtPtr stream; /* the stream context */
16797    int n_stream;
16798    xmlChar * name; /* the current name */
16799    int n_name;
16800    xmlChar * ns; /* the namespace name */
16801    int n_ns;
16802
16803    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16804    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16805    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16806        mem_base = xmlMemBlocks();
16807        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16808        name = gen_const_xmlChar_ptr(n_name, 1);
16809        ns = gen_const_xmlChar_ptr(n_ns, 2);
16810
16811        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
16812        desret_int(ret_val);
16813        call_tests++;
16814        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16815        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16816        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16817        xmlResetLastError();
16818        if (mem_base != xmlMemBlocks()) {
16819            printf("Leak of %d blocks found in xmlStreamPush",
16820	           xmlMemBlocks() - mem_base);
16821	    test_ret++;
16822            printf(" %d", n_stream);
16823            printf(" %d", n_name);
16824            printf(" %d", n_ns);
16825            printf("\n");
16826        }
16827    }
16828    }
16829    }
16830    function_tests++;
16831#endif
16832
16833    return(test_ret);
16834}
16835
16836
16837static int
16838test_xmlStreamPushAttr(void) {
16839    int test_ret = 0;
16840
16841#if defined(LIBXML_PATTERN_ENABLED)
16842    int mem_base;
16843    int ret_val;
16844    xmlStreamCtxtPtr stream; /* the stream context */
16845    int n_stream;
16846    xmlChar * name; /* the current name */
16847    int n_name;
16848    xmlChar * ns; /* the namespace name */
16849    int n_ns;
16850
16851    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16852    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16853    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16854        mem_base = xmlMemBlocks();
16855        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16856        name = gen_const_xmlChar_ptr(n_name, 1);
16857        ns = gen_const_xmlChar_ptr(n_ns, 2);
16858
16859        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
16860        desret_int(ret_val);
16861        call_tests++;
16862        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16863        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16864        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16865        xmlResetLastError();
16866        if (mem_base != xmlMemBlocks()) {
16867            printf("Leak of %d blocks found in xmlStreamPushAttr",
16868	           xmlMemBlocks() - mem_base);
16869	    test_ret++;
16870            printf(" %d", n_stream);
16871            printf(" %d", n_name);
16872            printf(" %d", n_ns);
16873            printf("\n");
16874        }
16875    }
16876    }
16877    }
16878    function_tests++;
16879#endif
16880
16881    return(test_ret);
16882}
16883
16884static int
16885test_pattern(void) {
16886    int test_ret = 0;
16887
16888    if (quiet == 0) printf("Testing pattern : 7 of 12 functions ...\n");
16889    test_ret += test_xmlPatternFromRoot();
16890    test_ret += test_xmlPatternGetStreamCtxt();
16891    test_ret += test_xmlPatternMatch();
16892    test_ret += test_xmlPatternMaxDepth();
16893    test_ret += test_xmlPatternStreamable();
16894    test_ret += test_xmlPatterncompile();
16895    test_ret += test_xmlStreamPop();
16896    test_ret += test_xmlStreamPush();
16897    test_ret += test_xmlStreamPushAttr();
16898
16899    if (test_ret != 0)
16900	printf("Module pattern: %d errors\n", test_ret);
16901    return(test_ret);
16902}
16903#ifdef LIBXML_SCHEMAS_ENABLED
16904
16905#define gen_nb_xmlRelaxNGPtr 1
16906static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16907    return(NULL);
16908}
16909static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16910}
16911#endif
16912
16913
16914static int
16915test_xmlRelaxNGDump(void) {
16916    int test_ret = 0;
16917
16918#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16919    int mem_base;
16920    FILE * output; /* the file output */
16921    int n_output;
16922    xmlRelaxNGPtr schema; /* a schema structure */
16923    int n_schema;
16924
16925    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16926    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16927        mem_base = xmlMemBlocks();
16928        output = gen_FILE_ptr(n_output, 0);
16929        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16930
16931        xmlRelaxNGDump(output, schema);
16932        call_tests++;
16933        des_FILE_ptr(n_output, output, 0);
16934        des_xmlRelaxNGPtr(n_schema, schema, 1);
16935        xmlResetLastError();
16936        if (mem_base != xmlMemBlocks()) {
16937            printf("Leak of %d blocks found in xmlRelaxNGDump",
16938	           xmlMemBlocks() - mem_base);
16939	    test_ret++;
16940            printf(" %d", n_output);
16941            printf(" %d", n_schema);
16942            printf("\n");
16943        }
16944    }
16945    }
16946    function_tests++;
16947#endif
16948
16949    return(test_ret);
16950}
16951
16952
16953static int
16954test_xmlRelaxNGDumpTree(void) {
16955    int test_ret = 0;
16956
16957#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16958    int mem_base;
16959    FILE * output; /* the file output */
16960    int n_output;
16961    xmlRelaxNGPtr schema; /* a schema structure */
16962    int n_schema;
16963
16964    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16965    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16966        mem_base = xmlMemBlocks();
16967        output = gen_FILE_ptr(n_output, 0);
16968        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16969
16970        xmlRelaxNGDumpTree(output, schema);
16971        call_tests++;
16972        des_FILE_ptr(n_output, output, 0);
16973        des_xmlRelaxNGPtr(n_schema, schema, 1);
16974        xmlResetLastError();
16975        if (mem_base != xmlMemBlocks()) {
16976            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
16977	           xmlMemBlocks() - mem_base);
16978	    test_ret++;
16979            printf(" %d", n_output);
16980            printf(" %d", n_schema);
16981            printf("\n");
16982        }
16983    }
16984    }
16985    function_tests++;
16986#endif
16987
16988    return(test_ret);
16989}
16990
16991#ifdef LIBXML_SCHEMAS_ENABLED
16992
16993#define gen_nb_xmlRelaxNGParserCtxtPtr 1
16994static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16995    return(NULL);
16996}
16997static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16998}
16999#endif
17000
17001#ifdef LIBXML_SCHEMAS_ENABLED
17002
17003#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17004static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17005    return(NULL);
17006}
17007static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17008}
17009#endif
17010
17011#ifdef LIBXML_SCHEMAS_ENABLED
17012
17013#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17014static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17015    return(NULL);
17016}
17017static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17018}
17019#endif
17020
17021#ifdef LIBXML_SCHEMAS_ENABLED
17022
17023#define gen_nb_void_ptr_ptr 1
17024static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17025    return(NULL);
17026}
17027static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17028}
17029#endif
17030
17031
17032static int
17033test_xmlRelaxNGGetParserErrors(void) {
17034    int test_ret = 0;
17035
17036#if defined(LIBXML_SCHEMAS_ENABLED)
17037    int mem_base;
17038    int ret_val;
17039    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17040    int n_ctxt;
17041    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17042    int n_err;
17043    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17044    int n_warn;
17045    void ** ctx; /* contextual data for the callbacks result */
17046    int n_ctx;
17047
17048    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17049    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17050    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17051    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17052        mem_base = xmlMemBlocks();
17053        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17054        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17055        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17056        ctx = gen_void_ptr_ptr(n_ctx, 3);
17057
17058        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17059        desret_int(ret_val);
17060        call_tests++;
17061        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17062        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17063        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17064        des_void_ptr_ptr(n_ctx, ctx, 3);
17065        xmlResetLastError();
17066        if (mem_base != xmlMemBlocks()) {
17067            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17068	           xmlMemBlocks() - mem_base);
17069	    test_ret++;
17070            printf(" %d", n_ctxt);
17071            printf(" %d", n_err);
17072            printf(" %d", n_warn);
17073            printf(" %d", n_ctx);
17074            printf("\n");
17075        }
17076    }
17077    }
17078    }
17079    }
17080    function_tests++;
17081#endif
17082
17083    return(test_ret);
17084}
17085
17086#ifdef LIBXML_SCHEMAS_ENABLED
17087
17088#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17089static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17090    return(NULL);
17091}
17092static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17093}
17094#endif
17095
17096
17097static int
17098test_xmlRelaxNGGetValidErrors(void) {
17099    int test_ret = 0;
17100
17101#if defined(LIBXML_SCHEMAS_ENABLED)
17102    int mem_base;
17103    int ret_val;
17104    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17105    int n_ctxt;
17106    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17107    int n_err;
17108    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17109    int n_warn;
17110    void ** ctx; /* the functions context result */
17111    int n_ctx;
17112
17113    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17114    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17115    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17116    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17117        mem_base = xmlMemBlocks();
17118        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17119        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17120        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17121        ctx = gen_void_ptr_ptr(n_ctx, 3);
17122
17123        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17124        desret_int(ret_val);
17125        call_tests++;
17126        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17127        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17128        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17129        des_void_ptr_ptr(n_ctx, ctx, 3);
17130        xmlResetLastError();
17131        if (mem_base != xmlMemBlocks()) {
17132            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17133	           xmlMemBlocks() - mem_base);
17134	    test_ret++;
17135            printf(" %d", n_ctxt);
17136            printf(" %d", n_err);
17137            printf(" %d", n_warn);
17138            printf(" %d", n_ctx);
17139            printf("\n");
17140        }
17141    }
17142    }
17143    }
17144    }
17145    function_tests++;
17146#endif
17147
17148    return(test_ret);
17149}
17150
17151
17152static int
17153test_xmlRelaxNGInitTypes(void) {
17154    int test_ret = 0;
17155
17156#if defined(LIBXML_SCHEMAS_ENABLED)
17157    int mem_base;
17158    int ret_val;
17159
17160        mem_base = xmlMemBlocks();
17161
17162        ret_val = xmlRelaxNGInitTypes();
17163        desret_int(ret_val);
17164        call_tests++;
17165        xmlResetLastError();
17166        if (mem_base != xmlMemBlocks()) {
17167            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17168	           xmlMemBlocks() - mem_base);
17169	    test_ret++;
17170            printf("\n");
17171        }
17172    function_tests++;
17173#endif
17174
17175    return(test_ret);
17176}
17177
17178
17179static int
17180test_xmlRelaxNGNewDocParserCtxt(void) {
17181    int test_ret = 0;
17182
17183#if defined(LIBXML_SCHEMAS_ENABLED)
17184    int mem_base;
17185    xmlRelaxNGParserCtxtPtr ret_val;
17186    xmlDocPtr doc; /* a preparsed document tree */
17187    int n_doc;
17188
17189    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17190        mem_base = xmlMemBlocks();
17191        doc = gen_xmlDocPtr(n_doc, 0);
17192
17193        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17194        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17195        call_tests++;
17196        des_xmlDocPtr(n_doc, doc, 0);
17197        xmlResetLastError();
17198        if (mem_base != xmlMemBlocks()) {
17199            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17200	           xmlMemBlocks() - mem_base);
17201	    test_ret++;
17202            printf(" %d", n_doc);
17203            printf("\n");
17204        }
17205    }
17206    function_tests++;
17207#endif
17208
17209    return(test_ret);
17210}
17211
17212
17213static int
17214test_xmlRelaxNGNewMemParserCtxt(void) {
17215    int test_ret = 0;
17216
17217#if defined(LIBXML_SCHEMAS_ENABLED)
17218    int mem_base;
17219    xmlRelaxNGParserCtxtPtr ret_val;
17220    char * buffer; /* a pointer to a char array containing the schemas */
17221    int n_buffer;
17222    int size; /* the size of the array */
17223    int n_size;
17224
17225    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17226    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17227        mem_base = xmlMemBlocks();
17228        buffer = gen_const_char_ptr(n_buffer, 0);
17229        size = gen_int(n_size, 1);
17230
17231        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17232        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17233        call_tests++;
17234        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17235        des_int(n_size, size, 1);
17236        xmlResetLastError();
17237        if (mem_base != xmlMemBlocks()) {
17238            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17239	           xmlMemBlocks() - mem_base);
17240	    test_ret++;
17241            printf(" %d", n_buffer);
17242            printf(" %d", n_size);
17243            printf("\n");
17244        }
17245    }
17246    }
17247    function_tests++;
17248#endif
17249
17250    return(test_ret);
17251}
17252
17253
17254static int
17255test_xmlRelaxNGNewParserCtxt(void) {
17256    int test_ret = 0;
17257
17258#if defined(LIBXML_SCHEMAS_ENABLED)
17259    int mem_base;
17260    xmlRelaxNGParserCtxtPtr ret_val;
17261    char * URL; /* the location of the schema */
17262    int n_URL;
17263
17264    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17265        mem_base = xmlMemBlocks();
17266        URL = gen_const_char_ptr(n_URL, 0);
17267
17268        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17269        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17270        call_tests++;
17271        des_const_char_ptr(n_URL, (const char *)URL, 0);
17272        xmlResetLastError();
17273        if (mem_base != xmlMemBlocks()) {
17274            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17275	           xmlMemBlocks() - mem_base);
17276	    test_ret++;
17277            printf(" %d", n_URL);
17278            printf("\n");
17279        }
17280    }
17281    function_tests++;
17282#endif
17283
17284    return(test_ret);
17285}
17286
17287
17288static int
17289test_xmlRelaxNGNewValidCtxt(void) {
17290    int test_ret = 0;
17291
17292
17293    /* missing type support */
17294    return(test_ret);
17295}
17296
17297
17298static int
17299test_xmlRelaxNGParse(void) {
17300    int test_ret = 0;
17301
17302
17303    /* missing type support */
17304    return(test_ret);
17305}
17306
17307
17308static int
17309test_xmlRelaxNGSetParserErrors(void) {
17310    int test_ret = 0;
17311
17312
17313    /* missing type support */
17314    return(test_ret);
17315}
17316
17317
17318static int
17319test_xmlRelaxNGSetValidErrors(void) {
17320    int test_ret = 0;
17321
17322
17323    /* missing type support */
17324    return(test_ret);
17325}
17326
17327
17328static int
17329test_xmlRelaxNGSetValidStructuredErrors(void) {
17330    int test_ret = 0;
17331
17332
17333    /* missing type support */
17334    return(test_ret);
17335}
17336
17337
17338static int
17339test_xmlRelaxNGValidateDoc(void) {
17340    int test_ret = 0;
17341
17342#if defined(LIBXML_SCHEMAS_ENABLED)
17343    int mem_base;
17344    int ret_val;
17345    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17346    int n_ctxt;
17347    xmlDocPtr doc; /* a parsed document tree */
17348    int n_doc;
17349
17350    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17351    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17352        mem_base = xmlMemBlocks();
17353        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17354        doc = gen_xmlDocPtr(n_doc, 1);
17355
17356        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17357        desret_int(ret_val);
17358        call_tests++;
17359        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17360        des_xmlDocPtr(n_doc, doc, 1);
17361        xmlResetLastError();
17362        if (mem_base != xmlMemBlocks()) {
17363            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17364	           xmlMemBlocks() - mem_base);
17365	    test_ret++;
17366            printf(" %d", n_ctxt);
17367            printf(" %d", n_doc);
17368            printf("\n");
17369        }
17370    }
17371    }
17372    function_tests++;
17373#endif
17374
17375    return(test_ret);
17376}
17377
17378
17379static int
17380test_xmlRelaxNGValidateFullElement(void) {
17381    int test_ret = 0;
17382
17383#if defined(LIBXML_SCHEMAS_ENABLED)
17384    int mem_base;
17385    int ret_val;
17386    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17387    int n_ctxt;
17388    xmlDocPtr doc; /* a document instance */
17389    int n_doc;
17390    xmlNodePtr elem; /* an element instance */
17391    int n_elem;
17392
17393    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17394    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17395    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17396        mem_base = xmlMemBlocks();
17397        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17398        doc = gen_xmlDocPtr(n_doc, 1);
17399        elem = gen_xmlNodePtr(n_elem, 2);
17400
17401        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17402        desret_int(ret_val);
17403        call_tests++;
17404        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17405        des_xmlDocPtr(n_doc, doc, 1);
17406        des_xmlNodePtr(n_elem, elem, 2);
17407        xmlResetLastError();
17408        if (mem_base != xmlMemBlocks()) {
17409            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17410	           xmlMemBlocks() - mem_base);
17411	    test_ret++;
17412            printf(" %d", n_ctxt);
17413            printf(" %d", n_doc);
17414            printf(" %d", n_elem);
17415            printf("\n");
17416        }
17417    }
17418    }
17419    }
17420    function_tests++;
17421#endif
17422
17423    return(test_ret);
17424}
17425
17426
17427static int
17428test_xmlRelaxNGValidatePopElement(void) {
17429    int test_ret = 0;
17430
17431#if defined(LIBXML_SCHEMAS_ENABLED)
17432    int mem_base;
17433    int ret_val;
17434    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17435    int n_ctxt;
17436    xmlDocPtr doc; /* a document instance */
17437    int n_doc;
17438    xmlNodePtr elem; /* an element instance */
17439    int n_elem;
17440
17441    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17442    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17443    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17444        mem_base = xmlMemBlocks();
17445        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17446        doc = gen_xmlDocPtr(n_doc, 1);
17447        elem = gen_xmlNodePtr(n_elem, 2);
17448
17449        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17450        desret_int(ret_val);
17451        call_tests++;
17452        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17453        des_xmlDocPtr(n_doc, doc, 1);
17454        des_xmlNodePtr(n_elem, elem, 2);
17455        xmlResetLastError();
17456        if (mem_base != xmlMemBlocks()) {
17457            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17458	           xmlMemBlocks() - mem_base);
17459	    test_ret++;
17460            printf(" %d", n_ctxt);
17461            printf(" %d", n_doc);
17462            printf(" %d", n_elem);
17463            printf("\n");
17464        }
17465    }
17466    }
17467    }
17468    function_tests++;
17469#endif
17470
17471    return(test_ret);
17472}
17473
17474
17475static int
17476test_xmlRelaxNGValidatePushCData(void) {
17477    int test_ret = 0;
17478
17479#if defined(LIBXML_SCHEMAS_ENABLED)
17480    int mem_base;
17481    int ret_val;
17482    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17483    int n_ctxt;
17484    xmlChar * data; /* some character data read */
17485    int n_data;
17486    int len; /* the lenght of the data */
17487    int n_len;
17488
17489    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17490    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17491    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17492        mem_base = xmlMemBlocks();
17493        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17494        data = gen_const_xmlChar_ptr(n_data, 1);
17495        len = gen_int(n_len, 2);
17496
17497        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17498        desret_int(ret_val);
17499        call_tests++;
17500        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17501        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17502        des_int(n_len, len, 2);
17503        xmlResetLastError();
17504        if (mem_base != xmlMemBlocks()) {
17505            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17506	           xmlMemBlocks() - mem_base);
17507	    test_ret++;
17508            printf(" %d", n_ctxt);
17509            printf(" %d", n_data);
17510            printf(" %d", n_len);
17511            printf("\n");
17512        }
17513    }
17514    }
17515    }
17516    function_tests++;
17517#endif
17518
17519    return(test_ret);
17520}
17521
17522
17523static int
17524test_xmlRelaxNGValidatePushElement(void) {
17525    int test_ret = 0;
17526
17527#if defined(LIBXML_SCHEMAS_ENABLED)
17528    int mem_base;
17529    int ret_val;
17530    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17531    int n_ctxt;
17532    xmlDocPtr doc; /* a document instance */
17533    int n_doc;
17534    xmlNodePtr elem; /* an element instance */
17535    int n_elem;
17536
17537    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17538    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17539    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17540        mem_base = xmlMemBlocks();
17541        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17542        doc = gen_xmlDocPtr(n_doc, 1);
17543        elem = gen_xmlNodePtr(n_elem, 2);
17544
17545        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17546        desret_int(ret_val);
17547        call_tests++;
17548        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17549        des_xmlDocPtr(n_doc, doc, 1);
17550        des_xmlNodePtr(n_elem, elem, 2);
17551        xmlResetLastError();
17552        if (mem_base != xmlMemBlocks()) {
17553            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17554	           xmlMemBlocks() - mem_base);
17555	    test_ret++;
17556            printf(" %d", n_ctxt);
17557            printf(" %d", n_doc);
17558            printf(" %d", n_elem);
17559            printf("\n");
17560        }
17561    }
17562    }
17563    }
17564    function_tests++;
17565#endif
17566
17567    return(test_ret);
17568}
17569
17570
17571static int
17572test_xmlRelaxParserSetFlag(void) {
17573    int test_ret = 0;
17574
17575#if defined(LIBXML_SCHEMAS_ENABLED)
17576    int mem_base;
17577    int ret_val;
17578    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17579    int n_ctxt;
17580    int flags; /* a set of flags values */
17581    int n_flags;
17582
17583    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17584    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17585        mem_base = xmlMemBlocks();
17586        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17587        flags = gen_int(n_flags, 1);
17588
17589        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17590        desret_int(ret_val);
17591        call_tests++;
17592        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17593        des_int(n_flags, flags, 1);
17594        xmlResetLastError();
17595        if (mem_base != xmlMemBlocks()) {
17596            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17597	           xmlMemBlocks() - mem_base);
17598	    test_ret++;
17599            printf(" %d", n_ctxt);
17600            printf(" %d", n_flags);
17601            printf("\n");
17602        }
17603    }
17604    }
17605    function_tests++;
17606#endif
17607
17608    return(test_ret);
17609}
17610
17611static int
17612test_relaxng(void) {
17613    int test_ret = 0;
17614
17615    if (quiet == 0) printf("Testing relaxng : 14 of 23 functions ...\n");
17616    test_ret += test_xmlRelaxNGDump();
17617    test_ret += test_xmlRelaxNGDumpTree();
17618    test_ret += test_xmlRelaxNGGetParserErrors();
17619    test_ret += test_xmlRelaxNGGetValidErrors();
17620    test_ret += test_xmlRelaxNGInitTypes();
17621    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17622    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17623    test_ret += test_xmlRelaxNGNewParserCtxt();
17624    test_ret += test_xmlRelaxNGNewValidCtxt();
17625    test_ret += test_xmlRelaxNGParse();
17626    test_ret += test_xmlRelaxNGSetParserErrors();
17627    test_ret += test_xmlRelaxNGSetValidErrors();
17628    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17629    test_ret += test_xmlRelaxNGValidateDoc();
17630    test_ret += test_xmlRelaxNGValidateFullElement();
17631    test_ret += test_xmlRelaxNGValidatePopElement();
17632    test_ret += test_xmlRelaxNGValidatePushCData();
17633    test_ret += test_xmlRelaxNGValidatePushElement();
17634    test_ret += test_xmlRelaxParserSetFlag();
17635
17636    if (test_ret != 0)
17637	printf("Module relaxng: %d errors\n", test_ret);
17638    return(test_ret);
17639}
17640static int
17641test_schemasInternals(void) {
17642    int test_ret = 0;
17643
17644    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17645
17646    if (test_ret != 0)
17647	printf("Module schemasInternals: %d errors\n", test_ret);
17648    return(test_ret);
17649}
17650
17651static int
17652test_xmlSchematronNewDocParserCtxt(void) {
17653    int test_ret = 0;
17654
17655
17656    /* missing type support */
17657    return(test_ret);
17658}
17659
17660
17661static int
17662test_xmlSchematronNewMemParserCtxt(void) {
17663    int test_ret = 0;
17664
17665
17666    /* missing type support */
17667    return(test_ret);
17668}
17669
17670
17671static int
17672test_xmlSchematronNewParserCtxt(void) {
17673    int test_ret = 0;
17674
17675
17676    /* missing type support */
17677    return(test_ret);
17678}
17679
17680
17681#define gen_nb_xmlSchematronPtr 1
17682static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17683    return(NULL);
17684}
17685static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17686}
17687
17688static int
17689test_xmlSchematronNewValidCtxt(void) {
17690    int test_ret = 0;
17691
17692
17693    /* missing type support */
17694    return(test_ret);
17695}
17696
17697
17698#define gen_nb_xmlSchematronParserCtxtPtr 1
17699static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17700    return(NULL);
17701}
17702static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17703}
17704
17705static int
17706test_xmlSchematronParse(void) {
17707    int test_ret = 0;
17708
17709
17710    /* missing type support */
17711    return(test_ret);
17712}
17713
17714
17715static int
17716test_xmlSchematronSetParserErrors(void) {
17717    int test_ret = 0;
17718
17719
17720    /* missing type support */
17721    return(test_ret);
17722}
17723
17724
17725#define gen_nb_xmlSchematronValidCtxtPtr 1
17726static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17727    return(NULL);
17728}
17729static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17730}
17731
17732static int
17733test_xmlSchematronSetValidErrors(void) {
17734    int test_ret = 0;
17735
17736
17737    /* missing type support */
17738    return(test_ret);
17739}
17740
17741
17742static int
17743test_xmlSchematronSetValidStructuredErrors(void) {
17744    int test_ret = 0;
17745
17746
17747    /* missing type support */
17748    return(test_ret);
17749}
17750
17751
17752static int
17753test_xmlSchematronValidateDoc(void) {
17754    int test_ret = 0;
17755
17756#if defined(LIBXML_SCHEMATRON_ENABLED)
17757    int mem_base;
17758    int ret_val;
17759    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
17760    int n_ctxt;
17761    xmlDocPtr instance; /* the document instace tree */
17762    int n_instance;
17763
17764    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
17765    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
17766        mem_base = xmlMemBlocks();
17767        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
17768        instance = gen_xmlDocPtr(n_instance, 1);
17769
17770        ret_val = xmlSchematronValidateDoc(ctxt, instance);
17771        desret_int(ret_val);
17772        call_tests++;
17773        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
17774        des_xmlDocPtr(n_instance, instance, 1);
17775        xmlResetLastError();
17776        if (mem_base != xmlMemBlocks()) {
17777            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
17778	           xmlMemBlocks() - mem_base);
17779	    test_ret++;
17780            printf(" %d", n_ctxt);
17781            printf(" %d", n_instance);
17782            printf("\n");
17783        }
17784    }
17785    }
17786    function_tests++;
17787#endif
17788
17789    return(test_ret);
17790}
17791
17792static int
17793test_schematron(void) {
17794    int test_ret = 0;
17795
17796    if (quiet == 0) printf("Testing schematron : 1 of 12 functions ...\n");
17797    test_ret += test_xmlSchematronNewDocParserCtxt();
17798    test_ret += test_xmlSchematronNewMemParserCtxt();
17799    test_ret += test_xmlSchematronNewParserCtxt();
17800    test_ret += test_xmlSchematronNewValidCtxt();
17801    test_ret += test_xmlSchematronParse();
17802    test_ret += test_xmlSchematronSetParserErrors();
17803    test_ret += test_xmlSchematronSetValidErrors();
17804    test_ret += test_xmlSchematronSetValidStructuredErrors();
17805    test_ret += test_xmlSchematronValidateDoc();
17806
17807    if (test_ret != 0)
17808	printf("Module schematron: %d errors\n", test_ret);
17809    return(test_ret);
17810}
17811
17812static int
17813test_xmlAddChild(void) {
17814    int test_ret = 0;
17815
17816    int mem_base;
17817    xmlNodePtr ret_val;
17818    xmlNodePtr parent; /* the parent node */
17819    int n_parent;
17820    xmlNodePtr cur; /* the child node */
17821    int n_cur;
17822
17823    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17824    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17825        mem_base = xmlMemBlocks();
17826        parent = gen_xmlNodePtr(n_parent, 0);
17827        cur = gen_xmlNodePtr_in(n_cur, 1);
17828
17829        ret_val = xmlAddChild(parent, cur);
17830        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
17831        desret_xmlNodePtr(ret_val);
17832        call_tests++;
17833        des_xmlNodePtr(n_parent, parent, 0);
17834        des_xmlNodePtr_in(n_cur, cur, 1);
17835        xmlResetLastError();
17836        if (mem_base != xmlMemBlocks()) {
17837            printf("Leak of %d blocks found in xmlAddChild",
17838	           xmlMemBlocks() - mem_base);
17839	    test_ret++;
17840            printf(" %d", n_parent);
17841            printf(" %d", n_cur);
17842            printf("\n");
17843        }
17844    }
17845    }
17846    function_tests++;
17847
17848    return(test_ret);
17849}
17850
17851
17852static int
17853test_xmlAddChildList(void) {
17854    int test_ret = 0;
17855
17856    int mem_base;
17857    xmlNodePtr ret_val;
17858    xmlNodePtr parent; /* the parent node */
17859    int n_parent;
17860    xmlNodePtr cur; /* the first node in the list */
17861    int n_cur;
17862
17863    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17864    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17865        mem_base = xmlMemBlocks();
17866        parent = gen_xmlNodePtr(n_parent, 0);
17867        cur = gen_xmlNodePtr_in(n_cur, 1);
17868
17869        ret_val = xmlAddChildList(parent, cur);
17870        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
17871        desret_xmlNodePtr(ret_val);
17872        call_tests++;
17873        des_xmlNodePtr(n_parent, parent, 0);
17874        des_xmlNodePtr_in(n_cur, cur, 1);
17875        xmlResetLastError();
17876        if (mem_base != xmlMemBlocks()) {
17877            printf("Leak of %d blocks found in xmlAddChildList",
17878	           xmlMemBlocks() - mem_base);
17879	    test_ret++;
17880            printf(" %d", n_parent);
17881            printf(" %d", n_cur);
17882            printf("\n");
17883        }
17884    }
17885    }
17886    function_tests++;
17887
17888    return(test_ret);
17889}
17890
17891
17892static int
17893test_xmlAddNextSibling(void) {
17894    int test_ret = 0;
17895
17896    int mem_base;
17897    xmlNodePtr ret_val;
17898    xmlNodePtr cur; /* the child node */
17899    int n_cur;
17900    xmlNodePtr elem; /* the new node */
17901    int n_elem;
17902
17903    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17904    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17905        mem_base = xmlMemBlocks();
17906        cur = gen_xmlNodePtr(n_cur, 0);
17907        elem = gen_xmlNodePtr_in(n_elem, 1);
17908
17909        ret_val = xmlAddNextSibling(cur, elem);
17910        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17911        desret_xmlNodePtr(ret_val);
17912        call_tests++;
17913        des_xmlNodePtr(n_cur, cur, 0);
17914        des_xmlNodePtr_in(n_elem, elem, 1);
17915        xmlResetLastError();
17916        if (mem_base != xmlMemBlocks()) {
17917            printf("Leak of %d blocks found in xmlAddNextSibling",
17918	           xmlMemBlocks() - mem_base);
17919	    test_ret++;
17920            printf(" %d", n_cur);
17921            printf(" %d", n_elem);
17922            printf("\n");
17923        }
17924    }
17925    }
17926    function_tests++;
17927
17928    return(test_ret);
17929}
17930
17931
17932static int
17933test_xmlAddPrevSibling(void) {
17934    int test_ret = 0;
17935
17936#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
17937    int mem_base;
17938    xmlNodePtr ret_val;
17939    xmlNodePtr cur; /* the child node */
17940    int n_cur;
17941    xmlNodePtr elem; /* the new node */
17942    int n_elem;
17943
17944    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17945    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17946        mem_base = xmlMemBlocks();
17947        cur = gen_xmlNodePtr(n_cur, 0);
17948        elem = gen_xmlNodePtr_in(n_elem, 1);
17949
17950        ret_val = xmlAddPrevSibling(cur, elem);
17951        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17952        desret_xmlNodePtr(ret_val);
17953        call_tests++;
17954        des_xmlNodePtr(n_cur, cur, 0);
17955        des_xmlNodePtr_in(n_elem, elem, 1);
17956        xmlResetLastError();
17957        if (mem_base != xmlMemBlocks()) {
17958            printf("Leak of %d blocks found in xmlAddPrevSibling",
17959	           xmlMemBlocks() - mem_base);
17960	    test_ret++;
17961            printf(" %d", n_cur);
17962            printf(" %d", n_elem);
17963            printf("\n");
17964        }
17965    }
17966    }
17967    function_tests++;
17968#endif
17969
17970    return(test_ret);
17971}
17972
17973
17974static int
17975test_xmlAddSibling(void) {
17976    int test_ret = 0;
17977
17978    int mem_base;
17979    xmlNodePtr ret_val;
17980    xmlNodePtr cur; /* the child node */
17981    int n_cur;
17982    xmlNodePtr elem; /* the new node */
17983    int n_elem;
17984
17985    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17986    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17987        mem_base = xmlMemBlocks();
17988        cur = gen_xmlNodePtr(n_cur, 0);
17989        elem = gen_xmlNodePtr_in(n_elem, 1);
17990
17991        ret_val = xmlAddSibling(cur, elem);
17992        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17993        desret_xmlNodePtr(ret_val);
17994        call_tests++;
17995        des_xmlNodePtr(n_cur, cur, 0);
17996        des_xmlNodePtr_in(n_elem, elem, 1);
17997        xmlResetLastError();
17998        if (mem_base != xmlMemBlocks()) {
17999            printf("Leak of %d blocks found in xmlAddSibling",
18000	           xmlMemBlocks() - mem_base);
18001	    test_ret++;
18002            printf(" %d", n_cur);
18003            printf(" %d", n_elem);
18004            printf("\n");
18005        }
18006    }
18007    }
18008    function_tests++;
18009
18010    return(test_ret);
18011}
18012
18013
18014static int
18015test_xmlAttrSerializeTxtContent(void) {
18016    int test_ret = 0;
18017
18018#if defined(LIBXML_OUTPUT_ENABLED)
18019#ifdef LIBXML_OUTPUT_ENABLED
18020    int mem_base;
18021    xmlBufferPtr buf; /* the XML buffer output */
18022    int n_buf;
18023    xmlDocPtr doc; /* the document */
18024    int n_doc;
18025    xmlAttrPtr attr; /* the attribute node */
18026    int n_attr;
18027    xmlChar * string; /* the text content */
18028    int n_string;
18029
18030    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18031    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18032    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18033    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18034        mem_base = xmlMemBlocks();
18035        buf = gen_xmlBufferPtr(n_buf, 0);
18036        doc = gen_xmlDocPtr(n_doc, 1);
18037        attr = gen_xmlAttrPtr(n_attr, 2);
18038        string = gen_const_xmlChar_ptr(n_string, 3);
18039
18040        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18041        call_tests++;
18042        des_xmlBufferPtr(n_buf, buf, 0);
18043        des_xmlDocPtr(n_doc, doc, 1);
18044        des_xmlAttrPtr(n_attr, attr, 2);
18045        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18046        xmlResetLastError();
18047        if (mem_base != xmlMemBlocks()) {
18048            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18049	           xmlMemBlocks() - mem_base);
18050	    test_ret++;
18051            printf(" %d", n_buf);
18052            printf(" %d", n_doc);
18053            printf(" %d", n_attr);
18054            printf(" %d", n_string);
18055            printf("\n");
18056        }
18057    }
18058    }
18059    }
18060    }
18061    function_tests++;
18062#endif
18063#endif
18064
18065    return(test_ret);
18066}
18067
18068
18069static int
18070test_xmlBufferAdd(void) {
18071    int test_ret = 0;
18072
18073    int mem_base;
18074    int ret_val;
18075    xmlBufferPtr buf; /* the buffer to dump */
18076    int n_buf;
18077    xmlChar * str; /* the #xmlChar string */
18078    int n_str;
18079    int len; /* the number of #xmlChar to add */
18080    int n_len;
18081
18082    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18083    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18084    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18085        mem_base = xmlMemBlocks();
18086        buf = gen_xmlBufferPtr(n_buf, 0);
18087        str = gen_const_xmlChar_ptr(n_str, 1);
18088        len = gen_int(n_len, 2);
18089
18090        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18091        desret_int(ret_val);
18092        call_tests++;
18093        des_xmlBufferPtr(n_buf, buf, 0);
18094        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18095        des_int(n_len, len, 2);
18096        xmlResetLastError();
18097        if (mem_base != xmlMemBlocks()) {
18098            printf("Leak of %d blocks found in xmlBufferAdd",
18099	           xmlMemBlocks() - mem_base);
18100	    test_ret++;
18101            printf(" %d", n_buf);
18102            printf(" %d", n_str);
18103            printf(" %d", n_len);
18104            printf("\n");
18105        }
18106    }
18107    }
18108    }
18109    function_tests++;
18110
18111    return(test_ret);
18112}
18113
18114
18115static int
18116test_xmlBufferAddHead(void) {
18117    int test_ret = 0;
18118
18119    int mem_base;
18120    int ret_val;
18121    xmlBufferPtr buf; /* the buffer */
18122    int n_buf;
18123    xmlChar * str; /* the #xmlChar string */
18124    int n_str;
18125    int len; /* the number of #xmlChar to add */
18126    int n_len;
18127
18128    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18129    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18130    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18131        mem_base = xmlMemBlocks();
18132        buf = gen_xmlBufferPtr(n_buf, 0);
18133        str = gen_const_xmlChar_ptr(n_str, 1);
18134        len = gen_int(n_len, 2);
18135
18136        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18137        desret_int(ret_val);
18138        call_tests++;
18139        des_xmlBufferPtr(n_buf, buf, 0);
18140        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18141        des_int(n_len, len, 2);
18142        xmlResetLastError();
18143        if (mem_base != xmlMemBlocks()) {
18144            printf("Leak of %d blocks found in xmlBufferAddHead",
18145	           xmlMemBlocks() - mem_base);
18146	    test_ret++;
18147            printf(" %d", n_buf);
18148            printf(" %d", n_str);
18149            printf(" %d", n_len);
18150            printf("\n");
18151        }
18152    }
18153    }
18154    }
18155    function_tests++;
18156
18157    return(test_ret);
18158}
18159
18160
18161static int
18162test_xmlBufferCCat(void) {
18163    int test_ret = 0;
18164
18165    int mem_base;
18166    int ret_val;
18167    xmlBufferPtr buf; /* the buffer to dump */
18168    int n_buf;
18169    char * str; /* the C char string */
18170    int n_str;
18171
18172    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18173    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18174        mem_base = xmlMemBlocks();
18175        buf = gen_xmlBufferPtr(n_buf, 0);
18176        str = gen_const_char_ptr(n_str, 1);
18177
18178        ret_val = xmlBufferCCat(buf, (const char *)str);
18179        desret_int(ret_val);
18180        call_tests++;
18181        des_xmlBufferPtr(n_buf, buf, 0);
18182        des_const_char_ptr(n_str, (const char *)str, 1);
18183        xmlResetLastError();
18184        if (mem_base != xmlMemBlocks()) {
18185            printf("Leak of %d blocks found in xmlBufferCCat",
18186	           xmlMemBlocks() - mem_base);
18187	    test_ret++;
18188            printf(" %d", n_buf);
18189            printf(" %d", n_str);
18190            printf("\n");
18191        }
18192    }
18193    }
18194    function_tests++;
18195
18196    return(test_ret);
18197}
18198
18199
18200static int
18201test_xmlBufferCat(void) {
18202    int test_ret = 0;
18203
18204    int mem_base;
18205    int ret_val;
18206    xmlBufferPtr buf; /* the buffer to add to */
18207    int n_buf;
18208    xmlChar * str; /* the #xmlChar string */
18209    int n_str;
18210
18211    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18212    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18213        mem_base = xmlMemBlocks();
18214        buf = gen_xmlBufferPtr(n_buf, 0);
18215        str = gen_const_xmlChar_ptr(n_str, 1);
18216
18217        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18218        desret_int(ret_val);
18219        call_tests++;
18220        des_xmlBufferPtr(n_buf, buf, 0);
18221        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18222        xmlResetLastError();
18223        if (mem_base != xmlMemBlocks()) {
18224            printf("Leak of %d blocks found in xmlBufferCat",
18225	           xmlMemBlocks() - mem_base);
18226	    test_ret++;
18227            printf(" %d", n_buf);
18228            printf(" %d", n_str);
18229            printf("\n");
18230        }
18231    }
18232    }
18233    function_tests++;
18234
18235    return(test_ret);
18236}
18237
18238
18239#define gen_nb_const_xmlBufferPtr 1
18240static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18241    return(NULL);
18242}
18243static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18244}
18245
18246static int
18247test_xmlBufferContent(void) {
18248    int test_ret = 0;
18249
18250    int mem_base;
18251    const xmlChar * ret_val;
18252    xmlBufferPtr buf; /* the buffer */
18253    int n_buf;
18254
18255    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18256        mem_base = xmlMemBlocks();
18257        buf = gen_const_xmlBufferPtr(n_buf, 0);
18258
18259        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18260        desret_const_xmlChar_ptr(ret_val);
18261        call_tests++;
18262        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18263        xmlResetLastError();
18264        if (mem_base != xmlMemBlocks()) {
18265            printf("Leak of %d blocks found in xmlBufferContent",
18266	           xmlMemBlocks() - mem_base);
18267	    test_ret++;
18268            printf(" %d", n_buf);
18269            printf("\n");
18270        }
18271    }
18272    function_tests++;
18273
18274    return(test_ret);
18275}
18276
18277
18278static int
18279test_xmlBufferCreate(void) {
18280    int test_ret = 0;
18281
18282    int mem_base;
18283    xmlBufferPtr ret_val;
18284
18285        mem_base = xmlMemBlocks();
18286
18287        ret_val = xmlBufferCreate();
18288        desret_xmlBufferPtr(ret_val);
18289        call_tests++;
18290        xmlResetLastError();
18291        if (mem_base != xmlMemBlocks()) {
18292            printf("Leak of %d blocks found in xmlBufferCreate",
18293	           xmlMemBlocks() - mem_base);
18294	    test_ret++;
18295            printf("\n");
18296        }
18297    function_tests++;
18298
18299    return(test_ret);
18300}
18301
18302
18303static int
18304test_xmlBufferCreateSize(void) {
18305    int test_ret = 0;
18306
18307
18308    /* missing type support */
18309    return(test_ret);
18310}
18311
18312
18313static int
18314test_xmlBufferCreateStatic(void) {
18315    int test_ret = 0;
18316
18317
18318    /* missing type support */
18319    return(test_ret);
18320}
18321
18322
18323static int
18324test_xmlBufferEmpty(void) {
18325    int test_ret = 0;
18326
18327    int mem_base;
18328    xmlBufferPtr buf; /* the buffer */
18329    int n_buf;
18330
18331    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18332        mem_base = xmlMemBlocks();
18333        buf = gen_xmlBufferPtr(n_buf, 0);
18334
18335        xmlBufferEmpty(buf);
18336        call_tests++;
18337        des_xmlBufferPtr(n_buf, buf, 0);
18338        xmlResetLastError();
18339        if (mem_base != xmlMemBlocks()) {
18340            printf("Leak of %d blocks found in xmlBufferEmpty",
18341	           xmlMemBlocks() - mem_base);
18342	    test_ret++;
18343            printf(" %d", n_buf);
18344            printf("\n");
18345        }
18346    }
18347    function_tests++;
18348
18349    return(test_ret);
18350}
18351
18352
18353static int
18354test_xmlBufferGrow(void) {
18355    int test_ret = 0;
18356
18357    int mem_base;
18358    int ret_val;
18359    xmlBufferPtr buf; /* the buffer */
18360    int n_buf;
18361    unsigned int len; /* the minimum free size to allocate */
18362    int n_len;
18363
18364    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18365    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18366        mem_base = xmlMemBlocks();
18367        buf = gen_xmlBufferPtr(n_buf, 0);
18368        len = gen_unsigned_int(n_len, 1);
18369
18370        ret_val = xmlBufferGrow(buf, len);
18371        desret_int(ret_val);
18372        call_tests++;
18373        des_xmlBufferPtr(n_buf, buf, 0);
18374        des_unsigned_int(n_len, len, 1);
18375        xmlResetLastError();
18376        if (mem_base != xmlMemBlocks()) {
18377            printf("Leak of %d blocks found in xmlBufferGrow",
18378	           xmlMemBlocks() - mem_base);
18379	    test_ret++;
18380            printf(" %d", n_buf);
18381            printf(" %d", n_len);
18382            printf("\n");
18383        }
18384    }
18385    }
18386    function_tests++;
18387
18388    return(test_ret);
18389}
18390
18391
18392static int
18393test_xmlBufferLength(void) {
18394    int test_ret = 0;
18395
18396    int mem_base;
18397    int ret_val;
18398    xmlBufferPtr buf; /* the buffer */
18399    int n_buf;
18400
18401    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18402        mem_base = xmlMemBlocks();
18403        buf = gen_const_xmlBufferPtr(n_buf, 0);
18404
18405        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18406        desret_int(ret_val);
18407        call_tests++;
18408        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18409        xmlResetLastError();
18410        if (mem_base != xmlMemBlocks()) {
18411            printf("Leak of %d blocks found in xmlBufferLength",
18412	           xmlMemBlocks() - mem_base);
18413	    test_ret++;
18414            printf(" %d", n_buf);
18415            printf("\n");
18416        }
18417    }
18418    function_tests++;
18419
18420    return(test_ret);
18421}
18422
18423
18424static int
18425test_xmlBufferResize(void) {
18426    int test_ret = 0;
18427
18428    int mem_base;
18429    int ret_val;
18430    xmlBufferPtr buf; /* the buffer to resize */
18431    int n_buf;
18432    unsigned int size; /* the desired size */
18433    int n_size;
18434
18435    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18436    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18437        mem_base = xmlMemBlocks();
18438        buf = gen_xmlBufferPtr(n_buf, 0);
18439        size = gen_unsigned_int(n_size, 1);
18440
18441        ret_val = xmlBufferResize(buf, size);
18442        desret_int(ret_val);
18443        call_tests++;
18444        des_xmlBufferPtr(n_buf, buf, 0);
18445        des_unsigned_int(n_size, size, 1);
18446        xmlResetLastError();
18447        if (mem_base != xmlMemBlocks()) {
18448            printf("Leak of %d blocks found in xmlBufferResize",
18449	           xmlMemBlocks() - mem_base);
18450	    test_ret++;
18451            printf(" %d", n_buf);
18452            printf(" %d", n_size);
18453            printf("\n");
18454        }
18455    }
18456    }
18457    function_tests++;
18458
18459    return(test_ret);
18460}
18461
18462
18463static int
18464test_xmlBufferSetAllocationScheme(void) {
18465    int test_ret = 0;
18466
18467    int mem_base;
18468    xmlBufferPtr buf; /* the buffer to tune */
18469    int n_buf;
18470    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18471    int n_scheme;
18472
18473    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18474    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18475        mem_base = xmlMemBlocks();
18476        buf = gen_xmlBufferPtr(n_buf, 0);
18477        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18478
18479        xmlBufferSetAllocationScheme(buf, scheme);
18480        call_tests++;
18481        des_xmlBufferPtr(n_buf, buf, 0);
18482        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18483        xmlResetLastError();
18484        if (mem_base != xmlMemBlocks()) {
18485            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18486	           xmlMemBlocks() - mem_base);
18487	    test_ret++;
18488            printf(" %d", n_buf);
18489            printf(" %d", n_scheme);
18490            printf("\n");
18491        }
18492    }
18493    }
18494    function_tests++;
18495
18496    return(test_ret);
18497}
18498
18499
18500static int
18501test_xmlBufferShrink(void) {
18502    int test_ret = 0;
18503
18504    int mem_base;
18505    int ret_val;
18506    xmlBufferPtr buf; /* the buffer to dump */
18507    int n_buf;
18508    unsigned int len; /* the number of xmlChar to remove */
18509    int n_len;
18510
18511    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18512    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18513        mem_base = xmlMemBlocks();
18514        buf = gen_xmlBufferPtr(n_buf, 0);
18515        len = gen_unsigned_int(n_len, 1);
18516
18517        ret_val = xmlBufferShrink(buf, len);
18518        desret_int(ret_val);
18519        call_tests++;
18520        des_xmlBufferPtr(n_buf, buf, 0);
18521        des_unsigned_int(n_len, len, 1);
18522        xmlResetLastError();
18523        if (mem_base != xmlMemBlocks()) {
18524            printf("Leak of %d blocks found in xmlBufferShrink",
18525	           xmlMemBlocks() - mem_base);
18526	    test_ret++;
18527            printf(" %d", n_buf);
18528            printf(" %d", n_len);
18529            printf("\n");
18530        }
18531    }
18532    }
18533    function_tests++;
18534
18535    return(test_ret);
18536}
18537
18538
18539static int
18540test_xmlBufferWriteCHAR(void) {
18541    int test_ret = 0;
18542
18543    int mem_base;
18544    xmlBufferPtr buf; /* the XML buffer */
18545    int n_buf;
18546    xmlChar * string; /* the string to add */
18547    int n_string;
18548
18549    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18550    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18551        mem_base = xmlMemBlocks();
18552        buf = gen_xmlBufferPtr(n_buf, 0);
18553        string = gen_const_xmlChar_ptr(n_string, 1);
18554
18555        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18556        call_tests++;
18557        des_xmlBufferPtr(n_buf, buf, 0);
18558        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18559        xmlResetLastError();
18560        if (mem_base != xmlMemBlocks()) {
18561            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18562	           xmlMemBlocks() - mem_base);
18563	    test_ret++;
18564            printf(" %d", n_buf);
18565            printf(" %d", n_string);
18566            printf("\n");
18567        }
18568    }
18569    }
18570    function_tests++;
18571
18572    return(test_ret);
18573}
18574
18575
18576static int
18577test_xmlBufferWriteChar(void) {
18578    int test_ret = 0;
18579
18580    int mem_base;
18581    xmlBufferPtr buf; /* the XML buffer output */
18582    int n_buf;
18583    char * string; /* the string to add */
18584    int n_string;
18585
18586    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18587    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18588        mem_base = xmlMemBlocks();
18589        buf = gen_xmlBufferPtr(n_buf, 0);
18590        string = gen_const_char_ptr(n_string, 1);
18591
18592        xmlBufferWriteChar(buf, (const char *)string);
18593        call_tests++;
18594        des_xmlBufferPtr(n_buf, buf, 0);
18595        des_const_char_ptr(n_string, (const char *)string, 1);
18596        xmlResetLastError();
18597        if (mem_base != xmlMemBlocks()) {
18598            printf("Leak of %d blocks found in xmlBufferWriteChar",
18599	           xmlMemBlocks() - mem_base);
18600	    test_ret++;
18601            printf(" %d", n_buf);
18602            printf(" %d", n_string);
18603            printf("\n");
18604        }
18605    }
18606    }
18607    function_tests++;
18608
18609    return(test_ret);
18610}
18611
18612
18613static int
18614test_xmlBufferWriteQuotedString(void) {
18615    int test_ret = 0;
18616
18617    int mem_base;
18618    xmlBufferPtr buf; /* the XML buffer output */
18619    int n_buf;
18620    xmlChar * string; /* the string to add */
18621    int n_string;
18622
18623    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18624    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18625        mem_base = xmlMemBlocks();
18626        buf = gen_xmlBufferPtr(n_buf, 0);
18627        string = gen_const_xmlChar_ptr(n_string, 1);
18628
18629        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18630        call_tests++;
18631        des_xmlBufferPtr(n_buf, buf, 0);
18632        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18633        xmlResetLastError();
18634        if (mem_base != xmlMemBlocks()) {
18635            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18636	           xmlMemBlocks() - mem_base);
18637	    test_ret++;
18638            printf(" %d", n_buf);
18639            printf(" %d", n_string);
18640            printf("\n");
18641        }
18642    }
18643    }
18644    function_tests++;
18645
18646    return(test_ret);
18647}
18648
18649
18650static int
18651test_xmlBuildQName(void) {
18652    int test_ret = 0;
18653
18654    int mem_base;
18655    xmlChar * ret_val;
18656    xmlChar * ncname; /* the Name */
18657    int n_ncname;
18658    xmlChar * prefix; /* the prefix */
18659    int n_prefix;
18660    xmlChar * memory; /* preallocated memory */
18661    int n_memory;
18662    int len; /* preallocated memory length */
18663    int n_len;
18664
18665    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18666    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18667    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18668    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18669        mem_base = xmlMemBlocks();
18670        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18671        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18672        memory = gen_xmlChar_ptr(n_memory, 2);
18673        len = gen_int(n_len, 3);
18674
18675        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18676        if ((ret_val != NULL) && (ret_val != ncname) &&
18677              (ret_val != prefix) && (ret_val != memory))
18678              xmlFree(ret_val);
18679	  ret_val = NULL;
18680        desret_xmlChar_ptr(ret_val);
18681        call_tests++;
18682        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18683        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18684        des_xmlChar_ptr(n_memory, memory, 2);
18685        des_int(n_len, len, 3);
18686        xmlResetLastError();
18687        if (mem_base != xmlMemBlocks()) {
18688            printf("Leak of %d blocks found in xmlBuildQName",
18689	           xmlMemBlocks() - mem_base);
18690	    test_ret++;
18691            printf(" %d", n_ncname);
18692            printf(" %d", n_prefix);
18693            printf(" %d", n_memory);
18694            printf(" %d", n_len);
18695            printf("\n");
18696        }
18697    }
18698    }
18699    }
18700    }
18701    function_tests++;
18702
18703    return(test_ret);
18704}
18705
18706
18707static int
18708test_xmlCopyDoc(void) {
18709    int test_ret = 0;
18710
18711#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18712    int mem_base;
18713    xmlDocPtr ret_val;
18714    xmlDocPtr doc; /* the document */
18715    int n_doc;
18716    int recursive; /* if not zero do a recursive copy. */
18717    int n_recursive;
18718
18719    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18720    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18721        mem_base = xmlMemBlocks();
18722        doc = gen_xmlDocPtr(n_doc, 0);
18723        recursive = gen_int(n_recursive, 1);
18724
18725        ret_val = xmlCopyDoc(doc, recursive);
18726        desret_xmlDocPtr(ret_val);
18727        call_tests++;
18728        des_xmlDocPtr(n_doc, doc, 0);
18729        des_int(n_recursive, recursive, 1);
18730        xmlResetLastError();
18731        if (mem_base != xmlMemBlocks()) {
18732            printf("Leak of %d blocks found in xmlCopyDoc",
18733	           xmlMemBlocks() - mem_base);
18734	    test_ret++;
18735            printf(" %d", n_doc);
18736            printf(" %d", n_recursive);
18737            printf("\n");
18738        }
18739    }
18740    }
18741    function_tests++;
18742#endif
18743
18744    return(test_ret);
18745}
18746
18747
18748static int
18749test_xmlCopyDtd(void) {
18750    int test_ret = 0;
18751
18752#if defined(LIBXML_TREE_ENABLED)
18753    int mem_base;
18754    xmlDtdPtr ret_val;
18755    xmlDtdPtr dtd; /* the dtd */
18756    int n_dtd;
18757
18758    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18759        mem_base = xmlMemBlocks();
18760        dtd = gen_xmlDtdPtr(n_dtd, 0);
18761
18762        ret_val = xmlCopyDtd(dtd);
18763        desret_xmlDtdPtr(ret_val);
18764        call_tests++;
18765        des_xmlDtdPtr(n_dtd, dtd, 0);
18766        xmlResetLastError();
18767        if (mem_base != xmlMemBlocks()) {
18768            printf("Leak of %d blocks found in xmlCopyDtd",
18769	           xmlMemBlocks() - mem_base);
18770	    test_ret++;
18771            printf(" %d", n_dtd);
18772            printf("\n");
18773        }
18774    }
18775    function_tests++;
18776#endif
18777
18778    return(test_ret);
18779}
18780
18781
18782static int
18783test_xmlCopyNamespace(void) {
18784    int test_ret = 0;
18785
18786    int mem_base;
18787    xmlNsPtr ret_val;
18788    xmlNsPtr cur; /* the namespace */
18789    int n_cur;
18790
18791    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18792        mem_base = xmlMemBlocks();
18793        cur = gen_xmlNsPtr(n_cur, 0);
18794
18795        ret_val = xmlCopyNamespace(cur);
18796        if (ret_val != NULL) xmlFreeNs(ret_val);
18797        desret_xmlNsPtr(ret_val);
18798        call_tests++;
18799        des_xmlNsPtr(n_cur, cur, 0);
18800        xmlResetLastError();
18801        if (mem_base != xmlMemBlocks()) {
18802            printf("Leak of %d blocks found in xmlCopyNamespace",
18803	           xmlMemBlocks() - mem_base);
18804	    test_ret++;
18805            printf(" %d", n_cur);
18806            printf("\n");
18807        }
18808    }
18809    function_tests++;
18810
18811    return(test_ret);
18812}
18813
18814
18815static int
18816test_xmlCopyNamespaceList(void) {
18817    int test_ret = 0;
18818
18819    int mem_base;
18820    xmlNsPtr ret_val;
18821    xmlNsPtr cur; /* the first namespace */
18822    int n_cur;
18823
18824    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18825        mem_base = xmlMemBlocks();
18826        cur = gen_xmlNsPtr(n_cur, 0);
18827
18828        ret_val = xmlCopyNamespaceList(cur);
18829        if (ret_val != NULL) xmlFreeNsList(ret_val);
18830        desret_xmlNsPtr(ret_val);
18831        call_tests++;
18832        des_xmlNsPtr(n_cur, cur, 0);
18833        xmlResetLastError();
18834        if (mem_base != xmlMemBlocks()) {
18835            printf("Leak of %d blocks found in xmlCopyNamespaceList",
18836	           xmlMemBlocks() - mem_base);
18837	    test_ret++;
18838            printf(" %d", n_cur);
18839            printf("\n");
18840        }
18841    }
18842    function_tests++;
18843
18844    return(test_ret);
18845}
18846
18847
18848static int
18849test_xmlCopyNode(void) {
18850    int test_ret = 0;
18851
18852    int mem_base;
18853    xmlNodePtr ret_val;
18854    xmlNodePtr node; /* the node */
18855    int n_node;
18856    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18857    int n_extended;
18858
18859    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18860    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18861        mem_base = xmlMemBlocks();
18862        node = gen_const_xmlNodePtr(n_node, 0);
18863        extended = gen_int(n_extended, 1);
18864
18865        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
18866        desret_xmlNodePtr(ret_val);
18867        call_tests++;
18868        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18869        des_int(n_extended, extended, 1);
18870        xmlResetLastError();
18871        if (mem_base != xmlMemBlocks()) {
18872            printf("Leak of %d blocks found in xmlCopyNode",
18873	           xmlMemBlocks() - mem_base);
18874	    test_ret++;
18875            printf(" %d", n_node);
18876            printf(" %d", n_extended);
18877            printf("\n");
18878        }
18879    }
18880    }
18881    function_tests++;
18882
18883    return(test_ret);
18884}
18885
18886
18887static int
18888test_xmlCopyNodeList(void) {
18889    int test_ret = 0;
18890
18891    int mem_base;
18892    xmlNodePtr ret_val;
18893    xmlNodePtr node; /* the first node in the list. */
18894    int n_node;
18895
18896    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18897        mem_base = xmlMemBlocks();
18898        node = gen_const_xmlNodePtr(n_node, 0);
18899
18900        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
18901        desret_xmlNodePtr(ret_val);
18902        call_tests++;
18903        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18904        xmlResetLastError();
18905        if (mem_base != xmlMemBlocks()) {
18906            printf("Leak of %d blocks found in xmlCopyNodeList",
18907	           xmlMemBlocks() - mem_base);
18908	    test_ret++;
18909            printf(" %d", n_node);
18910            printf("\n");
18911        }
18912    }
18913    function_tests++;
18914
18915    return(test_ret);
18916}
18917
18918
18919static int
18920test_xmlCopyProp(void) {
18921    int test_ret = 0;
18922
18923    int mem_base;
18924    xmlAttrPtr ret_val;
18925    xmlNodePtr target; /* the element where the attribute will be grafted */
18926    int n_target;
18927    xmlAttrPtr cur; /* the attribute */
18928    int n_cur;
18929
18930    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18931    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18932        mem_base = xmlMemBlocks();
18933        target = gen_xmlNodePtr(n_target, 0);
18934        cur = gen_xmlAttrPtr(n_cur, 1);
18935
18936        ret_val = xmlCopyProp(target, cur);
18937        desret_xmlAttrPtr(ret_val);
18938        call_tests++;
18939        des_xmlNodePtr(n_target, target, 0);
18940        des_xmlAttrPtr(n_cur, cur, 1);
18941        xmlResetLastError();
18942        if (mem_base != xmlMemBlocks()) {
18943            printf("Leak of %d blocks found in xmlCopyProp",
18944	           xmlMemBlocks() - mem_base);
18945	    test_ret++;
18946            printf(" %d", n_target);
18947            printf(" %d", n_cur);
18948            printf("\n");
18949        }
18950    }
18951    }
18952    function_tests++;
18953
18954    return(test_ret);
18955}
18956
18957
18958static int
18959test_xmlCopyPropList(void) {
18960    int test_ret = 0;
18961
18962    int mem_base;
18963    xmlAttrPtr ret_val;
18964    xmlNodePtr target; /* the element where the attributes will be grafted */
18965    int n_target;
18966    xmlAttrPtr cur; /* the first attribute */
18967    int n_cur;
18968
18969    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18970    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18971        mem_base = xmlMemBlocks();
18972        target = gen_xmlNodePtr(n_target, 0);
18973        cur = gen_xmlAttrPtr(n_cur, 1);
18974
18975        ret_val = xmlCopyPropList(target, cur);
18976        desret_xmlAttrPtr(ret_val);
18977        call_tests++;
18978        des_xmlNodePtr(n_target, target, 0);
18979        des_xmlAttrPtr(n_cur, cur, 1);
18980        xmlResetLastError();
18981        if (mem_base != xmlMemBlocks()) {
18982            printf("Leak of %d blocks found in xmlCopyPropList",
18983	           xmlMemBlocks() - mem_base);
18984	    test_ret++;
18985            printf(" %d", n_target);
18986            printf(" %d", n_cur);
18987            printf("\n");
18988        }
18989    }
18990    }
18991    function_tests++;
18992
18993    return(test_ret);
18994}
18995
18996
18997static int
18998test_xmlCreateIntSubset(void) {
18999    int test_ret = 0;
19000
19001    int mem_base;
19002    xmlDtdPtr ret_val;
19003    xmlDocPtr doc; /* the document pointer */
19004    int n_doc;
19005    xmlChar * name; /* the DTD name */
19006    int n_name;
19007    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19008    int n_ExternalID;
19009    xmlChar * SystemID; /* the system ID */
19010    int n_SystemID;
19011
19012    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19013    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19014    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19015    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19016        mem_base = xmlMemBlocks();
19017        doc = gen_xmlDocPtr(n_doc, 0);
19018        name = gen_const_xmlChar_ptr(n_name, 1);
19019        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19020        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19021
19022        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19023        desret_xmlDtdPtr(ret_val);
19024        call_tests++;
19025        des_xmlDocPtr(n_doc, doc, 0);
19026        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19027        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19028        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19029        xmlResetLastError();
19030        if (mem_base != xmlMemBlocks()) {
19031            printf("Leak of %d blocks found in xmlCreateIntSubset",
19032	           xmlMemBlocks() - mem_base);
19033	    test_ret++;
19034            printf(" %d", n_doc);
19035            printf(" %d", n_name);
19036            printf(" %d", n_ExternalID);
19037            printf(" %d", n_SystemID);
19038            printf("\n");
19039        }
19040    }
19041    }
19042    }
19043    }
19044    function_tests++;
19045
19046    return(test_ret);
19047}
19048
19049
19050#define gen_nb_xmlDOMWrapCtxtPtr 1
19051static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19052    return(NULL);
19053}
19054static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19055}
19056
19057static int
19058test_xmlDOMWrapAdoptNode(void) {
19059    int test_ret = 0;
19060
19061    int mem_base;
19062    int ret_val;
19063    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19064    int n_ctxt;
19065    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19066    int n_sourceDoc;
19067    xmlNodePtr node; /* the node to start with */
19068    int n_node;
19069    xmlDocPtr destDoc; /* the destination doc */
19070    int n_destDoc;
19071    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19072    int n_destParent;
19073    int options; /* option flags */
19074    int n_options;
19075
19076    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19077    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19078    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19079    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19080    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19081    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19082        mem_base = xmlMemBlocks();
19083        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19084        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19085        node = gen_xmlNodePtr(n_node, 2);
19086        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19087        destParent = gen_xmlNodePtr(n_destParent, 4);
19088        options = gen_int(n_options, 5);
19089
19090        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19091        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19092        desret_int(ret_val);
19093        call_tests++;
19094        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19095        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19096        des_xmlNodePtr(n_node, node, 2);
19097        des_xmlDocPtr(n_destDoc, destDoc, 3);
19098        des_xmlNodePtr(n_destParent, destParent, 4);
19099        des_int(n_options, options, 5);
19100        xmlResetLastError();
19101        if (mem_base != xmlMemBlocks()) {
19102            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19103	           xmlMemBlocks() - mem_base);
19104	    test_ret++;
19105            printf(" %d", n_ctxt);
19106            printf(" %d", n_sourceDoc);
19107            printf(" %d", n_node);
19108            printf(" %d", n_destDoc);
19109            printf(" %d", n_destParent);
19110            printf(" %d", n_options);
19111            printf("\n");
19112        }
19113    }
19114    }
19115    }
19116    }
19117    }
19118    }
19119    function_tests++;
19120
19121    return(test_ret);
19122}
19123
19124
19125static int
19126test_xmlDOMWrapNewCtxt(void) {
19127    int test_ret = 0;
19128
19129
19130    /* missing type support */
19131    return(test_ret);
19132}
19133
19134
19135static int
19136test_xmlDOMWrapReconcileNamespaces(void) {
19137    int test_ret = 0;
19138
19139    int mem_base;
19140    int ret_val;
19141    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19142    int n_ctxt;
19143    xmlNodePtr elem; /* the element-node */
19144    int n_elem;
19145    int options; /* option flags */
19146    int n_options;
19147
19148    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19149    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19150    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19151        mem_base = xmlMemBlocks();
19152        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19153        elem = gen_xmlNodePtr(n_elem, 1);
19154        options = gen_int(n_options, 2);
19155
19156        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19157        desret_int(ret_val);
19158        call_tests++;
19159        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19160        des_xmlNodePtr(n_elem, elem, 1);
19161        des_int(n_options, options, 2);
19162        xmlResetLastError();
19163        if (mem_base != xmlMemBlocks()) {
19164            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19165	           xmlMemBlocks() - mem_base);
19166	    test_ret++;
19167            printf(" %d", n_ctxt);
19168            printf(" %d", n_elem);
19169            printf(" %d", n_options);
19170            printf("\n");
19171        }
19172    }
19173    }
19174    }
19175    function_tests++;
19176
19177    return(test_ret);
19178}
19179
19180
19181static int
19182test_xmlDOMWrapRemoveNode(void) {
19183    int test_ret = 0;
19184
19185    int mem_base;
19186    int ret_val;
19187    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19188    int n_ctxt;
19189    xmlDocPtr doc; /* the doc */
19190    int n_doc;
19191    xmlNodePtr node; /* the node to be removed. */
19192    int n_node;
19193    int options; /* set of options, unused at the moment */
19194    int n_options;
19195
19196    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19197    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19198    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19199    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19200        mem_base = xmlMemBlocks();
19201        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19202        doc = gen_xmlDocPtr(n_doc, 1);
19203        node = gen_xmlNodePtr(n_node, 2);
19204        options = gen_int(n_options, 3);
19205
19206        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19207        desret_int(ret_val);
19208        call_tests++;
19209        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19210        des_xmlDocPtr(n_doc, doc, 1);
19211        des_xmlNodePtr(n_node, node, 2);
19212        des_int(n_options, options, 3);
19213        xmlResetLastError();
19214        if (mem_base != xmlMemBlocks()) {
19215            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19216	           xmlMemBlocks() - mem_base);
19217	    test_ret++;
19218            printf(" %d", n_ctxt);
19219            printf(" %d", n_doc);
19220            printf(" %d", n_node);
19221            printf(" %d", n_options);
19222            printf("\n");
19223        }
19224    }
19225    }
19226    }
19227    }
19228    function_tests++;
19229
19230    return(test_ret);
19231}
19232
19233
19234static int
19235test_xmlDocCopyNode(void) {
19236    int test_ret = 0;
19237
19238    int mem_base;
19239    xmlNodePtr ret_val;
19240    xmlNodePtr node; /* the node */
19241    int n_node;
19242    xmlDocPtr doc; /* the document */
19243    int n_doc;
19244    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19245    int n_extended;
19246
19247    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19248    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19249    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19250        mem_base = xmlMemBlocks();
19251        node = gen_const_xmlNodePtr(n_node, 0);
19252        doc = gen_xmlDocPtr(n_doc, 1);
19253        extended = gen_int(n_extended, 2);
19254
19255        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19256        desret_xmlNodePtr(ret_val);
19257        call_tests++;
19258        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19259        des_xmlDocPtr(n_doc, doc, 1);
19260        des_int(n_extended, extended, 2);
19261        xmlResetLastError();
19262        if (mem_base != xmlMemBlocks()) {
19263            printf("Leak of %d blocks found in xmlDocCopyNode",
19264	           xmlMemBlocks() - mem_base);
19265	    test_ret++;
19266            printf(" %d", n_node);
19267            printf(" %d", n_doc);
19268            printf(" %d", n_extended);
19269            printf("\n");
19270        }
19271    }
19272    }
19273    }
19274    function_tests++;
19275
19276    return(test_ret);
19277}
19278
19279
19280static int
19281test_xmlDocCopyNodeList(void) {
19282    int test_ret = 0;
19283
19284    int mem_base;
19285    xmlNodePtr ret_val;
19286    xmlDocPtr doc; /* the target document */
19287    int n_doc;
19288    xmlNodePtr node; /* the first node in the list. */
19289    int n_node;
19290
19291    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19292    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19293        mem_base = xmlMemBlocks();
19294        doc = gen_xmlDocPtr(n_doc, 0);
19295        node = gen_const_xmlNodePtr(n_node, 1);
19296
19297        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19298        desret_xmlNodePtr(ret_val);
19299        call_tests++;
19300        des_xmlDocPtr(n_doc, doc, 0);
19301        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19302        xmlResetLastError();
19303        if (mem_base != xmlMemBlocks()) {
19304            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19305	           xmlMemBlocks() - mem_base);
19306	    test_ret++;
19307            printf(" %d", n_doc);
19308            printf(" %d", n_node);
19309            printf("\n");
19310        }
19311    }
19312    }
19313    function_tests++;
19314
19315    return(test_ret);
19316}
19317
19318
19319static int
19320test_xmlDocDump(void) {
19321    int test_ret = 0;
19322
19323#if defined(LIBXML_OUTPUT_ENABLED)
19324    int mem_base;
19325    int ret_val;
19326    FILE * f; /* the FILE* */
19327    int n_f;
19328    xmlDocPtr cur; /* the document */
19329    int n_cur;
19330
19331    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19332    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19333        mem_base = xmlMemBlocks();
19334        f = gen_FILE_ptr(n_f, 0);
19335        cur = gen_xmlDocPtr(n_cur, 1);
19336
19337        ret_val = xmlDocDump(f, cur);
19338        desret_int(ret_val);
19339        call_tests++;
19340        des_FILE_ptr(n_f, f, 0);
19341        des_xmlDocPtr(n_cur, cur, 1);
19342        xmlResetLastError();
19343        if (mem_base != xmlMemBlocks()) {
19344            printf("Leak of %d blocks found in xmlDocDump",
19345	           xmlMemBlocks() - mem_base);
19346	    test_ret++;
19347            printf(" %d", n_f);
19348            printf(" %d", n_cur);
19349            printf("\n");
19350        }
19351    }
19352    }
19353    function_tests++;
19354#endif
19355
19356    return(test_ret);
19357}
19358
19359
19360static int
19361test_xmlDocDumpFormatMemory(void) {
19362    int test_ret = 0;
19363
19364#if defined(LIBXML_OUTPUT_ENABLED)
19365    int mem_base;
19366    xmlDocPtr cur; /* the document */
19367    int n_cur;
19368    xmlChar ** mem; /* OUT: the memory pointer */
19369    int n_mem;
19370    int * size; /* OUT: the memory length */
19371    int n_size;
19372    int format; /* should formatting spaces been added */
19373    int n_format;
19374
19375    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19376    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19377    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19378    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19379        mem_base = xmlMemBlocks();
19380        cur = gen_xmlDocPtr(n_cur, 0);
19381        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19382        size = gen_int_ptr(n_size, 2);
19383        format = gen_int(n_format, 3);
19384
19385        xmlDocDumpFormatMemory(cur, mem, size, format);
19386        call_tests++;
19387        des_xmlDocPtr(n_cur, cur, 0);
19388        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19389        des_int_ptr(n_size, size, 2);
19390        des_int(n_format, format, 3);
19391        xmlResetLastError();
19392        if (mem_base != xmlMemBlocks()) {
19393            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19394	           xmlMemBlocks() - mem_base);
19395	    test_ret++;
19396            printf(" %d", n_cur);
19397            printf(" %d", n_mem);
19398            printf(" %d", n_size);
19399            printf(" %d", n_format);
19400            printf("\n");
19401        }
19402    }
19403    }
19404    }
19405    }
19406    function_tests++;
19407#endif
19408
19409    return(test_ret);
19410}
19411
19412
19413static int
19414test_xmlDocDumpFormatMemoryEnc(void) {
19415    int test_ret = 0;
19416
19417#if defined(LIBXML_OUTPUT_ENABLED)
19418    int mem_base;
19419    xmlDocPtr out_doc; /* Document to generate XML text from */
19420    int n_out_doc;
19421    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19422    int n_doc_txt_ptr;
19423    int * doc_txt_len; /* Length of the generated XML text */
19424    int n_doc_txt_len;
19425    char * txt_encoding; /* Character encoding to use when generating XML text */
19426    int n_txt_encoding;
19427    int format; /* should formatting spaces been added */
19428    int n_format;
19429
19430    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19431    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19432    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19433    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19434    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19435        mem_base = xmlMemBlocks();
19436        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19437        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19438        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19439        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19440        format = gen_int(n_format, 4);
19441
19442        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19443        call_tests++;
19444        des_xmlDocPtr(n_out_doc, out_doc, 0);
19445        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19446        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19447        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19448        des_int(n_format, format, 4);
19449        xmlResetLastError();
19450        if (mem_base != xmlMemBlocks()) {
19451            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19452	           xmlMemBlocks() - mem_base);
19453	    test_ret++;
19454            printf(" %d", n_out_doc);
19455            printf(" %d", n_doc_txt_ptr);
19456            printf(" %d", n_doc_txt_len);
19457            printf(" %d", n_txt_encoding);
19458            printf(" %d", n_format);
19459            printf("\n");
19460        }
19461    }
19462    }
19463    }
19464    }
19465    }
19466    function_tests++;
19467#endif
19468
19469    return(test_ret);
19470}
19471
19472
19473static int
19474test_xmlDocDumpMemory(void) {
19475    int test_ret = 0;
19476
19477#if defined(LIBXML_OUTPUT_ENABLED)
19478    int mem_base;
19479    xmlDocPtr cur; /* the document */
19480    int n_cur;
19481    xmlChar ** mem; /* OUT: the memory pointer */
19482    int n_mem;
19483    int * size; /* OUT: the memory length */
19484    int n_size;
19485
19486    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19487    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19488    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19489        mem_base = xmlMemBlocks();
19490        cur = gen_xmlDocPtr(n_cur, 0);
19491        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19492        size = gen_int_ptr(n_size, 2);
19493
19494        xmlDocDumpMemory(cur, mem, size);
19495        call_tests++;
19496        des_xmlDocPtr(n_cur, cur, 0);
19497        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19498        des_int_ptr(n_size, size, 2);
19499        xmlResetLastError();
19500        if (mem_base != xmlMemBlocks()) {
19501            printf("Leak of %d blocks found in xmlDocDumpMemory",
19502	           xmlMemBlocks() - mem_base);
19503	    test_ret++;
19504            printf(" %d", n_cur);
19505            printf(" %d", n_mem);
19506            printf(" %d", n_size);
19507            printf("\n");
19508        }
19509    }
19510    }
19511    }
19512    function_tests++;
19513#endif
19514
19515    return(test_ret);
19516}
19517
19518
19519static int
19520test_xmlDocDumpMemoryEnc(void) {
19521    int test_ret = 0;
19522
19523#if defined(LIBXML_OUTPUT_ENABLED)
19524    int mem_base;
19525    xmlDocPtr out_doc; /* Document to generate XML text from */
19526    int n_out_doc;
19527    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19528    int n_doc_txt_ptr;
19529    int * doc_txt_len; /* Length of the generated XML text */
19530    int n_doc_txt_len;
19531    char * txt_encoding; /* Character encoding to use when generating XML text */
19532    int n_txt_encoding;
19533
19534    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19535    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19536    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19537    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19538        mem_base = xmlMemBlocks();
19539        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19540        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19541        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19542        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19543
19544        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19545        call_tests++;
19546        des_xmlDocPtr(n_out_doc, out_doc, 0);
19547        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19548        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19549        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19550        xmlResetLastError();
19551        if (mem_base != xmlMemBlocks()) {
19552            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19553	           xmlMemBlocks() - mem_base);
19554	    test_ret++;
19555            printf(" %d", n_out_doc);
19556            printf(" %d", n_doc_txt_ptr);
19557            printf(" %d", n_doc_txt_len);
19558            printf(" %d", n_txt_encoding);
19559            printf("\n");
19560        }
19561    }
19562    }
19563    }
19564    }
19565    function_tests++;
19566#endif
19567
19568    return(test_ret);
19569}
19570
19571
19572static int
19573test_xmlDocFormatDump(void) {
19574    int test_ret = 0;
19575
19576#if defined(LIBXML_OUTPUT_ENABLED)
19577    int mem_base;
19578    int ret_val;
19579    FILE * f; /* the FILE* */
19580    int n_f;
19581    xmlDocPtr cur; /* the document */
19582    int n_cur;
19583    int format; /* should formatting spaces been added */
19584    int n_format;
19585
19586    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19587    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19588    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19589        mem_base = xmlMemBlocks();
19590        f = gen_FILE_ptr(n_f, 0);
19591        cur = gen_xmlDocPtr(n_cur, 1);
19592        format = gen_int(n_format, 2);
19593
19594        ret_val = xmlDocFormatDump(f, cur, format);
19595        desret_int(ret_val);
19596        call_tests++;
19597        des_FILE_ptr(n_f, f, 0);
19598        des_xmlDocPtr(n_cur, cur, 1);
19599        des_int(n_format, format, 2);
19600        xmlResetLastError();
19601        if (mem_base != xmlMemBlocks()) {
19602            printf("Leak of %d blocks found in xmlDocFormatDump",
19603	           xmlMemBlocks() - mem_base);
19604	    test_ret++;
19605            printf(" %d", n_f);
19606            printf(" %d", n_cur);
19607            printf(" %d", n_format);
19608            printf("\n");
19609        }
19610    }
19611    }
19612    }
19613    function_tests++;
19614#endif
19615
19616    return(test_ret);
19617}
19618
19619
19620static int
19621test_xmlDocGetRootElement(void) {
19622    int test_ret = 0;
19623
19624    int mem_base;
19625    xmlNodePtr ret_val;
19626    xmlDocPtr doc; /* the document */
19627    int n_doc;
19628
19629    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19630        mem_base = xmlMemBlocks();
19631        doc = gen_xmlDocPtr(n_doc, 0);
19632
19633        ret_val = xmlDocGetRootElement(doc);
19634        desret_xmlNodePtr(ret_val);
19635        call_tests++;
19636        des_xmlDocPtr(n_doc, doc, 0);
19637        xmlResetLastError();
19638        if (mem_base != xmlMemBlocks()) {
19639            printf("Leak of %d blocks found in xmlDocGetRootElement",
19640	           xmlMemBlocks() - mem_base);
19641	    test_ret++;
19642            printf(" %d", n_doc);
19643            printf("\n");
19644        }
19645    }
19646    function_tests++;
19647
19648    return(test_ret);
19649}
19650
19651
19652static int
19653test_xmlDocSetRootElement(void) {
19654    int test_ret = 0;
19655
19656#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
19657    int mem_base;
19658    xmlNodePtr ret_val;
19659    xmlDocPtr doc; /* the document */
19660    int n_doc;
19661    xmlNodePtr root; /* the new document root element */
19662    int n_root;
19663
19664    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19665    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
19666        mem_base = xmlMemBlocks();
19667        doc = gen_xmlDocPtr(n_doc, 0);
19668        root = gen_xmlNodePtr_in(n_root, 1);
19669
19670        ret_val = xmlDocSetRootElement(doc, root);
19671        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
19672        desret_xmlNodePtr(ret_val);
19673        call_tests++;
19674        des_xmlDocPtr(n_doc, doc, 0);
19675        des_xmlNodePtr_in(n_root, root, 1);
19676        xmlResetLastError();
19677        if (mem_base != xmlMemBlocks()) {
19678            printf("Leak of %d blocks found in xmlDocSetRootElement",
19679	           xmlMemBlocks() - mem_base);
19680	    test_ret++;
19681            printf(" %d", n_doc);
19682            printf(" %d", n_root);
19683            printf("\n");
19684        }
19685    }
19686    }
19687    function_tests++;
19688#endif
19689
19690    return(test_ret);
19691}
19692
19693
19694static int
19695test_xmlElemDump(void) {
19696    int test_ret = 0;
19697
19698#if defined(LIBXML_OUTPUT_ENABLED)
19699    int mem_base;
19700    FILE * f; /* the FILE * for the output */
19701    int n_f;
19702    xmlDocPtr doc; /* the document */
19703    int n_doc;
19704    xmlNodePtr cur; /* the current node */
19705    int n_cur;
19706
19707    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19708    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19709    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
19710        mem_base = xmlMemBlocks();
19711        f = gen_FILE_ptr(n_f, 0);
19712        doc = gen_xmlDocPtr(n_doc, 1);
19713        cur = gen_xmlNodePtr(n_cur, 2);
19714
19715        xmlElemDump(f, doc, cur);
19716        call_tests++;
19717        des_FILE_ptr(n_f, f, 0);
19718        des_xmlDocPtr(n_doc, doc, 1);
19719        des_xmlNodePtr(n_cur, cur, 2);
19720        xmlResetLastError();
19721        if (mem_base != xmlMemBlocks()) {
19722            printf("Leak of %d blocks found in xmlElemDump",
19723	           xmlMemBlocks() - mem_base);
19724	    test_ret++;
19725            printf(" %d", n_f);
19726            printf(" %d", n_doc);
19727            printf(" %d", n_cur);
19728            printf("\n");
19729        }
19730    }
19731    }
19732    }
19733    function_tests++;
19734#endif
19735
19736    return(test_ret);
19737}
19738
19739
19740static int
19741test_xmlGetBufferAllocationScheme(void) {
19742    int test_ret = 0;
19743
19744    int mem_base;
19745    xmlBufferAllocationScheme ret_val;
19746
19747        mem_base = xmlMemBlocks();
19748
19749        ret_val = xmlGetBufferAllocationScheme();
19750        desret_xmlBufferAllocationScheme(ret_val);
19751        call_tests++;
19752        xmlResetLastError();
19753        if (mem_base != xmlMemBlocks()) {
19754            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
19755	           xmlMemBlocks() - mem_base);
19756	    test_ret++;
19757            printf("\n");
19758        }
19759    function_tests++;
19760
19761    return(test_ret);
19762}
19763
19764
19765static int
19766test_xmlGetCompressMode(void) {
19767    int test_ret = 0;
19768
19769    int mem_base;
19770    int ret_val;
19771
19772        mem_base = xmlMemBlocks();
19773
19774        ret_val = xmlGetCompressMode();
19775        desret_int(ret_val);
19776        call_tests++;
19777        xmlResetLastError();
19778        if (mem_base != xmlMemBlocks()) {
19779            printf("Leak of %d blocks found in xmlGetCompressMode",
19780	           xmlMemBlocks() - mem_base);
19781	    test_ret++;
19782            printf("\n");
19783        }
19784    function_tests++;
19785
19786    return(test_ret);
19787}
19788
19789
19790static int
19791test_xmlGetDocCompressMode(void) {
19792    int test_ret = 0;
19793
19794    int mem_base;
19795    int ret_val;
19796    xmlDocPtr doc; /* the document */
19797    int n_doc;
19798
19799    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19800        mem_base = xmlMemBlocks();
19801        doc = gen_xmlDocPtr(n_doc, 0);
19802
19803        ret_val = xmlGetDocCompressMode(doc);
19804        desret_int(ret_val);
19805        call_tests++;
19806        des_xmlDocPtr(n_doc, doc, 0);
19807        xmlResetLastError();
19808        if (mem_base != xmlMemBlocks()) {
19809            printf("Leak of %d blocks found in xmlGetDocCompressMode",
19810	           xmlMemBlocks() - mem_base);
19811	    test_ret++;
19812            printf(" %d", n_doc);
19813            printf("\n");
19814        }
19815    }
19816    function_tests++;
19817
19818    return(test_ret);
19819}
19820
19821
19822static int
19823test_xmlGetIntSubset(void) {
19824    int test_ret = 0;
19825
19826    int mem_base;
19827    xmlDtdPtr ret_val;
19828    xmlDocPtr doc; /* the document pointer */
19829    int n_doc;
19830
19831    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19832        mem_base = xmlMemBlocks();
19833        doc = gen_xmlDocPtr(n_doc, 0);
19834
19835        ret_val = xmlGetIntSubset(doc);
19836        desret_xmlDtdPtr(ret_val);
19837        call_tests++;
19838        des_xmlDocPtr(n_doc, doc, 0);
19839        xmlResetLastError();
19840        if (mem_base != xmlMemBlocks()) {
19841            printf("Leak of %d blocks found in xmlGetIntSubset",
19842	           xmlMemBlocks() - mem_base);
19843	    test_ret++;
19844            printf(" %d", n_doc);
19845            printf("\n");
19846        }
19847    }
19848    function_tests++;
19849
19850    return(test_ret);
19851}
19852
19853
19854static int
19855test_xmlGetLastChild(void) {
19856    int test_ret = 0;
19857
19858    int mem_base;
19859    xmlNodePtr ret_val;
19860    xmlNodePtr parent; /* the parent node */
19861    int n_parent;
19862
19863    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19864        mem_base = xmlMemBlocks();
19865        parent = gen_xmlNodePtr(n_parent, 0);
19866
19867        ret_val = xmlGetLastChild(parent);
19868        desret_xmlNodePtr(ret_val);
19869        call_tests++;
19870        des_xmlNodePtr(n_parent, parent, 0);
19871        xmlResetLastError();
19872        if (mem_base != xmlMemBlocks()) {
19873            printf("Leak of %d blocks found in xmlGetLastChild",
19874	           xmlMemBlocks() - mem_base);
19875	    test_ret++;
19876            printf(" %d", n_parent);
19877            printf("\n");
19878        }
19879    }
19880    function_tests++;
19881
19882    return(test_ret);
19883}
19884
19885
19886static int
19887test_xmlGetLineNo(void) {
19888    int test_ret = 0;
19889
19890    int mem_base;
19891    long ret_val;
19892    xmlNodePtr node; /* valid node */
19893    int n_node;
19894
19895    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19896        mem_base = xmlMemBlocks();
19897        node = gen_xmlNodePtr(n_node, 0);
19898
19899        ret_val = xmlGetLineNo(node);
19900        desret_long(ret_val);
19901        call_tests++;
19902        des_xmlNodePtr(n_node, node, 0);
19903        xmlResetLastError();
19904        if (mem_base != xmlMemBlocks()) {
19905            printf("Leak of %d blocks found in xmlGetLineNo",
19906	           xmlMemBlocks() - mem_base);
19907	    test_ret++;
19908            printf(" %d", n_node);
19909            printf("\n");
19910        }
19911    }
19912    function_tests++;
19913
19914    return(test_ret);
19915}
19916
19917
19918static int
19919test_xmlGetNoNsProp(void) {
19920    int test_ret = 0;
19921
19922    int mem_base;
19923    xmlChar * ret_val;
19924    xmlNodePtr node; /* the node */
19925    int n_node;
19926    xmlChar * name; /* the attribute name */
19927    int n_name;
19928
19929    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19930    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19931        mem_base = xmlMemBlocks();
19932        node = gen_xmlNodePtr(n_node, 0);
19933        name = gen_const_xmlChar_ptr(n_name, 1);
19934
19935        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
19936        desret_xmlChar_ptr(ret_val);
19937        call_tests++;
19938        des_xmlNodePtr(n_node, node, 0);
19939        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19940        xmlResetLastError();
19941        if (mem_base != xmlMemBlocks()) {
19942            printf("Leak of %d blocks found in xmlGetNoNsProp",
19943	           xmlMemBlocks() - mem_base);
19944	    test_ret++;
19945            printf(" %d", n_node);
19946            printf(" %d", n_name);
19947            printf("\n");
19948        }
19949    }
19950    }
19951    function_tests++;
19952
19953    return(test_ret);
19954}
19955
19956
19957static int
19958test_xmlGetNodePath(void) {
19959    int test_ret = 0;
19960
19961#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
19962    int mem_base;
19963    xmlChar * ret_val;
19964    xmlNodePtr node; /* a node */
19965    int n_node;
19966
19967    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19968        mem_base = xmlMemBlocks();
19969        node = gen_xmlNodePtr(n_node, 0);
19970
19971        ret_val = xmlGetNodePath(node);
19972        desret_xmlChar_ptr(ret_val);
19973        call_tests++;
19974        des_xmlNodePtr(n_node, node, 0);
19975        xmlResetLastError();
19976        if (mem_base != xmlMemBlocks()) {
19977            printf("Leak of %d blocks found in xmlGetNodePath",
19978	           xmlMemBlocks() - mem_base);
19979	    test_ret++;
19980            printf(" %d", n_node);
19981            printf("\n");
19982        }
19983    }
19984    function_tests++;
19985#endif
19986
19987    return(test_ret);
19988}
19989
19990
19991static int
19992test_xmlGetNsList(void) {
19993    int test_ret = 0;
19994
19995
19996    /* missing type support */
19997    return(test_ret);
19998}
19999
20000
20001static int
20002test_xmlGetNsProp(void) {
20003    int test_ret = 0;
20004
20005    int mem_base;
20006    xmlChar * ret_val;
20007    xmlNodePtr node; /* the node */
20008    int n_node;
20009    xmlChar * name; /* the attribute name */
20010    int n_name;
20011    xmlChar * nameSpace; /* the URI of the namespace */
20012    int n_nameSpace;
20013
20014    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20015    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20016    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20017        mem_base = xmlMemBlocks();
20018        node = gen_xmlNodePtr(n_node, 0);
20019        name = gen_const_xmlChar_ptr(n_name, 1);
20020        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20021
20022        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20023        desret_xmlChar_ptr(ret_val);
20024        call_tests++;
20025        des_xmlNodePtr(n_node, node, 0);
20026        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20027        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20028        xmlResetLastError();
20029        if (mem_base != xmlMemBlocks()) {
20030            printf("Leak of %d blocks found in xmlGetNsProp",
20031	           xmlMemBlocks() - mem_base);
20032	    test_ret++;
20033            printf(" %d", n_node);
20034            printf(" %d", n_name);
20035            printf(" %d", n_nameSpace);
20036            printf("\n");
20037        }
20038    }
20039    }
20040    }
20041    function_tests++;
20042
20043    return(test_ret);
20044}
20045
20046
20047static int
20048test_xmlGetProp(void) {
20049    int test_ret = 0;
20050
20051    int mem_base;
20052    xmlChar * ret_val;
20053    xmlNodePtr node; /* the node */
20054    int n_node;
20055    xmlChar * name; /* the attribute name */
20056    int n_name;
20057
20058    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20059    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20060        mem_base = xmlMemBlocks();
20061        node = gen_xmlNodePtr(n_node, 0);
20062        name = gen_const_xmlChar_ptr(n_name, 1);
20063
20064        ret_val = xmlGetProp(node, (const xmlChar *)name);
20065        desret_xmlChar_ptr(ret_val);
20066        call_tests++;
20067        des_xmlNodePtr(n_node, node, 0);
20068        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20069        xmlResetLastError();
20070        if (mem_base != xmlMemBlocks()) {
20071            printf("Leak of %d blocks found in xmlGetProp",
20072	           xmlMemBlocks() - mem_base);
20073	    test_ret++;
20074            printf(" %d", n_node);
20075            printf(" %d", n_name);
20076            printf("\n");
20077        }
20078    }
20079    }
20080    function_tests++;
20081
20082    return(test_ret);
20083}
20084
20085
20086static int
20087test_xmlHasNsProp(void) {
20088    int test_ret = 0;
20089
20090    int mem_base;
20091    xmlAttrPtr ret_val;
20092    xmlNodePtr node; /* the node */
20093    int n_node;
20094    xmlChar * name; /* the attribute name */
20095    int n_name;
20096    xmlChar * nameSpace; /* the URI of the namespace */
20097    int n_nameSpace;
20098
20099    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20100    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20101    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20102        mem_base = xmlMemBlocks();
20103        node = gen_xmlNodePtr(n_node, 0);
20104        name = gen_const_xmlChar_ptr(n_name, 1);
20105        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20106
20107        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20108        desret_xmlAttrPtr(ret_val);
20109        call_tests++;
20110        des_xmlNodePtr(n_node, node, 0);
20111        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20112        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20113        xmlResetLastError();
20114        if (mem_base != xmlMemBlocks()) {
20115            printf("Leak of %d blocks found in xmlHasNsProp",
20116	           xmlMemBlocks() - mem_base);
20117	    test_ret++;
20118            printf(" %d", n_node);
20119            printf(" %d", n_name);
20120            printf(" %d", n_nameSpace);
20121            printf("\n");
20122        }
20123    }
20124    }
20125    }
20126    function_tests++;
20127
20128    return(test_ret);
20129}
20130
20131
20132static int
20133test_xmlHasProp(void) {
20134    int test_ret = 0;
20135
20136    int mem_base;
20137    xmlAttrPtr ret_val;
20138    xmlNodePtr node; /* the node */
20139    int n_node;
20140    xmlChar * name; /* the attribute name */
20141    int n_name;
20142
20143    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20144    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20145        mem_base = xmlMemBlocks();
20146        node = gen_xmlNodePtr(n_node, 0);
20147        name = gen_const_xmlChar_ptr(n_name, 1);
20148
20149        ret_val = xmlHasProp(node, (const xmlChar *)name);
20150        desret_xmlAttrPtr(ret_val);
20151        call_tests++;
20152        des_xmlNodePtr(n_node, node, 0);
20153        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20154        xmlResetLastError();
20155        if (mem_base != xmlMemBlocks()) {
20156            printf("Leak of %d blocks found in xmlHasProp",
20157	           xmlMemBlocks() - mem_base);
20158	    test_ret++;
20159            printf(" %d", n_node);
20160            printf(" %d", n_name);
20161            printf("\n");
20162        }
20163    }
20164    }
20165    function_tests++;
20166
20167    return(test_ret);
20168}
20169
20170
20171static int
20172test_xmlIsBlankNode(void) {
20173    int test_ret = 0;
20174
20175    int mem_base;
20176    int ret_val;
20177    xmlNodePtr node; /* the node */
20178    int n_node;
20179
20180    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20181        mem_base = xmlMemBlocks();
20182        node = gen_xmlNodePtr(n_node, 0);
20183
20184        ret_val = xmlIsBlankNode(node);
20185        desret_int(ret_val);
20186        call_tests++;
20187        des_xmlNodePtr(n_node, node, 0);
20188        xmlResetLastError();
20189        if (mem_base != xmlMemBlocks()) {
20190            printf("Leak of %d blocks found in xmlIsBlankNode",
20191	           xmlMemBlocks() - mem_base);
20192	    test_ret++;
20193            printf(" %d", n_node);
20194            printf("\n");
20195        }
20196    }
20197    function_tests++;
20198
20199    return(test_ret);
20200}
20201
20202
20203static int
20204test_xmlIsXHTML(void) {
20205    int test_ret = 0;
20206
20207    int mem_base;
20208    int ret_val;
20209    xmlChar * systemID; /* the system identifier */
20210    int n_systemID;
20211    xmlChar * publicID; /* the public identifier */
20212    int n_publicID;
20213
20214    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20215    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20216        mem_base = xmlMemBlocks();
20217        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20218        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20219
20220        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20221        desret_int(ret_val);
20222        call_tests++;
20223        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20224        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20225        xmlResetLastError();
20226        if (mem_base != xmlMemBlocks()) {
20227            printf("Leak of %d blocks found in xmlIsXHTML",
20228	           xmlMemBlocks() - mem_base);
20229	    test_ret++;
20230            printf(" %d", n_systemID);
20231            printf(" %d", n_publicID);
20232            printf("\n");
20233        }
20234    }
20235    }
20236    function_tests++;
20237
20238    return(test_ret);
20239}
20240
20241
20242static int
20243test_xmlNewCDataBlock(void) {
20244    int test_ret = 0;
20245
20246    int mem_base;
20247    xmlNodePtr ret_val;
20248    xmlDocPtr doc; /* the document */
20249    int n_doc;
20250    xmlChar * content; /* the CDATA block content content */
20251    int n_content;
20252    int len; /* the length of the block */
20253    int n_len;
20254
20255    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20256    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20257    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20258        mem_base = xmlMemBlocks();
20259        doc = gen_xmlDocPtr(n_doc, 0);
20260        content = gen_const_xmlChar_ptr(n_content, 1);
20261        len = gen_int(n_len, 2);
20262
20263        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20264        desret_xmlNodePtr(ret_val);
20265        call_tests++;
20266        des_xmlDocPtr(n_doc, doc, 0);
20267        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20268        des_int(n_len, len, 2);
20269        xmlResetLastError();
20270        if (mem_base != xmlMemBlocks()) {
20271            printf("Leak of %d blocks found in xmlNewCDataBlock",
20272	           xmlMemBlocks() - mem_base);
20273	    test_ret++;
20274            printf(" %d", n_doc);
20275            printf(" %d", n_content);
20276            printf(" %d", n_len);
20277            printf("\n");
20278        }
20279    }
20280    }
20281    }
20282    function_tests++;
20283
20284    return(test_ret);
20285}
20286
20287
20288static int
20289test_xmlNewCharRef(void) {
20290    int test_ret = 0;
20291
20292    int mem_base;
20293    xmlNodePtr ret_val;
20294    xmlDocPtr doc; /* the document */
20295    int n_doc;
20296    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20297    int n_name;
20298
20299    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20300    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20301        mem_base = xmlMemBlocks();
20302        doc = gen_xmlDocPtr(n_doc, 0);
20303        name = gen_const_xmlChar_ptr(n_name, 1);
20304
20305        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20306        desret_xmlNodePtr(ret_val);
20307        call_tests++;
20308        des_xmlDocPtr(n_doc, doc, 0);
20309        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20310        xmlResetLastError();
20311        if (mem_base != xmlMemBlocks()) {
20312            printf("Leak of %d blocks found in xmlNewCharRef",
20313	           xmlMemBlocks() - mem_base);
20314	    test_ret++;
20315            printf(" %d", n_doc);
20316            printf(" %d", n_name);
20317            printf("\n");
20318        }
20319    }
20320    }
20321    function_tests++;
20322
20323    return(test_ret);
20324}
20325
20326
20327static int
20328test_xmlNewChild(void) {
20329    int test_ret = 0;
20330
20331#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20332#ifdef LIBXML_TREE_ENABLED
20333    int mem_base;
20334    xmlNodePtr ret_val;
20335    xmlNodePtr parent; /* the parent node */
20336    int n_parent;
20337    xmlNsPtr ns; /* a namespace if any */
20338    int n_ns;
20339    xmlChar * name; /* the name of the child */
20340    int n_name;
20341    xmlChar * content; /* the XML content of the child if any. */
20342    int n_content;
20343
20344    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20345    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20346    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20347    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20348        mem_base = xmlMemBlocks();
20349        parent = gen_xmlNodePtr(n_parent, 0);
20350        ns = gen_xmlNsPtr(n_ns, 1);
20351        name = gen_const_xmlChar_ptr(n_name, 2);
20352        content = gen_const_xmlChar_ptr(n_content, 3);
20353
20354        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20355        desret_xmlNodePtr(ret_val);
20356        call_tests++;
20357        des_xmlNodePtr(n_parent, parent, 0);
20358        des_xmlNsPtr(n_ns, ns, 1);
20359        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20360        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20361        xmlResetLastError();
20362        if (mem_base != xmlMemBlocks()) {
20363            printf("Leak of %d blocks found in xmlNewChild",
20364	           xmlMemBlocks() - mem_base);
20365	    test_ret++;
20366            printf(" %d", n_parent);
20367            printf(" %d", n_ns);
20368            printf(" %d", n_name);
20369            printf(" %d", n_content);
20370            printf("\n");
20371        }
20372    }
20373    }
20374    }
20375    }
20376    function_tests++;
20377#endif
20378#endif
20379
20380    return(test_ret);
20381}
20382
20383
20384static int
20385test_xmlNewComment(void) {
20386    int test_ret = 0;
20387
20388    int mem_base;
20389    xmlNodePtr ret_val;
20390    xmlChar * content; /* the comment content */
20391    int n_content;
20392
20393    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20394        mem_base = xmlMemBlocks();
20395        content = gen_const_xmlChar_ptr(n_content, 0);
20396
20397        ret_val = xmlNewComment((const xmlChar *)content);
20398        desret_xmlNodePtr(ret_val);
20399        call_tests++;
20400        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20401        xmlResetLastError();
20402        if (mem_base != xmlMemBlocks()) {
20403            printf("Leak of %d blocks found in xmlNewComment",
20404	           xmlMemBlocks() - mem_base);
20405	    test_ret++;
20406            printf(" %d", n_content);
20407            printf("\n");
20408        }
20409    }
20410    function_tests++;
20411
20412    return(test_ret);
20413}
20414
20415
20416static int
20417test_xmlNewDoc(void) {
20418    int test_ret = 0;
20419
20420    int mem_base;
20421    xmlDocPtr ret_val;
20422    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20423    int n_version;
20424
20425    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20426        mem_base = xmlMemBlocks();
20427        version = gen_const_xmlChar_ptr(n_version, 0);
20428
20429        ret_val = xmlNewDoc((const xmlChar *)version);
20430        desret_xmlDocPtr(ret_val);
20431        call_tests++;
20432        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20433        xmlResetLastError();
20434        if (mem_base != xmlMemBlocks()) {
20435            printf("Leak of %d blocks found in xmlNewDoc",
20436	           xmlMemBlocks() - mem_base);
20437	    test_ret++;
20438            printf(" %d", n_version);
20439            printf("\n");
20440        }
20441    }
20442    function_tests++;
20443
20444    return(test_ret);
20445}
20446
20447
20448static int
20449test_xmlNewDocComment(void) {
20450    int test_ret = 0;
20451
20452    int mem_base;
20453    xmlNodePtr ret_val;
20454    xmlDocPtr doc; /* the document */
20455    int n_doc;
20456    xmlChar * content; /* the comment content */
20457    int n_content;
20458
20459    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20460    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20461        mem_base = xmlMemBlocks();
20462        doc = gen_xmlDocPtr(n_doc, 0);
20463        content = gen_const_xmlChar_ptr(n_content, 1);
20464
20465        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20466        desret_xmlNodePtr(ret_val);
20467        call_tests++;
20468        des_xmlDocPtr(n_doc, doc, 0);
20469        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20470        xmlResetLastError();
20471        if (mem_base != xmlMemBlocks()) {
20472            printf("Leak of %d blocks found in xmlNewDocComment",
20473	           xmlMemBlocks() - mem_base);
20474	    test_ret++;
20475            printf(" %d", n_doc);
20476            printf(" %d", n_content);
20477            printf("\n");
20478        }
20479    }
20480    }
20481    function_tests++;
20482
20483    return(test_ret);
20484}
20485
20486
20487static int
20488test_xmlNewDocFragment(void) {
20489    int test_ret = 0;
20490
20491#if defined(LIBXML_TREE_ENABLED)
20492    int mem_base;
20493    xmlNodePtr ret_val;
20494    xmlDocPtr doc; /* the document owning the fragment */
20495    int n_doc;
20496
20497    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20498        mem_base = xmlMemBlocks();
20499        doc = gen_xmlDocPtr(n_doc, 0);
20500
20501        ret_val = xmlNewDocFragment(doc);
20502        desret_xmlNodePtr(ret_val);
20503        call_tests++;
20504        des_xmlDocPtr(n_doc, doc, 0);
20505        xmlResetLastError();
20506        if (mem_base != xmlMemBlocks()) {
20507            printf("Leak of %d blocks found in xmlNewDocFragment",
20508	           xmlMemBlocks() - mem_base);
20509	    test_ret++;
20510            printf(" %d", n_doc);
20511            printf("\n");
20512        }
20513    }
20514    function_tests++;
20515#endif
20516
20517    return(test_ret);
20518}
20519
20520
20521static int
20522test_xmlNewDocNode(void) {
20523    int test_ret = 0;
20524
20525    int mem_base;
20526    xmlNodePtr ret_val;
20527    xmlDocPtr doc; /* the document */
20528    int n_doc;
20529    xmlNsPtr ns; /* namespace if any */
20530    int n_ns;
20531    xmlChar * name; /* the node name */
20532    int n_name;
20533    xmlChar * content; /* the XML text content if any */
20534    int n_content;
20535
20536    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20537    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20538    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20539    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20540        mem_base = xmlMemBlocks();
20541        doc = gen_xmlDocPtr(n_doc, 0);
20542        ns = gen_xmlNsPtr(n_ns, 1);
20543        name = gen_const_xmlChar_ptr(n_name, 2);
20544        content = gen_const_xmlChar_ptr(n_content, 3);
20545
20546        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20547        desret_xmlNodePtr(ret_val);
20548        call_tests++;
20549        des_xmlDocPtr(n_doc, doc, 0);
20550        des_xmlNsPtr(n_ns, ns, 1);
20551        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20552        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20553        xmlResetLastError();
20554        if (mem_base != xmlMemBlocks()) {
20555            printf("Leak of %d blocks found in xmlNewDocNode",
20556	           xmlMemBlocks() - mem_base);
20557	    test_ret++;
20558            printf(" %d", n_doc);
20559            printf(" %d", n_ns);
20560            printf(" %d", n_name);
20561            printf(" %d", n_content);
20562            printf("\n");
20563        }
20564    }
20565    }
20566    }
20567    }
20568    function_tests++;
20569
20570    return(test_ret);
20571}
20572
20573
20574static int
20575test_xmlNewDocNodeEatName(void) {
20576    int test_ret = 0;
20577
20578    int mem_base;
20579    xmlNodePtr ret_val;
20580    xmlDocPtr doc; /* the document */
20581    int n_doc;
20582    xmlNsPtr ns; /* namespace if any */
20583    int n_ns;
20584    xmlChar * name; /* the node name */
20585    int n_name;
20586    xmlChar * content; /* the XML text content if any */
20587    int n_content;
20588
20589    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20590    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20591    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20592    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20593        mem_base = xmlMemBlocks();
20594        doc = gen_xmlDocPtr(n_doc, 0);
20595        ns = gen_xmlNsPtr(n_ns, 1);
20596        name = gen_eaten_name(n_name, 2);
20597        content = gen_const_xmlChar_ptr(n_content, 3);
20598
20599        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
20600        desret_xmlNodePtr(ret_val);
20601        call_tests++;
20602        des_xmlDocPtr(n_doc, doc, 0);
20603        des_xmlNsPtr(n_ns, ns, 1);
20604        des_eaten_name(n_name, name, 2);
20605        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20606        xmlResetLastError();
20607        if (mem_base != xmlMemBlocks()) {
20608            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20609	           xmlMemBlocks() - mem_base);
20610	    test_ret++;
20611            printf(" %d", n_doc);
20612            printf(" %d", n_ns);
20613            printf(" %d", n_name);
20614            printf(" %d", n_content);
20615            printf("\n");
20616        }
20617    }
20618    }
20619    }
20620    }
20621    function_tests++;
20622
20623    return(test_ret);
20624}
20625
20626
20627static int
20628test_xmlNewDocPI(void) {
20629    int test_ret = 0;
20630
20631    int mem_base;
20632    xmlNodePtr ret_val;
20633    xmlDocPtr doc; /* the target document */
20634    int n_doc;
20635    xmlChar * name; /* the processing instruction name */
20636    int n_name;
20637    xmlChar * content; /* the PI content */
20638    int n_content;
20639
20640    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20641    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20642    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20643        mem_base = xmlMemBlocks();
20644        doc = gen_xmlDocPtr(n_doc, 0);
20645        name = gen_const_xmlChar_ptr(n_name, 1);
20646        content = gen_const_xmlChar_ptr(n_content, 2);
20647
20648        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
20649        desret_xmlNodePtr(ret_val);
20650        call_tests++;
20651        des_xmlDocPtr(n_doc, doc, 0);
20652        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20653        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
20654        xmlResetLastError();
20655        if (mem_base != xmlMemBlocks()) {
20656            printf("Leak of %d blocks found in xmlNewDocPI",
20657	           xmlMemBlocks() - mem_base);
20658	    test_ret++;
20659            printf(" %d", n_doc);
20660            printf(" %d", n_name);
20661            printf(" %d", n_content);
20662            printf("\n");
20663        }
20664    }
20665    }
20666    }
20667    function_tests++;
20668
20669    return(test_ret);
20670}
20671
20672
20673static int
20674test_xmlNewDocProp(void) {
20675    int test_ret = 0;
20676
20677    int mem_base;
20678    xmlAttrPtr ret_val;
20679    xmlDocPtr doc; /* the document */
20680    int n_doc;
20681    xmlChar * name; /* the name of the attribute */
20682    int n_name;
20683    xmlChar * value; /* the value of the attribute */
20684    int n_value;
20685
20686    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20687    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20688    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20689        mem_base = xmlMemBlocks();
20690        doc = gen_xmlDocPtr(n_doc, 0);
20691        name = gen_const_xmlChar_ptr(n_name, 1);
20692        value = gen_const_xmlChar_ptr(n_value, 2);
20693
20694        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
20695        desret_xmlAttrPtr(ret_val);
20696        call_tests++;
20697        des_xmlDocPtr(n_doc, doc, 0);
20698        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20699        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20700        xmlResetLastError();
20701        if (mem_base != xmlMemBlocks()) {
20702            printf("Leak of %d blocks found in xmlNewDocProp",
20703	           xmlMemBlocks() - mem_base);
20704	    test_ret++;
20705            printf(" %d", n_doc);
20706            printf(" %d", n_name);
20707            printf(" %d", n_value);
20708            printf("\n");
20709        }
20710    }
20711    }
20712    }
20713    function_tests++;
20714
20715    return(test_ret);
20716}
20717
20718
20719static int
20720test_xmlNewDocRawNode(void) {
20721    int test_ret = 0;
20722
20723#if defined(LIBXML_TREE_ENABLED)
20724#ifdef LIBXML_TREE_ENABLED
20725    int mem_base;
20726    xmlNodePtr ret_val;
20727    xmlDocPtr doc; /* the document */
20728    int n_doc;
20729    xmlNsPtr ns; /* namespace if any */
20730    int n_ns;
20731    xmlChar * name; /* the node name */
20732    int n_name;
20733    xmlChar * content; /* the text content if any */
20734    int n_content;
20735
20736    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20737    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20738    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20739    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20740        mem_base = xmlMemBlocks();
20741        doc = gen_xmlDocPtr(n_doc, 0);
20742        ns = gen_xmlNsPtr(n_ns, 1);
20743        name = gen_const_xmlChar_ptr(n_name, 2);
20744        content = gen_const_xmlChar_ptr(n_content, 3);
20745
20746        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20747        desret_xmlNodePtr(ret_val);
20748        call_tests++;
20749        des_xmlDocPtr(n_doc, doc, 0);
20750        des_xmlNsPtr(n_ns, ns, 1);
20751        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20752        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20753        xmlResetLastError();
20754        if (mem_base != xmlMemBlocks()) {
20755            printf("Leak of %d blocks found in xmlNewDocRawNode",
20756	           xmlMemBlocks() - mem_base);
20757	    test_ret++;
20758            printf(" %d", n_doc);
20759            printf(" %d", n_ns);
20760            printf(" %d", n_name);
20761            printf(" %d", n_content);
20762            printf("\n");
20763        }
20764    }
20765    }
20766    }
20767    }
20768    function_tests++;
20769#endif
20770#endif
20771
20772    return(test_ret);
20773}
20774
20775
20776static int
20777test_xmlNewDocText(void) {
20778    int test_ret = 0;
20779
20780    int mem_base;
20781    xmlNodePtr ret_val;
20782    xmlDocPtr doc; /* the document */
20783    int n_doc;
20784    xmlChar * content; /* the text content */
20785    int n_content;
20786
20787    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20788    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20789        mem_base = xmlMemBlocks();
20790        doc = gen_xmlDocPtr(n_doc, 0);
20791        content = gen_const_xmlChar_ptr(n_content, 1);
20792
20793        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
20794        desret_xmlNodePtr(ret_val);
20795        call_tests++;
20796        des_xmlDocPtr(n_doc, doc, 0);
20797        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20798        xmlResetLastError();
20799        if (mem_base != xmlMemBlocks()) {
20800            printf("Leak of %d blocks found in xmlNewDocText",
20801	           xmlMemBlocks() - mem_base);
20802	    test_ret++;
20803            printf(" %d", n_doc);
20804            printf(" %d", n_content);
20805            printf("\n");
20806        }
20807    }
20808    }
20809    function_tests++;
20810
20811    return(test_ret);
20812}
20813
20814
20815static int
20816test_xmlNewDocTextLen(void) {
20817    int test_ret = 0;
20818
20819    int mem_base;
20820    xmlNodePtr ret_val;
20821    xmlDocPtr doc; /* the document */
20822    int n_doc;
20823    xmlChar * content; /* the text content */
20824    int n_content;
20825    int len; /* the text len. */
20826    int n_len;
20827
20828    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20829    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20830    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20831        mem_base = xmlMemBlocks();
20832        doc = gen_xmlDocPtr(n_doc, 0);
20833        content = gen_const_xmlChar_ptr(n_content, 1);
20834        len = gen_int(n_len, 2);
20835
20836        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
20837        desret_xmlNodePtr(ret_val);
20838        call_tests++;
20839        des_xmlDocPtr(n_doc, doc, 0);
20840        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20841        des_int(n_len, len, 2);
20842        xmlResetLastError();
20843        if (mem_base != xmlMemBlocks()) {
20844            printf("Leak of %d blocks found in xmlNewDocTextLen",
20845	           xmlMemBlocks() - mem_base);
20846	    test_ret++;
20847            printf(" %d", n_doc);
20848            printf(" %d", n_content);
20849            printf(" %d", n_len);
20850            printf("\n");
20851        }
20852    }
20853    }
20854    }
20855    function_tests++;
20856
20857    return(test_ret);
20858}
20859
20860
20861static int
20862test_xmlNewDtd(void) {
20863    int test_ret = 0;
20864
20865    int mem_base;
20866    xmlDtdPtr ret_val;
20867    xmlDocPtr doc; /* the document pointer */
20868    int n_doc;
20869    xmlChar * name; /* the DTD name */
20870    int n_name;
20871    xmlChar * ExternalID; /* the external ID */
20872    int n_ExternalID;
20873    xmlChar * SystemID; /* the system ID */
20874    int n_SystemID;
20875
20876    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20877    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20878    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20879    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20880        mem_base = xmlMemBlocks();
20881        doc = gen_xmlDocPtr(n_doc, 0);
20882        name = gen_const_xmlChar_ptr(n_name, 1);
20883        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20884        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20885
20886        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
20887        desret_xmlDtdPtr(ret_val);
20888        call_tests++;
20889        des_xmlDocPtr(n_doc, doc, 0);
20890        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20891        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
20892        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
20893        xmlResetLastError();
20894        if (mem_base != xmlMemBlocks()) {
20895            printf("Leak of %d blocks found in xmlNewDtd",
20896	           xmlMemBlocks() - mem_base);
20897	    test_ret++;
20898            printf(" %d", n_doc);
20899            printf(" %d", n_name);
20900            printf(" %d", n_ExternalID);
20901            printf(" %d", n_SystemID);
20902            printf("\n");
20903        }
20904    }
20905    }
20906    }
20907    }
20908    function_tests++;
20909
20910    return(test_ret);
20911}
20912
20913
20914static int
20915test_xmlNewNode(void) {
20916    int test_ret = 0;
20917
20918    int mem_base;
20919    xmlNodePtr ret_val;
20920    xmlNsPtr ns; /* namespace if any */
20921    int n_ns;
20922    xmlChar * name; /* the node name */
20923    int n_name;
20924
20925    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20926    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20927        mem_base = xmlMemBlocks();
20928        ns = gen_xmlNsPtr(n_ns, 0);
20929        name = gen_const_xmlChar_ptr(n_name, 1);
20930
20931        ret_val = xmlNewNode(ns, (const xmlChar *)name);
20932        desret_xmlNodePtr(ret_val);
20933        call_tests++;
20934        des_xmlNsPtr(n_ns, ns, 0);
20935        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20936        xmlResetLastError();
20937        if (mem_base != xmlMemBlocks()) {
20938            printf("Leak of %d blocks found in xmlNewNode",
20939	           xmlMemBlocks() - mem_base);
20940	    test_ret++;
20941            printf(" %d", n_ns);
20942            printf(" %d", n_name);
20943            printf("\n");
20944        }
20945    }
20946    }
20947    function_tests++;
20948
20949    return(test_ret);
20950}
20951
20952
20953static int
20954test_xmlNewNodeEatName(void) {
20955    int test_ret = 0;
20956
20957    int mem_base;
20958    xmlNodePtr ret_val;
20959    xmlNsPtr ns; /* namespace if any */
20960    int n_ns;
20961    xmlChar * name; /* the node name */
20962    int n_name;
20963
20964    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20965    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20966        mem_base = xmlMemBlocks();
20967        ns = gen_xmlNsPtr(n_ns, 0);
20968        name = gen_eaten_name(n_name, 1);
20969
20970        ret_val = xmlNewNodeEatName(ns, name);
20971        desret_xmlNodePtr(ret_val);
20972        call_tests++;
20973        des_xmlNsPtr(n_ns, ns, 0);
20974        des_eaten_name(n_name, name, 1);
20975        xmlResetLastError();
20976        if (mem_base != xmlMemBlocks()) {
20977            printf("Leak of %d blocks found in xmlNewNodeEatName",
20978	           xmlMemBlocks() - mem_base);
20979	    test_ret++;
20980            printf(" %d", n_ns);
20981            printf(" %d", n_name);
20982            printf("\n");
20983        }
20984    }
20985    }
20986    function_tests++;
20987
20988    return(test_ret);
20989}
20990
20991
20992static int
20993test_xmlNewNs(void) {
20994    int test_ret = 0;
20995
20996    int mem_base;
20997    xmlNsPtr ret_val;
20998    xmlNodePtr node; /* the element carrying the namespace */
20999    int n_node;
21000    xmlChar * href; /* the URI associated */
21001    int n_href;
21002    xmlChar * prefix; /* the prefix for the namespace */
21003    int n_prefix;
21004
21005    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21006    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21007    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21008        mem_base = xmlMemBlocks();
21009        node = gen_xmlNodePtr(n_node, 0);
21010        href = gen_const_xmlChar_ptr(n_href, 1);
21011        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21012
21013        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21014        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21015        desret_xmlNsPtr(ret_val);
21016        call_tests++;
21017        des_xmlNodePtr(n_node, node, 0);
21018        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21019        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21020        xmlResetLastError();
21021        if (mem_base != xmlMemBlocks()) {
21022            printf("Leak of %d blocks found in xmlNewNs",
21023	           xmlMemBlocks() - mem_base);
21024	    test_ret++;
21025            printf(" %d", n_node);
21026            printf(" %d", n_href);
21027            printf(" %d", n_prefix);
21028            printf("\n");
21029        }
21030    }
21031    }
21032    }
21033    function_tests++;
21034
21035    return(test_ret);
21036}
21037
21038
21039static int
21040test_xmlNewNsProp(void) {
21041    int test_ret = 0;
21042
21043    int mem_base;
21044    xmlAttrPtr ret_val;
21045    xmlNodePtr node; /* the holding node */
21046    int n_node;
21047    xmlNsPtr ns; /* the namespace */
21048    int n_ns;
21049    xmlChar * name; /* the name of the attribute */
21050    int n_name;
21051    xmlChar * value; /* the value of the attribute */
21052    int n_value;
21053
21054    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21055    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21056    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21057    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21058        mem_base = xmlMemBlocks();
21059        node = gen_xmlNodePtr(n_node, 0);
21060        ns = gen_xmlNsPtr(n_ns, 1);
21061        name = gen_const_xmlChar_ptr(n_name, 2);
21062        value = gen_const_xmlChar_ptr(n_value, 3);
21063
21064        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21065        desret_xmlAttrPtr(ret_val);
21066        call_tests++;
21067        des_xmlNodePtr(n_node, node, 0);
21068        des_xmlNsPtr(n_ns, ns, 1);
21069        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21070        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21071        xmlResetLastError();
21072        if (mem_base != xmlMemBlocks()) {
21073            printf("Leak of %d blocks found in xmlNewNsProp",
21074	           xmlMemBlocks() - mem_base);
21075	    test_ret++;
21076            printf(" %d", n_node);
21077            printf(" %d", n_ns);
21078            printf(" %d", n_name);
21079            printf(" %d", n_value);
21080            printf("\n");
21081        }
21082    }
21083    }
21084    }
21085    }
21086    function_tests++;
21087
21088    return(test_ret);
21089}
21090
21091
21092static int
21093test_xmlNewNsPropEatName(void) {
21094    int test_ret = 0;
21095
21096    int mem_base;
21097    xmlAttrPtr ret_val;
21098    xmlNodePtr node; /* the holding node */
21099    int n_node;
21100    xmlNsPtr ns; /* the namespace */
21101    int n_ns;
21102    xmlChar * name; /* the name of the attribute */
21103    int n_name;
21104    xmlChar * value; /* the value of the attribute */
21105    int n_value;
21106
21107    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21108    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21109    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21110    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21111        mem_base = xmlMemBlocks();
21112        node = gen_xmlNodePtr(n_node, 0);
21113        ns = gen_xmlNsPtr(n_ns, 1);
21114        name = gen_eaten_name(n_name, 2);
21115        value = gen_const_xmlChar_ptr(n_value, 3);
21116
21117        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21118        desret_xmlAttrPtr(ret_val);
21119        call_tests++;
21120        des_xmlNodePtr(n_node, node, 0);
21121        des_xmlNsPtr(n_ns, ns, 1);
21122        des_eaten_name(n_name, name, 2);
21123        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21124        xmlResetLastError();
21125        if (mem_base != xmlMemBlocks()) {
21126            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21127	           xmlMemBlocks() - mem_base);
21128	    test_ret++;
21129            printf(" %d", n_node);
21130            printf(" %d", n_ns);
21131            printf(" %d", n_name);
21132            printf(" %d", n_value);
21133            printf("\n");
21134        }
21135    }
21136    }
21137    }
21138    }
21139    function_tests++;
21140
21141    return(test_ret);
21142}
21143
21144
21145static int
21146test_xmlNewPI(void) {
21147    int test_ret = 0;
21148
21149    int mem_base;
21150    xmlNodePtr ret_val;
21151    xmlChar * name; /* the processing instruction name */
21152    int n_name;
21153    xmlChar * content; /* the PI content */
21154    int n_content;
21155
21156    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21157    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21158        mem_base = xmlMemBlocks();
21159        name = gen_const_xmlChar_ptr(n_name, 0);
21160        content = gen_const_xmlChar_ptr(n_content, 1);
21161
21162        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21163        desret_xmlNodePtr(ret_val);
21164        call_tests++;
21165        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21166        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21167        xmlResetLastError();
21168        if (mem_base != xmlMemBlocks()) {
21169            printf("Leak of %d blocks found in xmlNewPI",
21170	           xmlMemBlocks() - mem_base);
21171	    test_ret++;
21172            printf(" %d", n_name);
21173            printf(" %d", n_content);
21174            printf("\n");
21175        }
21176    }
21177    }
21178    function_tests++;
21179
21180    return(test_ret);
21181}
21182
21183
21184static int
21185test_xmlNewProp(void) {
21186    int test_ret = 0;
21187
21188#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21189#ifdef LIBXML_TREE_ENABLED
21190    int mem_base;
21191    xmlAttrPtr ret_val;
21192    xmlNodePtr node; /* the holding node */
21193    int n_node;
21194    xmlChar * name; /* the name of the attribute */
21195    int n_name;
21196    xmlChar * value; /* the value of the attribute */
21197    int n_value;
21198
21199    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21200    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21201    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21202        mem_base = xmlMemBlocks();
21203        node = gen_xmlNodePtr(n_node, 0);
21204        name = gen_const_xmlChar_ptr(n_name, 1);
21205        value = gen_const_xmlChar_ptr(n_value, 2);
21206
21207        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21208        desret_xmlAttrPtr(ret_val);
21209        call_tests++;
21210        des_xmlNodePtr(n_node, node, 0);
21211        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21212        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21213        xmlResetLastError();
21214        if (mem_base != xmlMemBlocks()) {
21215            printf("Leak of %d blocks found in xmlNewProp",
21216	           xmlMemBlocks() - mem_base);
21217	    test_ret++;
21218            printf(" %d", n_node);
21219            printf(" %d", n_name);
21220            printf(" %d", n_value);
21221            printf("\n");
21222        }
21223    }
21224    }
21225    }
21226    function_tests++;
21227#endif
21228#endif
21229
21230    return(test_ret);
21231}
21232
21233
21234static int
21235test_xmlNewReference(void) {
21236    int test_ret = 0;
21237
21238    int mem_base;
21239    xmlNodePtr ret_val;
21240    xmlDocPtr doc; /* the document */
21241    int n_doc;
21242    xmlChar * name; /* the reference name, or the reference string with & and ; */
21243    int n_name;
21244
21245    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21246    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21247        mem_base = xmlMemBlocks();
21248        doc = gen_xmlDocPtr(n_doc, 0);
21249        name = gen_const_xmlChar_ptr(n_name, 1);
21250
21251        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21252        desret_xmlNodePtr(ret_val);
21253        call_tests++;
21254        des_xmlDocPtr(n_doc, doc, 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 xmlNewReference",
21259	           xmlMemBlocks() - mem_base);
21260	    test_ret++;
21261            printf(" %d", n_doc);
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_xmlNewText(void) {
21275    int test_ret = 0;
21276
21277    int mem_base;
21278    xmlNodePtr ret_val;
21279    xmlChar * content; /* the text content */
21280    int n_content;
21281
21282    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21283        mem_base = xmlMemBlocks();
21284        content = gen_const_xmlChar_ptr(n_content, 0);
21285
21286        ret_val = xmlNewText((const xmlChar *)content);
21287        desret_xmlNodePtr(ret_val);
21288        call_tests++;
21289        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21290        xmlResetLastError();
21291        if (mem_base != xmlMemBlocks()) {
21292            printf("Leak of %d blocks found in xmlNewText",
21293	           xmlMemBlocks() - mem_base);
21294	    test_ret++;
21295            printf(" %d", n_content);
21296            printf("\n");
21297        }
21298    }
21299    function_tests++;
21300
21301    return(test_ret);
21302}
21303
21304
21305static int
21306test_xmlNewTextChild(void) {
21307    int test_ret = 0;
21308
21309#if defined(LIBXML_TREE_ENABLED)
21310#ifdef LIBXML_TREE_ENABLED
21311    int mem_base;
21312    xmlNodePtr ret_val;
21313    xmlNodePtr parent; /* the parent node */
21314    int n_parent;
21315    xmlNsPtr ns; /* a namespace if any */
21316    int n_ns;
21317    xmlChar * name; /* the name of the child */
21318    int n_name;
21319    xmlChar * content; /* the text content of the child if any. */
21320    int n_content;
21321
21322    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21323    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21324    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21325    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21326        mem_base = xmlMemBlocks();
21327        parent = gen_xmlNodePtr(n_parent, 0);
21328        ns = gen_xmlNsPtr(n_ns, 1);
21329        name = gen_const_xmlChar_ptr(n_name, 2);
21330        content = gen_const_xmlChar_ptr(n_content, 3);
21331
21332        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21333        desret_xmlNodePtr(ret_val);
21334        call_tests++;
21335        des_xmlNodePtr(n_parent, parent, 0);
21336        des_xmlNsPtr(n_ns, ns, 1);
21337        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21338        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21339        xmlResetLastError();
21340        if (mem_base != xmlMemBlocks()) {
21341            printf("Leak of %d blocks found in xmlNewTextChild",
21342	           xmlMemBlocks() - mem_base);
21343	    test_ret++;
21344            printf(" %d", n_parent);
21345            printf(" %d", n_ns);
21346            printf(" %d", n_name);
21347            printf(" %d", n_content);
21348            printf("\n");
21349        }
21350    }
21351    }
21352    }
21353    }
21354    function_tests++;
21355#endif
21356#endif
21357
21358    return(test_ret);
21359}
21360
21361
21362static int
21363test_xmlNewTextLen(void) {
21364    int test_ret = 0;
21365
21366    int mem_base;
21367    xmlNodePtr ret_val;
21368    xmlChar * content; /* the text content */
21369    int n_content;
21370    int len; /* the text len. */
21371    int n_len;
21372
21373    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21374    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21375        mem_base = xmlMemBlocks();
21376        content = gen_const_xmlChar_ptr(n_content, 0);
21377        len = gen_int(n_len, 1);
21378
21379        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21380        desret_xmlNodePtr(ret_val);
21381        call_tests++;
21382        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21383        des_int(n_len, len, 1);
21384        xmlResetLastError();
21385        if (mem_base != xmlMemBlocks()) {
21386            printf("Leak of %d blocks found in xmlNewTextLen",
21387	           xmlMemBlocks() - mem_base);
21388	    test_ret++;
21389            printf(" %d", n_content);
21390            printf(" %d", n_len);
21391            printf("\n");
21392        }
21393    }
21394    }
21395    function_tests++;
21396
21397    return(test_ret);
21398}
21399
21400
21401static int
21402test_xmlNodeAddContent(void) {
21403    int test_ret = 0;
21404
21405    int mem_base;
21406    xmlNodePtr cur; /* the node being modified */
21407    int n_cur;
21408    xmlChar * content; /* extra content */
21409    int n_content;
21410
21411    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21412    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21413        mem_base = xmlMemBlocks();
21414        cur = gen_xmlNodePtr(n_cur, 0);
21415        content = gen_const_xmlChar_ptr(n_content, 1);
21416
21417        xmlNodeAddContent(cur, (const xmlChar *)content);
21418        call_tests++;
21419        des_xmlNodePtr(n_cur, cur, 0);
21420        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21421        xmlResetLastError();
21422        if (mem_base != xmlMemBlocks()) {
21423            printf("Leak of %d blocks found in xmlNodeAddContent",
21424	           xmlMemBlocks() - mem_base);
21425	    test_ret++;
21426            printf(" %d", n_cur);
21427            printf(" %d", n_content);
21428            printf("\n");
21429        }
21430    }
21431    }
21432    function_tests++;
21433
21434    return(test_ret);
21435}
21436
21437
21438static int
21439test_xmlNodeAddContentLen(void) {
21440    int test_ret = 0;
21441
21442    int mem_base;
21443    xmlNodePtr cur; /* the node being modified */
21444    int n_cur;
21445    xmlChar * content; /* extra content */
21446    int n_content;
21447    int len; /* the size of @content */
21448    int n_len;
21449
21450    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21451    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21452    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21453        mem_base = xmlMemBlocks();
21454        cur = gen_xmlNodePtr(n_cur, 0);
21455        content = gen_const_xmlChar_ptr(n_content, 1);
21456        len = gen_int(n_len, 2);
21457
21458        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21459        call_tests++;
21460        des_xmlNodePtr(n_cur, cur, 0);
21461        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21462        des_int(n_len, len, 2);
21463        xmlResetLastError();
21464        if (mem_base != xmlMemBlocks()) {
21465            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21466	           xmlMemBlocks() - mem_base);
21467	    test_ret++;
21468            printf(" %d", n_cur);
21469            printf(" %d", n_content);
21470            printf(" %d", n_len);
21471            printf("\n");
21472        }
21473    }
21474    }
21475    }
21476    function_tests++;
21477
21478    return(test_ret);
21479}
21480
21481
21482static int
21483test_xmlNodeBufGetContent(void) {
21484    int test_ret = 0;
21485
21486    int mem_base;
21487    int ret_val;
21488    xmlBufferPtr buffer; /* a buffer */
21489    int n_buffer;
21490    xmlNodePtr cur; /* the node being read */
21491    int n_cur;
21492
21493    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21494    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21495        mem_base = xmlMemBlocks();
21496        buffer = gen_xmlBufferPtr(n_buffer, 0);
21497        cur = gen_xmlNodePtr(n_cur, 1);
21498
21499        ret_val = xmlNodeBufGetContent(buffer, cur);
21500        desret_int(ret_val);
21501        call_tests++;
21502        des_xmlBufferPtr(n_buffer, buffer, 0);
21503        des_xmlNodePtr(n_cur, cur, 1);
21504        xmlResetLastError();
21505        if (mem_base != xmlMemBlocks()) {
21506            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21507	           xmlMemBlocks() - mem_base);
21508	    test_ret++;
21509            printf(" %d", n_buffer);
21510            printf(" %d", n_cur);
21511            printf("\n");
21512        }
21513    }
21514    }
21515    function_tests++;
21516
21517    return(test_ret);
21518}
21519
21520
21521static int
21522test_xmlNodeDump(void) {
21523    int test_ret = 0;
21524
21525#if defined(LIBXML_OUTPUT_ENABLED)
21526    int mem_base;
21527    int ret_val;
21528    xmlBufferPtr buf; /* the XML buffer output */
21529    int n_buf;
21530    xmlDocPtr doc; /* the document */
21531    int n_doc;
21532    xmlNodePtr cur; /* the current node */
21533    int n_cur;
21534    int level; /* the imbrication level for indenting */
21535    int n_level;
21536    int format; /* is formatting allowed */
21537    int n_format;
21538
21539    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21540    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21541    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21542    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21543    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21544        mem_base = xmlMemBlocks();
21545        buf = gen_xmlBufferPtr(n_buf, 0);
21546        doc = gen_xmlDocPtr(n_doc, 1);
21547        cur = gen_xmlNodePtr(n_cur, 2);
21548        level = gen_int(n_level, 3);
21549        format = gen_int(n_format, 4);
21550
21551        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21552        desret_int(ret_val);
21553        call_tests++;
21554        des_xmlBufferPtr(n_buf, buf, 0);
21555        des_xmlDocPtr(n_doc, doc, 1);
21556        des_xmlNodePtr(n_cur, cur, 2);
21557        des_int(n_level, level, 3);
21558        des_int(n_format, format, 4);
21559        xmlResetLastError();
21560        if (mem_base != xmlMemBlocks()) {
21561            printf("Leak of %d blocks found in xmlNodeDump",
21562	           xmlMemBlocks() - mem_base);
21563	    test_ret++;
21564            printf(" %d", n_buf);
21565            printf(" %d", n_doc);
21566            printf(" %d", n_cur);
21567            printf(" %d", n_level);
21568            printf(" %d", n_format);
21569            printf("\n");
21570        }
21571    }
21572    }
21573    }
21574    }
21575    }
21576    function_tests++;
21577#endif
21578
21579    return(test_ret);
21580}
21581
21582
21583static int
21584test_xmlNodeDumpOutput(void) {
21585    int test_ret = 0;
21586
21587#if defined(LIBXML_OUTPUT_ENABLED)
21588    int mem_base;
21589    xmlOutputBufferPtr buf; /* the XML buffer output */
21590    int n_buf;
21591    xmlDocPtr doc; /* the document */
21592    int n_doc;
21593    xmlNodePtr cur; /* the current node */
21594    int n_cur;
21595    int level; /* the imbrication level for indenting */
21596    int n_level;
21597    int format; /* is formatting allowed */
21598    int n_format;
21599    char * encoding; /* an optional encoding string */
21600    int n_encoding;
21601
21602    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21603    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21604    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21605    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21606    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21607    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21608        mem_base = xmlMemBlocks();
21609        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21610        doc = gen_xmlDocPtr(n_doc, 1);
21611        cur = gen_xmlNodePtr(n_cur, 2);
21612        level = gen_int(n_level, 3);
21613        format = gen_int(n_format, 4);
21614        encoding = gen_const_char_ptr(n_encoding, 5);
21615
21616        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
21617        call_tests++;
21618        des_xmlOutputBufferPtr(n_buf, buf, 0);
21619        des_xmlDocPtr(n_doc, doc, 1);
21620        des_xmlNodePtr(n_cur, cur, 2);
21621        des_int(n_level, level, 3);
21622        des_int(n_format, format, 4);
21623        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
21624        xmlResetLastError();
21625        if (mem_base != xmlMemBlocks()) {
21626            printf("Leak of %d blocks found in xmlNodeDumpOutput",
21627	           xmlMemBlocks() - mem_base);
21628	    test_ret++;
21629            printf(" %d", n_buf);
21630            printf(" %d", n_doc);
21631            printf(" %d", n_cur);
21632            printf(" %d", n_level);
21633            printf(" %d", n_format);
21634            printf(" %d", n_encoding);
21635            printf("\n");
21636        }
21637    }
21638    }
21639    }
21640    }
21641    }
21642    }
21643    function_tests++;
21644#endif
21645
21646    return(test_ret);
21647}
21648
21649
21650static int
21651test_xmlNodeGetBase(void) {
21652    int test_ret = 0;
21653
21654    int mem_base;
21655    xmlChar * ret_val;
21656    xmlDocPtr doc; /* the document the node pertains to */
21657    int n_doc;
21658    xmlNodePtr cur; /* the node being checked */
21659    int n_cur;
21660
21661    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21662    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21663        mem_base = xmlMemBlocks();
21664        doc = gen_xmlDocPtr(n_doc, 0);
21665        cur = gen_xmlNodePtr(n_cur, 1);
21666
21667        ret_val = xmlNodeGetBase(doc, cur);
21668        desret_xmlChar_ptr(ret_val);
21669        call_tests++;
21670        des_xmlDocPtr(n_doc, doc, 0);
21671        des_xmlNodePtr(n_cur, cur, 1);
21672        xmlResetLastError();
21673        if (mem_base != xmlMemBlocks()) {
21674            printf("Leak of %d blocks found in xmlNodeGetBase",
21675	           xmlMemBlocks() - mem_base);
21676	    test_ret++;
21677            printf(" %d", n_doc);
21678            printf(" %d", n_cur);
21679            printf("\n");
21680        }
21681    }
21682    }
21683    function_tests++;
21684
21685    return(test_ret);
21686}
21687
21688
21689static int
21690test_xmlNodeGetContent(void) {
21691    int test_ret = 0;
21692
21693    int mem_base;
21694    xmlChar * ret_val;
21695    xmlNodePtr cur; /* the node being read */
21696    int n_cur;
21697
21698    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21699        mem_base = xmlMemBlocks();
21700        cur = gen_xmlNodePtr(n_cur, 0);
21701
21702        ret_val = xmlNodeGetContent(cur);
21703        desret_xmlChar_ptr(ret_val);
21704        call_tests++;
21705        des_xmlNodePtr(n_cur, cur, 0);
21706        xmlResetLastError();
21707        if (mem_base != xmlMemBlocks()) {
21708            printf("Leak of %d blocks found in xmlNodeGetContent",
21709	           xmlMemBlocks() - mem_base);
21710	    test_ret++;
21711            printf(" %d", n_cur);
21712            printf("\n");
21713        }
21714    }
21715    function_tests++;
21716
21717    return(test_ret);
21718}
21719
21720
21721static int
21722test_xmlNodeGetLang(void) {
21723    int test_ret = 0;
21724
21725    int mem_base;
21726    xmlChar * ret_val;
21727    xmlNodePtr cur; /* the node being checked */
21728    int n_cur;
21729
21730    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21731        mem_base = xmlMemBlocks();
21732        cur = gen_xmlNodePtr(n_cur, 0);
21733
21734        ret_val = xmlNodeGetLang(cur);
21735        desret_xmlChar_ptr(ret_val);
21736        call_tests++;
21737        des_xmlNodePtr(n_cur, cur, 0);
21738        xmlResetLastError();
21739        if (mem_base != xmlMemBlocks()) {
21740            printf("Leak of %d blocks found in xmlNodeGetLang",
21741	           xmlMemBlocks() - mem_base);
21742	    test_ret++;
21743            printf(" %d", n_cur);
21744            printf("\n");
21745        }
21746    }
21747    function_tests++;
21748
21749    return(test_ret);
21750}
21751
21752
21753static int
21754test_xmlNodeGetSpacePreserve(void) {
21755    int test_ret = 0;
21756
21757    int mem_base;
21758    int ret_val;
21759    xmlNodePtr cur; /* the node being checked */
21760    int n_cur;
21761
21762    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21763        mem_base = xmlMemBlocks();
21764        cur = gen_xmlNodePtr(n_cur, 0);
21765
21766        ret_val = xmlNodeGetSpacePreserve(cur);
21767        desret_int(ret_val);
21768        call_tests++;
21769        des_xmlNodePtr(n_cur, cur, 0);
21770        xmlResetLastError();
21771        if (mem_base != xmlMemBlocks()) {
21772            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
21773	           xmlMemBlocks() - mem_base);
21774	    test_ret++;
21775            printf(" %d", n_cur);
21776            printf("\n");
21777        }
21778    }
21779    function_tests++;
21780
21781    return(test_ret);
21782}
21783
21784
21785static int
21786test_xmlNodeIsText(void) {
21787    int test_ret = 0;
21788
21789    int mem_base;
21790    int ret_val;
21791    xmlNodePtr node; /* the node */
21792    int n_node;
21793
21794    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21795        mem_base = xmlMemBlocks();
21796        node = gen_xmlNodePtr(n_node, 0);
21797
21798        ret_val = xmlNodeIsText(node);
21799        desret_int(ret_val);
21800        call_tests++;
21801        des_xmlNodePtr(n_node, node, 0);
21802        xmlResetLastError();
21803        if (mem_base != xmlMemBlocks()) {
21804            printf("Leak of %d blocks found in xmlNodeIsText",
21805	           xmlMemBlocks() - mem_base);
21806	    test_ret++;
21807            printf(" %d", n_node);
21808            printf("\n");
21809        }
21810    }
21811    function_tests++;
21812
21813    return(test_ret);
21814}
21815
21816
21817static int
21818test_xmlNodeListGetRawString(void) {
21819    int test_ret = 0;
21820
21821#if defined(LIBXML_TREE_ENABLED)
21822    int mem_base;
21823    xmlChar * ret_val;
21824    xmlDocPtr doc; /* the document */
21825    int n_doc;
21826    xmlNodePtr list; /* a Node list */
21827    int n_list;
21828    int inLine; /* should we replace entity contents or show their external form */
21829    int n_inLine;
21830
21831    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21832    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21833    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21834        mem_base = xmlMemBlocks();
21835        doc = gen_xmlDocPtr(n_doc, 0);
21836        list = gen_xmlNodePtr(n_list, 1);
21837        inLine = gen_int(n_inLine, 2);
21838
21839        ret_val = xmlNodeListGetRawString(doc, list, inLine);
21840        desret_xmlChar_ptr(ret_val);
21841        call_tests++;
21842        des_xmlDocPtr(n_doc, doc, 0);
21843        des_xmlNodePtr(n_list, list, 1);
21844        des_int(n_inLine, inLine, 2);
21845        xmlResetLastError();
21846        if (mem_base != xmlMemBlocks()) {
21847            printf("Leak of %d blocks found in xmlNodeListGetRawString",
21848	           xmlMemBlocks() - mem_base);
21849	    test_ret++;
21850            printf(" %d", n_doc);
21851            printf(" %d", n_list);
21852            printf(" %d", n_inLine);
21853            printf("\n");
21854        }
21855    }
21856    }
21857    }
21858    function_tests++;
21859#endif
21860
21861    return(test_ret);
21862}
21863
21864
21865static int
21866test_xmlNodeListGetString(void) {
21867    int test_ret = 0;
21868
21869    int mem_base;
21870    xmlChar * ret_val;
21871    xmlDocPtr doc; /* the document */
21872    int n_doc;
21873    xmlNodePtr list; /* a Node list */
21874    int n_list;
21875    int inLine; /* should we replace entity contents or show their external form */
21876    int n_inLine;
21877
21878    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21879    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21880    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21881        mem_base = xmlMemBlocks();
21882        doc = gen_xmlDocPtr(n_doc, 0);
21883        list = gen_xmlNodePtr(n_list, 1);
21884        inLine = gen_int(n_inLine, 2);
21885
21886        ret_val = xmlNodeListGetString(doc, list, inLine);
21887        desret_xmlChar_ptr(ret_val);
21888        call_tests++;
21889        des_xmlDocPtr(n_doc, doc, 0);
21890        des_xmlNodePtr(n_list, list, 1);
21891        des_int(n_inLine, inLine, 2);
21892        xmlResetLastError();
21893        if (mem_base != xmlMemBlocks()) {
21894            printf("Leak of %d blocks found in xmlNodeListGetString",
21895	           xmlMemBlocks() - mem_base);
21896	    test_ret++;
21897            printf(" %d", n_doc);
21898            printf(" %d", n_list);
21899            printf(" %d", n_inLine);
21900            printf("\n");
21901        }
21902    }
21903    }
21904    }
21905    function_tests++;
21906
21907    return(test_ret);
21908}
21909
21910
21911static int
21912test_xmlNodeSetBase(void) {
21913    int test_ret = 0;
21914
21915#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
21916    int mem_base;
21917    xmlNodePtr cur; /* the node being changed */
21918    int n_cur;
21919    xmlChar * uri; /* the new base URI */
21920    int n_uri;
21921
21922    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21923    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
21924        mem_base = xmlMemBlocks();
21925        cur = gen_xmlNodePtr(n_cur, 0);
21926        uri = gen_const_xmlChar_ptr(n_uri, 1);
21927
21928        xmlNodeSetBase(cur, (const xmlChar *)uri);
21929        call_tests++;
21930        des_xmlNodePtr(n_cur, cur, 0);
21931        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
21932        xmlResetLastError();
21933        if (mem_base != xmlMemBlocks()) {
21934            printf("Leak of %d blocks found in xmlNodeSetBase",
21935	           xmlMemBlocks() - mem_base);
21936	    test_ret++;
21937            printf(" %d", n_cur);
21938            printf(" %d", n_uri);
21939            printf("\n");
21940        }
21941    }
21942    }
21943    function_tests++;
21944#endif
21945
21946    return(test_ret);
21947}
21948
21949
21950static int
21951test_xmlNodeSetContent(void) {
21952    int test_ret = 0;
21953
21954    int mem_base;
21955    xmlNodePtr cur; /* the node being modified */
21956    int n_cur;
21957    xmlChar * content; /* the new value of the content */
21958    int n_content;
21959
21960    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21961    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21962        mem_base = xmlMemBlocks();
21963        cur = gen_xmlNodePtr(n_cur, 0);
21964        content = gen_const_xmlChar_ptr(n_content, 1);
21965
21966        xmlNodeSetContent(cur, (const xmlChar *)content);
21967        call_tests++;
21968        des_xmlNodePtr(n_cur, cur, 0);
21969        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21970        xmlResetLastError();
21971        if (mem_base != xmlMemBlocks()) {
21972            printf("Leak of %d blocks found in xmlNodeSetContent",
21973	           xmlMemBlocks() - mem_base);
21974	    test_ret++;
21975            printf(" %d", n_cur);
21976            printf(" %d", n_content);
21977            printf("\n");
21978        }
21979    }
21980    }
21981    function_tests++;
21982
21983    return(test_ret);
21984}
21985
21986
21987static int
21988test_xmlNodeSetContentLen(void) {
21989    int test_ret = 0;
21990
21991#if defined(LIBXML_TREE_ENABLED)
21992    int mem_base;
21993    xmlNodePtr cur; /* the node being modified */
21994    int n_cur;
21995    xmlChar * content; /* the new value of the content */
21996    int n_content;
21997    int len; /* the size of @content */
21998    int n_len;
21999
22000    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22001    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22002    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22003        mem_base = xmlMemBlocks();
22004        cur = gen_xmlNodePtr(n_cur, 0);
22005        content = gen_const_xmlChar_ptr(n_content, 1);
22006        len = gen_int(n_len, 2);
22007
22008        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22009        call_tests++;
22010        des_xmlNodePtr(n_cur, cur, 0);
22011        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22012        des_int(n_len, len, 2);
22013        xmlResetLastError();
22014        if (mem_base != xmlMemBlocks()) {
22015            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22016	           xmlMemBlocks() - mem_base);
22017	    test_ret++;
22018            printf(" %d", n_cur);
22019            printf(" %d", n_content);
22020            printf(" %d", n_len);
22021            printf("\n");
22022        }
22023    }
22024    }
22025    }
22026    function_tests++;
22027#endif
22028
22029    return(test_ret);
22030}
22031
22032
22033static int
22034test_xmlNodeSetLang(void) {
22035    int test_ret = 0;
22036
22037#if defined(LIBXML_TREE_ENABLED)
22038    int mem_base;
22039    xmlNodePtr cur; /* the node being changed */
22040    int n_cur;
22041    xmlChar * lang; /* the language description */
22042    int n_lang;
22043
22044    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22045    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22046        mem_base = xmlMemBlocks();
22047        cur = gen_xmlNodePtr(n_cur, 0);
22048        lang = gen_const_xmlChar_ptr(n_lang, 1);
22049
22050        xmlNodeSetLang(cur, (const xmlChar *)lang);
22051        call_tests++;
22052        des_xmlNodePtr(n_cur, cur, 0);
22053        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22054        xmlResetLastError();
22055        if (mem_base != xmlMemBlocks()) {
22056            printf("Leak of %d blocks found in xmlNodeSetLang",
22057	           xmlMemBlocks() - mem_base);
22058	    test_ret++;
22059            printf(" %d", n_cur);
22060            printf(" %d", n_lang);
22061            printf("\n");
22062        }
22063    }
22064    }
22065    function_tests++;
22066#endif
22067
22068    return(test_ret);
22069}
22070
22071
22072static int
22073test_xmlNodeSetName(void) {
22074    int test_ret = 0;
22075
22076#if defined(LIBXML_TREE_ENABLED)
22077    int mem_base;
22078    xmlNodePtr cur; /* the node being changed */
22079    int n_cur;
22080    xmlChar * name; /* the new tag name */
22081    int n_name;
22082
22083    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22084    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22085        mem_base = xmlMemBlocks();
22086        cur = gen_xmlNodePtr(n_cur, 0);
22087        name = gen_const_xmlChar_ptr(n_name, 1);
22088
22089        xmlNodeSetName(cur, (const xmlChar *)name);
22090        call_tests++;
22091        des_xmlNodePtr(n_cur, cur, 0);
22092        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22093        xmlResetLastError();
22094        if (mem_base != xmlMemBlocks()) {
22095            printf("Leak of %d blocks found in xmlNodeSetName",
22096	           xmlMemBlocks() - mem_base);
22097	    test_ret++;
22098            printf(" %d", n_cur);
22099            printf(" %d", n_name);
22100            printf("\n");
22101        }
22102    }
22103    }
22104    function_tests++;
22105#endif
22106
22107    return(test_ret);
22108}
22109
22110
22111static int
22112test_xmlNodeSetSpacePreserve(void) {
22113    int test_ret = 0;
22114
22115#if defined(LIBXML_TREE_ENABLED)
22116    int mem_base;
22117    xmlNodePtr cur; /* the node being changed */
22118    int n_cur;
22119    int val; /* the xml:space value ("0": default, 1: "preserve") */
22120    int n_val;
22121
22122    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22123    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22124        mem_base = xmlMemBlocks();
22125        cur = gen_xmlNodePtr(n_cur, 0);
22126        val = gen_int(n_val, 1);
22127
22128        xmlNodeSetSpacePreserve(cur, val);
22129        call_tests++;
22130        des_xmlNodePtr(n_cur, cur, 0);
22131        des_int(n_val, val, 1);
22132        xmlResetLastError();
22133        if (mem_base != xmlMemBlocks()) {
22134            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22135	           xmlMemBlocks() - mem_base);
22136	    test_ret++;
22137            printf(" %d", n_cur);
22138            printf(" %d", n_val);
22139            printf("\n");
22140        }
22141    }
22142    }
22143    function_tests++;
22144#endif
22145
22146    return(test_ret);
22147}
22148
22149
22150static int
22151test_xmlReconciliateNs(void) {
22152    int test_ret = 0;
22153
22154#if defined(LIBXML_TREE_ENABLED)
22155#ifdef LIBXML_TREE_ENABLED
22156    int mem_base;
22157    int ret_val;
22158    xmlDocPtr doc; /* the document */
22159    int n_doc;
22160    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22161    int n_tree;
22162
22163    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22164    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22165        mem_base = xmlMemBlocks();
22166        doc = gen_xmlDocPtr(n_doc, 0);
22167        tree = gen_xmlNodePtr(n_tree, 1);
22168
22169        ret_val = xmlReconciliateNs(doc, tree);
22170        desret_int(ret_val);
22171        call_tests++;
22172        des_xmlDocPtr(n_doc, doc, 0);
22173        des_xmlNodePtr(n_tree, tree, 1);
22174        xmlResetLastError();
22175        if (mem_base != xmlMemBlocks()) {
22176            printf("Leak of %d blocks found in xmlReconciliateNs",
22177	           xmlMemBlocks() - mem_base);
22178	    test_ret++;
22179            printf(" %d", n_doc);
22180            printf(" %d", n_tree);
22181            printf("\n");
22182        }
22183    }
22184    }
22185    function_tests++;
22186#endif
22187#endif
22188
22189    return(test_ret);
22190}
22191
22192
22193static int
22194test_xmlRemoveProp(void) {
22195    int test_ret = 0;
22196
22197#if defined(LIBXML_TREE_ENABLED)
22198    int mem_base;
22199    int ret_val;
22200    xmlAttrPtr cur; /* an attribute */
22201    int n_cur;
22202
22203    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22204        mem_base = xmlMemBlocks();
22205        cur = gen_xmlAttrPtr(n_cur, 0);
22206
22207        ret_val = xmlRemoveProp(cur);
22208        cur = NULL;
22209        desret_int(ret_val);
22210        call_tests++;
22211        des_xmlAttrPtr(n_cur, cur, 0);
22212        xmlResetLastError();
22213        if (mem_base != xmlMemBlocks()) {
22214            printf("Leak of %d blocks found in xmlRemoveProp",
22215	           xmlMemBlocks() - mem_base);
22216	    test_ret++;
22217            printf(" %d", n_cur);
22218            printf("\n");
22219        }
22220    }
22221    function_tests++;
22222#endif
22223
22224    return(test_ret);
22225}
22226
22227
22228static int
22229test_xmlReplaceNode(void) {
22230    int test_ret = 0;
22231
22232#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22233    int mem_base;
22234    xmlNodePtr ret_val;
22235    xmlNodePtr old; /* the old node */
22236    int n_old;
22237    xmlNodePtr cur; /* the node */
22238    int n_cur;
22239
22240    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22241    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22242        mem_base = xmlMemBlocks();
22243        old = gen_xmlNodePtr(n_old, 0);
22244        cur = gen_xmlNodePtr_in(n_cur, 1);
22245
22246        ret_val = xmlReplaceNode(old, cur);
22247        if (cur != NULL) {
22248              xmlUnlinkNode(cur);
22249              xmlFreeNode(cur) ; cur = NULL ; }
22250          if (old != NULL) {
22251              xmlUnlinkNode(old);
22252              xmlFreeNode(old) ; old = NULL ; }
22253	  ret_val = NULL;
22254        desret_xmlNodePtr(ret_val);
22255        call_tests++;
22256        des_xmlNodePtr(n_old, old, 0);
22257        des_xmlNodePtr_in(n_cur, cur, 1);
22258        xmlResetLastError();
22259        if (mem_base != xmlMemBlocks()) {
22260            printf("Leak of %d blocks found in xmlReplaceNode",
22261	           xmlMemBlocks() - mem_base);
22262	    test_ret++;
22263            printf(" %d", n_old);
22264            printf(" %d", n_cur);
22265            printf("\n");
22266        }
22267    }
22268    }
22269    function_tests++;
22270#endif
22271
22272    return(test_ret);
22273}
22274
22275
22276static int
22277test_xmlSaveFile(void) {
22278    int test_ret = 0;
22279
22280#if defined(LIBXML_OUTPUT_ENABLED)
22281    int mem_base;
22282    int ret_val;
22283    const char * filename; /* the filename (or URL) */
22284    int n_filename;
22285    xmlDocPtr cur; /* the document */
22286    int n_cur;
22287
22288    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22289    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22290        mem_base = xmlMemBlocks();
22291        filename = gen_fileoutput(n_filename, 0);
22292        cur = gen_xmlDocPtr(n_cur, 1);
22293
22294        ret_val = xmlSaveFile(filename, cur);
22295        desret_int(ret_val);
22296        call_tests++;
22297        des_fileoutput(n_filename, filename, 0);
22298        des_xmlDocPtr(n_cur, cur, 1);
22299        xmlResetLastError();
22300        if (mem_base != xmlMemBlocks()) {
22301            printf("Leak of %d blocks found in xmlSaveFile",
22302	           xmlMemBlocks() - mem_base);
22303	    test_ret++;
22304            printf(" %d", n_filename);
22305            printf(" %d", n_cur);
22306            printf("\n");
22307        }
22308    }
22309    }
22310    function_tests++;
22311#endif
22312
22313    return(test_ret);
22314}
22315
22316
22317static int
22318test_xmlSaveFileEnc(void) {
22319    int test_ret = 0;
22320
22321#if defined(LIBXML_OUTPUT_ENABLED)
22322    int mem_base;
22323    int ret_val;
22324    const char * filename; /* the filename (or URL) */
22325    int n_filename;
22326    xmlDocPtr cur; /* the document */
22327    int n_cur;
22328    char * encoding; /* the name of an encoding (or NULL) */
22329    int n_encoding;
22330
22331    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22332    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22333    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22334        mem_base = xmlMemBlocks();
22335        filename = gen_fileoutput(n_filename, 0);
22336        cur = gen_xmlDocPtr(n_cur, 1);
22337        encoding = gen_const_char_ptr(n_encoding, 2);
22338
22339        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22340        desret_int(ret_val);
22341        call_tests++;
22342        des_fileoutput(n_filename, filename, 0);
22343        des_xmlDocPtr(n_cur, cur, 1);
22344        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22345        xmlResetLastError();
22346        if (mem_base != xmlMemBlocks()) {
22347            printf("Leak of %d blocks found in xmlSaveFileEnc",
22348	           xmlMemBlocks() - mem_base);
22349	    test_ret++;
22350            printf(" %d", n_filename);
22351            printf(" %d", n_cur);
22352            printf(" %d", n_encoding);
22353            printf("\n");
22354        }
22355    }
22356    }
22357    }
22358    function_tests++;
22359#endif
22360
22361    return(test_ret);
22362}
22363
22364
22365static int
22366test_xmlSaveFileTo(void) {
22367    int test_ret = 0;
22368
22369#if defined(LIBXML_OUTPUT_ENABLED)
22370    int mem_base;
22371    int ret_val;
22372    xmlOutputBufferPtr buf; /* an output I/O buffer */
22373    int n_buf;
22374    xmlDocPtr cur; /* the document */
22375    int n_cur;
22376    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22377    int n_encoding;
22378
22379    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22380    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22381    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22382        mem_base = xmlMemBlocks();
22383        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22384        cur = gen_xmlDocPtr(n_cur, 1);
22385        encoding = gen_const_char_ptr(n_encoding, 2);
22386
22387        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22388        buf = NULL;
22389        desret_int(ret_val);
22390        call_tests++;
22391        des_xmlOutputBufferPtr(n_buf, buf, 0);
22392        des_xmlDocPtr(n_cur, cur, 1);
22393        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22394        xmlResetLastError();
22395        if (mem_base != xmlMemBlocks()) {
22396            printf("Leak of %d blocks found in xmlSaveFileTo",
22397	           xmlMemBlocks() - mem_base);
22398	    test_ret++;
22399            printf(" %d", n_buf);
22400            printf(" %d", n_cur);
22401            printf(" %d", n_encoding);
22402            printf("\n");
22403        }
22404    }
22405    }
22406    }
22407    function_tests++;
22408#endif
22409
22410    return(test_ret);
22411}
22412
22413
22414static int
22415test_xmlSaveFormatFile(void) {
22416    int test_ret = 0;
22417
22418#if defined(LIBXML_OUTPUT_ENABLED)
22419    int mem_base;
22420    int ret_val;
22421    const char * filename; /* the filename (or URL) */
22422    int n_filename;
22423    xmlDocPtr cur; /* the document */
22424    int n_cur;
22425    int format; /* should formatting spaces been added */
22426    int n_format;
22427
22428    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22429    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22430    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22431        mem_base = xmlMemBlocks();
22432        filename = gen_fileoutput(n_filename, 0);
22433        cur = gen_xmlDocPtr(n_cur, 1);
22434        format = gen_int(n_format, 2);
22435
22436        ret_val = xmlSaveFormatFile(filename, cur, format);
22437        desret_int(ret_val);
22438        call_tests++;
22439        des_fileoutput(n_filename, filename, 0);
22440        des_xmlDocPtr(n_cur, cur, 1);
22441        des_int(n_format, format, 2);
22442        xmlResetLastError();
22443        if (mem_base != xmlMemBlocks()) {
22444            printf("Leak of %d blocks found in xmlSaveFormatFile",
22445	           xmlMemBlocks() - mem_base);
22446	    test_ret++;
22447            printf(" %d", n_filename);
22448            printf(" %d", n_cur);
22449            printf(" %d", n_format);
22450            printf("\n");
22451        }
22452    }
22453    }
22454    }
22455    function_tests++;
22456#endif
22457
22458    return(test_ret);
22459}
22460
22461
22462static int
22463test_xmlSaveFormatFileEnc(void) {
22464    int test_ret = 0;
22465
22466#if defined(LIBXML_OUTPUT_ENABLED)
22467    int mem_base;
22468    int ret_val;
22469    const char * filename; /* the filename or URL to output */
22470    int n_filename;
22471    xmlDocPtr cur; /* the document being saved */
22472    int n_cur;
22473    char * encoding; /* the name of the encoding to use or NULL. */
22474    int n_encoding;
22475    int format; /* should formatting spaces be added. */
22476    int n_format;
22477
22478    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22479    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22480    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22481    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22482        mem_base = xmlMemBlocks();
22483        filename = gen_fileoutput(n_filename, 0);
22484        cur = gen_xmlDocPtr(n_cur, 1);
22485        encoding = gen_const_char_ptr(n_encoding, 2);
22486        format = gen_int(n_format, 3);
22487
22488        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22489        desret_int(ret_val);
22490        call_tests++;
22491        des_fileoutput(n_filename, filename, 0);
22492        des_xmlDocPtr(n_cur, cur, 1);
22493        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22494        des_int(n_format, format, 3);
22495        xmlResetLastError();
22496        if (mem_base != xmlMemBlocks()) {
22497            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22498	           xmlMemBlocks() - mem_base);
22499	    test_ret++;
22500            printf(" %d", n_filename);
22501            printf(" %d", n_cur);
22502            printf(" %d", n_encoding);
22503            printf(" %d", n_format);
22504            printf("\n");
22505        }
22506    }
22507    }
22508    }
22509    }
22510    function_tests++;
22511#endif
22512
22513    return(test_ret);
22514}
22515
22516
22517static int
22518test_xmlSaveFormatFileTo(void) {
22519    int test_ret = 0;
22520
22521#if defined(LIBXML_OUTPUT_ENABLED)
22522    int mem_base;
22523    int ret_val;
22524    xmlOutputBufferPtr buf; /* an output I/O buffer */
22525    int n_buf;
22526    xmlDocPtr cur; /* the document */
22527    int n_cur;
22528    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22529    int n_encoding;
22530    int format; /* should formatting spaces been added */
22531    int n_format;
22532
22533    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22534    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22535    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22536    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22537        mem_base = xmlMemBlocks();
22538        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22539        cur = gen_xmlDocPtr(n_cur, 1);
22540        encoding = gen_const_char_ptr(n_encoding, 2);
22541        format = gen_int(n_format, 3);
22542
22543        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22544        buf = NULL;
22545        desret_int(ret_val);
22546        call_tests++;
22547        des_xmlOutputBufferPtr(n_buf, buf, 0);
22548        des_xmlDocPtr(n_cur, cur, 1);
22549        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22550        des_int(n_format, format, 3);
22551        xmlResetLastError();
22552        if (mem_base != xmlMemBlocks()) {
22553            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22554	           xmlMemBlocks() - mem_base);
22555	    test_ret++;
22556            printf(" %d", n_buf);
22557            printf(" %d", n_cur);
22558            printf(" %d", n_encoding);
22559            printf(" %d", n_format);
22560            printf("\n");
22561        }
22562    }
22563    }
22564    }
22565    }
22566    function_tests++;
22567#endif
22568
22569    return(test_ret);
22570}
22571
22572
22573static int
22574test_xmlSearchNs(void) {
22575    int test_ret = 0;
22576
22577    int mem_base;
22578    xmlNsPtr ret_val;
22579    xmlDocPtr doc; /* the document */
22580    int n_doc;
22581    xmlNodePtr node; /* the current node */
22582    int n_node;
22583    xmlChar * nameSpace; /* the namespace prefix */
22584    int n_nameSpace;
22585
22586    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22587    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22588    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22589        mem_base = xmlMemBlocks();
22590        doc = gen_xmlDocPtr(n_doc, 0);
22591        node = gen_xmlNodePtr(n_node, 1);
22592        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22593
22594        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
22595        desret_xmlNsPtr(ret_val);
22596        call_tests++;
22597        des_xmlDocPtr(n_doc, doc, 0);
22598        des_xmlNodePtr(n_node, node, 1);
22599        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
22600        xmlResetLastError();
22601        if (mem_base != xmlMemBlocks()) {
22602            printf("Leak of %d blocks found in xmlSearchNs",
22603	           xmlMemBlocks() - mem_base);
22604	    test_ret++;
22605            printf(" %d", n_doc);
22606            printf(" %d", n_node);
22607            printf(" %d", n_nameSpace);
22608            printf("\n");
22609        }
22610    }
22611    }
22612    }
22613    function_tests++;
22614
22615    return(test_ret);
22616}
22617
22618
22619static int
22620test_xmlSearchNsByHref(void) {
22621    int test_ret = 0;
22622
22623    int mem_base;
22624    xmlNsPtr ret_val;
22625    xmlDocPtr doc; /* the document */
22626    int n_doc;
22627    xmlNodePtr node; /* the current node */
22628    int n_node;
22629    xmlChar * href; /* the namespace value */
22630    int n_href;
22631
22632    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22633    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22634    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22635        mem_base = xmlMemBlocks();
22636        doc = gen_xmlDocPtr(n_doc, 0);
22637        node = gen_xmlNodePtr(n_node, 1);
22638        href = gen_const_xmlChar_ptr(n_href, 2);
22639
22640        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
22641        desret_xmlNsPtr(ret_val);
22642        call_tests++;
22643        des_xmlDocPtr(n_doc, doc, 0);
22644        des_xmlNodePtr(n_node, node, 1);
22645        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
22646        xmlResetLastError();
22647        if (mem_base != xmlMemBlocks()) {
22648            printf("Leak of %d blocks found in xmlSearchNsByHref",
22649	           xmlMemBlocks() - mem_base);
22650	    test_ret++;
22651            printf(" %d", n_doc);
22652            printf(" %d", n_node);
22653            printf(" %d", n_href);
22654            printf("\n");
22655        }
22656    }
22657    }
22658    }
22659    function_tests++;
22660
22661    return(test_ret);
22662}
22663
22664
22665static int
22666test_xmlSetBufferAllocationScheme(void) {
22667    int test_ret = 0;
22668
22669    int mem_base;
22670    xmlBufferAllocationScheme scheme; /* allocation method to use */
22671    int n_scheme;
22672
22673    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
22674        mem_base = xmlMemBlocks();
22675        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
22676
22677        xmlSetBufferAllocationScheme(scheme);
22678        call_tests++;
22679        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
22680        xmlResetLastError();
22681        if (mem_base != xmlMemBlocks()) {
22682            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
22683	           xmlMemBlocks() - mem_base);
22684	    test_ret++;
22685            printf(" %d", n_scheme);
22686            printf("\n");
22687        }
22688    }
22689    function_tests++;
22690
22691    return(test_ret);
22692}
22693
22694
22695static int
22696test_xmlSetCompressMode(void) {
22697    int test_ret = 0;
22698
22699    int mem_base;
22700    int mode; /* the compression ratio */
22701    int n_mode;
22702
22703    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22704        mem_base = xmlMemBlocks();
22705        mode = gen_int(n_mode, 0);
22706
22707        xmlSetCompressMode(mode);
22708        call_tests++;
22709        des_int(n_mode, mode, 0);
22710        xmlResetLastError();
22711        if (mem_base != xmlMemBlocks()) {
22712            printf("Leak of %d blocks found in xmlSetCompressMode",
22713	           xmlMemBlocks() - mem_base);
22714	    test_ret++;
22715            printf(" %d", n_mode);
22716            printf("\n");
22717        }
22718    }
22719    function_tests++;
22720
22721    return(test_ret);
22722}
22723
22724
22725static int
22726test_xmlSetDocCompressMode(void) {
22727    int test_ret = 0;
22728
22729    int mem_base;
22730    xmlDocPtr doc; /* the document */
22731    int n_doc;
22732    int mode; /* the compression ratio */
22733    int n_mode;
22734
22735    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22736    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22737        mem_base = xmlMemBlocks();
22738        doc = gen_xmlDocPtr(n_doc, 0);
22739        mode = gen_int(n_mode, 1);
22740
22741        xmlSetDocCompressMode(doc, mode);
22742        call_tests++;
22743        des_xmlDocPtr(n_doc, doc, 0);
22744        des_int(n_mode, mode, 1);
22745        xmlResetLastError();
22746        if (mem_base != xmlMemBlocks()) {
22747            printf("Leak of %d blocks found in xmlSetDocCompressMode",
22748	           xmlMemBlocks() - mem_base);
22749	    test_ret++;
22750            printf(" %d", n_doc);
22751            printf(" %d", n_mode);
22752            printf("\n");
22753        }
22754    }
22755    }
22756    function_tests++;
22757
22758    return(test_ret);
22759}
22760
22761
22762static int
22763test_xmlSetNs(void) {
22764    int test_ret = 0;
22765
22766    int mem_base;
22767    xmlNodePtr node; /* a node in the document */
22768    int n_node;
22769    xmlNsPtr ns; /* a namespace pointer */
22770    int n_ns;
22771
22772    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22773    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22774        mem_base = xmlMemBlocks();
22775        node = gen_xmlNodePtr(n_node, 0);
22776        ns = gen_xmlNsPtr(n_ns, 1);
22777
22778        xmlSetNs(node, ns);
22779        call_tests++;
22780        des_xmlNodePtr(n_node, node, 0);
22781        des_xmlNsPtr(n_ns, ns, 1);
22782        xmlResetLastError();
22783        if (mem_base != xmlMemBlocks()) {
22784            printf("Leak of %d blocks found in xmlSetNs",
22785	           xmlMemBlocks() - mem_base);
22786	    test_ret++;
22787            printf(" %d", n_node);
22788            printf(" %d", n_ns);
22789            printf("\n");
22790        }
22791    }
22792    }
22793    function_tests++;
22794
22795    return(test_ret);
22796}
22797
22798
22799static int
22800test_xmlSetNsProp(void) {
22801    int test_ret = 0;
22802
22803#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22804    int mem_base;
22805    xmlAttrPtr ret_val;
22806    xmlNodePtr node; /* the node */
22807    int n_node;
22808    xmlNsPtr ns; /* the namespace definition */
22809    int n_ns;
22810    xmlChar * name; /* the attribute name */
22811    int n_name;
22812    xmlChar * value; /* the attribute value */
22813    int n_value;
22814
22815    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22816    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22817    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22818    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22819        mem_base = xmlMemBlocks();
22820        node = gen_xmlNodePtr(n_node, 0);
22821        ns = gen_xmlNsPtr(n_ns, 1);
22822        name = gen_const_xmlChar_ptr(n_name, 2);
22823        value = gen_const_xmlChar_ptr(n_value, 3);
22824
22825        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
22826        desret_xmlAttrPtr(ret_val);
22827        call_tests++;
22828        des_xmlNodePtr(n_node, node, 0);
22829        des_xmlNsPtr(n_ns, ns, 1);
22830        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22831        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22832        xmlResetLastError();
22833        if (mem_base != xmlMemBlocks()) {
22834            printf("Leak of %d blocks found in xmlSetNsProp",
22835	           xmlMemBlocks() - mem_base);
22836	    test_ret++;
22837            printf(" %d", n_node);
22838            printf(" %d", n_ns);
22839            printf(" %d", n_name);
22840            printf(" %d", n_value);
22841            printf("\n");
22842        }
22843    }
22844    }
22845    }
22846    }
22847    function_tests++;
22848#endif
22849
22850    return(test_ret);
22851}
22852
22853
22854static int
22855test_xmlSetProp(void) {
22856    int test_ret = 0;
22857
22858#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22859    int mem_base;
22860    xmlAttrPtr ret_val;
22861    xmlNodePtr node; /* the node */
22862    int n_node;
22863    xmlChar * name; /* the attribute name */
22864    int n_name;
22865    xmlChar * value; /* the attribute value */
22866    int n_value;
22867
22868    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22869    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22870    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22871        mem_base = xmlMemBlocks();
22872        node = gen_xmlNodePtr(n_node, 0);
22873        name = gen_const_xmlChar_ptr(n_name, 1);
22874        value = gen_const_xmlChar_ptr(n_value, 2);
22875
22876        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
22877        desret_xmlAttrPtr(ret_val);
22878        call_tests++;
22879        des_xmlNodePtr(n_node, node, 0);
22880        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22881        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22882        xmlResetLastError();
22883        if (mem_base != xmlMemBlocks()) {
22884            printf("Leak of %d blocks found in xmlSetProp",
22885	           xmlMemBlocks() - mem_base);
22886	    test_ret++;
22887            printf(" %d", n_node);
22888            printf(" %d", n_name);
22889            printf(" %d", n_value);
22890            printf("\n");
22891        }
22892    }
22893    }
22894    }
22895    function_tests++;
22896#endif
22897
22898    return(test_ret);
22899}
22900
22901
22902static int
22903test_xmlSplitQName2(void) {
22904    int test_ret = 0;
22905
22906    int mem_base;
22907    xmlChar * ret_val;
22908    xmlChar * name; /* the full QName */
22909    int n_name;
22910    xmlChar ** prefix; /* a xmlChar ** */
22911    int n_prefix;
22912
22913    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22914    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
22915        mem_base = xmlMemBlocks();
22916        name = gen_const_xmlChar_ptr(n_name, 0);
22917        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
22918
22919        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
22920        desret_xmlChar_ptr(ret_val);
22921        call_tests++;
22922        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22923        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
22924        xmlResetLastError();
22925        if (mem_base != xmlMemBlocks()) {
22926            printf("Leak of %d blocks found in xmlSplitQName2",
22927	           xmlMemBlocks() - mem_base);
22928	    test_ret++;
22929            printf(" %d", n_name);
22930            printf(" %d", n_prefix);
22931            printf("\n");
22932        }
22933    }
22934    }
22935    function_tests++;
22936
22937    return(test_ret);
22938}
22939
22940
22941static int
22942test_xmlSplitQName3(void) {
22943    int test_ret = 0;
22944
22945    int mem_base;
22946    const xmlChar * ret_val;
22947    xmlChar * name; /* the full QName */
22948    int n_name;
22949    int * len; /* an int * */
22950    int n_len;
22951
22952    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22953    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
22954        mem_base = xmlMemBlocks();
22955        name = gen_const_xmlChar_ptr(n_name, 0);
22956        len = gen_int_ptr(n_len, 1);
22957
22958        ret_val = xmlSplitQName3((const xmlChar *)name, len);
22959        desret_const_xmlChar_ptr(ret_val);
22960        call_tests++;
22961        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22962        des_int_ptr(n_len, len, 1);
22963        xmlResetLastError();
22964        if (mem_base != xmlMemBlocks()) {
22965            printf("Leak of %d blocks found in xmlSplitQName3",
22966	           xmlMemBlocks() - mem_base);
22967	    test_ret++;
22968            printf(" %d", n_name);
22969            printf(" %d", n_len);
22970            printf("\n");
22971        }
22972    }
22973    }
22974    function_tests++;
22975
22976    return(test_ret);
22977}
22978
22979
22980static int
22981test_xmlStringGetNodeList(void) {
22982    int test_ret = 0;
22983
22984    int mem_base;
22985    xmlNodePtr ret_val;
22986    xmlDocPtr doc; /* the document */
22987    int n_doc;
22988    xmlChar * value; /* the value of the attribute */
22989    int n_value;
22990
22991    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22992    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22993        mem_base = xmlMemBlocks();
22994        doc = gen_xmlDocPtr(n_doc, 0);
22995        value = gen_const_xmlChar_ptr(n_value, 1);
22996
22997        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
22998        desret_xmlNodePtr(ret_val);
22999        call_tests++;
23000        des_xmlDocPtr(n_doc, doc, 0);
23001        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23002        xmlResetLastError();
23003        if (mem_base != xmlMemBlocks()) {
23004            printf("Leak of %d blocks found in xmlStringGetNodeList",
23005	           xmlMemBlocks() - mem_base);
23006	    test_ret++;
23007            printf(" %d", n_doc);
23008            printf(" %d", n_value);
23009            printf("\n");
23010        }
23011    }
23012    }
23013    function_tests++;
23014
23015    return(test_ret);
23016}
23017
23018
23019static int
23020test_xmlStringLenGetNodeList(void) {
23021    int test_ret = 0;
23022
23023    int mem_base;
23024    xmlNodePtr ret_val;
23025    xmlDocPtr doc; /* the document */
23026    int n_doc;
23027    xmlChar * value; /* the value of the text */
23028    int n_value;
23029    int len; /* the length of the string value */
23030    int n_len;
23031
23032    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23033    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23034    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23035        mem_base = xmlMemBlocks();
23036        doc = gen_xmlDocPtr(n_doc, 0);
23037        value = gen_const_xmlChar_ptr(n_value, 1);
23038        len = gen_int(n_len, 2);
23039
23040        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23041        desret_xmlNodePtr(ret_val);
23042        call_tests++;
23043        des_xmlDocPtr(n_doc, doc, 0);
23044        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23045        des_int(n_len, len, 2);
23046        xmlResetLastError();
23047        if (mem_base != xmlMemBlocks()) {
23048            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23049	           xmlMemBlocks() - mem_base);
23050	    test_ret++;
23051            printf(" %d", n_doc);
23052            printf(" %d", n_value);
23053            printf(" %d", n_len);
23054            printf("\n");
23055        }
23056    }
23057    }
23058    }
23059    function_tests++;
23060
23061    return(test_ret);
23062}
23063
23064
23065static int
23066test_xmlTextConcat(void) {
23067    int test_ret = 0;
23068
23069    int mem_base;
23070    int ret_val;
23071    xmlNodePtr node; /* the node */
23072    int n_node;
23073    xmlChar * content; /* the content */
23074    int n_content;
23075    int len; /* @content length */
23076    int n_len;
23077
23078    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23079    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23080    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23081        mem_base = xmlMemBlocks();
23082        node = gen_xmlNodePtr(n_node, 0);
23083        content = gen_const_xmlChar_ptr(n_content, 1);
23084        len = gen_int(n_len, 2);
23085
23086        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23087        desret_int(ret_val);
23088        call_tests++;
23089        des_xmlNodePtr(n_node, node, 0);
23090        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23091        des_int(n_len, len, 2);
23092        xmlResetLastError();
23093        if (mem_base != xmlMemBlocks()) {
23094            printf("Leak of %d blocks found in xmlTextConcat",
23095	           xmlMemBlocks() - mem_base);
23096	    test_ret++;
23097            printf(" %d", n_node);
23098            printf(" %d", n_content);
23099            printf(" %d", n_len);
23100            printf("\n");
23101        }
23102    }
23103    }
23104    }
23105    function_tests++;
23106
23107    return(test_ret);
23108}
23109
23110
23111static int
23112test_xmlTextMerge(void) {
23113    int test_ret = 0;
23114
23115    int mem_base;
23116    xmlNodePtr ret_val;
23117    xmlNodePtr first; /* the first text node */
23118    int n_first;
23119    xmlNodePtr second; /* the second text node being merged */
23120    int n_second;
23121
23122    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23123    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23124        mem_base = xmlMemBlocks();
23125        first = gen_xmlNodePtr_in(n_first, 0);
23126        second = gen_xmlNodePtr_in(n_second, 1);
23127
23128        ret_val = xmlTextMerge(first, second);
23129        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23130              xmlUnlinkNode(second);
23131              xmlFreeNode(second) ; second = NULL ; }
23132        desret_xmlNodePtr(ret_val);
23133        call_tests++;
23134        des_xmlNodePtr_in(n_first, first, 0);
23135        des_xmlNodePtr_in(n_second, second, 1);
23136        xmlResetLastError();
23137        if (mem_base != xmlMemBlocks()) {
23138            printf("Leak of %d blocks found in xmlTextMerge",
23139	           xmlMemBlocks() - mem_base);
23140	    test_ret++;
23141            printf(" %d", n_first);
23142            printf(" %d", n_second);
23143            printf("\n");
23144        }
23145    }
23146    }
23147    function_tests++;
23148
23149    return(test_ret);
23150}
23151
23152
23153static int
23154test_xmlUnsetNsProp(void) {
23155    int test_ret = 0;
23156
23157#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23158    int mem_base;
23159    int ret_val;
23160    xmlNodePtr node; /* the node */
23161    int n_node;
23162    xmlNsPtr ns; /* the namespace definition */
23163    int n_ns;
23164    xmlChar * name; /* the attribute name */
23165    int n_name;
23166
23167    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23168    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23169    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23170        mem_base = xmlMemBlocks();
23171        node = gen_xmlNodePtr(n_node, 0);
23172        ns = gen_xmlNsPtr(n_ns, 1);
23173        name = gen_const_xmlChar_ptr(n_name, 2);
23174
23175        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23176        desret_int(ret_val);
23177        call_tests++;
23178        des_xmlNodePtr(n_node, node, 0);
23179        des_xmlNsPtr(n_ns, ns, 1);
23180        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23181        xmlResetLastError();
23182        if (mem_base != xmlMemBlocks()) {
23183            printf("Leak of %d blocks found in xmlUnsetNsProp",
23184	           xmlMemBlocks() - mem_base);
23185	    test_ret++;
23186            printf(" %d", n_node);
23187            printf(" %d", n_ns);
23188            printf(" %d", n_name);
23189            printf("\n");
23190        }
23191    }
23192    }
23193    }
23194    function_tests++;
23195#endif
23196
23197    return(test_ret);
23198}
23199
23200
23201static int
23202test_xmlUnsetProp(void) {
23203    int test_ret = 0;
23204
23205#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23206    int mem_base;
23207    int ret_val;
23208    xmlNodePtr node; /* the node */
23209    int n_node;
23210    xmlChar * name; /* the attribute name */
23211    int n_name;
23212
23213    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23214    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23215        mem_base = xmlMemBlocks();
23216        node = gen_xmlNodePtr(n_node, 0);
23217        name = gen_const_xmlChar_ptr(n_name, 1);
23218
23219        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23220        desret_int(ret_val);
23221        call_tests++;
23222        des_xmlNodePtr(n_node, node, 0);
23223        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23224        xmlResetLastError();
23225        if (mem_base != xmlMemBlocks()) {
23226            printf("Leak of %d blocks found in xmlUnsetProp",
23227	           xmlMemBlocks() - mem_base);
23228	    test_ret++;
23229            printf(" %d", n_node);
23230            printf(" %d", n_name);
23231            printf("\n");
23232        }
23233    }
23234    }
23235    function_tests++;
23236#endif
23237
23238    return(test_ret);
23239}
23240
23241
23242static int
23243test_xmlValidateNCName(void) {
23244    int test_ret = 0;
23245
23246#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED)
23247#ifdef LIBXML_TREE_ENABLED
23248    int mem_base;
23249    int ret_val;
23250    xmlChar * value; /* the value to check */
23251    int n_value;
23252    int space; /* allow spaces in front and end of the string */
23253    int n_space;
23254
23255    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23256    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23257        mem_base = xmlMemBlocks();
23258        value = gen_const_xmlChar_ptr(n_value, 0);
23259        space = gen_int(n_space, 1);
23260
23261        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23262        desret_int(ret_val);
23263        call_tests++;
23264        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23265        des_int(n_space, space, 1);
23266        xmlResetLastError();
23267        if (mem_base != xmlMemBlocks()) {
23268            printf("Leak of %d blocks found in xmlValidateNCName",
23269	           xmlMemBlocks() - mem_base);
23270	    test_ret++;
23271            printf(" %d", n_value);
23272            printf(" %d", n_space);
23273            printf("\n");
23274        }
23275    }
23276    }
23277    function_tests++;
23278#endif
23279#endif
23280
23281    return(test_ret);
23282}
23283
23284
23285static int
23286test_xmlValidateNMToken(void) {
23287    int test_ret = 0;
23288
23289#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23290#ifdef LIBXML_TREE_ENABLED
23291    int mem_base;
23292    int ret_val;
23293    xmlChar * value; /* the value to check */
23294    int n_value;
23295    int space; /* allow spaces in front and end of the string */
23296    int n_space;
23297
23298    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23299    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23300        mem_base = xmlMemBlocks();
23301        value = gen_const_xmlChar_ptr(n_value, 0);
23302        space = gen_int(n_space, 1);
23303
23304        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23305        desret_int(ret_val);
23306        call_tests++;
23307        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23308        des_int(n_space, space, 1);
23309        xmlResetLastError();
23310        if (mem_base != xmlMemBlocks()) {
23311            printf("Leak of %d blocks found in xmlValidateNMToken",
23312	           xmlMemBlocks() - mem_base);
23313	    test_ret++;
23314            printf(" %d", n_value);
23315            printf(" %d", n_space);
23316            printf("\n");
23317        }
23318    }
23319    }
23320    function_tests++;
23321#endif
23322#endif
23323
23324    return(test_ret);
23325}
23326
23327
23328static int
23329test_xmlValidateName(void) {
23330    int test_ret = 0;
23331
23332#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23333#ifdef LIBXML_TREE_ENABLED
23334    int mem_base;
23335    int ret_val;
23336    xmlChar * value; /* the value to check */
23337    int n_value;
23338    int space; /* allow spaces in front and end of the string */
23339    int n_space;
23340
23341    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23342    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23343        mem_base = xmlMemBlocks();
23344        value = gen_const_xmlChar_ptr(n_value, 0);
23345        space = gen_int(n_space, 1);
23346
23347        ret_val = xmlValidateName((const xmlChar *)value, space);
23348        desret_int(ret_val);
23349        call_tests++;
23350        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23351        des_int(n_space, space, 1);
23352        xmlResetLastError();
23353        if (mem_base != xmlMemBlocks()) {
23354            printf("Leak of %d blocks found in xmlValidateName",
23355	           xmlMemBlocks() - mem_base);
23356	    test_ret++;
23357            printf(" %d", n_value);
23358            printf(" %d", n_space);
23359            printf("\n");
23360        }
23361    }
23362    }
23363    function_tests++;
23364#endif
23365#endif
23366
23367    return(test_ret);
23368}
23369
23370
23371static int
23372test_xmlValidateQName(void) {
23373    int test_ret = 0;
23374
23375#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23376#ifdef LIBXML_TREE_ENABLED
23377    int mem_base;
23378    int ret_val;
23379    xmlChar * value; /* the value to check */
23380    int n_value;
23381    int space; /* allow spaces in front and end of the string */
23382    int n_space;
23383
23384    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23385    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23386        mem_base = xmlMemBlocks();
23387        value = gen_const_xmlChar_ptr(n_value, 0);
23388        space = gen_int(n_space, 1);
23389
23390        ret_val = xmlValidateQName((const xmlChar *)value, space);
23391        desret_int(ret_val);
23392        call_tests++;
23393        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23394        des_int(n_space, space, 1);
23395        xmlResetLastError();
23396        if (mem_base != xmlMemBlocks()) {
23397            printf("Leak of %d blocks found in xmlValidateQName",
23398	           xmlMemBlocks() - mem_base);
23399	    test_ret++;
23400            printf(" %d", n_value);
23401            printf(" %d", n_space);
23402            printf("\n");
23403        }
23404    }
23405    }
23406    function_tests++;
23407#endif
23408#endif
23409
23410    return(test_ret);
23411}
23412
23413static int
23414test_tree(void) {
23415    int test_ret = 0;
23416
23417    if (quiet == 0) printf("Testing tree : 132 of 151 functions ...\n");
23418    test_ret += test_xmlAddChild();
23419    test_ret += test_xmlAddChildList();
23420    test_ret += test_xmlAddNextSibling();
23421    test_ret += test_xmlAddPrevSibling();
23422    test_ret += test_xmlAddSibling();
23423    test_ret += test_xmlAttrSerializeTxtContent();
23424    test_ret += test_xmlBufferAdd();
23425    test_ret += test_xmlBufferAddHead();
23426    test_ret += test_xmlBufferCCat();
23427    test_ret += test_xmlBufferCat();
23428    test_ret += test_xmlBufferContent();
23429    test_ret += test_xmlBufferCreate();
23430    test_ret += test_xmlBufferCreateSize();
23431    test_ret += test_xmlBufferCreateStatic();
23432    test_ret += test_xmlBufferEmpty();
23433    test_ret += test_xmlBufferGrow();
23434    test_ret += test_xmlBufferLength();
23435    test_ret += test_xmlBufferResize();
23436    test_ret += test_xmlBufferSetAllocationScheme();
23437    test_ret += test_xmlBufferShrink();
23438    test_ret += test_xmlBufferWriteCHAR();
23439    test_ret += test_xmlBufferWriteChar();
23440    test_ret += test_xmlBufferWriteQuotedString();
23441    test_ret += test_xmlBuildQName();
23442    test_ret += test_xmlCopyDoc();
23443    test_ret += test_xmlCopyDtd();
23444    test_ret += test_xmlCopyNamespace();
23445    test_ret += test_xmlCopyNamespaceList();
23446    test_ret += test_xmlCopyNode();
23447    test_ret += test_xmlCopyNodeList();
23448    test_ret += test_xmlCopyProp();
23449    test_ret += test_xmlCopyPropList();
23450    test_ret += test_xmlCreateIntSubset();
23451    test_ret += test_xmlDOMWrapAdoptNode();
23452    test_ret += test_xmlDOMWrapNewCtxt();
23453    test_ret += test_xmlDOMWrapReconcileNamespaces();
23454    test_ret += test_xmlDOMWrapRemoveNode();
23455    test_ret += test_xmlDocCopyNode();
23456    test_ret += test_xmlDocCopyNodeList();
23457    test_ret += test_xmlDocDump();
23458    test_ret += test_xmlDocDumpFormatMemory();
23459    test_ret += test_xmlDocDumpFormatMemoryEnc();
23460    test_ret += test_xmlDocDumpMemory();
23461    test_ret += test_xmlDocDumpMemoryEnc();
23462    test_ret += test_xmlDocFormatDump();
23463    test_ret += test_xmlDocGetRootElement();
23464    test_ret += test_xmlDocSetRootElement();
23465    test_ret += test_xmlElemDump();
23466    test_ret += test_xmlGetBufferAllocationScheme();
23467    test_ret += test_xmlGetCompressMode();
23468    test_ret += test_xmlGetDocCompressMode();
23469    test_ret += test_xmlGetIntSubset();
23470    test_ret += test_xmlGetLastChild();
23471    test_ret += test_xmlGetLineNo();
23472    test_ret += test_xmlGetNoNsProp();
23473    test_ret += test_xmlGetNodePath();
23474    test_ret += test_xmlGetNsList();
23475    test_ret += test_xmlGetNsProp();
23476    test_ret += test_xmlGetProp();
23477    test_ret += test_xmlHasNsProp();
23478    test_ret += test_xmlHasProp();
23479    test_ret += test_xmlIsBlankNode();
23480    test_ret += test_xmlIsXHTML();
23481    test_ret += test_xmlNewCDataBlock();
23482    test_ret += test_xmlNewCharRef();
23483    test_ret += test_xmlNewChild();
23484    test_ret += test_xmlNewComment();
23485    test_ret += test_xmlNewDoc();
23486    test_ret += test_xmlNewDocComment();
23487    test_ret += test_xmlNewDocFragment();
23488    test_ret += test_xmlNewDocNode();
23489    test_ret += test_xmlNewDocNodeEatName();
23490    test_ret += test_xmlNewDocPI();
23491    test_ret += test_xmlNewDocProp();
23492    test_ret += test_xmlNewDocRawNode();
23493    test_ret += test_xmlNewDocText();
23494    test_ret += test_xmlNewDocTextLen();
23495    test_ret += test_xmlNewDtd();
23496    test_ret += test_xmlNewNode();
23497    test_ret += test_xmlNewNodeEatName();
23498    test_ret += test_xmlNewNs();
23499    test_ret += test_xmlNewNsProp();
23500    test_ret += test_xmlNewNsPropEatName();
23501    test_ret += test_xmlNewPI();
23502    test_ret += test_xmlNewProp();
23503    test_ret += test_xmlNewReference();
23504    test_ret += test_xmlNewText();
23505    test_ret += test_xmlNewTextChild();
23506    test_ret += test_xmlNewTextLen();
23507    test_ret += test_xmlNodeAddContent();
23508    test_ret += test_xmlNodeAddContentLen();
23509    test_ret += test_xmlNodeBufGetContent();
23510    test_ret += test_xmlNodeDump();
23511    test_ret += test_xmlNodeDumpOutput();
23512    test_ret += test_xmlNodeGetBase();
23513    test_ret += test_xmlNodeGetContent();
23514    test_ret += test_xmlNodeGetLang();
23515    test_ret += test_xmlNodeGetSpacePreserve();
23516    test_ret += test_xmlNodeIsText();
23517    test_ret += test_xmlNodeListGetRawString();
23518    test_ret += test_xmlNodeListGetString();
23519    test_ret += test_xmlNodeSetBase();
23520    test_ret += test_xmlNodeSetContent();
23521    test_ret += test_xmlNodeSetContentLen();
23522    test_ret += test_xmlNodeSetLang();
23523    test_ret += test_xmlNodeSetName();
23524    test_ret += test_xmlNodeSetSpacePreserve();
23525    test_ret += test_xmlReconciliateNs();
23526    test_ret += test_xmlRemoveProp();
23527    test_ret += test_xmlReplaceNode();
23528    test_ret += test_xmlSaveFile();
23529    test_ret += test_xmlSaveFileEnc();
23530    test_ret += test_xmlSaveFileTo();
23531    test_ret += test_xmlSaveFormatFile();
23532    test_ret += test_xmlSaveFormatFileEnc();
23533    test_ret += test_xmlSaveFormatFileTo();
23534    test_ret += test_xmlSearchNs();
23535    test_ret += test_xmlSearchNsByHref();
23536    test_ret += test_xmlSetBufferAllocationScheme();
23537    test_ret += test_xmlSetCompressMode();
23538    test_ret += test_xmlSetDocCompressMode();
23539    test_ret += test_xmlSetNs();
23540    test_ret += test_xmlSetNsProp();
23541    test_ret += test_xmlSetProp();
23542    test_ret += test_xmlSplitQName2();
23543    test_ret += test_xmlSplitQName3();
23544    test_ret += test_xmlStringGetNodeList();
23545    test_ret += test_xmlStringLenGetNodeList();
23546    test_ret += test_xmlTextConcat();
23547    test_ret += test_xmlTextMerge();
23548    test_ret += test_xmlUnsetNsProp();
23549    test_ret += test_xmlUnsetProp();
23550    test_ret += test_xmlValidateNCName();
23551    test_ret += test_xmlValidateNMToken();
23552    test_ret += test_xmlValidateName();
23553    test_ret += test_xmlValidateQName();
23554
23555    if (test_ret != 0)
23556	printf("Module tree: %d errors\n", test_ret);
23557    return(test_ret);
23558}
23559
23560static int
23561test_xmlBuildRelativeURI(void) {
23562    int test_ret = 0;
23563
23564    int mem_base;
23565    xmlChar * ret_val;
23566    xmlChar * URI; /* the URI reference under consideration */
23567    int n_URI;
23568    xmlChar * base; /* the base value */
23569    int n_base;
23570
23571    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23572    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23573        mem_base = xmlMemBlocks();
23574        URI = gen_const_xmlChar_ptr(n_URI, 0);
23575        base = gen_const_xmlChar_ptr(n_base, 1);
23576
23577        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
23578        desret_xmlChar_ptr(ret_val);
23579        call_tests++;
23580        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23581        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23582        xmlResetLastError();
23583        if (mem_base != xmlMemBlocks()) {
23584            printf("Leak of %d blocks found in xmlBuildRelativeURI",
23585	           xmlMemBlocks() - mem_base);
23586	    test_ret++;
23587            printf(" %d", n_URI);
23588            printf(" %d", n_base);
23589            printf("\n");
23590        }
23591    }
23592    }
23593    function_tests++;
23594
23595    return(test_ret);
23596}
23597
23598
23599static int
23600test_xmlBuildURI(void) {
23601    int test_ret = 0;
23602
23603    int mem_base;
23604    xmlChar * ret_val;
23605    xmlChar * URI; /* the URI instance found in the document */
23606    int n_URI;
23607    xmlChar * base; /* the base value */
23608    int n_base;
23609
23610    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23611    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23612        mem_base = xmlMemBlocks();
23613        URI = gen_const_xmlChar_ptr(n_URI, 0);
23614        base = gen_const_xmlChar_ptr(n_base, 1);
23615
23616        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
23617        desret_xmlChar_ptr(ret_val);
23618        call_tests++;
23619        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23620        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23621        xmlResetLastError();
23622        if (mem_base != xmlMemBlocks()) {
23623            printf("Leak of %d blocks found in xmlBuildURI",
23624	           xmlMemBlocks() - mem_base);
23625	    test_ret++;
23626            printf(" %d", n_URI);
23627            printf(" %d", n_base);
23628            printf("\n");
23629        }
23630    }
23631    }
23632    function_tests++;
23633
23634    return(test_ret);
23635}
23636
23637
23638static int
23639test_xmlCanonicPath(void) {
23640    int test_ret = 0;
23641
23642    int mem_base;
23643    xmlChar * ret_val;
23644    xmlChar * path; /* the resource locator in a filesystem notation */
23645    int n_path;
23646
23647    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
23648        mem_base = xmlMemBlocks();
23649        path = gen_const_xmlChar_ptr(n_path, 0);
23650
23651        ret_val = xmlCanonicPath((const xmlChar *)path);
23652        desret_xmlChar_ptr(ret_val);
23653        call_tests++;
23654        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
23655        xmlResetLastError();
23656        if (mem_base != xmlMemBlocks()) {
23657            printf("Leak of %d blocks found in xmlCanonicPath",
23658	           xmlMemBlocks() - mem_base);
23659	    test_ret++;
23660            printf(" %d", n_path);
23661            printf("\n");
23662        }
23663    }
23664    function_tests++;
23665
23666    return(test_ret);
23667}
23668
23669
23670static int
23671test_xmlCreateURI(void) {
23672    int test_ret = 0;
23673
23674
23675    /* missing type support */
23676    return(test_ret);
23677}
23678
23679
23680static int
23681test_xmlNormalizeURIPath(void) {
23682    int test_ret = 0;
23683
23684    int mem_base;
23685    int ret_val;
23686    char * path; /* pointer to the path string */
23687    int n_path;
23688
23689    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
23690        mem_base = xmlMemBlocks();
23691        path = gen_char_ptr(n_path, 0);
23692
23693        ret_val = xmlNormalizeURIPath(path);
23694        desret_int(ret_val);
23695        call_tests++;
23696        des_char_ptr(n_path, path, 0);
23697        xmlResetLastError();
23698        if (mem_base != xmlMemBlocks()) {
23699            printf("Leak of %d blocks found in xmlNormalizeURIPath",
23700	           xmlMemBlocks() - mem_base);
23701	    test_ret++;
23702            printf(" %d", n_path);
23703            printf("\n");
23704        }
23705    }
23706    function_tests++;
23707
23708    return(test_ret);
23709}
23710
23711
23712static int
23713test_xmlParseURI(void) {
23714    int test_ret = 0;
23715
23716
23717    /* missing type support */
23718    return(test_ret);
23719}
23720
23721
23722static int
23723test_xmlParseURIRaw(void) {
23724    int test_ret = 0;
23725
23726
23727    /* missing type support */
23728    return(test_ret);
23729}
23730
23731
23732#define gen_nb_xmlURIPtr 1
23733static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23734    return(NULL);
23735}
23736static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23737}
23738
23739static int
23740test_xmlParseURIReference(void) {
23741    int test_ret = 0;
23742
23743    int mem_base;
23744    int ret_val;
23745    xmlURIPtr uri; /* pointer to an URI structure */
23746    int n_uri;
23747    char * str; /* the string to analyze */
23748    int n_str;
23749
23750    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23751    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
23752        mem_base = xmlMemBlocks();
23753        uri = gen_xmlURIPtr(n_uri, 0);
23754        str = gen_const_char_ptr(n_str, 1);
23755
23756        ret_val = xmlParseURIReference(uri, (const char *)str);
23757        desret_int(ret_val);
23758        call_tests++;
23759        des_xmlURIPtr(n_uri, uri, 0);
23760        des_const_char_ptr(n_str, (const char *)str, 1);
23761        xmlResetLastError();
23762        if (mem_base != xmlMemBlocks()) {
23763            printf("Leak of %d blocks found in xmlParseURIReference",
23764	           xmlMemBlocks() - mem_base);
23765	    test_ret++;
23766            printf(" %d", n_uri);
23767            printf(" %d", n_str);
23768            printf("\n");
23769        }
23770    }
23771    }
23772    function_tests++;
23773
23774    return(test_ret);
23775}
23776
23777
23778static int
23779test_xmlPrintURI(void) {
23780    int test_ret = 0;
23781
23782    int mem_base;
23783    FILE * stream; /* a FILE* for the output */
23784    int n_stream;
23785    xmlURIPtr uri; /* pointer to an xmlURI */
23786    int n_uri;
23787
23788    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
23789    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23790        mem_base = xmlMemBlocks();
23791        stream = gen_FILE_ptr(n_stream, 0);
23792        uri = gen_xmlURIPtr(n_uri, 1);
23793
23794        xmlPrintURI(stream, uri);
23795        call_tests++;
23796        des_FILE_ptr(n_stream, stream, 0);
23797        des_xmlURIPtr(n_uri, uri, 1);
23798        xmlResetLastError();
23799        if (mem_base != xmlMemBlocks()) {
23800            printf("Leak of %d blocks found in xmlPrintURI",
23801	           xmlMemBlocks() - mem_base);
23802	    test_ret++;
23803            printf(" %d", n_stream);
23804            printf(" %d", n_uri);
23805            printf("\n");
23806        }
23807    }
23808    }
23809    function_tests++;
23810
23811    return(test_ret);
23812}
23813
23814
23815static int
23816test_xmlSaveUri(void) {
23817    int test_ret = 0;
23818
23819    int mem_base;
23820    xmlChar * ret_val;
23821    xmlURIPtr uri; /* pointer to an xmlURI */
23822    int n_uri;
23823
23824    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23825        mem_base = xmlMemBlocks();
23826        uri = gen_xmlURIPtr(n_uri, 0);
23827
23828        ret_val = xmlSaveUri(uri);
23829        desret_xmlChar_ptr(ret_val);
23830        call_tests++;
23831        des_xmlURIPtr(n_uri, uri, 0);
23832        xmlResetLastError();
23833        if (mem_base != xmlMemBlocks()) {
23834            printf("Leak of %d blocks found in xmlSaveUri",
23835	           xmlMemBlocks() - mem_base);
23836	    test_ret++;
23837            printf(" %d", n_uri);
23838            printf("\n");
23839        }
23840    }
23841    function_tests++;
23842
23843    return(test_ret);
23844}
23845
23846
23847static int
23848test_xmlURIEscape(void) {
23849    int test_ret = 0;
23850
23851    int mem_base;
23852    xmlChar * ret_val;
23853    xmlChar * str; /* the string of the URI to escape */
23854    int n_str;
23855
23856    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23857        mem_base = xmlMemBlocks();
23858        str = gen_const_xmlChar_ptr(n_str, 0);
23859
23860        ret_val = xmlURIEscape((const xmlChar *)str);
23861        desret_xmlChar_ptr(ret_val);
23862        call_tests++;
23863        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23864        xmlResetLastError();
23865        if (mem_base != xmlMemBlocks()) {
23866            printf("Leak of %d blocks found in xmlURIEscape",
23867	           xmlMemBlocks() - mem_base);
23868	    test_ret++;
23869            printf(" %d", n_str);
23870            printf("\n");
23871        }
23872    }
23873    function_tests++;
23874
23875    return(test_ret);
23876}
23877
23878
23879static int
23880test_xmlURIEscapeStr(void) {
23881    int test_ret = 0;
23882
23883    int mem_base;
23884    xmlChar * ret_val;
23885    xmlChar * str; /* string to escape */
23886    int n_str;
23887    xmlChar * list; /* exception list string of chars not to escape */
23888    int n_list;
23889
23890    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23891    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
23892        mem_base = xmlMemBlocks();
23893        str = gen_const_xmlChar_ptr(n_str, 0);
23894        list = gen_const_xmlChar_ptr(n_list, 1);
23895
23896        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
23897        desret_xmlChar_ptr(ret_val);
23898        call_tests++;
23899        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23900        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
23901        xmlResetLastError();
23902        if (mem_base != xmlMemBlocks()) {
23903            printf("Leak of %d blocks found in xmlURIEscapeStr",
23904	           xmlMemBlocks() - mem_base);
23905	    test_ret++;
23906            printf(" %d", n_str);
23907            printf(" %d", n_list);
23908            printf("\n");
23909        }
23910    }
23911    }
23912    function_tests++;
23913
23914    return(test_ret);
23915}
23916
23917
23918static int
23919test_xmlURIUnescapeString(void) {
23920    int test_ret = 0;
23921
23922
23923    /* missing type support */
23924    return(test_ret);
23925}
23926
23927static int
23928test_uri(void) {
23929    int test_ret = 0;
23930
23931    if (quiet == 0) printf("Testing uri : 9 of 14 functions ...\n");
23932    test_ret += test_xmlBuildRelativeURI();
23933    test_ret += test_xmlBuildURI();
23934    test_ret += test_xmlCanonicPath();
23935    test_ret += test_xmlCreateURI();
23936    test_ret += test_xmlNormalizeURIPath();
23937    test_ret += test_xmlParseURI();
23938    test_ret += test_xmlParseURIRaw();
23939    test_ret += test_xmlParseURIReference();
23940    test_ret += test_xmlPrintURI();
23941    test_ret += test_xmlSaveUri();
23942    test_ret += test_xmlURIEscape();
23943    test_ret += test_xmlURIEscapeStr();
23944    test_ret += test_xmlURIUnescapeString();
23945
23946    if (test_ret != 0)
23947	printf("Module uri: %d errors\n", test_ret);
23948    return(test_ret);
23949}
23950
23951static int
23952test_xmlAddAttributeDecl(void) {
23953    int test_ret = 0;
23954
23955    int mem_base;
23956    xmlAttributePtr ret_val;
23957    xmlValidCtxtPtr ctxt; /* the validation context */
23958    int n_ctxt;
23959    xmlDtdPtr dtd; /* pointer to the DTD */
23960    int n_dtd;
23961    xmlChar * elem; /* the element name */
23962    int n_elem;
23963    xmlChar * name; /* the attribute name */
23964    int n_name;
23965    xmlChar * ns; /* the attribute namespace prefix */
23966    int n_ns;
23967    xmlAttributeType type; /* the attribute type */
23968    int n_type;
23969    xmlAttributeDefault def; /* the attribute default type */
23970    int n_def;
23971    xmlChar * defaultValue; /* the attribute default value */
23972    int n_defaultValue;
23973    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
23974    int n_tree;
23975
23976    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23977    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23978    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23979    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23980    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
23981    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
23982    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
23983    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
23984    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
23985        mem_base = xmlMemBlocks();
23986        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23987        dtd = gen_xmlDtdPtr(n_dtd, 1);
23988        elem = gen_const_xmlChar_ptr(n_elem, 2);
23989        name = gen_const_xmlChar_ptr(n_name, 3);
23990        ns = gen_const_xmlChar_ptr(n_ns, 4);
23991        type = gen_xmlAttributeType(n_type, 5);
23992        def = gen_xmlAttributeDefault(n_def, 6);
23993        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
23994        tree = gen_xmlEnumerationPtr(n_tree, 8);
23995
23996        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
23997        desret_xmlAttributePtr(ret_val);
23998        call_tests++;
23999        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24000        des_xmlDtdPtr(n_dtd, dtd, 1);
24001        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24002        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24003        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24004        des_xmlAttributeType(n_type, type, 5);
24005        des_xmlAttributeDefault(n_def, def, 6);
24006        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24007        des_xmlEnumerationPtr(n_tree, tree, 8);
24008        xmlResetLastError();
24009        if (mem_base != xmlMemBlocks()) {
24010            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24011	           xmlMemBlocks() - mem_base);
24012	    test_ret++;
24013            printf(" %d", n_ctxt);
24014            printf(" %d", n_dtd);
24015            printf(" %d", n_elem);
24016            printf(" %d", n_name);
24017            printf(" %d", n_ns);
24018            printf(" %d", n_type);
24019            printf(" %d", n_def);
24020            printf(" %d", n_defaultValue);
24021            printf(" %d", n_tree);
24022            printf("\n");
24023        }
24024    }
24025    }
24026    }
24027    }
24028    }
24029    }
24030    }
24031    }
24032    }
24033    function_tests++;
24034
24035    return(test_ret);
24036}
24037
24038
24039static int
24040test_xmlAddElementDecl(void) {
24041    int test_ret = 0;
24042
24043    int mem_base;
24044    xmlElementPtr ret_val;
24045    xmlValidCtxtPtr ctxt; /* the validation context */
24046    int n_ctxt;
24047    xmlDtdPtr dtd; /* pointer to the DTD */
24048    int n_dtd;
24049    xmlChar * name; /* the entity name */
24050    int n_name;
24051    xmlElementTypeVal type; /* the element type */
24052    int n_type;
24053    xmlElementContentPtr content; /* the element content tree or NULL */
24054    int n_content;
24055
24056    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24057    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24058    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24059    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24060    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24061        mem_base = xmlMemBlocks();
24062        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24063        dtd = gen_xmlDtdPtr(n_dtd, 1);
24064        name = gen_const_xmlChar_ptr(n_name, 2);
24065        type = gen_xmlElementTypeVal(n_type, 3);
24066        content = gen_xmlElementContentPtr(n_content, 4);
24067
24068        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24069        desret_xmlElementPtr(ret_val);
24070        call_tests++;
24071        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24072        des_xmlDtdPtr(n_dtd, dtd, 1);
24073        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24074        des_xmlElementTypeVal(n_type, type, 3);
24075        des_xmlElementContentPtr(n_content, content, 4);
24076        xmlResetLastError();
24077        if (mem_base != xmlMemBlocks()) {
24078            printf("Leak of %d blocks found in xmlAddElementDecl",
24079	           xmlMemBlocks() - mem_base);
24080	    test_ret++;
24081            printf(" %d", n_ctxt);
24082            printf(" %d", n_dtd);
24083            printf(" %d", n_name);
24084            printf(" %d", n_type);
24085            printf(" %d", n_content);
24086            printf("\n");
24087        }
24088    }
24089    }
24090    }
24091    }
24092    }
24093    function_tests++;
24094
24095    return(test_ret);
24096}
24097
24098
24099static int
24100test_xmlAddID(void) {
24101    int test_ret = 0;
24102
24103
24104    /* missing type support */
24105    return(test_ret);
24106}
24107
24108
24109static int
24110test_xmlAddNotationDecl(void) {
24111    int test_ret = 0;
24112
24113
24114    /* missing type support */
24115    return(test_ret);
24116}
24117
24118
24119static int
24120test_xmlAddRef(void) {
24121    int test_ret = 0;
24122
24123
24124    /* missing type support */
24125    return(test_ret);
24126}
24127
24128
24129#define gen_nb_xmlAttributeTablePtr 1
24130static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24131    return(NULL);
24132}
24133static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24134}
24135
24136static int
24137test_xmlCopyAttributeTable(void) {
24138    int test_ret = 0;
24139
24140
24141    /* missing type support */
24142    return(test_ret);
24143}
24144
24145
24146static int
24147test_xmlCopyDocElementContent(void) {
24148    int test_ret = 0;
24149
24150    int mem_base;
24151    xmlElementContentPtr ret_val;
24152    xmlDocPtr doc; /* the document owning the element declaration */
24153    int n_doc;
24154    xmlElementContentPtr cur; /* An element content pointer. */
24155    int n_cur;
24156
24157    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24158    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24159        mem_base = xmlMemBlocks();
24160        doc = gen_xmlDocPtr(n_doc, 0);
24161        cur = gen_xmlElementContentPtr(n_cur, 1);
24162
24163        ret_val = xmlCopyDocElementContent(doc, cur);
24164        desret_xmlElementContentPtr(ret_val);
24165        call_tests++;
24166        des_xmlDocPtr(n_doc, doc, 0);
24167        des_xmlElementContentPtr(n_cur, cur, 1);
24168        xmlResetLastError();
24169        if (mem_base != xmlMemBlocks()) {
24170            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24171	           xmlMemBlocks() - mem_base);
24172	    test_ret++;
24173            printf(" %d", n_doc);
24174            printf(" %d", n_cur);
24175            printf("\n");
24176        }
24177    }
24178    }
24179    function_tests++;
24180
24181    return(test_ret);
24182}
24183
24184
24185static int
24186test_xmlCopyElementContent(void) {
24187    int test_ret = 0;
24188
24189    int mem_base;
24190    xmlElementContentPtr ret_val;
24191    xmlElementContentPtr cur; /* An element content pointer. */
24192    int n_cur;
24193
24194    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24195        mem_base = xmlMemBlocks();
24196        cur = gen_xmlElementContentPtr(n_cur, 0);
24197
24198        ret_val = xmlCopyElementContent(cur);
24199        desret_xmlElementContentPtr(ret_val);
24200        call_tests++;
24201        des_xmlElementContentPtr(n_cur, cur, 0);
24202        xmlResetLastError();
24203        if (mem_base != xmlMemBlocks()) {
24204            printf("Leak of %d blocks found in xmlCopyElementContent",
24205	           xmlMemBlocks() - mem_base);
24206	    test_ret++;
24207            printf(" %d", n_cur);
24208            printf("\n");
24209        }
24210    }
24211    function_tests++;
24212
24213    return(test_ret);
24214}
24215
24216
24217#define gen_nb_xmlElementTablePtr 1
24218static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24219    return(NULL);
24220}
24221static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24222}
24223
24224static int
24225test_xmlCopyElementTable(void) {
24226    int test_ret = 0;
24227
24228
24229    /* missing type support */
24230    return(test_ret);
24231}
24232
24233
24234static int
24235test_xmlCopyEnumeration(void) {
24236    int test_ret = 0;
24237
24238
24239    /* missing type support */
24240    return(test_ret);
24241}
24242
24243
24244#define gen_nb_xmlNotationTablePtr 1
24245static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24246    return(NULL);
24247}
24248static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24249}
24250
24251static int
24252test_xmlCopyNotationTable(void) {
24253    int test_ret = 0;
24254
24255
24256    /* missing type support */
24257    return(test_ret);
24258}
24259
24260
24261static int
24262test_xmlCreateEnumeration(void) {
24263    int test_ret = 0;
24264
24265
24266    /* missing type support */
24267    return(test_ret);
24268}
24269
24270
24271#define gen_nb_xmlAttributePtr 1
24272static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24273    return(NULL);
24274}
24275static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24276}
24277
24278static int
24279test_xmlDumpAttributeDecl(void) {
24280    int test_ret = 0;
24281
24282#if defined(LIBXML_OUTPUT_ENABLED)
24283    int mem_base;
24284    xmlBufferPtr buf; /* the XML buffer output */
24285    int n_buf;
24286    xmlAttributePtr attr; /* An attribute declaration */
24287    int n_attr;
24288
24289    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24290    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24291        mem_base = xmlMemBlocks();
24292        buf = gen_xmlBufferPtr(n_buf, 0);
24293        attr = gen_xmlAttributePtr(n_attr, 1);
24294
24295        xmlDumpAttributeDecl(buf, attr);
24296        call_tests++;
24297        des_xmlBufferPtr(n_buf, buf, 0);
24298        des_xmlAttributePtr(n_attr, attr, 1);
24299        xmlResetLastError();
24300        if (mem_base != xmlMemBlocks()) {
24301            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24302	           xmlMemBlocks() - mem_base);
24303	    test_ret++;
24304            printf(" %d", n_buf);
24305            printf(" %d", n_attr);
24306            printf("\n");
24307        }
24308    }
24309    }
24310    function_tests++;
24311#endif
24312
24313    return(test_ret);
24314}
24315
24316
24317static int
24318test_xmlDumpAttributeTable(void) {
24319    int test_ret = 0;
24320
24321#if defined(LIBXML_OUTPUT_ENABLED)
24322    int mem_base;
24323    xmlBufferPtr buf; /* the XML buffer output */
24324    int n_buf;
24325    xmlAttributeTablePtr table; /* An attribute table */
24326    int n_table;
24327
24328    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24329    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24330        mem_base = xmlMemBlocks();
24331        buf = gen_xmlBufferPtr(n_buf, 0);
24332        table = gen_xmlAttributeTablePtr(n_table, 1);
24333
24334        xmlDumpAttributeTable(buf, table);
24335        call_tests++;
24336        des_xmlBufferPtr(n_buf, buf, 0);
24337        des_xmlAttributeTablePtr(n_table, table, 1);
24338        xmlResetLastError();
24339        if (mem_base != xmlMemBlocks()) {
24340            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24341	           xmlMemBlocks() - mem_base);
24342	    test_ret++;
24343            printf(" %d", n_buf);
24344            printf(" %d", n_table);
24345            printf("\n");
24346        }
24347    }
24348    }
24349    function_tests++;
24350#endif
24351
24352    return(test_ret);
24353}
24354
24355
24356#define gen_nb_xmlElementPtr 1
24357static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24358    return(NULL);
24359}
24360static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24361}
24362
24363static int
24364test_xmlDumpElementDecl(void) {
24365    int test_ret = 0;
24366
24367#if defined(LIBXML_OUTPUT_ENABLED)
24368    int mem_base;
24369    xmlBufferPtr buf; /* the XML buffer output */
24370    int n_buf;
24371    xmlElementPtr elem; /* An element table */
24372    int n_elem;
24373
24374    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24375    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24376        mem_base = xmlMemBlocks();
24377        buf = gen_xmlBufferPtr(n_buf, 0);
24378        elem = gen_xmlElementPtr(n_elem, 1);
24379
24380        xmlDumpElementDecl(buf, elem);
24381        call_tests++;
24382        des_xmlBufferPtr(n_buf, buf, 0);
24383        des_xmlElementPtr(n_elem, elem, 1);
24384        xmlResetLastError();
24385        if (mem_base != xmlMemBlocks()) {
24386            printf("Leak of %d blocks found in xmlDumpElementDecl",
24387	           xmlMemBlocks() - mem_base);
24388	    test_ret++;
24389            printf(" %d", n_buf);
24390            printf(" %d", n_elem);
24391            printf("\n");
24392        }
24393    }
24394    }
24395    function_tests++;
24396#endif
24397
24398    return(test_ret);
24399}
24400
24401
24402static int
24403test_xmlDumpElementTable(void) {
24404    int test_ret = 0;
24405
24406#if defined(LIBXML_OUTPUT_ENABLED)
24407    int mem_base;
24408    xmlBufferPtr buf; /* the XML buffer output */
24409    int n_buf;
24410    xmlElementTablePtr table; /* An element table */
24411    int n_table;
24412
24413    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24414    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24415        mem_base = xmlMemBlocks();
24416        buf = gen_xmlBufferPtr(n_buf, 0);
24417        table = gen_xmlElementTablePtr(n_table, 1);
24418
24419        xmlDumpElementTable(buf, table);
24420        call_tests++;
24421        des_xmlBufferPtr(n_buf, buf, 0);
24422        des_xmlElementTablePtr(n_table, table, 1);
24423        xmlResetLastError();
24424        if (mem_base != xmlMemBlocks()) {
24425            printf("Leak of %d blocks found in xmlDumpElementTable",
24426	           xmlMemBlocks() - mem_base);
24427	    test_ret++;
24428            printf(" %d", n_buf);
24429            printf(" %d", n_table);
24430            printf("\n");
24431        }
24432    }
24433    }
24434    function_tests++;
24435#endif
24436
24437    return(test_ret);
24438}
24439
24440
24441#define gen_nb_xmlNotationPtr 1
24442static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24443    return(NULL);
24444}
24445static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24446}
24447
24448static int
24449test_xmlDumpNotationDecl(void) {
24450    int test_ret = 0;
24451
24452#if defined(LIBXML_OUTPUT_ENABLED)
24453    int mem_base;
24454    xmlBufferPtr buf; /* the XML buffer output */
24455    int n_buf;
24456    xmlNotationPtr nota; /* A notation declaration */
24457    int n_nota;
24458
24459    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24460    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24461        mem_base = xmlMemBlocks();
24462        buf = gen_xmlBufferPtr(n_buf, 0);
24463        nota = gen_xmlNotationPtr(n_nota, 1);
24464
24465        xmlDumpNotationDecl(buf, nota);
24466        call_tests++;
24467        des_xmlBufferPtr(n_buf, buf, 0);
24468        des_xmlNotationPtr(n_nota, nota, 1);
24469        xmlResetLastError();
24470        if (mem_base != xmlMemBlocks()) {
24471            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24472	           xmlMemBlocks() - mem_base);
24473	    test_ret++;
24474            printf(" %d", n_buf);
24475            printf(" %d", n_nota);
24476            printf("\n");
24477        }
24478    }
24479    }
24480    function_tests++;
24481#endif
24482
24483    return(test_ret);
24484}
24485
24486
24487static int
24488test_xmlDumpNotationTable(void) {
24489    int test_ret = 0;
24490
24491#if defined(LIBXML_OUTPUT_ENABLED)
24492    int mem_base;
24493    xmlBufferPtr buf; /* the XML buffer output */
24494    int n_buf;
24495    xmlNotationTablePtr table; /* A notation table */
24496    int n_table;
24497
24498    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24499    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24500        mem_base = xmlMemBlocks();
24501        buf = gen_xmlBufferPtr(n_buf, 0);
24502        table = gen_xmlNotationTablePtr(n_table, 1);
24503
24504        xmlDumpNotationTable(buf, table);
24505        call_tests++;
24506        des_xmlBufferPtr(n_buf, buf, 0);
24507        des_xmlNotationTablePtr(n_table, table, 1);
24508        xmlResetLastError();
24509        if (mem_base != xmlMemBlocks()) {
24510            printf("Leak of %d blocks found in xmlDumpNotationTable",
24511	           xmlMemBlocks() - mem_base);
24512	    test_ret++;
24513            printf(" %d", n_buf);
24514            printf(" %d", n_table);
24515            printf("\n");
24516        }
24517    }
24518    }
24519    function_tests++;
24520#endif
24521
24522    return(test_ret);
24523}
24524
24525
24526static int
24527test_xmlGetDtdAttrDesc(void) {
24528    int test_ret = 0;
24529
24530    int mem_base;
24531    xmlAttributePtr ret_val;
24532    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24533    int n_dtd;
24534    xmlChar * elem; /* the element name */
24535    int n_elem;
24536    xmlChar * name; /* the attribute name */
24537    int n_name;
24538
24539    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24540    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24541    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24542        mem_base = xmlMemBlocks();
24543        dtd = gen_xmlDtdPtr(n_dtd, 0);
24544        elem = gen_const_xmlChar_ptr(n_elem, 1);
24545        name = gen_const_xmlChar_ptr(n_name, 2);
24546
24547        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
24548        desret_xmlAttributePtr(ret_val);
24549        call_tests++;
24550        des_xmlDtdPtr(n_dtd, dtd, 0);
24551        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24552        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24553        xmlResetLastError();
24554        if (mem_base != xmlMemBlocks()) {
24555            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
24556	           xmlMemBlocks() - mem_base);
24557	    test_ret++;
24558            printf(" %d", n_dtd);
24559            printf(" %d", n_elem);
24560            printf(" %d", n_name);
24561            printf("\n");
24562        }
24563    }
24564    }
24565    }
24566    function_tests++;
24567
24568    return(test_ret);
24569}
24570
24571
24572static int
24573test_xmlGetDtdElementDesc(void) {
24574    int test_ret = 0;
24575
24576    int mem_base;
24577    xmlElementPtr ret_val;
24578    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24579    int n_dtd;
24580    xmlChar * name; /* the element name */
24581    int n_name;
24582
24583    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24584    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24585        mem_base = xmlMemBlocks();
24586        dtd = gen_xmlDtdPtr(n_dtd, 0);
24587        name = gen_const_xmlChar_ptr(n_name, 1);
24588
24589        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
24590        desret_xmlElementPtr(ret_val);
24591        call_tests++;
24592        des_xmlDtdPtr(n_dtd, dtd, 0);
24593        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24594        xmlResetLastError();
24595        if (mem_base != xmlMemBlocks()) {
24596            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
24597	           xmlMemBlocks() - mem_base);
24598	    test_ret++;
24599            printf(" %d", n_dtd);
24600            printf(" %d", n_name);
24601            printf("\n");
24602        }
24603    }
24604    }
24605    function_tests++;
24606
24607    return(test_ret);
24608}
24609
24610
24611static int
24612test_xmlGetDtdNotationDesc(void) {
24613    int test_ret = 0;
24614
24615
24616    /* missing type support */
24617    return(test_ret);
24618}
24619
24620
24621static int
24622test_xmlGetDtdQAttrDesc(void) {
24623    int test_ret = 0;
24624
24625    int mem_base;
24626    xmlAttributePtr ret_val;
24627    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24628    int n_dtd;
24629    xmlChar * elem; /* the element name */
24630    int n_elem;
24631    xmlChar * name; /* the attribute name */
24632    int n_name;
24633    xmlChar * prefix; /* the attribute namespace prefix */
24634    int n_prefix;
24635
24636    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24637    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24638    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24639    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24640        mem_base = xmlMemBlocks();
24641        dtd = gen_xmlDtdPtr(n_dtd, 0);
24642        elem = gen_const_xmlChar_ptr(n_elem, 1);
24643        name = gen_const_xmlChar_ptr(n_name, 2);
24644        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
24645
24646        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
24647        desret_xmlAttributePtr(ret_val);
24648        call_tests++;
24649        des_xmlDtdPtr(n_dtd, dtd, 0);
24650        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24651        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24652        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
24653        xmlResetLastError();
24654        if (mem_base != xmlMemBlocks()) {
24655            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
24656	           xmlMemBlocks() - mem_base);
24657	    test_ret++;
24658            printf(" %d", n_dtd);
24659            printf(" %d", n_elem);
24660            printf(" %d", n_name);
24661            printf(" %d", n_prefix);
24662            printf("\n");
24663        }
24664    }
24665    }
24666    }
24667    }
24668    function_tests++;
24669
24670    return(test_ret);
24671}
24672
24673
24674static int
24675test_xmlGetDtdQElementDesc(void) {
24676    int test_ret = 0;
24677
24678    int mem_base;
24679    xmlElementPtr ret_val;
24680    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24681    int n_dtd;
24682    xmlChar * name; /* the element name */
24683    int n_name;
24684    xmlChar * prefix; /* the element namespace prefix */
24685    int n_prefix;
24686
24687    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24688    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24689    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24690        mem_base = xmlMemBlocks();
24691        dtd = gen_xmlDtdPtr(n_dtd, 0);
24692        name = gen_const_xmlChar_ptr(n_name, 1);
24693        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
24694
24695        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
24696        desret_xmlElementPtr(ret_val);
24697        call_tests++;
24698        des_xmlDtdPtr(n_dtd, dtd, 0);
24699        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24700        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
24701        xmlResetLastError();
24702        if (mem_base != xmlMemBlocks()) {
24703            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
24704	           xmlMemBlocks() - mem_base);
24705	    test_ret++;
24706            printf(" %d", n_dtd);
24707            printf(" %d", n_name);
24708            printf(" %d", n_prefix);
24709            printf("\n");
24710        }
24711    }
24712    }
24713    }
24714    function_tests++;
24715
24716    return(test_ret);
24717}
24718
24719
24720static int
24721test_xmlGetID(void) {
24722    int test_ret = 0;
24723
24724    int mem_base;
24725    xmlAttrPtr ret_val;
24726    xmlDocPtr doc; /* pointer to the document */
24727    int n_doc;
24728    xmlChar * ID; /* the ID value */
24729    int n_ID;
24730
24731    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24732    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
24733        mem_base = xmlMemBlocks();
24734        doc = gen_xmlDocPtr(n_doc, 0);
24735        ID = gen_const_xmlChar_ptr(n_ID, 1);
24736
24737        ret_val = xmlGetID(doc, (const xmlChar *)ID);
24738        desret_xmlAttrPtr(ret_val);
24739        call_tests++;
24740        des_xmlDocPtr(n_doc, doc, 0);
24741        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
24742        xmlResetLastError();
24743        if (mem_base != xmlMemBlocks()) {
24744            printf("Leak of %d blocks found in xmlGetID",
24745	           xmlMemBlocks() - mem_base);
24746	    test_ret++;
24747            printf(" %d", n_doc);
24748            printf(" %d", n_ID);
24749            printf("\n");
24750        }
24751    }
24752    }
24753    function_tests++;
24754
24755    return(test_ret);
24756}
24757
24758
24759static int
24760test_xmlGetRefs(void) {
24761    int test_ret = 0;
24762
24763
24764    /* missing type support */
24765    return(test_ret);
24766}
24767
24768
24769static int
24770test_xmlIsID(void) {
24771    int test_ret = 0;
24772
24773    int mem_base;
24774    int ret_val;
24775    xmlDocPtr doc; /* the document */
24776    int n_doc;
24777    xmlNodePtr elem; /* the element carrying the attribute */
24778    int n_elem;
24779    xmlAttrPtr attr; /* the attribute */
24780    int n_attr;
24781
24782    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24783    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24784    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24785        mem_base = xmlMemBlocks();
24786        doc = gen_xmlDocPtr(n_doc, 0);
24787        elem = gen_xmlNodePtr(n_elem, 1);
24788        attr = gen_xmlAttrPtr(n_attr, 2);
24789
24790        ret_val = xmlIsID(doc, elem, attr);
24791        desret_int(ret_val);
24792        call_tests++;
24793        des_xmlDocPtr(n_doc, doc, 0);
24794        des_xmlNodePtr(n_elem, elem, 1);
24795        des_xmlAttrPtr(n_attr, attr, 2);
24796        xmlResetLastError();
24797        if (mem_base != xmlMemBlocks()) {
24798            printf("Leak of %d blocks found in xmlIsID",
24799	           xmlMemBlocks() - mem_base);
24800	    test_ret++;
24801            printf(" %d", n_doc);
24802            printf(" %d", n_elem);
24803            printf(" %d", n_attr);
24804            printf("\n");
24805        }
24806    }
24807    }
24808    }
24809    function_tests++;
24810
24811    return(test_ret);
24812}
24813
24814
24815static int
24816test_xmlIsMixedElement(void) {
24817    int test_ret = 0;
24818
24819    int mem_base;
24820    int ret_val;
24821    xmlDocPtr doc; /* the document */
24822    int n_doc;
24823    xmlChar * name; /* the element name */
24824    int n_name;
24825
24826    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24827    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24828        mem_base = xmlMemBlocks();
24829        doc = gen_xmlDocPtr(n_doc, 0);
24830        name = gen_const_xmlChar_ptr(n_name, 1);
24831
24832        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
24833        desret_int(ret_val);
24834        call_tests++;
24835        des_xmlDocPtr(n_doc, doc, 0);
24836        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24837        xmlResetLastError();
24838        if (mem_base != xmlMemBlocks()) {
24839            printf("Leak of %d blocks found in xmlIsMixedElement",
24840	           xmlMemBlocks() - mem_base);
24841	    test_ret++;
24842            printf(" %d", n_doc);
24843            printf(" %d", n_name);
24844            printf("\n");
24845        }
24846    }
24847    }
24848    function_tests++;
24849
24850    return(test_ret);
24851}
24852
24853
24854static int
24855test_xmlIsRef(void) {
24856    int test_ret = 0;
24857
24858    int mem_base;
24859    int ret_val;
24860    xmlDocPtr doc; /* the document */
24861    int n_doc;
24862    xmlNodePtr elem; /* the element carrying the attribute */
24863    int n_elem;
24864    xmlAttrPtr attr; /* the attribute */
24865    int n_attr;
24866
24867    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24868    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24869    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24870        mem_base = xmlMemBlocks();
24871        doc = gen_xmlDocPtr(n_doc, 0);
24872        elem = gen_xmlNodePtr(n_elem, 1);
24873        attr = gen_xmlAttrPtr(n_attr, 2);
24874
24875        ret_val = xmlIsRef(doc, elem, attr);
24876        desret_int(ret_val);
24877        call_tests++;
24878        des_xmlDocPtr(n_doc, doc, 0);
24879        des_xmlNodePtr(n_elem, elem, 1);
24880        des_xmlAttrPtr(n_attr, attr, 2);
24881        xmlResetLastError();
24882        if (mem_base != xmlMemBlocks()) {
24883            printf("Leak of %d blocks found in xmlIsRef",
24884	           xmlMemBlocks() - mem_base);
24885	    test_ret++;
24886            printf(" %d", n_doc);
24887            printf(" %d", n_elem);
24888            printf(" %d", n_attr);
24889            printf("\n");
24890        }
24891    }
24892    }
24893    }
24894    function_tests++;
24895
24896    return(test_ret);
24897}
24898
24899
24900static int
24901test_xmlNewDocElementContent(void) {
24902    int test_ret = 0;
24903
24904    int mem_base;
24905    xmlElementContentPtr ret_val;
24906    xmlDocPtr doc; /* the document */
24907    int n_doc;
24908    xmlChar * name; /* the subelement name or NULL */
24909    int n_name;
24910    xmlElementContentType type; /* the type of element content decl */
24911    int n_type;
24912
24913    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24914    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24915    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24916        mem_base = xmlMemBlocks();
24917        doc = gen_xmlDocPtr(n_doc, 0);
24918        name = gen_const_xmlChar_ptr(n_name, 1);
24919        type = gen_xmlElementContentType(n_type, 2);
24920
24921        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
24922        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
24923        desret_xmlElementContentPtr(ret_val);
24924        call_tests++;
24925        des_xmlDocPtr(n_doc, doc, 0);
24926        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24927        des_xmlElementContentType(n_type, type, 2);
24928        xmlResetLastError();
24929        if (mem_base != xmlMemBlocks()) {
24930            printf("Leak of %d blocks found in xmlNewDocElementContent",
24931	           xmlMemBlocks() - mem_base);
24932	    test_ret++;
24933            printf(" %d", n_doc);
24934            printf(" %d", n_name);
24935            printf(" %d", n_type);
24936            printf("\n");
24937        }
24938    }
24939    }
24940    }
24941    function_tests++;
24942
24943    return(test_ret);
24944}
24945
24946
24947static int
24948test_xmlNewElementContent(void) {
24949    int test_ret = 0;
24950
24951    int mem_base;
24952    xmlElementContentPtr ret_val;
24953    xmlChar * name; /* the subelement name or NULL */
24954    int n_name;
24955    xmlElementContentType type; /* the type of element content decl */
24956    int n_type;
24957
24958    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24959    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24960        mem_base = xmlMemBlocks();
24961        name = gen_const_xmlChar_ptr(n_name, 0);
24962        type = gen_xmlElementContentType(n_type, 1);
24963
24964        ret_val = xmlNewElementContent((const xmlChar *)name, type);
24965        desret_xmlElementContentPtr(ret_val);
24966        call_tests++;
24967        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24968        des_xmlElementContentType(n_type, type, 1);
24969        xmlResetLastError();
24970        if (mem_base != xmlMemBlocks()) {
24971            printf("Leak of %d blocks found in xmlNewElementContent",
24972	           xmlMemBlocks() - mem_base);
24973	    test_ret++;
24974            printf(" %d", n_name);
24975            printf(" %d", n_type);
24976            printf("\n");
24977        }
24978    }
24979    }
24980    function_tests++;
24981
24982    return(test_ret);
24983}
24984
24985
24986static int
24987test_xmlNewValidCtxt(void) {
24988    int test_ret = 0;
24989
24990
24991    /* missing type support */
24992    return(test_ret);
24993}
24994
24995
24996static int
24997test_xmlRemoveID(void) {
24998    int test_ret = 0;
24999
25000    int mem_base;
25001    int ret_val;
25002    xmlDocPtr doc; /* the document */
25003    int n_doc;
25004    xmlAttrPtr attr; /* the attribute */
25005    int n_attr;
25006
25007    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25008    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25009        mem_base = xmlMemBlocks();
25010        doc = gen_xmlDocPtr(n_doc, 0);
25011        attr = gen_xmlAttrPtr(n_attr, 1);
25012
25013        ret_val = xmlRemoveID(doc, attr);
25014        desret_int(ret_val);
25015        call_tests++;
25016        des_xmlDocPtr(n_doc, doc, 0);
25017        des_xmlAttrPtr(n_attr, attr, 1);
25018        xmlResetLastError();
25019        if (mem_base != xmlMemBlocks()) {
25020            printf("Leak of %d blocks found in xmlRemoveID",
25021	           xmlMemBlocks() - mem_base);
25022	    test_ret++;
25023            printf(" %d", n_doc);
25024            printf(" %d", n_attr);
25025            printf("\n");
25026        }
25027    }
25028    }
25029    function_tests++;
25030
25031    return(test_ret);
25032}
25033
25034
25035static int
25036test_xmlRemoveRef(void) {
25037    int test_ret = 0;
25038
25039    int mem_base;
25040    int ret_val;
25041    xmlDocPtr doc; /* the document */
25042    int n_doc;
25043    xmlAttrPtr attr; /* the attribute */
25044    int n_attr;
25045
25046    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25047    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25048        mem_base = xmlMemBlocks();
25049        doc = gen_xmlDocPtr(n_doc, 0);
25050        attr = gen_xmlAttrPtr(n_attr, 1);
25051
25052        ret_val = xmlRemoveRef(doc, attr);
25053        desret_int(ret_val);
25054        call_tests++;
25055        des_xmlDocPtr(n_doc, doc, 0);
25056        des_xmlAttrPtr(n_attr, attr, 1);
25057        xmlResetLastError();
25058        if (mem_base != xmlMemBlocks()) {
25059            printf("Leak of %d blocks found in xmlRemoveRef",
25060	           xmlMemBlocks() - mem_base);
25061	    test_ret++;
25062            printf(" %d", n_doc);
25063            printf(" %d", n_attr);
25064            printf("\n");
25065        }
25066    }
25067    }
25068    function_tests++;
25069
25070    return(test_ret);
25071}
25072
25073
25074static int
25075test_xmlSnprintfElementContent(void) {
25076    int test_ret = 0;
25077
25078    int mem_base;
25079    char * buf; /* an output buffer */
25080    int n_buf;
25081    int size; /* the buffer size */
25082    int n_size;
25083    xmlElementContentPtr content; /* An element table */
25084    int n_content;
25085    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25086    int n_englob;
25087
25088    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25089    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25090    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25091    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25092        mem_base = xmlMemBlocks();
25093        buf = gen_char_ptr(n_buf, 0);
25094        size = gen_int(n_size, 1);
25095        content = gen_xmlElementContentPtr(n_content, 2);
25096        englob = gen_int(n_englob, 3);
25097
25098        xmlSnprintfElementContent(buf, size, content, englob);
25099        call_tests++;
25100        des_char_ptr(n_buf, buf, 0);
25101        des_int(n_size, size, 1);
25102        des_xmlElementContentPtr(n_content, content, 2);
25103        des_int(n_englob, englob, 3);
25104        xmlResetLastError();
25105        if (mem_base != xmlMemBlocks()) {
25106            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25107	           xmlMemBlocks() - mem_base);
25108	    test_ret++;
25109            printf(" %d", n_buf);
25110            printf(" %d", n_size);
25111            printf(" %d", n_content);
25112            printf(" %d", n_englob);
25113            printf("\n");
25114        }
25115    }
25116    }
25117    }
25118    }
25119    function_tests++;
25120
25121    return(test_ret);
25122}
25123
25124
25125static int
25126test_xmlSprintfElementContent(void) {
25127    int test_ret = 0;
25128
25129#if defined(LIBXML_OUTPUT_ENABLED)
25130#ifdef LIBXML_OUTPUT_ENABLED
25131    int mem_base;
25132    char * buf; /* an output buffer */
25133    int n_buf;
25134    xmlElementContentPtr content; /* An element table */
25135    int n_content;
25136    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25137    int n_englob;
25138
25139    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25140    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25141    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25142        mem_base = xmlMemBlocks();
25143        buf = gen_char_ptr(n_buf, 0);
25144        content = gen_xmlElementContentPtr(n_content, 1);
25145        englob = gen_int(n_englob, 2);
25146
25147        xmlSprintfElementContent(buf, content, englob);
25148        call_tests++;
25149        des_char_ptr(n_buf, buf, 0);
25150        des_xmlElementContentPtr(n_content, content, 1);
25151        des_int(n_englob, englob, 2);
25152        xmlResetLastError();
25153        if (mem_base != xmlMemBlocks()) {
25154            printf("Leak of %d blocks found in xmlSprintfElementContent",
25155	           xmlMemBlocks() - mem_base);
25156	    test_ret++;
25157            printf(" %d", n_buf);
25158            printf(" %d", n_content);
25159            printf(" %d", n_englob);
25160            printf("\n");
25161        }
25162    }
25163    }
25164    }
25165    function_tests++;
25166#endif
25167#endif
25168
25169    return(test_ret);
25170}
25171
25172
25173static int
25174test_xmlValidBuildContentModel(void) {
25175    int test_ret = 0;
25176
25177#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25178    int mem_base;
25179    int ret_val;
25180    xmlValidCtxtPtr ctxt; /* a validation context */
25181    int n_ctxt;
25182    xmlElementPtr elem; /* an element declaration node */
25183    int n_elem;
25184
25185    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25186    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25187        mem_base = xmlMemBlocks();
25188        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25189        elem = gen_xmlElementPtr(n_elem, 1);
25190
25191        ret_val = xmlValidBuildContentModel(ctxt, elem);
25192        desret_int(ret_val);
25193        call_tests++;
25194        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25195        des_xmlElementPtr(n_elem, elem, 1);
25196        xmlResetLastError();
25197        if (mem_base != xmlMemBlocks()) {
25198            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25199	           xmlMemBlocks() - mem_base);
25200	    test_ret++;
25201            printf(" %d", n_ctxt);
25202            printf(" %d", n_elem);
25203            printf("\n");
25204        }
25205    }
25206    }
25207    function_tests++;
25208#endif
25209
25210    return(test_ret);
25211}
25212
25213
25214static int
25215test_xmlValidCtxtNormalizeAttributeValue(void) {
25216    int test_ret = 0;
25217
25218#if defined(LIBXML_VALID_ENABLED)
25219    int mem_base;
25220    xmlChar * ret_val;
25221    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25222    int n_ctxt;
25223    xmlDocPtr doc; /* the document */
25224    int n_doc;
25225    xmlNodePtr elem; /* the parent */
25226    int n_elem;
25227    xmlChar * name; /* the attribute name */
25228    int n_name;
25229    xmlChar * value; /* the attribute value */
25230    int n_value;
25231
25232    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25233    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25234    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25235    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25236    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25237        mem_base = xmlMemBlocks();
25238        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25239        doc = gen_xmlDocPtr(n_doc, 1);
25240        elem = gen_xmlNodePtr(n_elem, 2);
25241        name = gen_const_xmlChar_ptr(n_name, 3);
25242        value = gen_const_xmlChar_ptr(n_value, 4);
25243
25244        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25245        desret_xmlChar_ptr(ret_val);
25246        call_tests++;
25247        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25248        des_xmlDocPtr(n_doc, doc, 1);
25249        des_xmlNodePtr(n_elem, elem, 2);
25250        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25251        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25252        xmlResetLastError();
25253        if (mem_base != xmlMemBlocks()) {
25254            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25255	           xmlMemBlocks() - mem_base);
25256	    test_ret++;
25257            printf(" %d", n_ctxt);
25258            printf(" %d", n_doc);
25259            printf(" %d", n_elem);
25260            printf(" %d", n_name);
25261            printf(" %d", n_value);
25262            printf("\n");
25263        }
25264    }
25265    }
25266    }
25267    }
25268    }
25269    function_tests++;
25270#endif
25271
25272    return(test_ret);
25273}
25274
25275
25276#define gen_nb_xmlElementContent_ptr 1
25277static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25278    return(NULL);
25279}
25280static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25281}
25282
25283static int
25284test_xmlValidGetPotentialChildren(void) {
25285    int test_ret = 0;
25286
25287#if defined(LIBXML_VALID_ENABLED)
25288#ifdef LIBXML_VALID_ENABLED
25289    int mem_base;
25290    int ret_val;
25291    xmlElementContent * ctree; /* an element content tree */
25292    int n_ctree;
25293    xmlChar ** list; /* an array to store the list of child names */
25294    int n_list;
25295    int * len; /* a pointer to the number of element in the list */
25296    int n_len;
25297    int max; /* the size of the array */
25298    int n_max;
25299
25300    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25301    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
25302    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25303    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25304        mem_base = xmlMemBlocks();
25305        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25306        list = gen_const_xmlChar_ptr_ptr(n_list, 1);
25307        len = gen_int_ptr(n_len, 2);
25308        max = gen_int(n_max, 3);
25309
25310        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)list, len, max);
25311        desret_int(ret_val);
25312        call_tests++;
25313        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25314        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 1);
25315        des_int_ptr(n_len, len, 2);
25316        des_int(n_max, max, 3);
25317        xmlResetLastError();
25318        if (mem_base != xmlMemBlocks()) {
25319            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25320	           xmlMemBlocks() - mem_base);
25321	    test_ret++;
25322            printf(" %d", n_ctree);
25323            printf(" %d", n_list);
25324            printf(" %d", n_len);
25325            printf(" %d", n_max);
25326            printf("\n");
25327        }
25328    }
25329    }
25330    }
25331    }
25332    function_tests++;
25333#endif
25334#endif
25335
25336    return(test_ret);
25337}
25338
25339
25340static int
25341test_xmlValidGetValidElements(void) {
25342    int test_ret = 0;
25343
25344#if defined(LIBXML_VALID_ENABLED)
25345#ifdef LIBXML_VALID_ENABLED
25346    int mem_base;
25347    int ret_val;
25348    xmlNode * prev; /* an element to insert after */
25349    int n_prev;
25350    xmlNode * next; /* an element to insert next */
25351    int n_next;
25352    xmlChar ** names; /* an array to store the list of child names */
25353    int n_names;
25354    int max; /* the size of the array */
25355    int n_max;
25356
25357    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25358    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25359    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25360    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25361        mem_base = xmlMemBlocks();
25362        prev = gen_xmlNodePtr(n_prev, 0);
25363        next = gen_xmlNodePtr(n_next, 1);
25364        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25365        max = gen_int(n_max, 3);
25366
25367        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25368        desret_int(ret_val);
25369        call_tests++;
25370        des_xmlNodePtr(n_prev, prev, 0);
25371        des_xmlNodePtr(n_next, next, 1);
25372        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25373        des_int(n_max, max, 3);
25374        xmlResetLastError();
25375        if (mem_base != xmlMemBlocks()) {
25376            printf("Leak of %d blocks found in xmlValidGetValidElements",
25377	           xmlMemBlocks() - mem_base);
25378	    test_ret++;
25379            printf(" %d", n_prev);
25380            printf(" %d", n_next);
25381            printf(" %d", n_names);
25382            printf(" %d", n_max);
25383            printf("\n");
25384        }
25385    }
25386    }
25387    }
25388    }
25389    function_tests++;
25390#endif
25391#endif
25392
25393    return(test_ret);
25394}
25395
25396
25397static int
25398test_xmlValidNormalizeAttributeValue(void) {
25399    int test_ret = 0;
25400
25401#if defined(LIBXML_VALID_ENABLED)
25402    int mem_base;
25403    xmlChar * ret_val;
25404    xmlDocPtr doc; /* the document */
25405    int n_doc;
25406    xmlNodePtr elem; /* the parent */
25407    int n_elem;
25408    xmlChar * name; /* the attribute name */
25409    int n_name;
25410    xmlChar * value; /* the attribute value */
25411    int n_value;
25412
25413    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25414    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25415    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25416    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25417        mem_base = xmlMemBlocks();
25418        doc = gen_xmlDocPtr(n_doc, 0);
25419        elem = gen_xmlNodePtr(n_elem, 1);
25420        name = gen_const_xmlChar_ptr(n_name, 2);
25421        value = gen_const_xmlChar_ptr(n_value, 3);
25422
25423        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25424        desret_xmlChar_ptr(ret_val);
25425        call_tests++;
25426        des_xmlDocPtr(n_doc, doc, 0);
25427        des_xmlNodePtr(n_elem, elem, 1);
25428        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25429        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25430        xmlResetLastError();
25431        if (mem_base != xmlMemBlocks()) {
25432            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25433	           xmlMemBlocks() - mem_base);
25434	    test_ret++;
25435            printf(" %d", n_doc);
25436            printf(" %d", n_elem);
25437            printf(" %d", n_name);
25438            printf(" %d", n_value);
25439            printf("\n");
25440        }
25441    }
25442    }
25443    }
25444    }
25445    function_tests++;
25446#endif
25447
25448    return(test_ret);
25449}
25450
25451
25452static int
25453test_xmlValidateAttributeDecl(void) {
25454    int test_ret = 0;
25455
25456#if defined(LIBXML_VALID_ENABLED)
25457    int mem_base;
25458    int ret_val;
25459    xmlValidCtxtPtr ctxt; /* the validation context */
25460    int n_ctxt;
25461    xmlDocPtr doc; /* a document instance */
25462    int n_doc;
25463    xmlAttributePtr attr; /* an attribute definition */
25464    int n_attr;
25465
25466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25467    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25468    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25469        mem_base = xmlMemBlocks();
25470        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25471        doc = gen_xmlDocPtr(n_doc, 1);
25472        attr = gen_xmlAttributePtr(n_attr, 2);
25473
25474        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25475        desret_int(ret_val);
25476        call_tests++;
25477        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25478        des_xmlDocPtr(n_doc, doc, 1);
25479        des_xmlAttributePtr(n_attr, attr, 2);
25480        xmlResetLastError();
25481        if (mem_base != xmlMemBlocks()) {
25482            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25483	           xmlMemBlocks() - mem_base);
25484	    test_ret++;
25485            printf(" %d", n_ctxt);
25486            printf(" %d", n_doc);
25487            printf(" %d", n_attr);
25488            printf("\n");
25489        }
25490    }
25491    }
25492    }
25493    function_tests++;
25494#endif
25495
25496    return(test_ret);
25497}
25498
25499
25500static int
25501test_xmlValidateAttributeValue(void) {
25502    int test_ret = 0;
25503
25504#if defined(LIBXML_VALID_ENABLED)
25505    int mem_base;
25506    int ret_val;
25507    xmlAttributeType type; /* an attribute type */
25508    int n_type;
25509    xmlChar * value; /* an attribute value */
25510    int n_value;
25511
25512    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25513    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25514        mem_base = xmlMemBlocks();
25515        type = gen_xmlAttributeType(n_type, 0);
25516        value = gen_const_xmlChar_ptr(n_value, 1);
25517
25518        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25519        desret_int(ret_val);
25520        call_tests++;
25521        des_xmlAttributeType(n_type, type, 0);
25522        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25523        xmlResetLastError();
25524        if (mem_base != xmlMemBlocks()) {
25525            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25526	           xmlMemBlocks() - mem_base);
25527	    test_ret++;
25528            printf(" %d", n_type);
25529            printf(" %d", n_value);
25530            printf("\n");
25531        }
25532    }
25533    }
25534    function_tests++;
25535#endif
25536
25537    return(test_ret);
25538}
25539
25540
25541static int
25542test_xmlValidateDocument(void) {
25543    int test_ret = 0;
25544
25545#if defined(LIBXML_VALID_ENABLED)
25546    int mem_base;
25547    int ret_val;
25548    xmlValidCtxtPtr ctxt; /* the validation context */
25549    int n_ctxt;
25550    xmlDocPtr doc; /* a document instance */
25551    int n_doc;
25552
25553    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25554    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25555        mem_base = xmlMemBlocks();
25556        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25557        doc = gen_xmlDocPtr(n_doc, 1);
25558
25559        ret_val = xmlValidateDocument(ctxt, doc);
25560        desret_int(ret_val);
25561        call_tests++;
25562        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25563        des_xmlDocPtr(n_doc, doc, 1);
25564        xmlResetLastError();
25565        if (mem_base != xmlMemBlocks()) {
25566            printf("Leak of %d blocks found in xmlValidateDocument",
25567	           xmlMemBlocks() - mem_base);
25568	    test_ret++;
25569            printf(" %d", n_ctxt);
25570            printf(" %d", n_doc);
25571            printf("\n");
25572        }
25573    }
25574    }
25575    function_tests++;
25576#endif
25577
25578    return(test_ret);
25579}
25580
25581
25582static int
25583test_xmlValidateDocumentFinal(void) {
25584    int test_ret = 0;
25585
25586#if defined(LIBXML_VALID_ENABLED)
25587    int mem_base;
25588    int ret_val;
25589    xmlValidCtxtPtr ctxt; /* the validation context */
25590    int n_ctxt;
25591    xmlDocPtr doc; /* a document instance */
25592    int n_doc;
25593
25594    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25595    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25596        mem_base = xmlMemBlocks();
25597        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25598        doc = gen_xmlDocPtr(n_doc, 1);
25599
25600        ret_val = xmlValidateDocumentFinal(ctxt, doc);
25601        desret_int(ret_val);
25602        call_tests++;
25603        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25604        des_xmlDocPtr(n_doc, doc, 1);
25605        xmlResetLastError();
25606        if (mem_base != xmlMemBlocks()) {
25607            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
25608	           xmlMemBlocks() - mem_base);
25609	    test_ret++;
25610            printf(" %d", n_ctxt);
25611            printf(" %d", n_doc);
25612            printf("\n");
25613        }
25614    }
25615    }
25616    function_tests++;
25617#endif
25618
25619    return(test_ret);
25620}
25621
25622
25623static int
25624test_xmlValidateDtd(void) {
25625    int test_ret = 0;
25626
25627#if defined(LIBXML_VALID_ENABLED)
25628    int mem_base;
25629    int ret_val;
25630    xmlValidCtxtPtr ctxt; /* the validation context */
25631    int n_ctxt;
25632    xmlDocPtr doc; /* a document instance */
25633    int n_doc;
25634    xmlDtdPtr dtd; /* a dtd instance */
25635    int n_dtd;
25636
25637    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25638    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25639    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25640        mem_base = xmlMemBlocks();
25641        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25642        doc = gen_xmlDocPtr(n_doc, 1);
25643        dtd = gen_xmlDtdPtr(n_dtd, 2);
25644
25645        ret_val = xmlValidateDtd(ctxt, doc, dtd);
25646        desret_int(ret_val);
25647        call_tests++;
25648        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25649        des_xmlDocPtr(n_doc, doc, 1);
25650        des_xmlDtdPtr(n_dtd, dtd, 2);
25651        xmlResetLastError();
25652        if (mem_base != xmlMemBlocks()) {
25653            printf("Leak of %d blocks found in xmlValidateDtd",
25654	           xmlMemBlocks() - mem_base);
25655	    test_ret++;
25656            printf(" %d", n_ctxt);
25657            printf(" %d", n_doc);
25658            printf(" %d", n_dtd);
25659            printf("\n");
25660        }
25661    }
25662    }
25663    }
25664    function_tests++;
25665#endif
25666
25667    return(test_ret);
25668}
25669
25670
25671static int
25672test_xmlValidateDtdFinal(void) {
25673    int test_ret = 0;
25674
25675#if defined(LIBXML_VALID_ENABLED)
25676    int mem_base;
25677    int ret_val;
25678    xmlValidCtxtPtr ctxt; /* the validation context */
25679    int n_ctxt;
25680    xmlDocPtr doc; /* a document instance */
25681    int n_doc;
25682
25683    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25684    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25685        mem_base = xmlMemBlocks();
25686        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25687        doc = gen_xmlDocPtr(n_doc, 1);
25688
25689        ret_val = xmlValidateDtdFinal(ctxt, doc);
25690        desret_int(ret_val);
25691        call_tests++;
25692        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25693        des_xmlDocPtr(n_doc, doc, 1);
25694        xmlResetLastError();
25695        if (mem_base != xmlMemBlocks()) {
25696            printf("Leak of %d blocks found in xmlValidateDtdFinal",
25697	           xmlMemBlocks() - mem_base);
25698	    test_ret++;
25699            printf(" %d", n_ctxt);
25700            printf(" %d", n_doc);
25701            printf("\n");
25702        }
25703    }
25704    }
25705    function_tests++;
25706#endif
25707
25708    return(test_ret);
25709}
25710
25711
25712static int
25713test_xmlValidateElement(void) {
25714    int test_ret = 0;
25715
25716#if defined(LIBXML_VALID_ENABLED)
25717    int mem_base;
25718    int ret_val;
25719    xmlValidCtxtPtr ctxt; /* the validation context */
25720    int n_ctxt;
25721    xmlDocPtr doc; /* a document instance */
25722    int n_doc;
25723    xmlNodePtr elem; /* an element instance */
25724    int n_elem;
25725
25726    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25727    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25728    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25729        mem_base = xmlMemBlocks();
25730        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25731        doc = gen_xmlDocPtr(n_doc, 1);
25732        elem = gen_xmlNodePtr(n_elem, 2);
25733
25734        ret_val = xmlValidateElement(ctxt, doc, elem);
25735        desret_int(ret_val);
25736        call_tests++;
25737        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25738        des_xmlDocPtr(n_doc, doc, 1);
25739        des_xmlNodePtr(n_elem, elem, 2);
25740        xmlResetLastError();
25741        if (mem_base != xmlMemBlocks()) {
25742            printf("Leak of %d blocks found in xmlValidateElement",
25743	           xmlMemBlocks() - mem_base);
25744	    test_ret++;
25745            printf(" %d", n_ctxt);
25746            printf(" %d", n_doc);
25747            printf(" %d", n_elem);
25748            printf("\n");
25749        }
25750    }
25751    }
25752    }
25753    function_tests++;
25754#endif
25755
25756    return(test_ret);
25757}
25758
25759
25760static int
25761test_xmlValidateElementDecl(void) {
25762    int test_ret = 0;
25763
25764#if defined(LIBXML_VALID_ENABLED)
25765    int mem_base;
25766    int ret_val;
25767    xmlValidCtxtPtr ctxt; /* the validation context */
25768    int n_ctxt;
25769    xmlDocPtr doc; /* a document instance */
25770    int n_doc;
25771    xmlElementPtr elem; /* an element definition */
25772    int n_elem;
25773
25774    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25775    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25776    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25777        mem_base = xmlMemBlocks();
25778        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25779        doc = gen_xmlDocPtr(n_doc, 1);
25780        elem = gen_xmlElementPtr(n_elem, 2);
25781
25782        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
25783        desret_int(ret_val);
25784        call_tests++;
25785        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25786        des_xmlDocPtr(n_doc, doc, 1);
25787        des_xmlElementPtr(n_elem, elem, 2);
25788        xmlResetLastError();
25789        if (mem_base != xmlMemBlocks()) {
25790            printf("Leak of %d blocks found in xmlValidateElementDecl",
25791	           xmlMemBlocks() - mem_base);
25792	    test_ret++;
25793            printf(" %d", n_ctxt);
25794            printf(" %d", n_doc);
25795            printf(" %d", n_elem);
25796            printf("\n");
25797        }
25798    }
25799    }
25800    }
25801    function_tests++;
25802#endif
25803
25804    return(test_ret);
25805}
25806
25807
25808static int
25809test_xmlValidateNameValue(void) {
25810    int test_ret = 0;
25811
25812#if defined(LIBXML_VALID_ENABLED)
25813    int mem_base;
25814    int ret_val;
25815    xmlChar * value; /* an Name value */
25816    int n_value;
25817
25818    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25819        mem_base = xmlMemBlocks();
25820        value = gen_const_xmlChar_ptr(n_value, 0);
25821
25822        ret_val = xmlValidateNameValue((const xmlChar *)value);
25823        desret_int(ret_val);
25824        call_tests++;
25825        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25826        xmlResetLastError();
25827        if (mem_base != xmlMemBlocks()) {
25828            printf("Leak of %d blocks found in xmlValidateNameValue",
25829	           xmlMemBlocks() - mem_base);
25830	    test_ret++;
25831            printf(" %d", n_value);
25832            printf("\n");
25833        }
25834    }
25835    function_tests++;
25836#endif
25837
25838    return(test_ret);
25839}
25840
25841
25842static int
25843test_xmlValidateNamesValue(void) {
25844    int test_ret = 0;
25845
25846#if defined(LIBXML_VALID_ENABLED)
25847    int mem_base;
25848    int ret_val;
25849    xmlChar * value; /* an Names value */
25850    int n_value;
25851
25852    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25853        mem_base = xmlMemBlocks();
25854        value = gen_const_xmlChar_ptr(n_value, 0);
25855
25856        ret_val = xmlValidateNamesValue((const xmlChar *)value);
25857        desret_int(ret_val);
25858        call_tests++;
25859        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25860        xmlResetLastError();
25861        if (mem_base != xmlMemBlocks()) {
25862            printf("Leak of %d blocks found in xmlValidateNamesValue",
25863	           xmlMemBlocks() - mem_base);
25864	    test_ret++;
25865            printf(" %d", n_value);
25866            printf("\n");
25867        }
25868    }
25869    function_tests++;
25870#endif
25871
25872    return(test_ret);
25873}
25874
25875
25876static int
25877test_xmlValidateNmtokenValue(void) {
25878    int test_ret = 0;
25879
25880#if defined(LIBXML_VALID_ENABLED)
25881    int mem_base;
25882    int ret_val;
25883    xmlChar * value; /* an Nmtoken value */
25884    int n_value;
25885
25886    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25887        mem_base = xmlMemBlocks();
25888        value = gen_const_xmlChar_ptr(n_value, 0);
25889
25890        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
25891        desret_int(ret_val);
25892        call_tests++;
25893        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25894        xmlResetLastError();
25895        if (mem_base != xmlMemBlocks()) {
25896            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
25897	           xmlMemBlocks() - mem_base);
25898	    test_ret++;
25899            printf(" %d", n_value);
25900            printf("\n");
25901        }
25902    }
25903    function_tests++;
25904#endif
25905
25906    return(test_ret);
25907}
25908
25909
25910static int
25911test_xmlValidateNmtokensValue(void) {
25912    int test_ret = 0;
25913
25914#if defined(LIBXML_VALID_ENABLED)
25915    int mem_base;
25916    int ret_val;
25917    xmlChar * value; /* an Nmtokens value */
25918    int n_value;
25919
25920    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25921        mem_base = xmlMemBlocks();
25922        value = gen_const_xmlChar_ptr(n_value, 0);
25923
25924        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
25925        desret_int(ret_val);
25926        call_tests++;
25927        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25928        xmlResetLastError();
25929        if (mem_base != xmlMemBlocks()) {
25930            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
25931	           xmlMemBlocks() - mem_base);
25932	    test_ret++;
25933            printf(" %d", n_value);
25934            printf("\n");
25935        }
25936    }
25937    function_tests++;
25938#endif
25939
25940    return(test_ret);
25941}
25942
25943
25944static int
25945test_xmlValidateNotationDecl(void) {
25946    int test_ret = 0;
25947
25948#if defined(LIBXML_VALID_ENABLED)
25949    int mem_base;
25950    int ret_val;
25951    xmlValidCtxtPtr ctxt; /* the validation context */
25952    int n_ctxt;
25953    xmlDocPtr doc; /* a document instance */
25954    int n_doc;
25955    xmlNotationPtr nota; /* a notation definition */
25956    int n_nota;
25957
25958    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25959    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25960    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25961        mem_base = xmlMemBlocks();
25962        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25963        doc = gen_xmlDocPtr(n_doc, 1);
25964        nota = gen_xmlNotationPtr(n_nota, 2);
25965
25966        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
25967        desret_int(ret_val);
25968        call_tests++;
25969        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25970        des_xmlDocPtr(n_doc, doc, 1);
25971        des_xmlNotationPtr(n_nota, nota, 2);
25972        xmlResetLastError();
25973        if (mem_base != xmlMemBlocks()) {
25974            printf("Leak of %d blocks found in xmlValidateNotationDecl",
25975	           xmlMemBlocks() - mem_base);
25976	    test_ret++;
25977            printf(" %d", n_ctxt);
25978            printf(" %d", n_doc);
25979            printf(" %d", n_nota);
25980            printf("\n");
25981        }
25982    }
25983    }
25984    }
25985    function_tests++;
25986#endif
25987
25988    return(test_ret);
25989}
25990
25991
25992static int
25993test_xmlValidateNotationUse(void) {
25994    int test_ret = 0;
25995
25996#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
25997    int mem_base;
25998    int ret_val;
25999    xmlValidCtxtPtr ctxt; /* the validation context */
26000    int n_ctxt;
26001    xmlDocPtr doc; /* the document */
26002    int n_doc;
26003    xmlChar * notationName; /* the notation name to check */
26004    int n_notationName;
26005
26006    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26007    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26008    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26009        mem_base = xmlMemBlocks();
26010        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26011        doc = gen_xmlDocPtr(n_doc, 1);
26012        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26013
26014        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26015        desret_int(ret_val);
26016        call_tests++;
26017        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26018        des_xmlDocPtr(n_doc, doc, 1);
26019        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26020        xmlResetLastError();
26021        if (mem_base != xmlMemBlocks()) {
26022            printf("Leak of %d blocks found in xmlValidateNotationUse",
26023	           xmlMemBlocks() - mem_base);
26024	    test_ret++;
26025            printf(" %d", n_ctxt);
26026            printf(" %d", n_doc);
26027            printf(" %d", n_notationName);
26028            printf("\n");
26029        }
26030    }
26031    }
26032    }
26033    function_tests++;
26034#endif
26035
26036    return(test_ret);
26037}
26038
26039
26040static int
26041test_xmlValidateOneAttribute(void) {
26042    int test_ret = 0;
26043
26044#if defined(LIBXML_VALID_ENABLED)
26045    int mem_base;
26046    int ret_val;
26047    xmlValidCtxtPtr ctxt; /* the validation context */
26048    int n_ctxt;
26049    xmlDocPtr doc; /* a document instance */
26050    int n_doc;
26051    xmlNodePtr elem; /* an element instance */
26052    int n_elem;
26053    xmlAttrPtr attr; /* an attribute instance */
26054    int n_attr;
26055    xmlChar * value; /* the attribute value (without entities processing) */
26056    int n_value;
26057
26058    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26059    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26060    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26061    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26062    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26063        mem_base = xmlMemBlocks();
26064        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26065        doc = gen_xmlDocPtr(n_doc, 1);
26066        elem = gen_xmlNodePtr(n_elem, 2);
26067        attr = gen_xmlAttrPtr(n_attr, 3);
26068        value = gen_const_xmlChar_ptr(n_value, 4);
26069
26070        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26071        desret_int(ret_val);
26072        call_tests++;
26073        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26074        des_xmlDocPtr(n_doc, doc, 1);
26075        des_xmlNodePtr(n_elem, elem, 2);
26076        des_xmlAttrPtr(n_attr, attr, 3);
26077        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26078        xmlResetLastError();
26079        if (mem_base != xmlMemBlocks()) {
26080            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26081	           xmlMemBlocks() - mem_base);
26082	    test_ret++;
26083            printf(" %d", n_ctxt);
26084            printf(" %d", n_doc);
26085            printf(" %d", n_elem);
26086            printf(" %d", n_attr);
26087            printf(" %d", n_value);
26088            printf("\n");
26089        }
26090    }
26091    }
26092    }
26093    }
26094    }
26095    function_tests++;
26096#endif
26097
26098    return(test_ret);
26099}
26100
26101
26102static int
26103test_xmlValidateOneElement(void) {
26104    int test_ret = 0;
26105
26106#if defined(LIBXML_VALID_ENABLED)
26107    int mem_base;
26108    int ret_val;
26109    xmlValidCtxtPtr ctxt; /* the validation context */
26110    int n_ctxt;
26111    xmlDocPtr doc; /* a document instance */
26112    int n_doc;
26113    xmlNodePtr elem; /* an element instance */
26114    int n_elem;
26115
26116    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26117    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26118    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26119        mem_base = xmlMemBlocks();
26120        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26121        doc = gen_xmlDocPtr(n_doc, 1);
26122        elem = gen_xmlNodePtr(n_elem, 2);
26123
26124        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26125        desret_int(ret_val);
26126        call_tests++;
26127        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26128        des_xmlDocPtr(n_doc, doc, 1);
26129        des_xmlNodePtr(n_elem, elem, 2);
26130        xmlResetLastError();
26131        if (mem_base != xmlMemBlocks()) {
26132            printf("Leak of %d blocks found in xmlValidateOneElement",
26133	           xmlMemBlocks() - mem_base);
26134	    test_ret++;
26135            printf(" %d", n_ctxt);
26136            printf(" %d", n_doc);
26137            printf(" %d", n_elem);
26138            printf("\n");
26139        }
26140    }
26141    }
26142    }
26143    function_tests++;
26144#endif
26145
26146    return(test_ret);
26147}
26148
26149
26150static int
26151test_xmlValidateOneNamespace(void) {
26152    int test_ret = 0;
26153
26154#if defined(LIBXML_VALID_ENABLED)
26155    int mem_base;
26156    int ret_val;
26157    xmlValidCtxtPtr ctxt; /* the validation context */
26158    int n_ctxt;
26159    xmlDocPtr doc; /* a document instance */
26160    int n_doc;
26161    xmlNodePtr elem; /* an element instance */
26162    int n_elem;
26163    xmlChar * prefix; /* the namespace prefix */
26164    int n_prefix;
26165    xmlNsPtr ns; /* an namespace declaration instance */
26166    int n_ns;
26167    xmlChar * value; /* the attribute value (without entities processing) */
26168    int n_value;
26169
26170    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26171    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26172    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26173    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26174    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26175    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26176        mem_base = xmlMemBlocks();
26177        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26178        doc = gen_xmlDocPtr(n_doc, 1);
26179        elem = gen_xmlNodePtr(n_elem, 2);
26180        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26181        ns = gen_xmlNsPtr(n_ns, 4);
26182        value = gen_const_xmlChar_ptr(n_value, 5);
26183
26184        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26185        desret_int(ret_val);
26186        call_tests++;
26187        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26188        des_xmlDocPtr(n_doc, doc, 1);
26189        des_xmlNodePtr(n_elem, elem, 2);
26190        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26191        des_xmlNsPtr(n_ns, ns, 4);
26192        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26193        xmlResetLastError();
26194        if (mem_base != xmlMemBlocks()) {
26195            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26196	           xmlMemBlocks() - mem_base);
26197	    test_ret++;
26198            printf(" %d", n_ctxt);
26199            printf(" %d", n_doc);
26200            printf(" %d", n_elem);
26201            printf(" %d", n_prefix);
26202            printf(" %d", n_ns);
26203            printf(" %d", n_value);
26204            printf("\n");
26205        }
26206    }
26207    }
26208    }
26209    }
26210    }
26211    }
26212    function_tests++;
26213#endif
26214
26215    return(test_ret);
26216}
26217
26218
26219static int
26220test_xmlValidatePopElement(void) {
26221    int test_ret = 0;
26222
26223#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26224    int mem_base;
26225    int ret_val;
26226    xmlValidCtxtPtr ctxt; /* the validation context */
26227    int n_ctxt;
26228    xmlDocPtr doc; /* a document instance */
26229    int n_doc;
26230    xmlNodePtr elem; /* an element instance */
26231    int n_elem;
26232    xmlChar * qname; /* the qualified name as appearing in the serialization */
26233    int n_qname;
26234
26235    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26236    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26237    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26238    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26239        mem_base = xmlMemBlocks();
26240        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26241        doc = gen_xmlDocPtr(n_doc, 1);
26242        elem = gen_xmlNodePtr(n_elem, 2);
26243        qname = gen_const_xmlChar_ptr(n_qname, 3);
26244
26245        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26246        desret_int(ret_val);
26247        call_tests++;
26248        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26249        des_xmlDocPtr(n_doc, doc, 1);
26250        des_xmlNodePtr(n_elem, elem, 2);
26251        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26252        xmlResetLastError();
26253        if (mem_base != xmlMemBlocks()) {
26254            printf("Leak of %d blocks found in xmlValidatePopElement",
26255	           xmlMemBlocks() - mem_base);
26256	    test_ret++;
26257            printf(" %d", n_ctxt);
26258            printf(" %d", n_doc);
26259            printf(" %d", n_elem);
26260            printf(" %d", n_qname);
26261            printf("\n");
26262        }
26263    }
26264    }
26265    }
26266    }
26267    function_tests++;
26268#endif
26269
26270    return(test_ret);
26271}
26272
26273
26274static int
26275test_xmlValidatePushCData(void) {
26276    int test_ret = 0;
26277
26278#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26279    int mem_base;
26280    int ret_val;
26281    xmlValidCtxtPtr ctxt; /* the validation context */
26282    int n_ctxt;
26283    xmlChar * data; /* some character data read */
26284    int n_data;
26285    int len; /* the lenght of the data */
26286    int n_len;
26287
26288    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26289    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26290    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26291        mem_base = xmlMemBlocks();
26292        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26293        data = gen_const_xmlChar_ptr(n_data, 1);
26294        len = gen_int(n_len, 2);
26295
26296        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26297        desret_int(ret_val);
26298        call_tests++;
26299        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26300        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26301        des_int(n_len, len, 2);
26302        xmlResetLastError();
26303        if (mem_base != xmlMemBlocks()) {
26304            printf("Leak of %d blocks found in xmlValidatePushCData",
26305	           xmlMemBlocks() - mem_base);
26306	    test_ret++;
26307            printf(" %d", n_ctxt);
26308            printf(" %d", n_data);
26309            printf(" %d", n_len);
26310            printf("\n");
26311        }
26312    }
26313    }
26314    }
26315    function_tests++;
26316#endif
26317
26318    return(test_ret);
26319}
26320
26321
26322static int
26323test_xmlValidatePushElement(void) {
26324    int test_ret = 0;
26325
26326#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26327    int mem_base;
26328    int ret_val;
26329    xmlValidCtxtPtr ctxt; /* the validation context */
26330    int n_ctxt;
26331    xmlDocPtr doc; /* a document instance */
26332    int n_doc;
26333    xmlNodePtr elem; /* an element instance */
26334    int n_elem;
26335    xmlChar * qname; /* the qualified name as appearing in the serialization */
26336    int n_qname;
26337
26338    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26339    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26340    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26341    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26342        mem_base = xmlMemBlocks();
26343        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26344        doc = gen_xmlDocPtr(n_doc, 1);
26345        elem = gen_xmlNodePtr(n_elem, 2);
26346        qname = gen_const_xmlChar_ptr(n_qname, 3);
26347
26348        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26349        desret_int(ret_val);
26350        call_tests++;
26351        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26352        des_xmlDocPtr(n_doc, doc, 1);
26353        des_xmlNodePtr(n_elem, elem, 2);
26354        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26355        xmlResetLastError();
26356        if (mem_base != xmlMemBlocks()) {
26357            printf("Leak of %d blocks found in xmlValidatePushElement",
26358	           xmlMemBlocks() - mem_base);
26359	    test_ret++;
26360            printf(" %d", n_ctxt);
26361            printf(" %d", n_doc);
26362            printf(" %d", n_elem);
26363            printf(" %d", n_qname);
26364            printf("\n");
26365        }
26366    }
26367    }
26368    }
26369    }
26370    function_tests++;
26371#endif
26372
26373    return(test_ret);
26374}
26375
26376
26377static int
26378test_xmlValidateRoot(void) {
26379    int test_ret = 0;
26380
26381#if defined(LIBXML_VALID_ENABLED)
26382    int mem_base;
26383    int ret_val;
26384    xmlValidCtxtPtr ctxt; /* the validation context */
26385    int n_ctxt;
26386    xmlDocPtr doc; /* a document instance */
26387    int n_doc;
26388
26389    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26390    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26391        mem_base = xmlMemBlocks();
26392        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26393        doc = gen_xmlDocPtr(n_doc, 1);
26394
26395        ret_val = xmlValidateRoot(ctxt, doc);
26396        desret_int(ret_val);
26397        call_tests++;
26398        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26399        des_xmlDocPtr(n_doc, doc, 1);
26400        xmlResetLastError();
26401        if (mem_base != xmlMemBlocks()) {
26402            printf("Leak of %d blocks found in xmlValidateRoot",
26403	           xmlMemBlocks() - mem_base);
26404	    test_ret++;
26405            printf(" %d", n_ctxt);
26406            printf(" %d", n_doc);
26407            printf("\n");
26408        }
26409    }
26410    }
26411    function_tests++;
26412#endif
26413
26414    return(test_ret);
26415}
26416
26417static int
26418test_valid(void) {
26419    int test_ret = 0;
26420
26421    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26422    test_ret += test_xmlAddAttributeDecl();
26423    test_ret += test_xmlAddElementDecl();
26424    test_ret += test_xmlAddID();
26425    test_ret += test_xmlAddNotationDecl();
26426    test_ret += test_xmlAddRef();
26427    test_ret += test_xmlCopyAttributeTable();
26428    test_ret += test_xmlCopyDocElementContent();
26429    test_ret += test_xmlCopyElementContent();
26430    test_ret += test_xmlCopyElementTable();
26431    test_ret += test_xmlCopyEnumeration();
26432    test_ret += test_xmlCopyNotationTable();
26433    test_ret += test_xmlCreateEnumeration();
26434    test_ret += test_xmlDumpAttributeDecl();
26435    test_ret += test_xmlDumpAttributeTable();
26436    test_ret += test_xmlDumpElementDecl();
26437    test_ret += test_xmlDumpElementTable();
26438    test_ret += test_xmlDumpNotationDecl();
26439    test_ret += test_xmlDumpNotationTable();
26440    test_ret += test_xmlGetDtdAttrDesc();
26441    test_ret += test_xmlGetDtdElementDesc();
26442    test_ret += test_xmlGetDtdNotationDesc();
26443    test_ret += test_xmlGetDtdQAttrDesc();
26444    test_ret += test_xmlGetDtdQElementDesc();
26445    test_ret += test_xmlGetID();
26446    test_ret += test_xmlGetRefs();
26447    test_ret += test_xmlIsID();
26448    test_ret += test_xmlIsMixedElement();
26449    test_ret += test_xmlIsRef();
26450    test_ret += test_xmlNewDocElementContent();
26451    test_ret += test_xmlNewElementContent();
26452    test_ret += test_xmlNewValidCtxt();
26453    test_ret += test_xmlRemoveID();
26454    test_ret += test_xmlRemoveRef();
26455    test_ret += test_xmlSnprintfElementContent();
26456    test_ret += test_xmlSprintfElementContent();
26457    test_ret += test_xmlValidBuildContentModel();
26458    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26459    test_ret += test_xmlValidGetPotentialChildren();
26460    test_ret += test_xmlValidGetValidElements();
26461    test_ret += test_xmlValidNormalizeAttributeValue();
26462    test_ret += test_xmlValidateAttributeDecl();
26463    test_ret += test_xmlValidateAttributeValue();
26464    test_ret += test_xmlValidateDocument();
26465    test_ret += test_xmlValidateDocumentFinal();
26466    test_ret += test_xmlValidateDtd();
26467    test_ret += test_xmlValidateDtdFinal();
26468    test_ret += test_xmlValidateElement();
26469    test_ret += test_xmlValidateElementDecl();
26470    test_ret += test_xmlValidateNameValue();
26471    test_ret += test_xmlValidateNamesValue();
26472    test_ret += test_xmlValidateNmtokenValue();
26473    test_ret += test_xmlValidateNmtokensValue();
26474    test_ret += test_xmlValidateNotationDecl();
26475    test_ret += test_xmlValidateNotationUse();
26476    test_ret += test_xmlValidateOneAttribute();
26477    test_ret += test_xmlValidateOneElement();
26478    test_ret += test_xmlValidateOneNamespace();
26479    test_ret += test_xmlValidatePopElement();
26480    test_ret += test_xmlValidatePushCData();
26481    test_ret += test_xmlValidatePushElement();
26482    test_ret += test_xmlValidateRoot();
26483
26484    if (test_ret != 0)
26485	printf("Module valid: %d errors\n", test_ret);
26486    return(test_ret);
26487}
26488
26489static int
26490test_xmlXIncludeNewContext(void) {
26491    int test_ret = 0;
26492
26493
26494    /* missing type support */
26495    return(test_ret);
26496}
26497
26498
26499static int
26500test_xmlXIncludeProcess(void) {
26501    int test_ret = 0;
26502
26503#if defined(LIBXML_XINCLUDE_ENABLED)
26504    int mem_base;
26505    int ret_val;
26506    xmlDocPtr doc; /* an XML document */
26507    int n_doc;
26508
26509    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26510        mem_base = xmlMemBlocks();
26511        doc = gen_xmlDocPtr(n_doc, 0);
26512
26513        ret_val = xmlXIncludeProcess(doc);
26514        desret_int(ret_val);
26515        call_tests++;
26516        des_xmlDocPtr(n_doc, doc, 0);
26517        xmlResetLastError();
26518        if (mem_base != xmlMemBlocks()) {
26519            printf("Leak of %d blocks found in xmlXIncludeProcess",
26520	           xmlMemBlocks() - mem_base);
26521	    test_ret++;
26522            printf(" %d", n_doc);
26523            printf("\n");
26524        }
26525    }
26526    function_tests++;
26527#endif
26528
26529    return(test_ret);
26530}
26531
26532
26533static int
26534test_xmlXIncludeProcessFlags(void) {
26535    int test_ret = 0;
26536
26537#if defined(LIBXML_XINCLUDE_ENABLED)
26538    int mem_base;
26539    int ret_val;
26540    xmlDocPtr doc; /* an XML document */
26541    int n_doc;
26542    int flags; /* a set of xmlParserOption used for parsing XML includes */
26543    int n_flags;
26544
26545    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26546    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26547        mem_base = xmlMemBlocks();
26548        doc = gen_xmlDocPtr(n_doc, 0);
26549        flags = gen_int(n_flags, 1);
26550
26551        ret_val = xmlXIncludeProcessFlags(doc, flags);
26552        desret_int(ret_val);
26553        call_tests++;
26554        des_xmlDocPtr(n_doc, doc, 0);
26555        des_int(n_flags, flags, 1);
26556        xmlResetLastError();
26557        if (mem_base != xmlMemBlocks()) {
26558            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
26559	           xmlMemBlocks() - mem_base);
26560	    test_ret++;
26561            printf(" %d", n_doc);
26562            printf(" %d", n_flags);
26563            printf("\n");
26564        }
26565    }
26566    }
26567    function_tests++;
26568#endif
26569
26570    return(test_ret);
26571}
26572
26573#ifdef LIBXML_XINCLUDE_ENABLED
26574
26575#define gen_nb_xmlXIncludeCtxtPtr 1
26576static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26577    return(NULL);
26578}
26579static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26580}
26581#endif
26582
26583
26584static int
26585test_xmlXIncludeProcessNode(void) {
26586    int test_ret = 0;
26587
26588#if defined(LIBXML_XINCLUDE_ENABLED)
26589    int mem_base;
26590    int ret_val;
26591    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
26592    int n_ctxt;
26593    xmlNodePtr node; /* a node in an XML document */
26594    int n_node;
26595
26596    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26597    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
26598        mem_base = xmlMemBlocks();
26599        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26600        node = gen_xmlNodePtr(n_node, 1);
26601
26602        ret_val = xmlXIncludeProcessNode(ctxt, node);
26603        desret_int(ret_val);
26604        call_tests++;
26605        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26606        des_xmlNodePtr(n_node, node, 1);
26607        xmlResetLastError();
26608        if (mem_base != xmlMemBlocks()) {
26609            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
26610	           xmlMemBlocks() - mem_base);
26611	    test_ret++;
26612            printf(" %d", n_ctxt);
26613            printf(" %d", n_node);
26614            printf("\n");
26615        }
26616    }
26617    }
26618    function_tests++;
26619#endif
26620
26621    return(test_ret);
26622}
26623
26624
26625static int
26626test_xmlXIncludeProcessTree(void) {
26627    int test_ret = 0;
26628
26629#if defined(LIBXML_XINCLUDE_ENABLED)
26630    int mem_base;
26631    int ret_val;
26632    xmlNodePtr tree; /* a node in an XML document */
26633    int n_tree;
26634
26635    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26636        mem_base = xmlMemBlocks();
26637        tree = gen_xmlNodePtr(n_tree, 0);
26638
26639        ret_val = xmlXIncludeProcessTree(tree);
26640        desret_int(ret_val);
26641        call_tests++;
26642        des_xmlNodePtr(n_tree, tree, 0);
26643        xmlResetLastError();
26644        if (mem_base != xmlMemBlocks()) {
26645            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
26646	           xmlMemBlocks() - mem_base);
26647	    test_ret++;
26648            printf(" %d", n_tree);
26649            printf("\n");
26650        }
26651    }
26652    function_tests++;
26653#endif
26654
26655    return(test_ret);
26656}
26657
26658
26659static int
26660test_xmlXIncludeProcessTreeFlags(void) {
26661    int test_ret = 0;
26662
26663#if defined(LIBXML_XINCLUDE_ENABLED)
26664    int mem_base;
26665    int ret_val;
26666    xmlNodePtr tree; /* a node in an XML document */
26667    int n_tree;
26668    int flags; /* a set of xmlParserOption used for parsing XML includes */
26669    int n_flags;
26670
26671    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26672    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26673        mem_base = xmlMemBlocks();
26674        tree = gen_xmlNodePtr(n_tree, 0);
26675        flags = gen_int(n_flags, 1);
26676
26677        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
26678        desret_int(ret_val);
26679        call_tests++;
26680        des_xmlNodePtr(n_tree, tree, 0);
26681        des_int(n_flags, flags, 1);
26682        xmlResetLastError();
26683        if (mem_base != xmlMemBlocks()) {
26684            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
26685	           xmlMemBlocks() - mem_base);
26686	    test_ret++;
26687            printf(" %d", n_tree);
26688            printf(" %d", n_flags);
26689            printf("\n");
26690        }
26691    }
26692    }
26693    function_tests++;
26694#endif
26695
26696    return(test_ret);
26697}
26698
26699
26700static int
26701test_xmlXIncludeSetFlags(void) {
26702    int test_ret = 0;
26703
26704#if defined(LIBXML_XINCLUDE_ENABLED)
26705    int mem_base;
26706    int ret_val;
26707    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
26708    int n_ctxt;
26709    int flags; /* a set of xmlParserOption used for parsing XML includes */
26710    int n_flags;
26711
26712    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26713    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26714        mem_base = xmlMemBlocks();
26715        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26716        flags = gen_int(n_flags, 1);
26717
26718        ret_val = xmlXIncludeSetFlags(ctxt, flags);
26719        desret_int(ret_val);
26720        call_tests++;
26721        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26722        des_int(n_flags, flags, 1);
26723        xmlResetLastError();
26724        if (mem_base != xmlMemBlocks()) {
26725            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
26726	           xmlMemBlocks() - mem_base);
26727	    test_ret++;
26728            printf(" %d", n_ctxt);
26729            printf(" %d", n_flags);
26730            printf("\n");
26731        }
26732    }
26733    }
26734    function_tests++;
26735#endif
26736
26737    return(test_ret);
26738}
26739
26740static int
26741test_xinclude(void) {
26742    int test_ret = 0;
26743
26744    if (quiet == 0) printf("Testing xinclude : 6 of 8 functions ...\n");
26745    test_ret += test_xmlXIncludeNewContext();
26746    test_ret += test_xmlXIncludeProcess();
26747    test_ret += test_xmlXIncludeProcessFlags();
26748    test_ret += test_xmlXIncludeProcessNode();
26749    test_ret += test_xmlXIncludeProcessTree();
26750    test_ret += test_xmlXIncludeProcessTreeFlags();
26751    test_ret += test_xmlXIncludeSetFlags();
26752
26753    if (test_ret != 0)
26754	printf("Module xinclude: %d errors\n", test_ret);
26755    return(test_ret);
26756}
26757
26758static int
26759test_xmlAllocOutputBuffer(void) {
26760    int test_ret = 0;
26761
26762#if defined(LIBXML_OUTPUT_ENABLED)
26763    int mem_base;
26764    xmlOutputBufferPtr ret_val;
26765    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26766    int n_encoder;
26767
26768    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26769        mem_base = xmlMemBlocks();
26770        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
26771
26772        ret_val = xmlAllocOutputBuffer(encoder);
26773        desret_xmlOutputBufferPtr(ret_val);
26774        call_tests++;
26775        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
26776        xmlResetLastError();
26777        if (mem_base != xmlMemBlocks()) {
26778            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
26779	           xmlMemBlocks() - mem_base);
26780	    test_ret++;
26781            printf(" %d", n_encoder);
26782            printf("\n");
26783        }
26784    }
26785    function_tests++;
26786#endif
26787
26788    return(test_ret);
26789}
26790
26791
26792static int
26793test_xmlAllocParserInputBuffer(void) {
26794    int test_ret = 0;
26795
26796    int mem_base;
26797    xmlParserInputBufferPtr ret_val;
26798    xmlCharEncoding enc; /* the charset encoding if known */
26799    int n_enc;
26800
26801    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26802        mem_base = xmlMemBlocks();
26803        enc = gen_xmlCharEncoding(n_enc, 0);
26804
26805        ret_val = xmlAllocParserInputBuffer(enc);
26806        desret_xmlParserInputBufferPtr(ret_val);
26807        call_tests++;
26808        des_xmlCharEncoding(n_enc, enc, 0);
26809        xmlResetLastError();
26810        if (mem_base != xmlMemBlocks()) {
26811            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
26812	           xmlMemBlocks() - mem_base);
26813	    test_ret++;
26814            printf(" %d", n_enc);
26815            printf("\n");
26816        }
26817    }
26818    function_tests++;
26819
26820    return(test_ret);
26821}
26822
26823
26824static int
26825test_xmlCheckFilename(void) {
26826    int test_ret = 0;
26827
26828    int mem_base;
26829    int ret_val;
26830    char * path; /* the path to check */
26831    int n_path;
26832
26833    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
26834        mem_base = xmlMemBlocks();
26835        path = gen_const_char_ptr(n_path, 0);
26836
26837        ret_val = xmlCheckFilename((const char *)path);
26838        desret_int(ret_val);
26839        call_tests++;
26840        des_const_char_ptr(n_path, (const char *)path, 0);
26841        xmlResetLastError();
26842        if (mem_base != xmlMemBlocks()) {
26843            printf("Leak of %d blocks found in xmlCheckFilename",
26844	           xmlMemBlocks() - mem_base);
26845	    test_ret++;
26846            printf(" %d", n_path);
26847            printf("\n");
26848        }
26849    }
26850    function_tests++;
26851
26852    return(test_ret);
26853}
26854
26855
26856static int
26857test_xmlCheckHTTPInput(void) {
26858    int test_ret = 0;
26859
26860    int mem_base;
26861    xmlParserInputPtr ret_val;
26862    xmlParserCtxtPtr ctxt; /* an XML parser context */
26863    int n_ctxt;
26864    xmlParserInputPtr ret; /* an XML parser input */
26865    int n_ret;
26866
26867    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
26868    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
26869        mem_base = xmlMemBlocks();
26870        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
26871        ret = gen_xmlParserInputPtr(n_ret, 1);
26872
26873        ret_val = xmlCheckHTTPInput(ctxt, ret);
26874        desret_xmlParserInputPtr(ret_val);
26875        call_tests++;
26876        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
26877        des_xmlParserInputPtr(n_ret, ret, 1);
26878        xmlResetLastError();
26879        if (mem_base != xmlMemBlocks()) {
26880            printf("Leak of %d blocks found in xmlCheckHTTPInput",
26881	           xmlMemBlocks() - mem_base);
26882	    test_ret++;
26883            printf(" %d", n_ctxt);
26884            printf(" %d", n_ret);
26885            printf("\n");
26886        }
26887    }
26888    }
26889    function_tests++;
26890
26891    return(test_ret);
26892}
26893
26894
26895static int
26896test_xmlCleanupInputCallbacks(void) {
26897    int test_ret = 0;
26898
26899    int mem_base;
26900
26901        mem_base = xmlMemBlocks();
26902
26903        xmlCleanupInputCallbacks();
26904        call_tests++;
26905        xmlResetLastError();
26906        if (mem_base != xmlMemBlocks()) {
26907            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
26908	           xmlMemBlocks() - mem_base);
26909	    test_ret++;
26910            printf("\n");
26911        }
26912    function_tests++;
26913
26914    return(test_ret);
26915}
26916
26917
26918static int
26919test_xmlCleanupOutputCallbacks(void) {
26920    int test_ret = 0;
26921
26922#if defined(LIBXML_OUTPUT_ENABLED)
26923    int mem_base;
26924
26925        mem_base = xmlMemBlocks();
26926
26927        xmlCleanupOutputCallbacks();
26928        call_tests++;
26929        xmlResetLastError();
26930        if (mem_base != xmlMemBlocks()) {
26931            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
26932	           xmlMemBlocks() - mem_base);
26933	    test_ret++;
26934            printf("\n");
26935        }
26936    function_tests++;
26937#endif
26938
26939    return(test_ret);
26940}
26941
26942
26943static int
26944test_xmlFileClose(void) {
26945    int test_ret = 0;
26946
26947    int mem_base;
26948    int ret_val;
26949    void * context; /* the I/O context */
26950    int n_context;
26951
26952    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26953        mem_base = xmlMemBlocks();
26954        context = gen_void_ptr(n_context, 0);
26955
26956        ret_val = xmlFileClose(context);
26957        desret_int(ret_val);
26958        call_tests++;
26959        des_void_ptr(n_context, context, 0);
26960        xmlResetLastError();
26961        if (mem_base != xmlMemBlocks()) {
26962            printf("Leak of %d blocks found in xmlFileClose",
26963	           xmlMemBlocks() - mem_base);
26964	    test_ret++;
26965            printf(" %d", n_context);
26966            printf("\n");
26967        }
26968    }
26969    function_tests++;
26970
26971    return(test_ret);
26972}
26973
26974
26975static int
26976test_xmlFileMatch(void) {
26977    int test_ret = 0;
26978
26979    int mem_base;
26980    int ret_val;
26981    const char * filename; /* the URI for matching */
26982    int n_filename;
26983
26984    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26985        mem_base = xmlMemBlocks();
26986        filename = gen_filepath(n_filename, 0);
26987
26988        ret_val = xmlFileMatch(filename);
26989        desret_int(ret_val);
26990        call_tests++;
26991        des_filepath(n_filename, filename, 0);
26992        xmlResetLastError();
26993        if (mem_base != xmlMemBlocks()) {
26994            printf("Leak of %d blocks found in xmlFileMatch",
26995	           xmlMemBlocks() - mem_base);
26996	    test_ret++;
26997            printf(" %d", n_filename);
26998            printf("\n");
26999        }
27000    }
27001    function_tests++;
27002
27003    return(test_ret);
27004}
27005
27006
27007static int
27008test_xmlFileOpen(void) {
27009    int test_ret = 0;
27010
27011    int mem_base;
27012    void * ret_val;
27013    const char * filename; /* the URI for matching */
27014    int n_filename;
27015
27016    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27017        mem_base = xmlMemBlocks();
27018        filename = gen_filepath(n_filename, 0);
27019
27020        ret_val = xmlFileOpen(filename);
27021        desret_void_ptr(ret_val);
27022        call_tests++;
27023        des_filepath(n_filename, filename, 0);
27024        xmlResetLastError();
27025        if (mem_base != xmlMemBlocks()) {
27026            printf("Leak of %d blocks found in xmlFileOpen",
27027	           xmlMemBlocks() - mem_base);
27028	    test_ret++;
27029            printf(" %d", n_filename);
27030            printf("\n");
27031        }
27032    }
27033    function_tests++;
27034
27035    return(test_ret);
27036}
27037
27038
27039static int
27040test_xmlFileRead(void) {
27041    int test_ret = 0;
27042
27043    int mem_base;
27044    int ret_val;
27045    void * context; /* the I/O context */
27046    int n_context;
27047    char * buffer; /* where to drop data */
27048    int n_buffer;
27049    int len; /* number of bytes to write */
27050    int n_len;
27051
27052    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27053    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27054    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27055        mem_base = xmlMemBlocks();
27056        context = gen_void_ptr(n_context, 0);
27057        buffer = gen_char_ptr(n_buffer, 1);
27058        len = gen_int(n_len, 2);
27059
27060        ret_val = xmlFileRead(context, buffer, len);
27061        desret_int(ret_val);
27062        call_tests++;
27063        des_void_ptr(n_context, context, 0);
27064        des_char_ptr(n_buffer, buffer, 1);
27065        des_int(n_len, len, 2);
27066        xmlResetLastError();
27067        if (mem_base != xmlMemBlocks()) {
27068            printf("Leak of %d blocks found in xmlFileRead",
27069	           xmlMemBlocks() - mem_base);
27070	    test_ret++;
27071            printf(" %d", n_context);
27072            printf(" %d", n_buffer);
27073            printf(" %d", n_len);
27074            printf("\n");
27075        }
27076    }
27077    }
27078    }
27079    function_tests++;
27080
27081    return(test_ret);
27082}
27083
27084
27085static int
27086test_xmlIOFTPClose(void) {
27087    int test_ret = 0;
27088
27089#if defined(LIBXML_FTP_ENABLED)
27090    int mem_base;
27091    int ret_val;
27092    void * context; /* the I/O context */
27093    int n_context;
27094
27095    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27096        mem_base = xmlMemBlocks();
27097        context = gen_void_ptr(n_context, 0);
27098
27099        ret_val = xmlIOFTPClose(context);
27100        desret_int(ret_val);
27101        call_tests++;
27102        des_void_ptr(n_context, context, 0);
27103        xmlResetLastError();
27104        if (mem_base != xmlMemBlocks()) {
27105            printf("Leak of %d blocks found in xmlIOFTPClose",
27106	           xmlMemBlocks() - mem_base);
27107	    test_ret++;
27108            printf(" %d", n_context);
27109            printf("\n");
27110        }
27111    }
27112    function_tests++;
27113#endif
27114
27115    return(test_ret);
27116}
27117
27118
27119static int
27120test_xmlIOFTPMatch(void) {
27121    int test_ret = 0;
27122
27123#if defined(LIBXML_FTP_ENABLED)
27124    int mem_base;
27125    int ret_val;
27126    const char * filename; /* the URI for matching */
27127    int n_filename;
27128
27129    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27130        mem_base = xmlMemBlocks();
27131        filename = gen_filepath(n_filename, 0);
27132
27133        ret_val = xmlIOFTPMatch(filename);
27134        desret_int(ret_val);
27135        call_tests++;
27136        des_filepath(n_filename, filename, 0);
27137        xmlResetLastError();
27138        if (mem_base != xmlMemBlocks()) {
27139            printf("Leak of %d blocks found in xmlIOFTPMatch",
27140	           xmlMemBlocks() - mem_base);
27141	    test_ret++;
27142            printf(" %d", n_filename);
27143            printf("\n");
27144        }
27145    }
27146    function_tests++;
27147#endif
27148
27149    return(test_ret);
27150}
27151
27152
27153static int
27154test_xmlIOFTPOpen(void) {
27155    int test_ret = 0;
27156
27157#if defined(LIBXML_FTP_ENABLED)
27158    int mem_base;
27159    void * ret_val;
27160    const char * filename; /* the URI for matching */
27161    int n_filename;
27162
27163    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27164        mem_base = xmlMemBlocks();
27165        filename = gen_filepath(n_filename, 0);
27166
27167        ret_val = xmlIOFTPOpen(filename);
27168        desret_void_ptr(ret_val);
27169        call_tests++;
27170        des_filepath(n_filename, filename, 0);
27171        xmlResetLastError();
27172        if (mem_base != xmlMemBlocks()) {
27173            printf("Leak of %d blocks found in xmlIOFTPOpen",
27174	           xmlMemBlocks() - mem_base);
27175	    test_ret++;
27176            printf(" %d", n_filename);
27177            printf("\n");
27178        }
27179    }
27180    function_tests++;
27181#endif
27182
27183    return(test_ret);
27184}
27185
27186
27187static int
27188test_xmlIOFTPRead(void) {
27189    int test_ret = 0;
27190
27191#if defined(LIBXML_FTP_ENABLED)
27192    int mem_base;
27193    int ret_val;
27194    void * context; /* the I/O context */
27195    int n_context;
27196    char * buffer; /* where to drop data */
27197    int n_buffer;
27198    int len; /* number of bytes to write */
27199    int n_len;
27200
27201    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27202    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27203    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27204        mem_base = xmlMemBlocks();
27205        context = gen_void_ptr(n_context, 0);
27206        buffer = gen_char_ptr(n_buffer, 1);
27207        len = gen_int(n_len, 2);
27208
27209        ret_val = xmlIOFTPRead(context, buffer, len);
27210        desret_int(ret_val);
27211        call_tests++;
27212        des_void_ptr(n_context, context, 0);
27213        des_char_ptr(n_buffer, buffer, 1);
27214        des_int(n_len, len, 2);
27215        xmlResetLastError();
27216        if (mem_base != xmlMemBlocks()) {
27217            printf("Leak of %d blocks found in xmlIOFTPRead",
27218	           xmlMemBlocks() - mem_base);
27219	    test_ret++;
27220            printf(" %d", n_context);
27221            printf(" %d", n_buffer);
27222            printf(" %d", n_len);
27223            printf("\n");
27224        }
27225    }
27226    }
27227    }
27228    function_tests++;
27229#endif
27230
27231    return(test_ret);
27232}
27233
27234
27235static int
27236test_xmlIOHTTPClose(void) {
27237    int test_ret = 0;
27238
27239#if defined(LIBXML_HTTP_ENABLED)
27240    int mem_base;
27241    int ret_val;
27242    void * context; /* the I/O context */
27243    int n_context;
27244
27245    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27246        mem_base = xmlMemBlocks();
27247        context = gen_void_ptr(n_context, 0);
27248
27249        ret_val = xmlIOHTTPClose(context);
27250        desret_int(ret_val);
27251        call_tests++;
27252        des_void_ptr(n_context, context, 0);
27253        xmlResetLastError();
27254        if (mem_base != xmlMemBlocks()) {
27255            printf("Leak of %d blocks found in xmlIOHTTPClose",
27256	           xmlMemBlocks() - mem_base);
27257	    test_ret++;
27258            printf(" %d", n_context);
27259            printf("\n");
27260        }
27261    }
27262    function_tests++;
27263#endif
27264
27265    return(test_ret);
27266}
27267
27268
27269static int
27270test_xmlIOHTTPMatch(void) {
27271    int test_ret = 0;
27272
27273#if defined(LIBXML_HTTP_ENABLED)
27274    int mem_base;
27275    int ret_val;
27276    const char * filename; /* the URI for matching */
27277    int n_filename;
27278
27279    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27280        mem_base = xmlMemBlocks();
27281        filename = gen_filepath(n_filename, 0);
27282
27283        ret_val = xmlIOHTTPMatch(filename);
27284        desret_int(ret_val);
27285        call_tests++;
27286        des_filepath(n_filename, filename, 0);
27287        xmlResetLastError();
27288        if (mem_base != xmlMemBlocks()) {
27289            printf("Leak of %d blocks found in xmlIOHTTPMatch",
27290	           xmlMemBlocks() - mem_base);
27291	    test_ret++;
27292            printf(" %d", n_filename);
27293            printf("\n");
27294        }
27295    }
27296    function_tests++;
27297#endif
27298
27299    return(test_ret);
27300}
27301
27302
27303static int
27304test_xmlIOHTTPOpen(void) {
27305    int test_ret = 0;
27306
27307#if defined(LIBXML_HTTP_ENABLED)
27308    int mem_base;
27309    void * ret_val;
27310    const char * filename; /* the URI for matching */
27311    int n_filename;
27312
27313    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27314        mem_base = xmlMemBlocks();
27315        filename = gen_filepath(n_filename, 0);
27316
27317        ret_val = xmlIOHTTPOpen(filename);
27318        desret_xmlNanoHTTPCtxtPtr(ret_val);
27319        call_tests++;
27320        des_filepath(n_filename, filename, 0);
27321        xmlResetLastError();
27322        if (mem_base != xmlMemBlocks()) {
27323            printf("Leak of %d blocks found in xmlIOHTTPOpen",
27324	           xmlMemBlocks() - mem_base);
27325	    test_ret++;
27326            printf(" %d", n_filename);
27327            printf("\n");
27328        }
27329    }
27330    function_tests++;
27331#endif
27332
27333    return(test_ret);
27334}
27335
27336
27337static int
27338test_xmlIOHTTPRead(void) {
27339    int test_ret = 0;
27340
27341#if defined(LIBXML_HTTP_ENABLED)
27342    int mem_base;
27343    int ret_val;
27344    void * context; /* the I/O context */
27345    int n_context;
27346    char * buffer; /* where to drop data */
27347    int n_buffer;
27348    int len; /* number of bytes to write */
27349    int n_len;
27350
27351    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27352    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27353    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27354        mem_base = xmlMemBlocks();
27355        context = gen_void_ptr(n_context, 0);
27356        buffer = gen_char_ptr(n_buffer, 1);
27357        len = gen_int(n_len, 2);
27358
27359        ret_val = xmlIOHTTPRead(context, buffer, len);
27360        desret_int(ret_val);
27361        call_tests++;
27362        des_void_ptr(n_context, context, 0);
27363        des_char_ptr(n_buffer, buffer, 1);
27364        des_int(n_len, len, 2);
27365        xmlResetLastError();
27366        if (mem_base != xmlMemBlocks()) {
27367            printf("Leak of %d blocks found in xmlIOHTTPRead",
27368	           xmlMemBlocks() - mem_base);
27369	    test_ret++;
27370            printf(" %d", n_context);
27371            printf(" %d", n_buffer);
27372            printf(" %d", n_len);
27373            printf("\n");
27374        }
27375    }
27376    }
27377    }
27378    function_tests++;
27379#endif
27380
27381    return(test_ret);
27382}
27383
27384
27385static int
27386test_xmlNoNetExternalEntityLoader(void) {
27387    int test_ret = 0;
27388
27389    int mem_base;
27390    xmlParserInputPtr ret_val;
27391    const char * URL; /* the URL for the entity to load */
27392    int n_URL;
27393    char * ID; /* the System ID for the entity to load */
27394    int n_ID;
27395    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27396    int n_ctxt;
27397
27398    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27399    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27400    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27401        mem_base = xmlMemBlocks();
27402        URL = gen_filepath(n_URL, 0);
27403        ID = gen_const_char_ptr(n_ID, 1);
27404        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27405
27406        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27407        desret_xmlParserInputPtr(ret_val);
27408        call_tests++;
27409        des_filepath(n_URL, URL, 0);
27410        des_const_char_ptr(n_ID, (const char *)ID, 1);
27411        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27412        xmlResetLastError();
27413        if (mem_base != xmlMemBlocks()) {
27414            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27415	           xmlMemBlocks() - mem_base);
27416	    test_ret++;
27417            printf(" %d", n_URL);
27418            printf(" %d", n_ID);
27419            printf(" %d", n_ctxt);
27420            printf("\n");
27421        }
27422    }
27423    }
27424    }
27425    function_tests++;
27426
27427    return(test_ret);
27428}
27429
27430
27431static int
27432test_xmlNormalizeWindowsPath(void) {
27433    int test_ret = 0;
27434
27435    int mem_base;
27436    xmlChar * ret_val;
27437    xmlChar * path; /* the input file path */
27438    int n_path;
27439
27440    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27441        mem_base = xmlMemBlocks();
27442        path = gen_const_xmlChar_ptr(n_path, 0);
27443
27444        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27445        desret_xmlChar_ptr(ret_val);
27446        call_tests++;
27447        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27448        xmlResetLastError();
27449        if (mem_base != xmlMemBlocks()) {
27450            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27451	           xmlMemBlocks() - mem_base);
27452	    test_ret++;
27453            printf(" %d", n_path);
27454            printf("\n");
27455        }
27456    }
27457    function_tests++;
27458
27459    return(test_ret);
27460}
27461
27462
27463static int
27464test_xmlOutputBufferCreateFd(void) {
27465    int test_ret = 0;
27466
27467#if defined(LIBXML_OUTPUT_ENABLED)
27468    int mem_base;
27469    xmlOutputBufferPtr ret_val;
27470    int fd; /* a file descriptor number */
27471    int n_fd;
27472    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27473    int n_encoder;
27474
27475    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27476    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27477        mem_base = xmlMemBlocks();
27478        fd = gen_int(n_fd, 0);
27479        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27480
27481        ret_val = xmlOutputBufferCreateFd(fd, encoder);
27482        desret_xmlOutputBufferPtr(ret_val);
27483        call_tests++;
27484        des_int(n_fd, fd, 0);
27485        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27486        xmlResetLastError();
27487        if (mem_base != xmlMemBlocks()) {
27488            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
27489	           xmlMemBlocks() - mem_base);
27490	    test_ret++;
27491            printf(" %d", n_fd);
27492            printf(" %d", n_encoder);
27493            printf("\n");
27494        }
27495    }
27496    }
27497    function_tests++;
27498#endif
27499
27500    return(test_ret);
27501}
27502
27503
27504static int
27505test_xmlOutputBufferCreateFile(void) {
27506    int test_ret = 0;
27507
27508#if defined(LIBXML_OUTPUT_ENABLED)
27509    int mem_base;
27510    xmlOutputBufferPtr ret_val;
27511    FILE * file; /* a FILE* */
27512    int n_file;
27513    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27514    int n_encoder;
27515
27516    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27517    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27518        mem_base = xmlMemBlocks();
27519        file = gen_FILE_ptr(n_file, 0);
27520        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27521
27522        ret_val = xmlOutputBufferCreateFile(file, encoder);
27523        desret_xmlOutputBufferPtr(ret_val);
27524        call_tests++;
27525        des_FILE_ptr(n_file, file, 0);
27526        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27527        xmlResetLastError();
27528        if (mem_base != xmlMemBlocks()) {
27529            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
27530	           xmlMemBlocks() - mem_base);
27531	    test_ret++;
27532            printf(" %d", n_file);
27533            printf(" %d", n_encoder);
27534            printf("\n");
27535        }
27536    }
27537    }
27538    function_tests++;
27539#endif
27540
27541    return(test_ret);
27542}
27543
27544
27545static int
27546test_xmlOutputBufferCreateFilename(void) {
27547    int test_ret = 0;
27548
27549#if defined(LIBXML_OUTPUT_ENABLED)
27550    int mem_base;
27551    xmlOutputBufferPtr ret_val;
27552    const char * URI; /* a C string containing the URI or filename */
27553    int n_URI;
27554    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27555    int n_encoder;
27556    int compression; /* the compression ration (0 none, 9 max). */
27557    int n_compression;
27558
27559    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27560    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27561    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
27562        mem_base = xmlMemBlocks();
27563        URI = gen_fileoutput(n_URI, 0);
27564        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27565        compression = gen_int(n_compression, 2);
27566
27567        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
27568        desret_xmlOutputBufferPtr(ret_val);
27569        call_tests++;
27570        des_fileoutput(n_URI, URI, 0);
27571        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27572        des_int(n_compression, compression, 2);
27573        xmlResetLastError();
27574        if (mem_base != xmlMemBlocks()) {
27575            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
27576	           xmlMemBlocks() - mem_base);
27577	    test_ret++;
27578            printf(" %d", n_URI);
27579            printf(" %d", n_encoder);
27580            printf(" %d", n_compression);
27581            printf("\n");
27582        }
27583    }
27584    }
27585    }
27586    function_tests++;
27587#endif
27588
27589    return(test_ret);
27590}
27591
27592
27593static int
27594test_xmlOutputBufferFlush(void) {
27595    int test_ret = 0;
27596
27597#if defined(LIBXML_OUTPUT_ENABLED)
27598    int mem_base;
27599    int ret_val;
27600    xmlOutputBufferPtr out; /* a buffered output */
27601    int n_out;
27602
27603    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27604        mem_base = xmlMemBlocks();
27605        out = gen_xmlOutputBufferPtr(n_out, 0);
27606
27607        ret_val = xmlOutputBufferFlush(out);
27608        desret_int(ret_val);
27609        call_tests++;
27610        des_xmlOutputBufferPtr(n_out, out, 0);
27611        xmlResetLastError();
27612        if (mem_base != xmlMemBlocks()) {
27613            printf("Leak of %d blocks found in xmlOutputBufferFlush",
27614	           xmlMemBlocks() - mem_base);
27615	    test_ret++;
27616            printf(" %d", n_out);
27617            printf("\n");
27618        }
27619    }
27620    function_tests++;
27621#endif
27622
27623    return(test_ret);
27624}
27625
27626
27627static int
27628test_xmlOutputBufferWrite(void) {
27629    int test_ret = 0;
27630
27631#if defined(LIBXML_OUTPUT_ENABLED)
27632    int mem_base;
27633    int ret_val;
27634    xmlOutputBufferPtr out; /* a buffered parser output */
27635    int n_out;
27636    int len; /* the size in bytes of the array. */
27637    int n_len;
27638    char * buf; /* an char array */
27639    int n_buf;
27640
27641    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27642    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27643    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27644        mem_base = xmlMemBlocks();
27645        out = gen_xmlOutputBufferPtr(n_out, 0);
27646        len = gen_int(n_len, 1);
27647        buf = gen_const_char_ptr(n_buf, 2);
27648
27649        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
27650        desret_int(ret_val);
27651        call_tests++;
27652        des_xmlOutputBufferPtr(n_out, out, 0);
27653        des_int(n_len, len, 1);
27654        des_const_char_ptr(n_buf, (const char *)buf, 2);
27655        xmlResetLastError();
27656        if (mem_base != xmlMemBlocks()) {
27657            printf("Leak of %d blocks found in xmlOutputBufferWrite",
27658	           xmlMemBlocks() - mem_base);
27659	    test_ret++;
27660            printf(" %d", n_out);
27661            printf(" %d", n_len);
27662            printf(" %d", n_buf);
27663            printf("\n");
27664        }
27665    }
27666    }
27667    }
27668    function_tests++;
27669#endif
27670
27671    return(test_ret);
27672}
27673
27674
27675static int
27676test_xmlOutputBufferWriteEscape(void) {
27677    int test_ret = 0;
27678
27679
27680    /* missing type support */
27681    return(test_ret);
27682}
27683
27684
27685static int
27686test_xmlOutputBufferWriteString(void) {
27687    int test_ret = 0;
27688
27689#if defined(LIBXML_OUTPUT_ENABLED)
27690    int mem_base;
27691    int ret_val;
27692    xmlOutputBufferPtr out; /* a buffered parser output */
27693    int n_out;
27694    char * str; /* a zero terminated C string */
27695    int n_str;
27696
27697    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27698    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
27699        mem_base = xmlMemBlocks();
27700        out = gen_xmlOutputBufferPtr(n_out, 0);
27701        str = gen_const_char_ptr(n_str, 1);
27702
27703        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
27704        desret_int(ret_val);
27705        call_tests++;
27706        des_xmlOutputBufferPtr(n_out, out, 0);
27707        des_const_char_ptr(n_str, (const char *)str, 1);
27708        xmlResetLastError();
27709        if (mem_base != xmlMemBlocks()) {
27710            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
27711	           xmlMemBlocks() - mem_base);
27712	    test_ret++;
27713            printf(" %d", n_out);
27714            printf(" %d", n_str);
27715            printf("\n");
27716        }
27717    }
27718    }
27719    function_tests++;
27720#endif
27721
27722    return(test_ret);
27723}
27724
27725
27726static int
27727test_xmlParserGetDirectory(void) {
27728    int test_ret = 0;
27729
27730
27731    /* missing type support */
27732    return(test_ret);
27733}
27734
27735
27736static int
27737test_xmlParserInputBufferCreateFd(void) {
27738    int test_ret = 0;
27739
27740    int mem_base;
27741    xmlParserInputBufferPtr ret_val;
27742    int fd; /* a file descriptor number */
27743    int n_fd;
27744    xmlCharEncoding enc; /* the charset encoding if known */
27745    int n_enc;
27746
27747    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27748    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27749        mem_base = xmlMemBlocks();
27750        fd = gen_int(n_fd, 0);
27751        enc = gen_xmlCharEncoding(n_enc, 1);
27752        if (fd >= 0) fd = -1;
27753
27754        ret_val = xmlParserInputBufferCreateFd(fd, enc);
27755        desret_xmlParserInputBufferPtr(ret_val);
27756        call_tests++;
27757        des_int(n_fd, fd, 0);
27758        des_xmlCharEncoding(n_enc, enc, 1);
27759        xmlResetLastError();
27760        if (mem_base != xmlMemBlocks()) {
27761            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
27762	           xmlMemBlocks() - mem_base);
27763	    test_ret++;
27764            printf(" %d", n_fd);
27765            printf(" %d", n_enc);
27766            printf("\n");
27767        }
27768    }
27769    }
27770    function_tests++;
27771
27772    return(test_ret);
27773}
27774
27775
27776static int
27777test_xmlParserInputBufferCreateFile(void) {
27778    int test_ret = 0;
27779
27780    int mem_base;
27781    xmlParserInputBufferPtr ret_val;
27782    FILE * file; /* a FILE* */
27783    int n_file;
27784    xmlCharEncoding enc; /* the charset encoding if known */
27785    int n_enc;
27786
27787    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27788    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27789        mem_base = xmlMemBlocks();
27790        file = gen_FILE_ptr(n_file, 0);
27791        enc = gen_xmlCharEncoding(n_enc, 1);
27792
27793        ret_val = xmlParserInputBufferCreateFile(file, enc);
27794        desret_xmlParserInputBufferPtr(ret_val);
27795        call_tests++;
27796        des_FILE_ptr(n_file, file, 0);
27797        des_xmlCharEncoding(n_enc, enc, 1);
27798        xmlResetLastError();
27799        if (mem_base != xmlMemBlocks()) {
27800            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
27801	           xmlMemBlocks() - mem_base);
27802	    test_ret++;
27803            printf(" %d", n_file);
27804            printf(" %d", n_enc);
27805            printf("\n");
27806        }
27807    }
27808    }
27809    function_tests++;
27810
27811    return(test_ret);
27812}
27813
27814
27815static int
27816test_xmlParserInputBufferCreateFilename(void) {
27817    int test_ret = 0;
27818
27819    int mem_base;
27820    xmlParserInputBufferPtr ret_val;
27821    const char * URI; /* a C string containing the URI or filename */
27822    int n_URI;
27823    xmlCharEncoding enc; /* the charset encoding if known */
27824    int n_enc;
27825
27826    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27827    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27828        mem_base = xmlMemBlocks();
27829        URI = gen_fileoutput(n_URI, 0);
27830        enc = gen_xmlCharEncoding(n_enc, 1);
27831
27832        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
27833        desret_xmlParserInputBufferPtr(ret_val);
27834        call_tests++;
27835        des_fileoutput(n_URI, URI, 0);
27836        des_xmlCharEncoding(n_enc, enc, 1);
27837        xmlResetLastError();
27838        if (mem_base != xmlMemBlocks()) {
27839            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
27840	           xmlMemBlocks() - mem_base);
27841	    test_ret++;
27842            printf(" %d", n_URI);
27843            printf(" %d", n_enc);
27844            printf("\n");
27845        }
27846    }
27847    }
27848    function_tests++;
27849
27850    return(test_ret);
27851}
27852
27853
27854static int
27855test_xmlParserInputBufferCreateMem(void) {
27856    int test_ret = 0;
27857
27858    int mem_base;
27859    xmlParserInputBufferPtr ret_val;
27860    char * mem; /* the memory input */
27861    int n_mem;
27862    int size; /* the length of the memory block */
27863    int n_size;
27864    xmlCharEncoding enc; /* the charset encoding if known */
27865    int n_enc;
27866
27867    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27868    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27869    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27870        mem_base = xmlMemBlocks();
27871        mem = gen_const_char_ptr(n_mem, 0);
27872        size = gen_int(n_size, 1);
27873        enc = gen_xmlCharEncoding(n_enc, 2);
27874
27875        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
27876        desret_xmlParserInputBufferPtr(ret_val);
27877        call_tests++;
27878        des_const_char_ptr(n_mem, (const char *)mem, 0);
27879        des_int(n_size, size, 1);
27880        des_xmlCharEncoding(n_enc, enc, 2);
27881        xmlResetLastError();
27882        if (mem_base != xmlMemBlocks()) {
27883            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
27884	           xmlMemBlocks() - mem_base);
27885	    test_ret++;
27886            printf(" %d", n_mem);
27887            printf(" %d", n_size);
27888            printf(" %d", n_enc);
27889            printf("\n");
27890        }
27891    }
27892    }
27893    }
27894    function_tests++;
27895
27896    return(test_ret);
27897}
27898
27899
27900static int
27901test_xmlParserInputBufferCreateStatic(void) {
27902    int test_ret = 0;
27903
27904    int mem_base;
27905    xmlParserInputBufferPtr ret_val;
27906    char * mem; /* the memory input */
27907    int n_mem;
27908    int size; /* the length of the memory block */
27909    int n_size;
27910    xmlCharEncoding enc; /* the charset encoding if known */
27911    int n_enc;
27912
27913    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27914    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27915    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27916        mem_base = xmlMemBlocks();
27917        mem = gen_const_char_ptr(n_mem, 0);
27918        size = gen_int(n_size, 1);
27919        enc = gen_xmlCharEncoding(n_enc, 2);
27920
27921        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
27922        desret_xmlParserInputBufferPtr(ret_val);
27923        call_tests++;
27924        des_const_char_ptr(n_mem, (const char *)mem, 0);
27925        des_int(n_size, size, 1);
27926        des_xmlCharEncoding(n_enc, enc, 2);
27927        xmlResetLastError();
27928        if (mem_base != xmlMemBlocks()) {
27929            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
27930	           xmlMemBlocks() - mem_base);
27931	    test_ret++;
27932            printf(" %d", n_mem);
27933            printf(" %d", n_size);
27934            printf(" %d", n_enc);
27935            printf("\n");
27936        }
27937    }
27938    }
27939    }
27940    function_tests++;
27941
27942    return(test_ret);
27943}
27944
27945
27946static int
27947test_xmlParserInputBufferGrow(void) {
27948    int test_ret = 0;
27949
27950    int mem_base;
27951    int ret_val;
27952    xmlParserInputBufferPtr in; /* a buffered parser input */
27953    int n_in;
27954    int len; /* indicative value of the amount of chars to read */
27955    int n_len;
27956
27957    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27958    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27959        mem_base = xmlMemBlocks();
27960        in = gen_xmlParserInputBufferPtr(n_in, 0);
27961        len = gen_int(n_len, 1);
27962
27963        ret_val = xmlParserInputBufferGrow(in, len);
27964        desret_int(ret_val);
27965        call_tests++;
27966        des_xmlParserInputBufferPtr(n_in, in, 0);
27967        des_int(n_len, len, 1);
27968        xmlResetLastError();
27969        if (mem_base != xmlMemBlocks()) {
27970            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
27971	           xmlMemBlocks() - mem_base);
27972	    test_ret++;
27973            printf(" %d", n_in);
27974            printf(" %d", n_len);
27975            printf("\n");
27976        }
27977    }
27978    }
27979    function_tests++;
27980
27981    return(test_ret);
27982}
27983
27984
27985static int
27986test_xmlParserInputBufferPush(void) {
27987    int test_ret = 0;
27988
27989    int mem_base;
27990    int ret_val;
27991    xmlParserInputBufferPtr in; /* a buffered parser input */
27992    int n_in;
27993    int len; /* the size in bytes of the array. */
27994    int n_len;
27995    char * buf; /* an char array */
27996    int n_buf;
27997
27998    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27999    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28000    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28001        mem_base = xmlMemBlocks();
28002        in = gen_xmlParserInputBufferPtr(n_in, 0);
28003        len = gen_int(n_len, 1);
28004        buf = gen_const_char_ptr(n_buf, 2);
28005
28006        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28007        desret_int(ret_val);
28008        call_tests++;
28009        des_xmlParserInputBufferPtr(n_in, in, 0);
28010        des_int(n_len, len, 1);
28011        des_const_char_ptr(n_buf, (const char *)buf, 2);
28012        xmlResetLastError();
28013        if (mem_base != xmlMemBlocks()) {
28014            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28015	           xmlMemBlocks() - mem_base);
28016	    test_ret++;
28017            printf(" %d", n_in);
28018            printf(" %d", n_len);
28019            printf(" %d", n_buf);
28020            printf("\n");
28021        }
28022    }
28023    }
28024    }
28025    function_tests++;
28026
28027    return(test_ret);
28028}
28029
28030
28031static int
28032test_xmlParserInputBufferRead(void) {
28033    int test_ret = 0;
28034
28035    int mem_base;
28036    int ret_val;
28037    xmlParserInputBufferPtr in; /* a buffered parser input */
28038    int n_in;
28039    int len; /* indicative value of the amount of chars to read */
28040    int n_len;
28041
28042    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28043    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28044        mem_base = xmlMemBlocks();
28045        in = gen_xmlParserInputBufferPtr(n_in, 0);
28046        len = gen_int(n_len, 1);
28047
28048        ret_val = xmlParserInputBufferRead(in, len);
28049        desret_int(ret_val);
28050        call_tests++;
28051        des_xmlParserInputBufferPtr(n_in, in, 0);
28052        des_int(n_len, len, 1);
28053        xmlResetLastError();
28054        if (mem_base != xmlMemBlocks()) {
28055            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28056	           xmlMemBlocks() - mem_base);
28057	    test_ret++;
28058            printf(" %d", n_in);
28059            printf(" %d", n_len);
28060            printf("\n");
28061        }
28062    }
28063    }
28064    function_tests++;
28065
28066    return(test_ret);
28067}
28068
28069
28070static int
28071test_xmlPopInputCallbacks(void) {
28072    int test_ret = 0;
28073
28074    int mem_base;
28075    int ret_val;
28076
28077        mem_base = xmlMemBlocks();
28078
28079        ret_val = xmlPopInputCallbacks();
28080        desret_int(ret_val);
28081        call_tests++;
28082        xmlResetLastError();
28083        if (mem_base != xmlMemBlocks()) {
28084            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28085	           xmlMemBlocks() - mem_base);
28086	    test_ret++;
28087            printf("\n");
28088        }
28089    function_tests++;
28090
28091    return(test_ret);
28092}
28093
28094
28095static int
28096test_xmlRegisterDefaultInputCallbacks(void) {
28097    int test_ret = 0;
28098
28099    int mem_base;
28100
28101        mem_base = xmlMemBlocks();
28102
28103        xmlRegisterDefaultInputCallbacks();
28104        call_tests++;
28105        xmlResetLastError();
28106        if (mem_base != xmlMemBlocks()) {
28107            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28108	           xmlMemBlocks() - mem_base);
28109	    test_ret++;
28110            printf("\n");
28111        }
28112    function_tests++;
28113
28114    return(test_ret);
28115}
28116
28117
28118static int
28119test_xmlRegisterDefaultOutputCallbacks(void) {
28120    int test_ret = 0;
28121
28122#if defined(LIBXML_OUTPUT_ENABLED)
28123    int mem_base;
28124
28125        mem_base = xmlMemBlocks();
28126
28127        xmlRegisterDefaultOutputCallbacks();
28128        call_tests++;
28129        xmlResetLastError();
28130        if (mem_base != xmlMemBlocks()) {
28131            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28132	           xmlMemBlocks() - mem_base);
28133	    test_ret++;
28134            printf("\n");
28135        }
28136    function_tests++;
28137#endif
28138
28139    return(test_ret);
28140}
28141
28142
28143static int
28144test_xmlRegisterHTTPPostCallbacks(void) {
28145    int test_ret = 0;
28146
28147#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28148    int mem_base;
28149
28150        mem_base = xmlMemBlocks();
28151
28152        xmlRegisterHTTPPostCallbacks();
28153        call_tests++;
28154        xmlResetLastError();
28155        if (mem_base != xmlMemBlocks()) {
28156            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28157	           xmlMemBlocks() - mem_base);
28158	    test_ret++;
28159            printf("\n");
28160        }
28161    function_tests++;
28162#endif
28163
28164    return(test_ret);
28165}
28166
28167static int
28168test_xmlIO(void) {
28169    int test_ret = 0;
28170
28171    if (quiet == 0) printf("Testing xmlIO : 38 of 47 functions ...\n");
28172    test_ret += test_xmlAllocOutputBuffer();
28173    test_ret += test_xmlAllocParserInputBuffer();
28174    test_ret += test_xmlCheckFilename();
28175    test_ret += test_xmlCheckHTTPInput();
28176    test_ret += test_xmlCleanupInputCallbacks();
28177    test_ret += test_xmlCleanupOutputCallbacks();
28178    test_ret += test_xmlFileClose();
28179    test_ret += test_xmlFileMatch();
28180    test_ret += test_xmlFileOpen();
28181    test_ret += test_xmlFileRead();
28182    test_ret += test_xmlIOFTPClose();
28183    test_ret += test_xmlIOFTPMatch();
28184    test_ret += test_xmlIOFTPOpen();
28185    test_ret += test_xmlIOFTPRead();
28186    test_ret += test_xmlIOHTTPClose();
28187    test_ret += test_xmlIOHTTPMatch();
28188    test_ret += test_xmlIOHTTPOpen();
28189    test_ret += test_xmlIOHTTPRead();
28190    test_ret += test_xmlNoNetExternalEntityLoader();
28191    test_ret += test_xmlNormalizeWindowsPath();
28192    test_ret += test_xmlOutputBufferCreateFd();
28193    test_ret += test_xmlOutputBufferCreateFile();
28194    test_ret += test_xmlOutputBufferCreateFilename();
28195    test_ret += test_xmlOutputBufferFlush();
28196    test_ret += test_xmlOutputBufferWrite();
28197    test_ret += test_xmlOutputBufferWriteEscape();
28198    test_ret += test_xmlOutputBufferWriteString();
28199    test_ret += test_xmlParserGetDirectory();
28200    test_ret += test_xmlParserInputBufferCreateFd();
28201    test_ret += test_xmlParserInputBufferCreateFile();
28202    test_ret += test_xmlParserInputBufferCreateFilename();
28203    test_ret += test_xmlParserInputBufferCreateMem();
28204    test_ret += test_xmlParserInputBufferCreateStatic();
28205    test_ret += test_xmlParserInputBufferGrow();
28206    test_ret += test_xmlParserInputBufferPush();
28207    test_ret += test_xmlParserInputBufferRead();
28208    test_ret += test_xmlPopInputCallbacks();
28209    test_ret += test_xmlRegisterDefaultInputCallbacks();
28210    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28211    test_ret += test_xmlRegisterHTTPPostCallbacks();
28212
28213    if (test_ret != 0)
28214	printf("Module xmlIO: %d errors\n", test_ret);
28215    return(test_ret);
28216}
28217#ifdef LIBXML_AUTOMATA_ENABLED
28218
28219#define gen_nb_xmlAutomataPtr 1
28220static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28221    return(NULL);
28222}
28223static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28224}
28225#endif
28226
28227
28228static int
28229test_xmlAutomataCompile(void) {
28230    int test_ret = 0;
28231
28232
28233    /* missing type support */
28234    return(test_ret);
28235}
28236
28237
28238static int
28239test_xmlAutomataGetInitState(void) {
28240    int test_ret = 0;
28241
28242
28243    /* missing type support */
28244    return(test_ret);
28245}
28246
28247
28248static int
28249test_xmlAutomataIsDeterminist(void) {
28250    int test_ret = 0;
28251
28252#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28253    int mem_base;
28254    int ret_val;
28255    xmlAutomataPtr am; /* an automata */
28256    int n_am;
28257
28258    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28259        mem_base = xmlMemBlocks();
28260        am = gen_xmlAutomataPtr(n_am, 0);
28261
28262        ret_val = xmlAutomataIsDeterminist(am);
28263        desret_int(ret_val);
28264        call_tests++;
28265        des_xmlAutomataPtr(n_am, am, 0);
28266        xmlResetLastError();
28267        if (mem_base != xmlMemBlocks()) {
28268            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28269	           xmlMemBlocks() - mem_base);
28270	    test_ret++;
28271            printf(" %d", n_am);
28272            printf("\n");
28273        }
28274    }
28275    function_tests++;
28276#endif
28277
28278    return(test_ret);
28279}
28280
28281#ifdef LIBXML_AUTOMATA_ENABLED
28282
28283#define gen_nb_xmlAutomataStatePtr 1
28284static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28285    return(NULL);
28286}
28287static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28288}
28289#endif
28290
28291
28292static int
28293test_xmlAutomataNewAllTrans(void) {
28294    int test_ret = 0;
28295
28296
28297    /* missing type support */
28298    return(test_ret);
28299}
28300
28301
28302static int
28303test_xmlAutomataNewCountTrans(void) {
28304    int test_ret = 0;
28305
28306
28307    /* missing type support */
28308    return(test_ret);
28309}
28310
28311
28312static int
28313test_xmlAutomataNewCountTrans2(void) {
28314    int test_ret = 0;
28315
28316
28317    /* missing type support */
28318    return(test_ret);
28319}
28320
28321
28322static int
28323test_xmlAutomataNewCountedTrans(void) {
28324    int test_ret = 0;
28325
28326
28327    /* missing type support */
28328    return(test_ret);
28329}
28330
28331
28332static int
28333test_xmlAutomataNewCounter(void) {
28334    int test_ret = 0;
28335
28336#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28337    int mem_base;
28338    int ret_val;
28339    xmlAutomataPtr am; /* an automata */
28340    int n_am;
28341    int min; /* the minimal value on the counter */
28342    int n_min;
28343    int max; /* the maximal value on the counter */
28344    int n_max;
28345
28346    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28347    for (n_min = 0;n_min < gen_nb_int;n_min++) {
28348    for (n_max = 0;n_max < gen_nb_int;n_max++) {
28349        mem_base = xmlMemBlocks();
28350        am = gen_xmlAutomataPtr(n_am, 0);
28351        min = gen_int(n_min, 1);
28352        max = gen_int(n_max, 2);
28353
28354        ret_val = xmlAutomataNewCounter(am, min, max);
28355        desret_int(ret_val);
28356        call_tests++;
28357        des_xmlAutomataPtr(n_am, am, 0);
28358        des_int(n_min, min, 1);
28359        des_int(n_max, max, 2);
28360        xmlResetLastError();
28361        if (mem_base != xmlMemBlocks()) {
28362            printf("Leak of %d blocks found in xmlAutomataNewCounter",
28363	           xmlMemBlocks() - mem_base);
28364	    test_ret++;
28365            printf(" %d", n_am);
28366            printf(" %d", n_min);
28367            printf(" %d", n_max);
28368            printf("\n");
28369        }
28370    }
28371    }
28372    }
28373    function_tests++;
28374#endif
28375
28376    return(test_ret);
28377}
28378
28379
28380static int
28381test_xmlAutomataNewCounterTrans(void) {
28382    int test_ret = 0;
28383
28384
28385    /* missing type support */
28386    return(test_ret);
28387}
28388
28389
28390static int
28391test_xmlAutomataNewEpsilon(void) {
28392    int test_ret = 0;
28393
28394
28395    /* missing type support */
28396    return(test_ret);
28397}
28398
28399
28400static int
28401test_xmlAutomataNewNegTrans(void) {
28402    int test_ret = 0;
28403
28404
28405    /* missing type support */
28406    return(test_ret);
28407}
28408
28409
28410static int
28411test_xmlAutomataNewOnceTrans(void) {
28412    int test_ret = 0;
28413
28414
28415    /* missing type support */
28416    return(test_ret);
28417}
28418
28419
28420static int
28421test_xmlAutomataNewOnceTrans2(void) {
28422    int test_ret = 0;
28423
28424
28425    /* missing type support */
28426    return(test_ret);
28427}
28428
28429
28430static int
28431test_xmlAutomataNewState(void) {
28432    int test_ret = 0;
28433
28434
28435    /* missing type support */
28436    return(test_ret);
28437}
28438
28439
28440static int
28441test_xmlAutomataNewTransition(void) {
28442    int test_ret = 0;
28443
28444
28445    /* missing type support */
28446    return(test_ret);
28447}
28448
28449
28450static int
28451test_xmlAutomataNewTransition2(void) {
28452    int test_ret = 0;
28453
28454
28455    /* missing type support */
28456    return(test_ret);
28457}
28458
28459
28460static int
28461test_xmlAutomataSetFinalState(void) {
28462    int test_ret = 0;
28463
28464#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28465    int mem_base;
28466    int ret_val;
28467    xmlAutomataPtr am; /* an automata */
28468    int n_am;
28469    xmlAutomataStatePtr state; /* a state in this automata */
28470    int n_state;
28471
28472    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28473    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
28474        mem_base = xmlMemBlocks();
28475        am = gen_xmlAutomataPtr(n_am, 0);
28476        state = gen_xmlAutomataStatePtr(n_state, 1);
28477
28478        ret_val = xmlAutomataSetFinalState(am, state);
28479        desret_int(ret_val);
28480        call_tests++;
28481        des_xmlAutomataPtr(n_am, am, 0);
28482        des_xmlAutomataStatePtr(n_state, state, 1);
28483        xmlResetLastError();
28484        if (mem_base != xmlMemBlocks()) {
28485            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
28486	           xmlMemBlocks() - mem_base);
28487	    test_ret++;
28488            printf(" %d", n_am);
28489            printf(" %d", n_state);
28490            printf("\n");
28491        }
28492    }
28493    }
28494    function_tests++;
28495#endif
28496
28497    return(test_ret);
28498}
28499
28500
28501static int
28502test_xmlNewAutomata(void) {
28503    int test_ret = 0;
28504
28505
28506    /* missing type support */
28507    return(test_ret);
28508}
28509
28510static int
28511test_xmlautomata(void) {
28512    int test_ret = 0;
28513
28514    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
28515    test_ret += test_xmlAutomataCompile();
28516    test_ret += test_xmlAutomataGetInitState();
28517    test_ret += test_xmlAutomataIsDeterminist();
28518    test_ret += test_xmlAutomataNewAllTrans();
28519    test_ret += test_xmlAutomataNewCountTrans();
28520    test_ret += test_xmlAutomataNewCountTrans2();
28521    test_ret += test_xmlAutomataNewCountedTrans();
28522    test_ret += test_xmlAutomataNewCounter();
28523    test_ret += test_xmlAutomataNewCounterTrans();
28524    test_ret += test_xmlAutomataNewEpsilon();
28525    test_ret += test_xmlAutomataNewNegTrans();
28526    test_ret += test_xmlAutomataNewOnceTrans();
28527    test_ret += test_xmlAutomataNewOnceTrans2();
28528    test_ret += test_xmlAutomataNewState();
28529    test_ret += test_xmlAutomataNewTransition();
28530    test_ret += test_xmlAutomataNewTransition2();
28531    test_ret += test_xmlAutomataSetFinalState();
28532    test_ret += test_xmlNewAutomata();
28533
28534    if (test_ret != 0)
28535	printf("Module xmlautomata: %d errors\n", test_ret);
28536    return(test_ret);
28537}
28538
28539#define gen_nb_xmlGenericErrorFunc_ptr 1
28540static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28541    return(NULL);
28542}
28543static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28544}
28545
28546static int
28547test_initGenericErrorDefaultFunc(void) {
28548    int test_ret = 0;
28549
28550    int mem_base;
28551    xmlGenericErrorFunc * handler; /* the handler */
28552    int n_handler;
28553
28554    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
28555        mem_base = xmlMemBlocks();
28556        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
28557
28558        initGenericErrorDefaultFunc(handler);
28559        call_tests++;
28560        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
28561        xmlResetLastError();
28562        if (mem_base != xmlMemBlocks()) {
28563            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
28564	           xmlMemBlocks() - mem_base);
28565	    test_ret++;
28566            printf(" %d", n_handler);
28567            printf("\n");
28568        }
28569    }
28570    function_tests++;
28571
28572    return(test_ret);
28573}
28574
28575
28576#define gen_nb_xmlErrorPtr 1
28577static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28578    return(NULL);
28579}
28580static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28581}
28582
28583static int
28584test_xmlCopyError(void) {
28585    int test_ret = 0;
28586
28587    int mem_base;
28588    int ret_val;
28589    xmlErrorPtr from; /* a source error */
28590    int n_from;
28591    xmlErrorPtr to; /* a target error */
28592    int n_to;
28593
28594    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
28595    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
28596        mem_base = xmlMemBlocks();
28597        from = gen_xmlErrorPtr(n_from, 0);
28598        to = gen_xmlErrorPtr(n_to, 1);
28599
28600        ret_val = xmlCopyError(from, to);
28601        desret_int(ret_val);
28602        call_tests++;
28603        des_xmlErrorPtr(n_from, from, 0);
28604        des_xmlErrorPtr(n_to, to, 1);
28605        xmlResetLastError();
28606        if (mem_base != xmlMemBlocks()) {
28607            printf("Leak of %d blocks found in xmlCopyError",
28608	           xmlMemBlocks() - mem_base);
28609	    test_ret++;
28610            printf(" %d", n_from);
28611            printf(" %d", n_to);
28612            printf("\n");
28613        }
28614    }
28615    }
28616    function_tests++;
28617
28618    return(test_ret);
28619}
28620
28621
28622static int
28623test_xmlCtxtGetLastError(void) {
28624    int test_ret = 0;
28625
28626
28627    /* missing type support */
28628    return(test_ret);
28629}
28630
28631
28632static int
28633test_xmlCtxtResetLastError(void) {
28634    int test_ret = 0;
28635
28636    int mem_base;
28637    void * ctx; /* an XML parser context */
28638    int n_ctx;
28639
28640    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
28641        mem_base = xmlMemBlocks();
28642        ctx = gen_void_ptr(n_ctx, 0);
28643
28644        xmlCtxtResetLastError(ctx);
28645        call_tests++;
28646        des_void_ptr(n_ctx, ctx, 0);
28647        xmlResetLastError();
28648        if (mem_base != xmlMemBlocks()) {
28649            printf("Leak of %d blocks found in xmlCtxtResetLastError",
28650	           xmlMemBlocks() - mem_base);
28651	    test_ret++;
28652            printf(" %d", n_ctx);
28653            printf("\n");
28654        }
28655    }
28656    function_tests++;
28657
28658    return(test_ret);
28659}
28660
28661
28662static int
28663test_xmlGetLastError(void) {
28664    int test_ret = 0;
28665
28666
28667    /* missing type support */
28668    return(test_ret);
28669}
28670
28671
28672static int
28673test_xmlParserError(void) {
28674    int test_ret = 0;
28675
28676
28677    /* missing type support */
28678    return(test_ret);
28679}
28680
28681
28682static int
28683test_xmlParserPrintFileContext(void) {
28684    int test_ret = 0;
28685
28686    int mem_base;
28687    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28688    int n_input;
28689
28690    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28691        mem_base = xmlMemBlocks();
28692        input = gen_xmlParserInputPtr(n_input, 0);
28693
28694        xmlParserPrintFileContext(input);
28695        call_tests++;
28696        des_xmlParserInputPtr(n_input, input, 0);
28697        xmlResetLastError();
28698        if (mem_base != xmlMemBlocks()) {
28699            printf("Leak of %d blocks found in xmlParserPrintFileContext",
28700	           xmlMemBlocks() - mem_base);
28701	    test_ret++;
28702            printf(" %d", n_input);
28703            printf("\n");
28704        }
28705    }
28706    function_tests++;
28707
28708    return(test_ret);
28709}
28710
28711
28712static int
28713test_xmlParserPrintFileInfo(void) {
28714    int test_ret = 0;
28715
28716    int mem_base;
28717    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28718    int n_input;
28719
28720    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28721        mem_base = xmlMemBlocks();
28722        input = gen_xmlParserInputPtr(n_input, 0);
28723
28724        xmlParserPrintFileInfo(input);
28725        call_tests++;
28726        des_xmlParserInputPtr(n_input, input, 0);
28727        xmlResetLastError();
28728        if (mem_base != xmlMemBlocks()) {
28729            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
28730	           xmlMemBlocks() - mem_base);
28731	    test_ret++;
28732            printf(" %d", n_input);
28733            printf("\n");
28734        }
28735    }
28736    function_tests++;
28737
28738    return(test_ret);
28739}
28740
28741
28742static int
28743test_xmlParserValidityError(void) {
28744    int test_ret = 0;
28745
28746
28747    /* missing type support */
28748    return(test_ret);
28749}
28750
28751
28752static int
28753test_xmlParserValidityWarning(void) {
28754    int test_ret = 0;
28755
28756
28757    /* missing type support */
28758    return(test_ret);
28759}
28760
28761
28762static int
28763test_xmlParserWarning(void) {
28764    int test_ret = 0;
28765
28766
28767    /* missing type support */
28768    return(test_ret);
28769}
28770
28771
28772static int
28773test_xmlResetError(void) {
28774    int test_ret = 0;
28775
28776    int mem_base;
28777    xmlErrorPtr err; /* pointer to the error. */
28778    int n_err;
28779
28780    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
28781        mem_base = xmlMemBlocks();
28782        err = gen_xmlErrorPtr(n_err, 0);
28783
28784        xmlResetError(err);
28785        call_tests++;
28786        des_xmlErrorPtr(n_err, err, 0);
28787        xmlResetLastError();
28788        if (mem_base != xmlMemBlocks()) {
28789            printf("Leak of %d blocks found in xmlResetError",
28790	           xmlMemBlocks() - mem_base);
28791	    test_ret++;
28792            printf(" %d", n_err);
28793            printf("\n");
28794        }
28795    }
28796    function_tests++;
28797
28798    return(test_ret);
28799}
28800
28801
28802static int
28803test_xmlResetLastError(void) {
28804    int test_ret = 0;
28805
28806
28807
28808        xmlResetLastError();
28809        call_tests++;
28810        xmlResetLastError();
28811    function_tests++;
28812
28813    return(test_ret);
28814}
28815
28816
28817static int
28818test_xmlSetGenericErrorFunc(void) {
28819    int test_ret = 0;
28820
28821
28822    /* missing type support */
28823    return(test_ret);
28824}
28825
28826
28827static int
28828test_xmlSetStructuredErrorFunc(void) {
28829    int test_ret = 0;
28830
28831
28832    /* missing type support */
28833    return(test_ret);
28834}
28835
28836static int
28837test_xmlerror(void) {
28838    int test_ret = 0;
28839
28840    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
28841    test_ret += test_initGenericErrorDefaultFunc();
28842    test_ret += test_xmlCopyError();
28843    test_ret += test_xmlCtxtGetLastError();
28844    test_ret += test_xmlCtxtResetLastError();
28845    test_ret += test_xmlGetLastError();
28846    test_ret += test_xmlParserError();
28847    test_ret += test_xmlParserPrintFileContext();
28848    test_ret += test_xmlParserPrintFileInfo();
28849    test_ret += test_xmlParserValidityError();
28850    test_ret += test_xmlParserValidityWarning();
28851    test_ret += test_xmlParserWarning();
28852    test_ret += test_xmlResetError();
28853    test_ret += test_xmlResetLastError();
28854    test_ret += test_xmlSetGenericErrorFunc();
28855    test_ret += test_xmlSetStructuredErrorFunc();
28856
28857    if (test_ret != 0)
28858	printf("Module xmlerror: %d errors\n", test_ret);
28859    return(test_ret);
28860}
28861#ifdef LIBXML_MODULES_ENABLED
28862
28863#define gen_nb_xmlModulePtr 1
28864static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28865    return(NULL);
28866}
28867static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28868}
28869#endif
28870
28871
28872static int
28873test_xmlModuleClose(void) {
28874    int test_ret = 0;
28875
28876#if defined(LIBXML_MODULES_ENABLED)
28877    int mem_base;
28878    int ret_val;
28879    xmlModulePtr module; /* the module handle */
28880    int n_module;
28881
28882    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
28883        mem_base = xmlMemBlocks();
28884        module = gen_xmlModulePtr(n_module, 0);
28885
28886        ret_val = xmlModuleClose(module);
28887        desret_int(ret_val);
28888        call_tests++;
28889        des_xmlModulePtr(n_module, module, 0);
28890        xmlResetLastError();
28891        if (mem_base != xmlMemBlocks()) {
28892            printf("Leak of %d blocks found in xmlModuleClose",
28893	           xmlMemBlocks() - mem_base);
28894	    test_ret++;
28895            printf(" %d", n_module);
28896            printf("\n");
28897        }
28898    }
28899    function_tests++;
28900#endif
28901
28902    return(test_ret);
28903}
28904
28905
28906static int
28907test_xmlModuleOpen(void) {
28908    int test_ret = 0;
28909
28910
28911    /* missing type support */
28912    return(test_ret);
28913}
28914
28915
28916static int
28917test_xmlModuleSymbol(void) {
28918    int test_ret = 0;
28919
28920#if defined(LIBXML_MODULES_ENABLED)
28921    int mem_base;
28922    int ret_val;
28923    xmlModulePtr module; /* the module */
28924    int n_module;
28925    char * name; /* the name of the symbol */
28926    int n_name;
28927    void ** symbol; /* the resulting symbol address */
28928    int n_symbol;
28929
28930    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
28931    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
28932    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
28933        mem_base = xmlMemBlocks();
28934        module = gen_xmlModulePtr(n_module, 0);
28935        name = gen_const_char_ptr(n_name, 1);
28936        symbol = gen_void_ptr_ptr(n_symbol, 2);
28937
28938        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
28939        desret_int(ret_val);
28940        call_tests++;
28941        des_xmlModulePtr(n_module, module, 0);
28942        des_const_char_ptr(n_name, (const char *)name, 1);
28943        des_void_ptr_ptr(n_symbol, symbol, 2);
28944        xmlResetLastError();
28945        if (mem_base != xmlMemBlocks()) {
28946            printf("Leak of %d blocks found in xmlModuleSymbol",
28947	           xmlMemBlocks() - mem_base);
28948	    test_ret++;
28949            printf(" %d", n_module);
28950            printf(" %d", n_name);
28951            printf(" %d", n_symbol);
28952            printf("\n");
28953        }
28954    }
28955    }
28956    }
28957    function_tests++;
28958#endif
28959
28960    return(test_ret);
28961}
28962
28963static int
28964test_xmlmodule(void) {
28965    int test_ret = 0;
28966
28967    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
28968    test_ret += test_xmlModuleClose();
28969    test_ret += test_xmlModuleOpen();
28970    test_ret += test_xmlModuleSymbol();
28971
28972    if (test_ret != 0)
28973	printf("Module xmlmodule: %d errors\n", test_ret);
28974    return(test_ret);
28975}
28976
28977static int
28978test_xmlNewTextReader(void) {
28979    int test_ret = 0;
28980
28981#if defined(LIBXML_READER_ENABLED)
28982    int mem_base;
28983    xmlTextReaderPtr ret_val;
28984    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
28985    int n_input;
28986    const char * URI; /* the URI information for the source if available */
28987    int n_URI;
28988
28989    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
28990    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
28991        mem_base = xmlMemBlocks();
28992        input = gen_xmlParserInputBufferPtr(n_input, 0);
28993        URI = gen_filepath(n_URI, 1);
28994
28995        ret_val = xmlNewTextReader(input, URI);
28996        desret_xmlTextReaderPtr(ret_val);
28997        call_tests++;
28998        des_xmlParserInputBufferPtr(n_input, input, 0);
28999        des_filepath(n_URI, URI, 1);
29000        xmlResetLastError();
29001        if (mem_base != xmlMemBlocks()) {
29002            printf("Leak of %d blocks found in xmlNewTextReader",
29003	           xmlMemBlocks() - mem_base);
29004	    test_ret++;
29005            printf(" %d", n_input);
29006            printf(" %d", n_URI);
29007            printf("\n");
29008        }
29009    }
29010    }
29011    function_tests++;
29012#endif
29013
29014    return(test_ret);
29015}
29016
29017
29018static int
29019test_xmlNewTextReaderFilename(void) {
29020    int test_ret = 0;
29021
29022#if defined(LIBXML_READER_ENABLED)
29023    int mem_base;
29024    xmlTextReaderPtr ret_val;
29025    const char * URI; /* the URI of the resource to process */
29026    int n_URI;
29027
29028    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29029        mem_base = xmlMemBlocks();
29030        URI = gen_filepath(n_URI, 0);
29031
29032        ret_val = xmlNewTextReaderFilename(URI);
29033        desret_xmlTextReaderPtr(ret_val);
29034        call_tests++;
29035        des_filepath(n_URI, URI, 0);
29036        xmlResetLastError();
29037        if (mem_base != xmlMemBlocks()) {
29038            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29039	           xmlMemBlocks() - mem_base);
29040	    test_ret++;
29041            printf(" %d", n_URI);
29042            printf("\n");
29043        }
29044    }
29045    function_tests++;
29046#endif
29047
29048    return(test_ret);
29049}
29050
29051
29052static int
29053test_xmlReaderForDoc(void) {
29054    int test_ret = 0;
29055
29056#if defined(LIBXML_READER_ENABLED)
29057    int mem_base;
29058    xmlTextReaderPtr ret_val;
29059    xmlChar * cur; /* a pointer to a zero terminated string */
29060    int n_cur;
29061    const char * URL; /* the base URL to use for the document */
29062    int n_URL;
29063    char * encoding; /* the document encoding, or NULL */
29064    int n_encoding;
29065    int options; /* a combination of xmlParserOption */
29066    int n_options;
29067
29068    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29069    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29070    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29071    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29072        mem_base = xmlMemBlocks();
29073        cur = gen_const_xmlChar_ptr(n_cur, 0);
29074        URL = gen_filepath(n_URL, 1);
29075        encoding = gen_const_char_ptr(n_encoding, 2);
29076        options = gen_parseroptions(n_options, 3);
29077
29078        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29079        desret_xmlTextReaderPtr(ret_val);
29080        call_tests++;
29081        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29082        des_filepath(n_URL, URL, 1);
29083        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29084        des_parseroptions(n_options, options, 3);
29085        xmlResetLastError();
29086        if (mem_base != xmlMemBlocks()) {
29087            printf("Leak of %d blocks found in xmlReaderForDoc",
29088	           xmlMemBlocks() - mem_base);
29089	    test_ret++;
29090            printf(" %d", n_cur);
29091            printf(" %d", n_URL);
29092            printf(" %d", n_encoding);
29093            printf(" %d", n_options);
29094            printf("\n");
29095        }
29096    }
29097    }
29098    }
29099    }
29100    function_tests++;
29101#endif
29102
29103    return(test_ret);
29104}
29105
29106
29107static int
29108test_xmlReaderForFile(void) {
29109    int test_ret = 0;
29110
29111#if defined(LIBXML_READER_ENABLED)
29112    int mem_base;
29113    xmlTextReaderPtr ret_val;
29114    const char * filename; /* a file or URL */
29115    int n_filename;
29116    char * encoding; /* the document encoding, or NULL */
29117    int n_encoding;
29118    int options; /* a combination of xmlParserOption */
29119    int n_options;
29120
29121    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29122    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29123    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29124        mem_base = xmlMemBlocks();
29125        filename = gen_filepath(n_filename, 0);
29126        encoding = gen_const_char_ptr(n_encoding, 1);
29127        options = gen_parseroptions(n_options, 2);
29128
29129        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29130        desret_xmlTextReaderPtr(ret_val);
29131        call_tests++;
29132        des_filepath(n_filename, filename, 0);
29133        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29134        des_parseroptions(n_options, options, 2);
29135        xmlResetLastError();
29136        if (mem_base != xmlMemBlocks()) {
29137            printf("Leak of %d blocks found in xmlReaderForFile",
29138	           xmlMemBlocks() - mem_base);
29139	    test_ret++;
29140            printf(" %d", n_filename);
29141            printf(" %d", n_encoding);
29142            printf(" %d", n_options);
29143            printf("\n");
29144        }
29145    }
29146    }
29147    }
29148    function_tests++;
29149#endif
29150
29151    return(test_ret);
29152}
29153
29154
29155static int
29156test_xmlReaderForMemory(void) {
29157    int test_ret = 0;
29158
29159#if defined(LIBXML_READER_ENABLED)
29160    int mem_base;
29161    xmlTextReaderPtr ret_val;
29162    char * buffer; /* a pointer to a char array */
29163    int n_buffer;
29164    int size; /* the size of the array */
29165    int n_size;
29166    const char * URL; /* the base URL to use for the document */
29167    int n_URL;
29168    char * encoding; /* the document encoding, or NULL */
29169    int n_encoding;
29170    int options; /* a combination of xmlParserOption */
29171    int n_options;
29172
29173    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29174    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29175    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29176    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29177    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29178        mem_base = xmlMemBlocks();
29179        buffer = gen_const_char_ptr(n_buffer, 0);
29180        size = gen_int(n_size, 1);
29181        URL = gen_filepath(n_URL, 2);
29182        encoding = gen_const_char_ptr(n_encoding, 3);
29183        options = gen_parseroptions(n_options, 4);
29184
29185        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29186        desret_xmlTextReaderPtr(ret_val);
29187        call_tests++;
29188        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29189        des_int(n_size, size, 1);
29190        des_filepath(n_URL, URL, 2);
29191        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29192        des_parseroptions(n_options, options, 4);
29193        xmlResetLastError();
29194        if (mem_base != xmlMemBlocks()) {
29195            printf("Leak of %d blocks found in xmlReaderForMemory",
29196	           xmlMemBlocks() - mem_base);
29197	    test_ret++;
29198            printf(" %d", n_buffer);
29199            printf(" %d", n_size);
29200            printf(" %d", n_URL);
29201            printf(" %d", n_encoding);
29202            printf(" %d", n_options);
29203            printf("\n");
29204        }
29205    }
29206    }
29207    }
29208    }
29209    }
29210    function_tests++;
29211#endif
29212
29213    return(test_ret);
29214}
29215
29216
29217static int
29218test_xmlReaderNewDoc(void) {
29219    int test_ret = 0;
29220
29221#if defined(LIBXML_READER_ENABLED)
29222    int mem_base;
29223    int ret_val;
29224    xmlTextReaderPtr reader; /* an XML reader */
29225    int n_reader;
29226    xmlChar * cur; /* a pointer to a zero terminated string */
29227    int n_cur;
29228    const char * URL; /* the base URL to use for the document */
29229    int n_URL;
29230    char * encoding; /* the document encoding, or NULL */
29231    int n_encoding;
29232    int options; /* a combination of xmlParserOption */
29233    int n_options;
29234
29235    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29236    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29237    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29238    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29239    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29240        mem_base = xmlMemBlocks();
29241        reader = gen_xmlTextReaderPtr(n_reader, 0);
29242        cur = gen_const_xmlChar_ptr(n_cur, 1);
29243        URL = gen_filepath(n_URL, 2);
29244        encoding = gen_const_char_ptr(n_encoding, 3);
29245        options = gen_parseroptions(n_options, 4);
29246
29247        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29248        desret_int(ret_val);
29249        call_tests++;
29250        des_xmlTextReaderPtr(n_reader, reader, 0);
29251        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29252        des_filepath(n_URL, URL, 2);
29253        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29254        des_parseroptions(n_options, options, 4);
29255        xmlResetLastError();
29256        if (mem_base != xmlMemBlocks()) {
29257            printf("Leak of %d blocks found in xmlReaderNewDoc",
29258	           xmlMemBlocks() - mem_base);
29259	    test_ret++;
29260            printf(" %d", n_reader);
29261            printf(" %d", n_cur);
29262            printf(" %d", n_URL);
29263            printf(" %d", n_encoding);
29264            printf(" %d", n_options);
29265            printf("\n");
29266        }
29267    }
29268    }
29269    }
29270    }
29271    }
29272    function_tests++;
29273#endif
29274
29275    return(test_ret);
29276}
29277
29278
29279static int
29280test_xmlReaderNewFile(void) {
29281    int test_ret = 0;
29282
29283#if defined(LIBXML_READER_ENABLED)
29284    int mem_base;
29285    int ret_val;
29286    xmlTextReaderPtr reader; /* an XML reader */
29287    int n_reader;
29288    const char * filename; /* a file or URL */
29289    int n_filename;
29290    char * encoding; /* the document encoding, or NULL */
29291    int n_encoding;
29292    int options; /* a combination of xmlParserOption */
29293    int n_options;
29294
29295    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29296    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29297    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29298    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29299        mem_base = xmlMemBlocks();
29300        reader = gen_xmlTextReaderPtr(n_reader, 0);
29301        filename = gen_filepath(n_filename, 1);
29302        encoding = gen_const_char_ptr(n_encoding, 2);
29303        options = gen_parseroptions(n_options, 3);
29304
29305        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29306        desret_int(ret_val);
29307        call_tests++;
29308        des_xmlTextReaderPtr(n_reader, reader, 0);
29309        des_filepath(n_filename, filename, 1);
29310        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29311        des_parseroptions(n_options, options, 3);
29312        xmlResetLastError();
29313        if (mem_base != xmlMemBlocks()) {
29314            printf("Leak of %d blocks found in xmlReaderNewFile",
29315	           xmlMemBlocks() - mem_base);
29316	    test_ret++;
29317            printf(" %d", n_reader);
29318            printf(" %d", n_filename);
29319            printf(" %d", n_encoding);
29320            printf(" %d", n_options);
29321            printf("\n");
29322        }
29323    }
29324    }
29325    }
29326    }
29327    function_tests++;
29328#endif
29329
29330    return(test_ret);
29331}
29332
29333
29334static int
29335test_xmlReaderNewMemory(void) {
29336    int test_ret = 0;
29337
29338#if defined(LIBXML_READER_ENABLED)
29339    int mem_base;
29340    int ret_val;
29341    xmlTextReaderPtr reader; /* an XML reader */
29342    int n_reader;
29343    char * buffer; /* a pointer to a char array */
29344    int n_buffer;
29345    int size; /* the size of the array */
29346    int n_size;
29347    const char * URL; /* the base URL to use for the document */
29348    int n_URL;
29349    char * encoding; /* the document encoding, or NULL */
29350    int n_encoding;
29351    int options; /* a combination of xmlParserOption */
29352    int n_options;
29353
29354    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29355    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29356    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29357    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29358    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29359    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29360        mem_base = xmlMemBlocks();
29361        reader = gen_xmlTextReaderPtr(n_reader, 0);
29362        buffer = gen_const_char_ptr(n_buffer, 1);
29363        size = gen_int(n_size, 2);
29364        URL = gen_filepath(n_URL, 3);
29365        encoding = gen_const_char_ptr(n_encoding, 4);
29366        options = gen_parseroptions(n_options, 5);
29367
29368        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29369        desret_int(ret_val);
29370        call_tests++;
29371        des_xmlTextReaderPtr(n_reader, reader, 0);
29372        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29373        des_int(n_size, size, 2);
29374        des_filepath(n_URL, URL, 3);
29375        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29376        des_parseroptions(n_options, options, 5);
29377        xmlResetLastError();
29378        if (mem_base != xmlMemBlocks()) {
29379            printf("Leak of %d blocks found in xmlReaderNewMemory",
29380	           xmlMemBlocks() - mem_base);
29381	    test_ret++;
29382            printf(" %d", n_reader);
29383            printf(" %d", n_buffer);
29384            printf(" %d", n_size);
29385            printf(" %d", n_URL);
29386            printf(" %d", n_encoding);
29387            printf(" %d", n_options);
29388            printf("\n");
29389        }
29390    }
29391    }
29392    }
29393    }
29394    }
29395    }
29396    function_tests++;
29397#endif
29398
29399    return(test_ret);
29400}
29401
29402
29403static int
29404test_xmlReaderNewWalker(void) {
29405    int test_ret = 0;
29406
29407#if defined(LIBXML_READER_ENABLED)
29408    int mem_base;
29409    int ret_val;
29410    xmlTextReaderPtr reader; /* an XML reader */
29411    int n_reader;
29412    xmlDocPtr doc; /* a preparsed document */
29413    int n_doc;
29414
29415    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29416    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29417        mem_base = xmlMemBlocks();
29418        reader = gen_xmlTextReaderPtr(n_reader, 0);
29419        doc = gen_xmlDocPtr(n_doc, 1);
29420
29421        ret_val = xmlReaderNewWalker(reader, doc);
29422        desret_int(ret_val);
29423        call_tests++;
29424        des_xmlTextReaderPtr(n_reader, reader, 0);
29425        des_xmlDocPtr(n_doc, doc, 1);
29426        xmlResetLastError();
29427        if (mem_base != xmlMemBlocks()) {
29428            printf("Leak of %d blocks found in xmlReaderNewWalker",
29429	           xmlMemBlocks() - mem_base);
29430	    test_ret++;
29431            printf(" %d", n_reader);
29432            printf(" %d", n_doc);
29433            printf("\n");
29434        }
29435    }
29436    }
29437    function_tests++;
29438#endif
29439
29440    return(test_ret);
29441}
29442
29443
29444static int
29445test_xmlReaderWalker(void) {
29446    int test_ret = 0;
29447
29448#if defined(LIBXML_READER_ENABLED)
29449    int mem_base;
29450    xmlTextReaderPtr ret_val;
29451    xmlDocPtr doc; /* a preparsed document */
29452    int n_doc;
29453
29454    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29455        mem_base = xmlMemBlocks();
29456        doc = gen_xmlDocPtr(n_doc, 0);
29457
29458        ret_val = xmlReaderWalker(doc);
29459        desret_xmlTextReaderPtr(ret_val);
29460        call_tests++;
29461        des_xmlDocPtr(n_doc, doc, 0);
29462        xmlResetLastError();
29463        if (mem_base != xmlMemBlocks()) {
29464            printf("Leak of %d blocks found in xmlReaderWalker",
29465	           xmlMemBlocks() - mem_base);
29466	    test_ret++;
29467            printf(" %d", n_doc);
29468            printf("\n");
29469        }
29470    }
29471    function_tests++;
29472#endif
29473
29474    return(test_ret);
29475}
29476
29477
29478static int
29479test_xmlTextReaderAttributeCount(void) {
29480    int test_ret = 0;
29481
29482#if defined(LIBXML_READER_ENABLED)
29483    int mem_base;
29484    int ret_val;
29485    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29486    int n_reader;
29487
29488    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29489        mem_base = xmlMemBlocks();
29490        reader = gen_xmlTextReaderPtr(n_reader, 0);
29491
29492        ret_val = xmlTextReaderAttributeCount(reader);
29493        desret_int(ret_val);
29494        call_tests++;
29495        des_xmlTextReaderPtr(n_reader, reader, 0);
29496        xmlResetLastError();
29497        if (mem_base != xmlMemBlocks()) {
29498            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
29499	           xmlMemBlocks() - mem_base);
29500	    test_ret++;
29501            printf(" %d", n_reader);
29502            printf("\n");
29503        }
29504    }
29505    function_tests++;
29506#endif
29507
29508    return(test_ret);
29509}
29510
29511
29512static int
29513test_xmlTextReaderBaseUri(void) {
29514    int test_ret = 0;
29515
29516#if defined(LIBXML_READER_ENABLED)
29517    int mem_base;
29518    xmlChar * ret_val;
29519    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29520    int n_reader;
29521
29522    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29523        mem_base = xmlMemBlocks();
29524        reader = gen_xmlTextReaderPtr(n_reader, 0);
29525
29526        ret_val = xmlTextReaderBaseUri(reader);
29527        desret_xmlChar_ptr(ret_val);
29528        call_tests++;
29529        des_xmlTextReaderPtr(n_reader, reader, 0);
29530        xmlResetLastError();
29531        if (mem_base != xmlMemBlocks()) {
29532            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
29533	           xmlMemBlocks() - mem_base);
29534	    test_ret++;
29535            printf(" %d", n_reader);
29536            printf("\n");
29537        }
29538    }
29539    function_tests++;
29540#endif
29541
29542    return(test_ret);
29543}
29544
29545
29546static int
29547test_xmlTextReaderByteConsumed(void) {
29548    int test_ret = 0;
29549
29550#if defined(LIBXML_READER_ENABLED)
29551    int mem_base;
29552    long ret_val;
29553    xmlTextReaderPtr reader; /* an XML reader */
29554    int n_reader;
29555
29556    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29557        mem_base = xmlMemBlocks();
29558        reader = gen_xmlTextReaderPtr(n_reader, 0);
29559
29560        ret_val = xmlTextReaderByteConsumed(reader);
29561        desret_long(ret_val);
29562        call_tests++;
29563        des_xmlTextReaderPtr(n_reader, reader, 0);
29564        xmlResetLastError();
29565        if (mem_base != xmlMemBlocks()) {
29566            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
29567	           xmlMemBlocks() - mem_base);
29568	    test_ret++;
29569            printf(" %d", n_reader);
29570            printf("\n");
29571        }
29572    }
29573    function_tests++;
29574#endif
29575
29576    return(test_ret);
29577}
29578
29579
29580static int
29581test_xmlTextReaderClose(void) {
29582    int test_ret = 0;
29583
29584#if defined(LIBXML_READER_ENABLED)
29585    int mem_base;
29586    int ret_val;
29587    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29588    int n_reader;
29589
29590    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29591        mem_base = xmlMemBlocks();
29592        reader = gen_xmlTextReaderPtr(n_reader, 0);
29593
29594        ret_val = xmlTextReaderClose(reader);
29595        desret_int(ret_val);
29596        call_tests++;
29597        des_xmlTextReaderPtr(n_reader, reader, 0);
29598        xmlResetLastError();
29599        if (mem_base != xmlMemBlocks()) {
29600            printf("Leak of %d blocks found in xmlTextReaderClose",
29601	           xmlMemBlocks() - mem_base);
29602	    test_ret++;
29603            printf(" %d", n_reader);
29604            printf("\n");
29605        }
29606    }
29607    function_tests++;
29608#endif
29609
29610    return(test_ret);
29611}
29612
29613
29614static int
29615test_xmlTextReaderConstBaseUri(void) {
29616    int test_ret = 0;
29617
29618#if defined(LIBXML_READER_ENABLED)
29619    int mem_base;
29620    const xmlChar * ret_val;
29621    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29622    int n_reader;
29623
29624    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29625        mem_base = xmlMemBlocks();
29626        reader = gen_xmlTextReaderPtr(n_reader, 0);
29627
29628        ret_val = xmlTextReaderConstBaseUri(reader);
29629        desret_const_xmlChar_ptr(ret_val);
29630        call_tests++;
29631        des_xmlTextReaderPtr(n_reader, reader, 0);
29632        xmlResetLastError();
29633        if (mem_base != xmlMemBlocks()) {
29634            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
29635	           xmlMemBlocks() - mem_base);
29636	    test_ret++;
29637            printf(" %d", n_reader);
29638            printf("\n");
29639        }
29640    }
29641    function_tests++;
29642#endif
29643
29644    return(test_ret);
29645}
29646
29647
29648static int
29649test_xmlTextReaderConstEncoding(void) {
29650    int test_ret = 0;
29651
29652#if defined(LIBXML_READER_ENABLED)
29653    int mem_base;
29654    const xmlChar * ret_val;
29655    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29656    int n_reader;
29657
29658    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29659        mem_base = xmlMemBlocks();
29660        reader = gen_xmlTextReaderPtr(n_reader, 0);
29661
29662        ret_val = xmlTextReaderConstEncoding(reader);
29663        desret_const_xmlChar_ptr(ret_val);
29664        call_tests++;
29665        des_xmlTextReaderPtr(n_reader, reader, 0);
29666        xmlResetLastError();
29667        if (mem_base != xmlMemBlocks()) {
29668            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
29669	           xmlMemBlocks() - mem_base);
29670	    test_ret++;
29671            printf(" %d", n_reader);
29672            printf("\n");
29673        }
29674    }
29675    function_tests++;
29676#endif
29677
29678    return(test_ret);
29679}
29680
29681
29682static int
29683test_xmlTextReaderConstLocalName(void) {
29684    int test_ret = 0;
29685
29686#if defined(LIBXML_READER_ENABLED)
29687    int mem_base;
29688    const xmlChar * ret_val;
29689    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29690    int n_reader;
29691
29692    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29693        mem_base = xmlMemBlocks();
29694        reader = gen_xmlTextReaderPtr(n_reader, 0);
29695
29696        ret_val = xmlTextReaderConstLocalName(reader);
29697        desret_const_xmlChar_ptr(ret_val);
29698        call_tests++;
29699        des_xmlTextReaderPtr(n_reader, reader, 0);
29700        xmlResetLastError();
29701        if (mem_base != xmlMemBlocks()) {
29702            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
29703	           xmlMemBlocks() - mem_base);
29704	    test_ret++;
29705            printf(" %d", n_reader);
29706            printf("\n");
29707        }
29708    }
29709    function_tests++;
29710#endif
29711
29712    return(test_ret);
29713}
29714
29715
29716static int
29717test_xmlTextReaderConstName(void) {
29718    int test_ret = 0;
29719
29720#if defined(LIBXML_READER_ENABLED)
29721    int mem_base;
29722    const xmlChar * ret_val;
29723    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29724    int n_reader;
29725
29726    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29727        mem_base = xmlMemBlocks();
29728        reader = gen_xmlTextReaderPtr(n_reader, 0);
29729
29730        ret_val = xmlTextReaderConstName(reader);
29731        desret_const_xmlChar_ptr(ret_val);
29732        call_tests++;
29733        des_xmlTextReaderPtr(n_reader, reader, 0);
29734        xmlResetLastError();
29735        if (mem_base != xmlMemBlocks()) {
29736            printf("Leak of %d blocks found in xmlTextReaderConstName",
29737	           xmlMemBlocks() - mem_base);
29738	    test_ret++;
29739            printf(" %d", n_reader);
29740            printf("\n");
29741        }
29742    }
29743    function_tests++;
29744#endif
29745
29746    return(test_ret);
29747}
29748
29749
29750static int
29751test_xmlTextReaderConstNamespaceUri(void) {
29752    int test_ret = 0;
29753
29754#if defined(LIBXML_READER_ENABLED)
29755    int mem_base;
29756    const xmlChar * ret_val;
29757    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29758    int n_reader;
29759
29760    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29761        mem_base = xmlMemBlocks();
29762        reader = gen_xmlTextReaderPtr(n_reader, 0);
29763
29764        ret_val = xmlTextReaderConstNamespaceUri(reader);
29765        desret_const_xmlChar_ptr(ret_val);
29766        call_tests++;
29767        des_xmlTextReaderPtr(n_reader, reader, 0);
29768        xmlResetLastError();
29769        if (mem_base != xmlMemBlocks()) {
29770            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
29771	           xmlMemBlocks() - mem_base);
29772	    test_ret++;
29773            printf(" %d", n_reader);
29774            printf("\n");
29775        }
29776    }
29777    function_tests++;
29778#endif
29779
29780    return(test_ret);
29781}
29782
29783
29784static int
29785test_xmlTextReaderConstPrefix(void) {
29786    int test_ret = 0;
29787
29788#if defined(LIBXML_READER_ENABLED)
29789    int mem_base;
29790    const xmlChar * ret_val;
29791    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29792    int n_reader;
29793
29794    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29795        mem_base = xmlMemBlocks();
29796        reader = gen_xmlTextReaderPtr(n_reader, 0);
29797
29798        ret_val = xmlTextReaderConstPrefix(reader);
29799        desret_const_xmlChar_ptr(ret_val);
29800        call_tests++;
29801        des_xmlTextReaderPtr(n_reader, reader, 0);
29802        xmlResetLastError();
29803        if (mem_base != xmlMemBlocks()) {
29804            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
29805	           xmlMemBlocks() - mem_base);
29806	    test_ret++;
29807            printf(" %d", n_reader);
29808            printf("\n");
29809        }
29810    }
29811    function_tests++;
29812#endif
29813
29814    return(test_ret);
29815}
29816
29817
29818static int
29819test_xmlTextReaderConstString(void) {
29820    int test_ret = 0;
29821
29822#if defined(LIBXML_READER_ENABLED)
29823    int mem_base;
29824    const xmlChar * ret_val;
29825    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29826    int n_reader;
29827    xmlChar * str; /* the string to intern. */
29828    int n_str;
29829
29830    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29831    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
29832        mem_base = xmlMemBlocks();
29833        reader = gen_xmlTextReaderPtr(n_reader, 0);
29834        str = gen_const_xmlChar_ptr(n_str, 1);
29835
29836        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
29837        desret_const_xmlChar_ptr(ret_val);
29838        call_tests++;
29839        des_xmlTextReaderPtr(n_reader, reader, 0);
29840        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
29841        xmlResetLastError();
29842        if (mem_base != xmlMemBlocks()) {
29843            printf("Leak of %d blocks found in xmlTextReaderConstString",
29844	           xmlMemBlocks() - mem_base);
29845	    test_ret++;
29846            printf(" %d", n_reader);
29847            printf(" %d", n_str);
29848            printf("\n");
29849        }
29850    }
29851    }
29852    function_tests++;
29853#endif
29854
29855    return(test_ret);
29856}
29857
29858
29859static int
29860test_xmlTextReaderConstValue(void) {
29861    int test_ret = 0;
29862
29863#if defined(LIBXML_READER_ENABLED)
29864    int mem_base;
29865    const xmlChar * ret_val;
29866    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29867    int n_reader;
29868
29869    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29870        mem_base = xmlMemBlocks();
29871        reader = gen_xmlTextReaderPtr(n_reader, 0);
29872
29873        ret_val = xmlTextReaderConstValue(reader);
29874        desret_const_xmlChar_ptr(ret_val);
29875        call_tests++;
29876        des_xmlTextReaderPtr(n_reader, reader, 0);
29877        xmlResetLastError();
29878        if (mem_base != xmlMemBlocks()) {
29879            printf("Leak of %d blocks found in xmlTextReaderConstValue",
29880	           xmlMemBlocks() - mem_base);
29881	    test_ret++;
29882            printf(" %d", n_reader);
29883            printf("\n");
29884        }
29885    }
29886    function_tests++;
29887#endif
29888
29889    return(test_ret);
29890}
29891
29892
29893static int
29894test_xmlTextReaderConstXmlLang(void) {
29895    int test_ret = 0;
29896
29897#if defined(LIBXML_READER_ENABLED)
29898    int mem_base;
29899    const xmlChar * ret_val;
29900    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29901    int n_reader;
29902
29903    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29904        mem_base = xmlMemBlocks();
29905        reader = gen_xmlTextReaderPtr(n_reader, 0);
29906
29907        ret_val = xmlTextReaderConstXmlLang(reader);
29908        desret_const_xmlChar_ptr(ret_val);
29909        call_tests++;
29910        des_xmlTextReaderPtr(n_reader, reader, 0);
29911        xmlResetLastError();
29912        if (mem_base != xmlMemBlocks()) {
29913            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
29914	           xmlMemBlocks() - mem_base);
29915	    test_ret++;
29916            printf(" %d", n_reader);
29917            printf("\n");
29918        }
29919    }
29920    function_tests++;
29921#endif
29922
29923    return(test_ret);
29924}
29925
29926
29927static int
29928test_xmlTextReaderConstXmlVersion(void) {
29929    int test_ret = 0;
29930
29931#if defined(LIBXML_READER_ENABLED)
29932    int mem_base;
29933    const xmlChar * ret_val;
29934    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29935    int n_reader;
29936
29937    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29938        mem_base = xmlMemBlocks();
29939        reader = gen_xmlTextReaderPtr(n_reader, 0);
29940
29941        ret_val = xmlTextReaderConstXmlVersion(reader);
29942        desret_const_xmlChar_ptr(ret_val);
29943        call_tests++;
29944        des_xmlTextReaderPtr(n_reader, reader, 0);
29945        xmlResetLastError();
29946        if (mem_base != xmlMemBlocks()) {
29947            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
29948	           xmlMemBlocks() - mem_base);
29949	    test_ret++;
29950            printf(" %d", n_reader);
29951            printf("\n");
29952        }
29953    }
29954    function_tests++;
29955#endif
29956
29957    return(test_ret);
29958}
29959
29960
29961static int
29962test_xmlTextReaderCurrentDoc(void) {
29963    int test_ret = 0;
29964
29965#if defined(LIBXML_READER_ENABLED)
29966    int mem_base;
29967    xmlDocPtr ret_val;
29968    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29969    int n_reader;
29970
29971    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29972        mem_base = xmlMemBlocks();
29973        reader = gen_xmlTextReaderPtr(n_reader, 0);
29974
29975        ret_val = xmlTextReaderCurrentDoc(reader);
29976        desret_xmlDocPtr(ret_val);
29977        call_tests++;
29978        des_xmlTextReaderPtr(n_reader, reader, 0);
29979        xmlResetLastError();
29980        if (mem_base != xmlMemBlocks()) {
29981            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
29982	           xmlMemBlocks() - mem_base);
29983	    test_ret++;
29984            printf(" %d", n_reader);
29985            printf("\n");
29986        }
29987    }
29988    function_tests++;
29989#endif
29990
29991    return(test_ret);
29992}
29993
29994
29995static int
29996test_xmlTextReaderCurrentNode(void) {
29997    int test_ret = 0;
29998
29999#if defined(LIBXML_READER_ENABLED)
30000    int mem_base;
30001    xmlNodePtr ret_val;
30002    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30003    int n_reader;
30004
30005    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30006        mem_base = xmlMemBlocks();
30007        reader = gen_xmlTextReaderPtr(n_reader, 0);
30008
30009        ret_val = xmlTextReaderCurrentNode(reader);
30010        desret_xmlNodePtr(ret_val);
30011        call_tests++;
30012        des_xmlTextReaderPtr(n_reader, reader, 0);
30013        xmlResetLastError();
30014        if (mem_base != xmlMemBlocks()) {
30015            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30016	           xmlMemBlocks() - mem_base);
30017	    test_ret++;
30018            printf(" %d", n_reader);
30019            printf("\n");
30020        }
30021    }
30022    function_tests++;
30023#endif
30024
30025    return(test_ret);
30026}
30027
30028
30029static int
30030test_xmlTextReaderDepth(void) {
30031    int test_ret = 0;
30032
30033#if defined(LIBXML_READER_ENABLED)
30034    int mem_base;
30035    int ret_val;
30036    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30037    int n_reader;
30038
30039    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30040        mem_base = xmlMemBlocks();
30041        reader = gen_xmlTextReaderPtr(n_reader, 0);
30042
30043        ret_val = xmlTextReaderDepth(reader);
30044        desret_int(ret_val);
30045        call_tests++;
30046        des_xmlTextReaderPtr(n_reader, reader, 0);
30047        xmlResetLastError();
30048        if (mem_base != xmlMemBlocks()) {
30049            printf("Leak of %d blocks found in xmlTextReaderDepth",
30050	           xmlMemBlocks() - mem_base);
30051	    test_ret++;
30052            printf(" %d", n_reader);
30053            printf("\n");
30054        }
30055    }
30056    function_tests++;
30057#endif
30058
30059    return(test_ret);
30060}
30061
30062
30063static int
30064test_xmlTextReaderExpand(void) {
30065    int test_ret = 0;
30066
30067#if defined(LIBXML_READER_ENABLED)
30068    int mem_base;
30069    xmlNodePtr ret_val;
30070    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30071    int n_reader;
30072
30073    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30074        mem_base = xmlMemBlocks();
30075        reader = gen_xmlTextReaderPtr(n_reader, 0);
30076
30077        ret_val = xmlTextReaderExpand(reader);
30078        desret_xmlNodePtr(ret_val);
30079        call_tests++;
30080        des_xmlTextReaderPtr(n_reader, reader, 0);
30081        xmlResetLastError();
30082        if (mem_base != xmlMemBlocks()) {
30083            printf("Leak of %d blocks found in xmlTextReaderExpand",
30084	           xmlMemBlocks() - mem_base);
30085	    test_ret++;
30086            printf(" %d", n_reader);
30087            printf("\n");
30088        }
30089    }
30090    function_tests++;
30091#endif
30092
30093    return(test_ret);
30094}
30095
30096
30097static int
30098test_xmlTextReaderGetAttribute(void) {
30099    int test_ret = 0;
30100
30101#if defined(LIBXML_READER_ENABLED)
30102    int mem_base;
30103    xmlChar * ret_val;
30104    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30105    int n_reader;
30106    xmlChar * name; /* the qualified name of the attribute. */
30107    int n_name;
30108
30109    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30110    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30111        mem_base = xmlMemBlocks();
30112        reader = gen_xmlTextReaderPtr(n_reader, 0);
30113        name = gen_const_xmlChar_ptr(n_name, 1);
30114
30115        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30116        desret_xmlChar_ptr(ret_val);
30117        call_tests++;
30118        des_xmlTextReaderPtr(n_reader, reader, 0);
30119        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30120        xmlResetLastError();
30121        if (mem_base != xmlMemBlocks()) {
30122            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30123	           xmlMemBlocks() - mem_base);
30124	    test_ret++;
30125            printf(" %d", n_reader);
30126            printf(" %d", n_name);
30127            printf("\n");
30128        }
30129    }
30130    }
30131    function_tests++;
30132#endif
30133
30134    return(test_ret);
30135}
30136
30137
30138static int
30139test_xmlTextReaderGetAttributeNo(void) {
30140    int test_ret = 0;
30141
30142#if defined(LIBXML_READER_ENABLED)
30143    int mem_base;
30144    xmlChar * ret_val;
30145    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30146    int n_reader;
30147    int no; /* the zero-based index of the attribute relative to the containing element */
30148    int n_no;
30149
30150    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30151    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30152        mem_base = xmlMemBlocks();
30153        reader = gen_xmlTextReaderPtr(n_reader, 0);
30154        no = gen_int(n_no, 1);
30155
30156        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30157        desret_xmlChar_ptr(ret_val);
30158        call_tests++;
30159        des_xmlTextReaderPtr(n_reader, reader, 0);
30160        des_int(n_no, no, 1);
30161        xmlResetLastError();
30162        if (mem_base != xmlMemBlocks()) {
30163            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30164	           xmlMemBlocks() - mem_base);
30165	    test_ret++;
30166            printf(" %d", n_reader);
30167            printf(" %d", n_no);
30168            printf("\n");
30169        }
30170    }
30171    }
30172    function_tests++;
30173#endif
30174
30175    return(test_ret);
30176}
30177
30178
30179static int
30180test_xmlTextReaderGetAttributeNs(void) {
30181    int test_ret = 0;
30182
30183#if defined(LIBXML_READER_ENABLED)
30184    int mem_base;
30185    xmlChar * ret_val;
30186    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30187    int n_reader;
30188    xmlChar * localName; /* the local name of the attribute. */
30189    int n_localName;
30190    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30191    int n_namespaceURI;
30192
30193    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30194    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30195    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30196        mem_base = xmlMemBlocks();
30197        reader = gen_xmlTextReaderPtr(n_reader, 0);
30198        localName = gen_const_xmlChar_ptr(n_localName, 1);
30199        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30200
30201        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30202        desret_xmlChar_ptr(ret_val);
30203        call_tests++;
30204        des_xmlTextReaderPtr(n_reader, reader, 0);
30205        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30206        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30207        xmlResetLastError();
30208        if (mem_base != xmlMemBlocks()) {
30209            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30210	           xmlMemBlocks() - mem_base);
30211	    test_ret++;
30212            printf(" %d", n_reader);
30213            printf(" %d", n_localName);
30214            printf(" %d", n_namespaceURI);
30215            printf("\n");
30216        }
30217    }
30218    }
30219    }
30220    function_tests++;
30221#endif
30222
30223    return(test_ret);
30224}
30225
30226#ifdef LIBXML_READER_ENABLED
30227
30228#define gen_nb_xmlTextReaderErrorFunc_ptr 1
30229static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30230    return(NULL);
30231}
30232static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30233}
30234#endif
30235
30236
30237static int
30238test_xmlTextReaderGetErrorHandler(void) {
30239    int test_ret = 0;
30240
30241#if defined(LIBXML_READER_ENABLED)
30242    int mem_base;
30243    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30244    int n_reader;
30245    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30246    int n_f;
30247    void ** arg; /* a user argument */
30248    int n_arg;
30249
30250    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30251    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30252    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30253        mem_base = xmlMemBlocks();
30254        reader = gen_xmlTextReaderPtr(n_reader, 0);
30255        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30256        arg = gen_void_ptr_ptr(n_arg, 2);
30257
30258        xmlTextReaderGetErrorHandler(reader, f, arg);
30259        call_tests++;
30260        des_xmlTextReaderPtr(n_reader, reader, 0);
30261        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30262        des_void_ptr_ptr(n_arg, arg, 2);
30263        xmlResetLastError();
30264        if (mem_base != xmlMemBlocks()) {
30265            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30266	           xmlMemBlocks() - mem_base);
30267	    test_ret++;
30268            printf(" %d", n_reader);
30269            printf(" %d", n_f);
30270            printf(" %d", n_arg);
30271            printf("\n");
30272        }
30273    }
30274    }
30275    }
30276    function_tests++;
30277#endif
30278
30279    return(test_ret);
30280}
30281
30282
30283static int
30284test_xmlTextReaderGetParserColumnNumber(void) {
30285    int test_ret = 0;
30286
30287#if defined(LIBXML_READER_ENABLED)
30288    int mem_base;
30289    int ret_val;
30290    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30291    int n_reader;
30292
30293    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30294        mem_base = xmlMemBlocks();
30295        reader = gen_xmlTextReaderPtr(n_reader, 0);
30296
30297        ret_val = xmlTextReaderGetParserColumnNumber(reader);
30298        desret_int(ret_val);
30299        call_tests++;
30300        des_xmlTextReaderPtr(n_reader, reader, 0);
30301        xmlResetLastError();
30302        if (mem_base != xmlMemBlocks()) {
30303            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30304	           xmlMemBlocks() - mem_base);
30305	    test_ret++;
30306            printf(" %d", n_reader);
30307            printf("\n");
30308        }
30309    }
30310    function_tests++;
30311#endif
30312
30313    return(test_ret);
30314}
30315
30316
30317static int
30318test_xmlTextReaderGetParserLineNumber(void) {
30319    int test_ret = 0;
30320
30321#if defined(LIBXML_READER_ENABLED)
30322    int mem_base;
30323    int ret_val;
30324    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30325    int n_reader;
30326
30327    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30328        mem_base = xmlMemBlocks();
30329        reader = gen_xmlTextReaderPtr(n_reader, 0);
30330
30331        ret_val = xmlTextReaderGetParserLineNumber(reader);
30332        desret_int(ret_val);
30333        call_tests++;
30334        des_xmlTextReaderPtr(n_reader, reader, 0);
30335        xmlResetLastError();
30336        if (mem_base != xmlMemBlocks()) {
30337            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30338	           xmlMemBlocks() - mem_base);
30339	    test_ret++;
30340            printf(" %d", n_reader);
30341            printf("\n");
30342        }
30343    }
30344    function_tests++;
30345#endif
30346
30347    return(test_ret);
30348}
30349
30350
30351static int
30352test_xmlTextReaderGetParserProp(void) {
30353    int test_ret = 0;
30354
30355#if defined(LIBXML_READER_ENABLED)
30356    int mem_base;
30357    int ret_val;
30358    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30359    int n_reader;
30360    int prop; /* the xmlParserProperties to get */
30361    int n_prop;
30362
30363    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30364    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30365        mem_base = xmlMemBlocks();
30366        reader = gen_xmlTextReaderPtr(n_reader, 0);
30367        prop = gen_int(n_prop, 1);
30368
30369        ret_val = xmlTextReaderGetParserProp(reader, prop);
30370        desret_int(ret_val);
30371        call_tests++;
30372        des_xmlTextReaderPtr(n_reader, reader, 0);
30373        des_int(n_prop, prop, 1);
30374        xmlResetLastError();
30375        if (mem_base != xmlMemBlocks()) {
30376            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30377	           xmlMemBlocks() - mem_base);
30378	    test_ret++;
30379            printf(" %d", n_reader);
30380            printf(" %d", n_prop);
30381            printf("\n");
30382        }
30383    }
30384    }
30385    function_tests++;
30386#endif
30387
30388    return(test_ret);
30389}
30390
30391
30392static int
30393test_xmlTextReaderGetRemainder(void) {
30394    int test_ret = 0;
30395
30396#if defined(LIBXML_READER_ENABLED)
30397    int mem_base;
30398    xmlParserInputBufferPtr ret_val;
30399    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30400    int n_reader;
30401
30402    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30403        mem_base = xmlMemBlocks();
30404        reader = gen_xmlTextReaderPtr(n_reader, 0);
30405
30406        ret_val = xmlTextReaderGetRemainder(reader);
30407        desret_xmlParserInputBufferPtr(ret_val);
30408        call_tests++;
30409        des_xmlTextReaderPtr(n_reader, reader, 0);
30410        xmlResetLastError();
30411        if (mem_base != xmlMemBlocks()) {
30412            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30413	           xmlMemBlocks() - mem_base);
30414	    test_ret++;
30415            printf(" %d", n_reader);
30416            printf("\n");
30417        }
30418    }
30419    function_tests++;
30420#endif
30421
30422    return(test_ret);
30423}
30424
30425
30426static int
30427test_xmlTextReaderHasAttributes(void) {
30428    int test_ret = 0;
30429
30430#if defined(LIBXML_READER_ENABLED)
30431    int mem_base;
30432    int ret_val;
30433    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30434    int n_reader;
30435
30436    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30437        mem_base = xmlMemBlocks();
30438        reader = gen_xmlTextReaderPtr(n_reader, 0);
30439
30440        ret_val = xmlTextReaderHasAttributes(reader);
30441        desret_int(ret_val);
30442        call_tests++;
30443        des_xmlTextReaderPtr(n_reader, reader, 0);
30444        xmlResetLastError();
30445        if (mem_base != xmlMemBlocks()) {
30446            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
30447	           xmlMemBlocks() - mem_base);
30448	    test_ret++;
30449            printf(" %d", n_reader);
30450            printf("\n");
30451        }
30452    }
30453    function_tests++;
30454#endif
30455
30456    return(test_ret);
30457}
30458
30459
30460static int
30461test_xmlTextReaderHasValue(void) {
30462    int test_ret = 0;
30463
30464#if defined(LIBXML_READER_ENABLED)
30465    int mem_base;
30466    int ret_val;
30467    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30468    int n_reader;
30469
30470    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30471        mem_base = xmlMemBlocks();
30472        reader = gen_xmlTextReaderPtr(n_reader, 0);
30473
30474        ret_val = xmlTextReaderHasValue(reader);
30475        desret_int(ret_val);
30476        call_tests++;
30477        des_xmlTextReaderPtr(n_reader, reader, 0);
30478        xmlResetLastError();
30479        if (mem_base != xmlMemBlocks()) {
30480            printf("Leak of %d blocks found in xmlTextReaderHasValue",
30481	           xmlMemBlocks() - mem_base);
30482	    test_ret++;
30483            printf(" %d", n_reader);
30484            printf("\n");
30485        }
30486    }
30487    function_tests++;
30488#endif
30489
30490    return(test_ret);
30491}
30492
30493
30494static int
30495test_xmlTextReaderIsDefault(void) {
30496    int test_ret = 0;
30497
30498#if defined(LIBXML_READER_ENABLED)
30499    int mem_base;
30500    int ret_val;
30501    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30502    int n_reader;
30503
30504    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30505        mem_base = xmlMemBlocks();
30506        reader = gen_xmlTextReaderPtr(n_reader, 0);
30507
30508        ret_val = xmlTextReaderIsDefault(reader);
30509        desret_int(ret_val);
30510        call_tests++;
30511        des_xmlTextReaderPtr(n_reader, reader, 0);
30512        xmlResetLastError();
30513        if (mem_base != xmlMemBlocks()) {
30514            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
30515	           xmlMemBlocks() - mem_base);
30516	    test_ret++;
30517            printf(" %d", n_reader);
30518            printf("\n");
30519        }
30520    }
30521    function_tests++;
30522#endif
30523
30524    return(test_ret);
30525}
30526
30527
30528static int
30529test_xmlTextReaderIsEmptyElement(void) {
30530    int test_ret = 0;
30531
30532#if defined(LIBXML_READER_ENABLED)
30533    int mem_base;
30534    int ret_val;
30535    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30536    int n_reader;
30537
30538    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30539        mem_base = xmlMemBlocks();
30540        reader = gen_xmlTextReaderPtr(n_reader, 0);
30541
30542        ret_val = xmlTextReaderIsEmptyElement(reader);
30543        desret_int(ret_val);
30544        call_tests++;
30545        des_xmlTextReaderPtr(n_reader, reader, 0);
30546        xmlResetLastError();
30547        if (mem_base != xmlMemBlocks()) {
30548            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
30549	           xmlMemBlocks() - mem_base);
30550	    test_ret++;
30551            printf(" %d", n_reader);
30552            printf("\n");
30553        }
30554    }
30555    function_tests++;
30556#endif
30557
30558    return(test_ret);
30559}
30560
30561
30562static int
30563test_xmlTextReaderIsNamespaceDecl(void) {
30564    int test_ret = 0;
30565
30566#if defined(LIBXML_READER_ENABLED)
30567    int mem_base;
30568    int ret_val;
30569    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30570    int n_reader;
30571
30572    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30573        mem_base = xmlMemBlocks();
30574        reader = gen_xmlTextReaderPtr(n_reader, 0);
30575
30576        ret_val = xmlTextReaderIsNamespaceDecl(reader);
30577        desret_int(ret_val);
30578        call_tests++;
30579        des_xmlTextReaderPtr(n_reader, reader, 0);
30580        xmlResetLastError();
30581        if (mem_base != xmlMemBlocks()) {
30582            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
30583	           xmlMemBlocks() - mem_base);
30584	    test_ret++;
30585            printf(" %d", n_reader);
30586            printf("\n");
30587        }
30588    }
30589    function_tests++;
30590#endif
30591
30592    return(test_ret);
30593}
30594
30595
30596static int
30597test_xmlTextReaderIsValid(void) {
30598    int test_ret = 0;
30599
30600#if defined(LIBXML_READER_ENABLED)
30601    int mem_base;
30602    int ret_val;
30603    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30604    int n_reader;
30605
30606    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30607        mem_base = xmlMemBlocks();
30608        reader = gen_xmlTextReaderPtr(n_reader, 0);
30609
30610        ret_val = xmlTextReaderIsValid(reader);
30611        desret_int(ret_val);
30612        call_tests++;
30613        des_xmlTextReaderPtr(n_reader, reader, 0);
30614        xmlResetLastError();
30615        if (mem_base != xmlMemBlocks()) {
30616            printf("Leak of %d blocks found in xmlTextReaderIsValid",
30617	           xmlMemBlocks() - mem_base);
30618	    test_ret++;
30619            printf(" %d", n_reader);
30620            printf("\n");
30621        }
30622    }
30623    function_tests++;
30624#endif
30625
30626    return(test_ret);
30627}
30628
30629
30630static int
30631test_xmlTextReaderLocalName(void) {
30632    int test_ret = 0;
30633
30634#if defined(LIBXML_READER_ENABLED)
30635    int mem_base;
30636    xmlChar * ret_val;
30637    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30638    int n_reader;
30639
30640    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30641        mem_base = xmlMemBlocks();
30642        reader = gen_xmlTextReaderPtr(n_reader, 0);
30643
30644        ret_val = xmlTextReaderLocalName(reader);
30645        desret_xmlChar_ptr(ret_val);
30646        call_tests++;
30647        des_xmlTextReaderPtr(n_reader, reader, 0);
30648        xmlResetLastError();
30649        if (mem_base != xmlMemBlocks()) {
30650            printf("Leak of %d blocks found in xmlTextReaderLocalName",
30651	           xmlMemBlocks() - mem_base);
30652	    test_ret++;
30653            printf(" %d", n_reader);
30654            printf("\n");
30655        }
30656    }
30657    function_tests++;
30658#endif
30659
30660    return(test_ret);
30661}
30662
30663#ifdef LIBXML_READER_ENABLED
30664
30665#define gen_nb_xmlTextReaderLocatorPtr 1
30666static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30667    return(NULL);
30668}
30669static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30670}
30671#endif
30672
30673
30674static int
30675test_xmlTextReaderLocatorBaseURI(void) {
30676    int test_ret = 0;
30677
30678#if defined(LIBXML_READER_ENABLED)
30679    int mem_base;
30680    xmlChar * ret_val;
30681    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30682    int n_locator;
30683
30684    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30685        mem_base = xmlMemBlocks();
30686        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30687
30688        ret_val = xmlTextReaderLocatorBaseURI(locator);
30689        desret_xmlChar_ptr(ret_val);
30690        call_tests++;
30691        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30692        xmlResetLastError();
30693        if (mem_base != xmlMemBlocks()) {
30694            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
30695	           xmlMemBlocks() - mem_base);
30696	    test_ret++;
30697            printf(" %d", n_locator);
30698            printf("\n");
30699        }
30700    }
30701    function_tests++;
30702#endif
30703
30704    return(test_ret);
30705}
30706
30707
30708static int
30709test_xmlTextReaderLocatorLineNumber(void) {
30710    int test_ret = 0;
30711
30712#if defined(LIBXML_READER_ENABLED)
30713    int mem_base;
30714    int ret_val;
30715    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30716    int n_locator;
30717
30718    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30719        mem_base = xmlMemBlocks();
30720        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30721
30722        ret_val = xmlTextReaderLocatorLineNumber(locator);
30723        desret_int(ret_val);
30724        call_tests++;
30725        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30726        xmlResetLastError();
30727        if (mem_base != xmlMemBlocks()) {
30728            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
30729	           xmlMemBlocks() - mem_base);
30730	    test_ret++;
30731            printf(" %d", n_locator);
30732            printf("\n");
30733        }
30734    }
30735    function_tests++;
30736#endif
30737
30738    return(test_ret);
30739}
30740
30741
30742static int
30743test_xmlTextReaderLookupNamespace(void) {
30744    int test_ret = 0;
30745
30746#if defined(LIBXML_READER_ENABLED)
30747    int mem_base;
30748    xmlChar * ret_val;
30749    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30750    int n_reader;
30751    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
30752    int n_prefix;
30753
30754    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30755    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
30756        mem_base = xmlMemBlocks();
30757        reader = gen_xmlTextReaderPtr(n_reader, 0);
30758        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
30759
30760        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
30761        desret_xmlChar_ptr(ret_val);
30762        call_tests++;
30763        des_xmlTextReaderPtr(n_reader, reader, 0);
30764        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
30765        xmlResetLastError();
30766        if (mem_base != xmlMemBlocks()) {
30767            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
30768	           xmlMemBlocks() - mem_base);
30769	    test_ret++;
30770            printf(" %d", n_reader);
30771            printf(" %d", n_prefix);
30772            printf("\n");
30773        }
30774    }
30775    }
30776    function_tests++;
30777#endif
30778
30779    return(test_ret);
30780}
30781
30782
30783static int
30784test_xmlTextReaderMoveToAttribute(void) {
30785    int test_ret = 0;
30786
30787#if defined(LIBXML_READER_ENABLED)
30788    int mem_base;
30789    int ret_val;
30790    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30791    int n_reader;
30792    xmlChar * name; /* the qualified name of the attribute. */
30793    int n_name;
30794
30795    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30796    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30797        mem_base = xmlMemBlocks();
30798        reader = gen_xmlTextReaderPtr(n_reader, 0);
30799        name = gen_const_xmlChar_ptr(n_name, 1);
30800
30801        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
30802        desret_int(ret_val);
30803        call_tests++;
30804        des_xmlTextReaderPtr(n_reader, reader, 0);
30805        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30806        xmlResetLastError();
30807        if (mem_base != xmlMemBlocks()) {
30808            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
30809	           xmlMemBlocks() - mem_base);
30810	    test_ret++;
30811            printf(" %d", n_reader);
30812            printf(" %d", n_name);
30813            printf("\n");
30814        }
30815    }
30816    }
30817    function_tests++;
30818#endif
30819
30820    return(test_ret);
30821}
30822
30823
30824static int
30825test_xmlTextReaderMoveToAttributeNo(void) {
30826    int test_ret = 0;
30827
30828#if defined(LIBXML_READER_ENABLED)
30829    int mem_base;
30830    int ret_val;
30831    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30832    int n_reader;
30833    int no; /* the zero-based index of the attribute relative to the containing element. */
30834    int n_no;
30835
30836    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30837    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30838        mem_base = xmlMemBlocks();
30839        reader = gen_xmlTextReaderPtr(n_reader, 0);
30840        no = gen_int(n_no, 1);
30841
30842        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
30843        desret_int(ret_val);
30844        call_tests++;
30845        des_xmlTextReaderPtr(n_reader, reader, 0);
30846        des_int(n_no, no, 1);
30847        xmlResetLastError();
30848        if (mem_base != xmlMemBlocks()) {
30849            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
30850	           xmlMemBlocks() - mem_base);
30851	    test_ret++;
30852            printf(" %d", n_reader);
30853            printf(" %d", n_no);
30854            printf("\n");
30855        }
30856    }
30857    }
30858    function_tests++;
30859#endif
30860
30861    return(test_ret);
30862}
30863
30864
30865static int
30866test_xmlTextReaderMoveToAttributeNs(void) {
30867    int test_ret = 0;
30868
30869#if defined(LIBXML_READER_ENABLED)
30870    int mem_base;
30871    int ret_val;
30872    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30873    int n_reader;
30874    xmlChar * localName; /* the local name of the attribute. */
30875    int n_localName;
30876    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30877    int n_namespaceURI;
30878
30879    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30880    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30881    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30882        mem_base = xmlMemBlocks();
30883        reader = gen_xmlTextReaderPtr(n_reader, 0);
30884        localName = gen_const_xmlChar_ptr(n_localName, 1);
30885        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30886
30887        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30888        desret_int(ret_val);
30889        call_tests++;
30890        des_xmlTextReaderPtr(n_reader, reader, 0);
30891        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30892        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30893        xmlResetLastError();
30894        if (mem_base != xmlMemBlocks()) {
30895            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
30896	           xmlMemBlocks() - mem_base);
30897	    test_ret++;
30898            printf(" %d", n_reader);
30899            printf(" %d", n_localName);
30900            printf(" %d", n_namespaceURI);
30901            printf("\n");
30902        }
30903    }
30904    }
30905    }
30906    function_tests++;
30907#endif
30908
30909    return(test_ret);
30910}
30911
30912
30913static int
30914test_xmlTextReaderMoveToElement(void) {
30915    int test_ret = 0;
30916
30917#if defined(LIBXML_READER_ENABLED)
30918    int mem_base;
30919    int ret_val;
30920    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30921    int n_reader;
30922
30923    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30924        mem_base = xmlMemBlocks();
30925        reader = gen_xmlTextReaderPtr(n_reader, 0);
30926
30927        ret_val = xmlTextReaderMoveToElement(reader);
30928        desret_int(ret_val);
30929        call_tests++;
30930        des_xmlTextReaderPtr(n_reader, reader, 0);
30931        xmlResetLastError();
30932        if (mem_base != xmlMemBlocks()) {
30933            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
30934	           xmlMemBlocks() - mem_base);
30935	    test_ret++;
30936            printf(" %d", n_reader);
30937            printf("\n");
30938        }
30939    }
30940    function_tests++;
30941#endif
30942
30943    return(test_ret);
30944}
30945
30946
30947static int
30948test_xmlTextReaderMoveToFirstAttribute(void) {
30949    int test_ret = 0;
30950
30951#if defined(LIBXML_READER_ENABLED)
30952    int mem_base;
30953    int ret_val;
30954    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30955    int n_reader;
30956
30957    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30958        mem_base = xmlMemBlocks();
30959        reader = gen_xmlTextReaderPtr(n_reader, 0);
30960
30961        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
30962        desret_int(ret_val);
30963        call_tests++;
30964        des_xmlTextReaderPtr(n_reader, reader, 0);
30965        xmlResetLastError();
30966        if (mem_base != xmlMemBlocks()) {
30967            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
30968	           xmlMemBlocks() - mem_base);
30969	    test_ret++;
30970            printf(" %d", n_reader);
30971            printf("\n");
30972        }
30973    }
30974    function_tests++;
30975#endif
30976
30977    return(test_ret);
30978}
30979
30980
30981static int
30982test_xmlTextReaderMoveToNextAttribute(void) {
30983    int test_ret = 0;
30984
30985#if defined(LIBXML_READER_ENABLED)
30986    int mem_base;
30987    int ret_val;
30988    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30989    int n_reader;
30990
30991    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30992        mem_base = xmlMemBlocks();
30993        reader = gen_xmlTextReaderPtr(n_reader, 0);
30994
30995        ret_val = xmlTextReaderMoveToNextAttribute(reader);
30996        desret_int(ret_val);
30997        call_tests++;
30998        des_xmlTextReaderPtr(n_reader, reader, 0);
30999        xmlResetLastError();
31000        if (mem_base != xmlMemBlocks()) {
31001            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31002	           xmlMemBlocks() - mem_base);
31003	    test_ret++;
31004            printf(" %d", n_reader);
31005            printf("\n");
31006        }
31007    }
31008    function_tests++;
31009#endif
31010
31011    return(test_ret);
31012}
31013
31014
31015static int
31016test_xmlTextReaderName(void) {
31017    int test_ret = 0;
31018
31019#if defined(LIBXML_READER_ENABLED)
31020    int mem_base;
31021    xmlChar * ret_val;
31022    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31023    int n_reader;
31024
31025    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31026        mem_base = xmlMemBlocks();
31027        reader = gen_xmlTextReaderPtr(n_reader, 0);
31028
31029        ret_val = xmlTextReaderName(reader);
31030        desret_xmlChar_ptr(ret_val);
31031        call_tests++;
31032        des_xmlTextReaderPtr(n_reader, reader, 0);
31033        xmlResetLastError();
31034        if (mem_base != xmlMemBlocks()) {
31035            printf("Leak of %d blocks found in xmlTextReaderName",
31036	           xmlMemBlocks() - mem_base);
31037	    test_ret++;
31038            printf(" %d", n_reader);
31039            printf("\n");
31040        }
31041    }
31042    function_tests++;
31043#endif
31044
31045    return(test_ret);
31046}
31047
31048
31049static int
31050test_xmlTextReaderNamespaceUri(void) {
31051    int test_ret = 0;
31052
31053#if defined(LIBXML_READER_ENABLED)
31054    int mem_base;
31055    xmlChar * ret_val;
31056    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31057    int n_reader;
31058
31059    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31060        mem_base = xmlMemBlocks();
31061        reader = gen_xmlTextReaderPtr(n_reader, 0);
31062
31063        ret_val = xmlTextReaderNamespaceUri(reader);
31064        desret_xmlChar_ptr(ret_val);
31065        call_tests++;
31066        des_xmlTextReaderPtr(n_reader, reader, 0);
31067        xmlResetLastError();
31068        if (mem_base != xmlMemBlocks()) {
31069            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31070	           xmlMemBlocks() - mem_base);
31071	    test_ret++;
31072            printf(" %d", n_reader);
31073            printf("\n");
31074        }
31075    }
31076    function_tests++;
31077#endif
31078
31079    return(test_ret);
31080}
31081
31082
31083static int
31084test_xmlTextReaderNext(void) {
31085    int test_ret = 0;
31086
31087#if defined(LIBXML_READER_ENABLED)
31088    int mem_base;
31089    int ret_val;
31090    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31091    int n_reader;
31092
31093    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31094        mem_base = xmlMemBlocks();
31095        reader = gen_xmlTextReaderPtr(n_reader, 0);
31096
31097        ret_val = xmlTextReaderNext(reader);
31098        desret_int(ret_val);
31099        call_tests++;
31100        des_xmlTextReaderPtr(n_reader, reader, 0);
31101        xmlResetLastError();
31102        if (mem_base != xmlMemBlocks()) {
31103            printf("Leak of %d blocks found in xmlTextReaderNext",
31104	           xmlMemBlocks() - mem_base);
31105	    test_ret++;
31106            printf(" %d", n_reader);
31107            printf("\n");
31108        }
31109    }
31110    function_tests++;
31111#endif
31112
31113    return(test_ret);
31114}
31115
31116
31117static int
31118test_xmlTextReaderNextSibling(void) {
31119    int test_ret = 0;
31120
31121#if defined(LIBXML_READER_ENABLED)
31122    int mem_base;
31123    int ret_val;
31124    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31125    int n_reader;
31126
31127    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31128        mem_base = xmlMemBlocks();
31129        reader = gen_xmlTextReaderPtr(n_reader, 0);
31130
31131        ret_val = xmlTextReaderNextSibling(reader);
31132        desret_int(ret_val);
31133        call_tests++;
31134        des_xmlTextReaderPtr(n_reader, reader, 0);
31135        xmlResetLastError();
31136        if (mem_base != xmlMemBlocks()) {
31137            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31138	           xmlMemBlocks() - mem_base);
31139	    test_ret++;
31140            printf(" %d", n_reader);
31141            printf("\n");
31142        }
31143    }
31144    function_tests++;
31145#endif
31146
31147    return(test_ret);
31148}
31149
31150
31151static int
31152test_xmlTextReaderNodeType(void) {
31153    int test_ret = 0;
31154
31155#if defined(LIBXML_READER_ENABLED)
31156    int mem_base;
31157    int ret_val;
31158    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31159    int n_reader;
31160
31161    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31162        mem_base = xmlMemBlocks();
31163        reader = gen_xmlTextReaderPtr(n_reader, 0);
31164
31165        ret_val = xmlTextReaderNodeType(reader);
31166        desret_int(ret_val);
31167        call_tests++;
31168        des_xmlTextReaderPtr(n_reader, reader, 0);
31169        xmlResetLastError();
31170        if (mem_base != xmlMemBlocks()) {
31171            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31172	           xmlMemBlocks() - mem_base);
31173	    test_ret++;
31174            printf(" %d", n_reader);
31175            printf("\n");
31176        }
31177    }
31178    function_tests++;
31179#endif
31180
31181    return(test_ret);
31182}
31183
31184
31185static int
31186test_xmlTextReaderNormalization(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
31195    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31196        mem_base = xmlMemBlocks();
31197        reader = gen_xmlTextReaderPtr(n_reader, 0);
31198
31199        ret_val = xmlTextReaderNormalization(reader);
31200        desret_int(ret_val);
31201        call_tests++;
31202        des_xmlTextReaderPtr(n_reader, reader, 0);
31203        xmlResetLastError();
31204        if (mem_base != xmlMemBlocks()) {
31205            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31206	           xmlMemBlocks() - mem_base);
31207	    test_ret++;
31208            printf(" %d", n_reader);
31209            printf("\n");
31210        }
31211    }
31212    function_tests++;
31213#endif
31214
31215    return(test_ret);
31216}
31217
31218
31219static int
31220test_xmlTextReaderPrefix(void) {
31221    int test_ret = 0;
31222
31223#if defined(LIBXML_READER_ENABLED)
31224    int mem_base;
31225    xmlChar * ret_val;
31226    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31227    int n_reader;
31228
31229    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31230        mem_base = xmlMemBlocks();
31231        reader = gen_xmlTextReaderPtr(n_reader, 0);
31232
31233        ret_val = xmlTextReaderPrefix(reader);
31234        desret_xmlChar_ptr(ret_val);
31235        call_tests++;
31236        des_xmlTextReaderPtr(n_reader, reader, 0);
31237        xmlResetLastError();
31238        if (mem_base != xmlMemBlocks()) {
31239            printf("Leak of %d blocks found in xmlTextReaderPrefix",
31240	           xmlMemBlocks() - mem_base);
31241	    test_ret++;
31242            printf(" %d", n_reader);
31243            printf("\n");
31244        }
31245    }
31246    function_tests++;
31247#endif
31248
31249    return(test_ret);
31250}
31251
31252
31253static int
31254test_xmlTextReaderPreserve(void) {
31255    int test_ret = 0;
31256
31257#if defined(LIBXML_READER_ENABLED)
31258    int mem_base;
31259    xmlNodePtr ret_val;
31260    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31261    int n_reader;
31262
31263    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31264        mem_base = xmlMemBlocks();
31265        reader = gen_xmlTextReaderPtr(n_reader, 0);
31266
31267        ret_val = xmlTextReaderPreserve(reader);
31268        desret_xmlNodePtr(ret_val);
31269        call_tests++;
31270        des_xmlTextReaderPtr(n_reader, reader, 0);
31271        xmlResetLastError();
31272        if (mem_base != xmlMemBlocks()) {
31273            printf("Leak of %d blocks found in xmlTextReaderPreserve",
31274	           xmlMemBlocks() - mem_base);
31275	    test_ret++;
31276            printf(" %d", n_reader);
31277            printf("\n");
31278        }
31279    }
31280    function_tests++;
31281#endif
31282
31283    return(test_ret);
31284}
31285
31286
31287static int
31288test_xmlTextReaderPreservePattern(void) {
31289    int test_ret = 0;
31290
31291#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31292#ifdef LIBXML_PATTERN_ENABLED
31293    int mem_base;
31294    int ret_val;
31295    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31296    int n_reader;
31297    xmlChar * pattern; /* an XPath subset pattern */
31298    int n_pattern;
31299    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31300    int n_namespaces;
31301
31302    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31303    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31304    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31305        mem_base = xmlMemBlocks();
31306        reader = gen_xmlTextReaderPtr(n_reader, 0);
31307        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31308        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31309
31310        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31311        desret_int(ret_val);
31312        call_tests++;
31313        des_xmlTextReaderPtr(n_reader, reader, 0);
31314        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31315        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31316        xmlResetLastError();
31317        if (mem_base != xmlMemBlocks()) {
31318            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31319	           xmlMemBlocks() - mem_base);
31320	    test_ret++;
31321            printf(" %d", n_reader);
31322            printf(" %d", n_pattern);
31323            printf(" %d", n_namespaces);
31324            printf("\n");
31325        }
31326    }
31327    }
31328    }
31329    function_tests++;
31330#endif
31331#endif
31332
31333    return(test_ret);
31334}
31335
31336
31337static int
31338test_xmlTextReaderQuoteChar(void) {
31339    int test_ret = 0;
31340
31341#if defined(LIBXML_READER_ENABLED)
31342    int mem_base;
31343    int ret_val;
31344    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31345    int n_reader;
31346
31347    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31348        mem_base = xmlMemBlocks();
31349        reader = gen_xmlTextReaderPtr(n_reader, 0);
31350
31351        ret_val = xmlTextReaderQuoteChar(reader);
31352        desret_int(ret_val);
31353        call_tests++;
31354        des_xmlTextReaderPtr(n_reader, reader, 0);
31355        xmlResetLastError();
31356        if (mem_base != xmlMemBlocks()) {
31357            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31358	           xmlMemBlocks() - mem_base);
31359	    test_ret++;
31360            printf(" %d", n_reader);
31361            printf("\n");
31362        }
31363    }
31364    function_tests++;
31365#endif
31366
31367    return(test_ret);
31368}
31369
31370
31371static int
31372test_xmlTextReaderRead(void) {
31373    int test_ret = 0;
31374
31375#if defined(LIBXML_READER_ENABLED)
31376    int mem_base;
31377    int ret_val;
31378    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31379    int n_reader;
31380
31381    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31382        mem_base = xmlMemBlocks();
31383        reader = gen_xmlTextReaderPtr(n_reader, 0);
31384
31385        ret_val = xmlTextReaderRead(reader);
31386        desret_int(ret_val);
31387        call_tests++;
31388        des_xmlTextReaderPtr(n_reader, reader, 0);
31389        xmlResetLastError();
31390        if (mem_base != xmlMemBlocks()) {
31391            printf("Leak of %d blocks found in xmlTextReaderRead",
31392	           xmlMemBlocks() - mem_base);
31393	    test_ret++;
31394            printf(" %d", n_reader);
31395            printf("\n");
31396        }
31397    }
31398    function_tests++;
31399#endif
31400
31401    return(test_ret);
31402}
31403
31404
31405static int
31406test_xmlTextReaderReadAttributeValue(void) {
31407    int test_ret = 0;
31408
31409#if defined(LIBXML_READER_ENABLED)
31410    int mem_base;
31411    int ret_val;
31412    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31413    int n_reader;
31414
31415    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31416        mem_base = xmlMemBlocks();
31417        reader = gen_xmlTextReaderPtr(n_reader, 0);
31418
31419        ret_val = xmlTextReaderReadAttributeValue(reader);
31420        desret_int(ret_val);
31421        call_tests++;
31422        des_xmlTextReaderPtr(n_reader, reader, 0);
31423        xmlResetLastError();
31424        if (mem_base != xmlMemBlocks()) {
31425            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31426	           xmlMemBlocks() - mem_base);
31427	    test_ret++;
31428            printf(" %d", n_reader);
31429            printf("\n");
31430        }
31431    }
31432    function_tests++;
31433#endif
31434
31435    return(test_ret);
31436}
31437
31438
31439static int
31440test_xmlTextReaderReadState(void) {
31441    int test_ret = 0;
31442
31443#if defined(LIBXML_READER_ENABLED)
31444    int mem_base;
31445    int ret_val;
31446    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31447    int n_reader;
31448
31449    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31450        mem_base = xmlMemBlocks();
31451        reader = gen_xmlTextReaderPtr(n_reader, 0);
31452
31453        ret_val = xmlTextReaderReadState(reader);
31454        desret_int(ret_val);
31455        call_tests++;
31456        des_xmlTextReaderPtr(n_reader, reader, 0);
31457        xmlResetLastError();
31458        if (mem_base != xmlMemBlocks()) {
31459            printf("Leak of %d blocks found in xmlTextReaderReadState",
31460	           xmlMemBlocks() - mem_base);
31461	    test_ret++;
31462            printf(" %d", n_reader);
31463            printf("\n");
31464        }
31465    }
31466    function_tests++;
31467#endif
31468
31469    return(test_ret);
31470}
31471
31472
31473static int
31474test_xmlTextReaderRelaxNGSetSchema(void) {
31475    int test_ret = 0;
31476
31477#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31478    int mem_base;
31479    int ret_val;
31480    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31481    int n_reader;
31482    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
31483    int n_schema;
31484
31485    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31486    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
31487        mem_base = xmlMemBlocks();
31488        reader = gen_xmlTextReaderPtr(n_reader, 0);
31489        schema = gen_xmlRelaxNGPtr(n_schema, 1);
31490
31491        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
31492        desret_int(ret_val);
31493        call_tests++;
31494        des_xmlTextReaderPtr(n_reader, reader, 0);
31495        des_xmlRelaxNGPtr(n_schema, schema, 1);
31496        xmlResetLastError();
31497        if (mem_base != xmlMemBlocks()) {
31498            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
31499	           xmlMemBlocks() - mem_base);
31500	    test_ret++;
31501            printf(" %d", n_reader);
31502            printf(" %d", n_schema);
31503            printf("\n");
31504        }
31505    }
31506    }
31507    function_tests++;
31508#endif
31509
31510    return(test_ret);
31511}
31512
31513
31514static int
31515test_xmlTextReaderRelaxNGValidate(void) {
31516    int test_ret = 0;
31517
31518#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31519    int mem_base;
31520    int ret_val;
31521    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31522    int n_reader;
31523    char * rng; /* the path to a RelaxNG schema or NULL */
31524    int n_rng;
31525
31526    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31527    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
31528        mem_base = xmlMemBlocks();
31529        reader = gen_xmlTextReaderPtr(n_reader, 0);
31530        rng = gen_const_char_ptr(n_rng, 1);
31531
31532        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
31533        desret_int(ret_val);
31534        call_tests++;
31535        des_xmlTextReaderPtr(n_reader, reader, 0);
31536        des_const_char_ptr(n_rng, (const char *)rng, 1);
31537        xmlResetLastError();
31538        if (mem_base != xmlMemBlocks()) {
31539            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
31540	           xmlMemBlocks() - mem_base);
31541	    test_ret++;
31542            printf(" %d", n_reader);
31543            printf(" %d", n_rng);
31544            printf("\n");
31545        }
31546    }
31547    }
31548    function_tests++;
31549#endif
31550
31551    return(test_ret);
31552}
31553
31554
31555static int
31556test_xmlTextReaderSchemaValidate(void) {
31557    int test_ret = 0;
31558
31559#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31560    int ret_val;
31561    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31562    int n_reader;
31563    char * xsd; /* the path to a W3C XSD schema or NULL */
31564    int n_xsd;
31565
31566    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31567    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
31568        reader = gen_xmlTextReaderPtr(n_reader, 0);
31569        xsd = gen_const_char_ptr(n_xsd, 1);
31570
31571        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
31572        desret_int(ret_val);
31573        call_tests++;
31574        des_xmlTextReaderPtr(n_reader, reader, 0);
31575        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
31576        xmlResetLastError();
31577    }
31578    }
31579    function_tests++;
31580#endif
31581
31582    return(test_ret);
31583}
31584
31585
31586static int
31587test_xmlTextReaderSetErrorHandler(void) {
31588    int test_ret = 0;
31589
31590
31591    /* missing type support */
31592    return(test_ret);
31593}
31594
31595
31596static int
31597test_xmlTextReaderSetParserProp(void) {
31598    int test_ret = 0;
31599
31600#if defined(LIBXML_READER_ENABLED)
31601    int mem_base;
31602    int ret_val;
31603    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31604    int n_reader;
31605    int prop; /* the xmlParserProperties to set */
31606    int n_prop;
31607    int value; /* usually 0 or 1 to (de)activate it */
31608    int n_value;
31609
31610    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31611    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31612    for (n_value = 0;n_value < gen_nb_int;n_value++) {
31613        mem_base = xmlMemBlocks();
31614        reader = gen_xmlTextReaderPtr(n_reader, 0);
31615        prop = gen_int(n_prop, 1);
31616        value = gen_int(n_value, 2);
31617
31618        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
31619        desret_int(ret_val);
31620        call_tests++;
31621        des_xmlTextReaderPtr(n_reader, reader, 0);
31622        des_int(n_prop, prop, 1);
31623        des_int(n_value, value, 2);
31624        xmlResetLastError();
31625        if (mem_base != xmlMemBlocks()) {
31626            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
31627	           xmlMemBlocks() - mem_base);
31628	    test_ret++;
31629            printf(" %d", n_reader);
31630            printf(" %d", n_prop);
31631            printf(" %d", n_value);
31632            printf("\n");
31633        }
31634    }
31635    }
31636    }
31637    function_tests++;
31638#endif
31639
31640    return(test_ret);
31641}
31642
31643#ifdef LIBXML_READER_ENABLED
31644
31645#define gen_nb_xmlSchemaPtr 1
31646static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31647    return(NULL);
31648}
31649static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31650}
31651#endif
31652
31653
31654static int
31655test_xmlTextReaderSetSchema(void) {
31656    int test_ret = 0;
31657
31658#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31659    int mem_base;
31660    int ret_val;
31661    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31662    int n_reader;
31663    xmlSchemaPtr schema; /* a precompiled Schema schema */
31664    int n_schema;
31665
31666    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31667    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
31668        mem_base = xmlMemBlocks();
31669        reader = gen_xmlTextReaderPtr(n_reader, 0);
31670        schema = gen_xmlSchemaPtr(n_schema, 1);
31671
31672        ret_val = xmlTextReaderSetSchema(reader, schema);
31673        desret_int(ret_val);
31674        call_tests++;
31675        des_xmlTextReaderPtr(n_reader, reader, 0);
31676        des_xmlSchemaPtr(n_schema, schema, 1);
31677        xmlResetLastError();
31678        if (mem_base != xmlMemBlocks()) {
31679            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
31680	           xmlMemBlocks() - mem_base);
31681	    test_ret++;
31682            printf(" %d", n_reader);
31683            printf(" %d", n_schema);
31684            printf("\n");
31685        }
31686    }
31687    }
31688    function_tests++;
31689#endif
31690
31691    return(test_ret);
31692}
31693
31694
31695static int
31696test_xmlTextReaderSetStructuredErrorHandler(void) {
31697    int test_ret = 0;
31698
31699
31700    /* missing type support */
31701    return(test_ret);
31702}
31703
31704
31705static int
31706test_xmlTextReaderStandalone(void) {
31707    int test_ret = 0;
31708
31709#if defined(LIBXML_READER_ENABLED)
31710    int mem_base;
31711    int ret_val;
31712    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31713    int n_reader;
31714
31715    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31716        mem_base = xmlMemBlocks();
31717        reader = gen_xmlTextReaderPtr(n_reader, 0);
31718
31719        ret_val = xmlTextReaderStandalone(reader);
31720        desret_int(ret_val);
31721        call_tests++;
31722        des_xmlTextReaderPtr(n_reader, reader, 0);
31723        xmlResetLastError();
31724        if (mem_base != xmlMemBlocks()) {
31725            printf("Leak of %d blocks found in xmlTextReaderStandalone",
31726	           xmlMemBlocks() - mem_base);
31727	    test_ret++;
31728            printf(" %d", n_reader);
31729            printf("\n");
31730        }
31731    }
31732    function_tests++;
31733#endif
31734
31735    return(test_ret);
31736}
31737
31738
31739static int
31740test_xmlTextReaderValue(void) {
31741    int test_ret = 0;
31742
31743#if defined(LIBXML_READER_ENABLED)
31744    int mem_base;
31745    xmlChar * ret_val;
31746    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31747    int n_reader;
31748
31749    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31750        mem_base = xmlMemBlocks();
31751        reader = gen_xmlTextReaderPtr(n_reader, 0);
31752
31753        ret_val = xmlTextReaderValue(reader);
31754        desret_xmlChar_ptr(ret_val);
31755        call_tests++;
31756        des_xmlTextReaderPtr(n_reader, reader, 0);
31757        xmlResetLastError();
31758        if (mem_base != xmlMemBlocks()) {
31759            printf("Leak of %d blocks found in xmlTextReaderValue",
31760	           xmlMemBlocks() - mem_base);
31761	    test_ret++;
31762            printf(" %d", n_reader);
31763            printf("\n");
31764        }
31765    }
31766    function_tests++;
31767#endif
31768
31769    return(test_ret);
31770}
31771
31772
31773static int
31774test_xmlTextReaderXmlLang(void) {
31775    int test_ret = 0;
31776
31777#if defined(LIBXML_READER_ENABLED)
31778    int mem_base;
31779    xmlChar * ret_val;
31780    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31781    int n_reader;
31782
31783    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31784        mem_base = xmlMemBlocks();
31785        reader = gen_xmlTextReaderPtr(n_reader, 0);
31786
31787        ret_val = xmlTextReaderXmlLang(reader);
31788        desret_xmlChar_ptr(ret_val);
31789        call_tests++;
31790        des_xmlTextReaderPtr(n_reader, reader, 0);
31791        xmlResetLastError();
31792        if (mem_base != xmlMemBlocks()) {
31793            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
31794	           xmlMemBlocks() - mem_base);
31795	    test_ret++;
31796            printf(" %d", n_reader);
31797            printf("\n");
31798        }
31799    }
31800    function_tests++;
31801#endif
31802
31803    return(test_ret);
31804}
31805
31806static int
31807test_xmlreader(void) {
31808    int test_ret = 0;
31809
31810    if (quiet == 0) printf("Testing xmlreader : 73 of 83 functions ...\n");
31811    test_ret += test_xmlNewTextReader();
31812    test_ret += test_xmlNewTextReaderFilename();
31813    test_ret += test_xmlReaderForDoc();
31814    test_ret += test_xmlReaderForFile();
31815    test_ret += test_xmlReaderForMemory();
31816    test_ret += test_xmlReaderNewDoc();
31817    test_ret += test_xmlReaderNewFile();
31818    test_ret += test_xmlReaderNewMemory();
31819    test_ret += test_xmlReaderNewWalker();
31820    test_ret += test_xmlReaderWalker();
31821    test_ret += test_xmlTextReaderAttributeCount();
31822    test_ret += test_xmlTextReaderBaseUri();
31823    test_ret += test_xmlTextReaderByteConsumed();
31824    test_ret += test_xmlTextReaderClose();
31825    test_ret += test_xmlTextReaderConstBaseUri();
31826    test_ret += test_xmlTextReaderConstEncoding();
31827    test_ret += test_xmlTextReaderConstLocalName();
31828    test_ret += test_xmlTextReaderConstName();
31829    test_ret += test_xmlTextReaderConstNamespaceUri();
31830    test_ret += test_xmlTextReaderConstPrefix();
31831    test_ret += test_xmlTextReaderConstString();
31832    test_ret += test_xmlTextReaderConstValue();
31833    test_ret += test_xmlTextReaderConstXmlLang();
31834    test_ret += test_xmlTextReaderConstXmlVersion();
31835    test_ret += test_xmlTextReaderCurrentDoc();
31836    test_ret += test_xmlTextReaderCurrentNode();
31837    test_ret += test_xmlTextReaderDepth();
31838    test_ret += test_xmlTextReaderExpand();
31839    test_ret += test_xmlTextReaderGetAttribute();
31840    test_ret += test_xmlTextReaderGetAttributeNo();
31841    test_ret += test_xmlTextReaderGetAttributeNs();
31842    test_ret += test_xmlTextReaderGetErrorHandler();
31843    test_ret += test_xmlTextReaderGetParserColumnNumber();
31844    test_ret += test_xmlTextReaderGetParserLineNumber();
31845    test_ret += test_xmlTextReaderGetParserProp();
31846    test_ret += test_xmlTextReaderGetRemainder();
31847    test_ret += test_xmlTextReaderHasAttributes();
31848    test_ret += test_xmlTextReaderHasValue();
31849    test_ret += test_xmlTextReaderIsDefault();
31850    test_ret += test_xmlTextReaderIsEmptyElement();
31851    test_ret += test_xmlTextReaderIsNamespaceDecl();
31852    test_ret += test_xmlTextReaderIsValid();
31853    test_ret += test_xmlTextReaderLocalName();
31854    test_ret += test_xmlTextReaderLocatorBaseURI();
31855    test_ret += test_xmlTextReaderLocatorLineNumber();
31856    test_ret += test_xmlTextReaderLookupNamespace();
31857    test_ret += test_xmlTextReaderMoveToAttribute();
31858    test_ret += test_xmlTextReaderMoveToAttributeNo();
31859    test_ret += test_xmlTextReaderMoveToAttributeNs();
31860    test_ret += test_xmlTextReaderMoveToElement();
31861    test_ret += test_xmlTextReaderMoveToFirstAttribute();
31862    test_ret += test_xmlTextReaderMoveToNextAttribute();
31863    test_ret += test_xmlTextReaderName();
31864    test_ret += test_xmlTextReaderNamespaceUri();
31865    test_ret += test_xmlTextReaderNext();
31866    test_ret += test_xmlTextReaderNextSibling();
31867    test_ret += test_xmlTextReaderNodeType();
31868    test_ret += test_xmlTextReaderNormalization();
31869    test_ret += test_xmlTextReaderPrefix();
31870    test_ret += test_xmlTextReaderPreserve();
31871    test_ret += test_xmlTextReaderPreservePattern();
31872    test_ret += test_xmlTextReaderQuoteChar();
31873    test_ret += test_xmlTextReaderRead();
31874    test_ret += test_xmlTextReaderReadAttributeValue();
31875    test_ret += test_xmlTextReaderReadState();
31876    test_ret += test_xmlTextReaderRelaxNGSetSchema();
31877    test_ret += test_xmlTextReaderRelaxNGValidate();
31878    test_ret += test_xmlTextReaderSchemaValidate();
31879    test_ret += test_xmlTextReaderSetErrorHandler();
31880    test_ret += test_xmlTextReaderSetParserProp();
31881    test_ret += test_xmlTextReaderSetSchema();
31882    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
31883    test_ret += test_xmlTextReaderStandalone();
31884    test_ret += test_xmlTextReaderValue();
31885    test_ret += test_xmlTextReaderXmlLang();
31886
31887    if (test_ret != 0)
31888	printf("Module xmlreader: %d errors\n", test_ret);
31889    return(test_ret);
31890}
31891#ifdef LIBXML_REGEXP_ENABLED
31892
31893#define gen_nb_xmlExpCtxtPtr 1
31894static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31895    return(NULL);
31896}
31897static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31898}
31899#endif
31900
31901
31902static int
31903test_xmlExpCtxtNbCons(void) {
31904    int test_ret = 0;
31905
31906#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
31907    int mem_base;
31908    int ret_val;
31909    xmlExpCtxtPtr ctxt; /* an expression context */
31910    int n_ctxt;
31911
31912    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
31913        mem_base = xmlMemBlocks();
31914        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
31915
31916        ret_val = xmlExpCtxtNbCons(ctxt);
31917        desret_int(ret_val);
31918        call_tests++;
31919        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
31920        xmlResetLastError();
31921        if (mem_base != xmlMemBlocks()) {
31922            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
31923	           xmlMemBlocks() - mem_base);
31924	    test_ret++;
31925            printf(" %d", n_ctxt);
31926            printf("\n");
31927        }
31928    }
31929    function_tests++;
31930#endif
31931
31932    return(test_ret);
31933}
31934
31935
31936static int
31937test_xmlExpCtxtNbNodes(void) {
31938    int test_ret = 0;
31939
31940#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
31941    int mem_base;
31942    int ret_val;
31943    xmlExpCtxtPtr ctxt; /* an expression context */
31944    int n_ctxt;
31945
31946    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
31947        mem_base = xmlMemBlocks();
31948        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
31949
31950        ret_val = xmlExpCtxtNbNodes(ctxt);
31951        desret_int(ret_val);
31952        call_tests++;
31953        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
31954        xmlResetLastError();
31955        if (mem_base != xmlMemBlocks()) {
31956            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
31957	           xmlMemBlocks() - mem_base);
31958	    test_ret++;
31959            printf(" %d", n_ctxt);
31960            printf("\n");
31961        }
31962    }
31963    function_tests++;
31964#endif
31965
31966    return(test_ret);
31967}
31968
31969#ifdef LIBXML_REGEXP_ENABLED
31970
31971#define gen_nb_xmlExpNodePtr 1
31972static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31973    return(NULL);
31974}
31975static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31976}
31977#endif
31978
31979
31980static int
31981test_xmlExpDump(void) {
31982    int test_ret = 0;
31983
31984#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
31985    int mem_base;
31986    xmlBufferPtr buf; /* a buffer to receive the output */
31987    int n_buf;
31988    xmlExpNodePtr expr; /* the compiled expression */
31989    int n_expr;
31990
31991    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
31992    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
31993        mem_base = xmlMemBlocks();
31994        buf = gen_xmlBufferPtr(n_buf, 0);
31995        expr = gen_xmlExpNodePtr(n_expr, 1);
31996
31997        xmlExpDump(buf, expr);
31998        call_tests++;
31999        des_xmlBufferPtr(n_buf, buf, 0);
32000        des_xmlExpNodePtr(n_expr, expr, 1);
32001        xmlResetLastError();
32002        if (mem_base != xmlMemBlocks()) {
32003            printf("Leak of %d blocks found in xmlExpDump",
32004	           xmlMemBlocks() - mem_base);
32005	    test_ret++;
32006            printf(" %d", n_buf);
32007            printf(" %d", n_expr);
32008            printf("\n");
32009        }
32010    }
32011    }
32012    function_tests++;
32013#endif
32014
32015    return(test_ret);
32016}
32017
32018
32019static int
32020test_xmlExpExpDerive(void) {
32021    int test_ret = 0;
32022
32023
32024    /* missing type support */
32025    return(test_ret);
32026}
32027
32028
32029static int
32030test_xmlExpGetLanguage(void) {
32031    int test_ret = 0;
32032
32033#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32034    int mem_base;
32035    int ret_val;
32036    xmlExpCtxtPtr ctxt; /* the expression context */
32037    int n_ctxt;
32038    xmlExpNodePtr exp; /* the expression */
32039    int n_exp;
32040    xmlChar ** list; /* where to store the tokens */
32041    int n_list;
32042    int len; /* the allocated lenght of @list */
32043    int n_len;
32044
32045    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32046    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32047    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
32048    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32049        mem_base = xmlMemBlocks();
32050        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32051        exp = gen_xmlExpNodePtr(n_exp, 1);
32052        list = gen_const_xmlChar_ptr_ptr(n_list, 2);
32053        len = gen_int(n_len, 3);
32054
32055        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)list, len);
32056        desret_int(ret_val);
32057        call_tests++;
32058        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32059        des_xmlExpNodePtr(n_exp, exp, 1);
32060        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2);
32061        des_int(n_len, len, 3);
32062        xmlResetLastError();
32063        if (mem_base != xmlMemBlocks()) {
32064            printf("Leak of %d blocks found in xmlExpGetLanguage",
32065	           xmlMemBlocks() - mem_base);
32066	    test_ret++;
32067            printf(" %d", n_ctxt);
32068            printf(" %d", n_exp);
32069            printf(" %d", n_list);
32070            printf(" %d", n_len);
32071            printf("\n");
32072        }
32073    }
32074    }
32075    }
32076    }
32077    function_tests++;
32078#endif
32079
32080    return(test_ret);
32081}
32082
32083
32084static int
32085test_xmlExpGetStart(void) {
32086    int test_ret = 0;
32087
32088#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32089    int mem_base;
32090    int ret_val;
32091    xmlExpCtxtPtr ctxt; /* the expression context */
32092    int n_ctxt;
32093    xmlExpNodePtr exp; /* the expression */
32094    int n_exp;
32095    xmlChar ** list; /* where to store the tokens */
32096    int n_list;
32097    int len; /* the allocated lenght of @list */
32098    int n_len;
32099
32100    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32101    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32102    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
32103    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32104        mem_base = xmlMemBlocks();
32105        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32106        exp = gen_xmlExpNodePtr(n_exp, 1);
32107        list = gen_const_xmlChar_ptr_ptr(n_list, 2);
32108        len = gen_int(n_len, 3);
32109
32110        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)list, len);
32111        desret_int(ret_val);
32112        call_tests++;
32113        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32114        des_xmlExpNodePtr(n_exp, exp, 1);
32115        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2);
32116        des_int(n_len, len, 3);
32117        xmlResetLastError();
32118        if (mem_base != xmlMemBlocks()) {
32119            printf("Leak of %d blocks found in xmlExpGetStart",
32120	           xmlMemBlocks() - mem_base);
32121	    test_ret++;
32122            printf(" %d", n_ctxt);
32123            printf(" %d", n_exp);
32124            printf(" %d", n_list);
32125            printf(" %d", n_len);
32126            printf("\n");
32127        }
32128    }
32129    }
32130    }
32131    }
32132    function_tests++;
32133#endif
32134
32135    return(test_ret);
32136}
32137
32138
32139static int
32140test_xmlExpIsNillable(void) {
32141    int test_ret = 0;
32142
32143#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32144    int mem_base;
32145    int ret_val;
32146    xmlExpNodePtr exp; /* the expression */
32147    int n_exp;
32148
32149    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32150        mem_base = xmlMemBlocks();
32151        exp = gen_xmlExpNodePtr(n_exp, 0);
32152
32153        ret_val = xmlExpIsNillable(exp);
32154        desret_int(ret_val);
32155        call_tests++;
32156        des_xmlExpNodePtr(n_exp, exp, 0);
32157        xmlResetLastError();
32158        if (mem_base != xmlMemBlocks()) {
32159            printf("Leak of %d blocks found in xmlExpIsNillable",
32160	           xmlMemBlocks() - mem_base);
32161	    test_ret++;
32162            printf(" %d", n_exp);
32163            printf("\n");
32164        }
32165    }
32166    function_tests++;
32167#endif
32168
32169    return(test_ret);
32170}
32171
32172
32173static int
32174test_xmlExpMaxToken(void) {
32175    int test_ret = 0;
32176
32177#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32178    int mem_base;
32179    int ret_val;
32180    xmlExpNodePtr expr; /* a compiled expression */
32181    int n_expr;
32182
32183    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32184        mem_base = xmlMemBlocks();
32185        expr = gen_xmlExpNodePtr(n_expr, 0);
32186
32187        ret_val = xmlExpMaxToken(expr);
32188        desret_int(ret_val);
32189        call_tests++;
32190        des_xmlExpNodePtr(n_expr, expr, 0);
32191        xmlResetLastError();
32192        if (mem_base != xmlMemBlocks()) {
32193            printf("Leak of %d blocks found in xmlExpMaxToken",
32194	           xmlMemBlocks() - mem_base);
32195	    test_ret++;
32196            printf(" %d", n_expr);
32197            printf("\n");
32198        }
32199    }
32200    function_tests++;
32201#endif
32202
32203    return(test_ret);
32204}
32205
32206
32207static int
32208test_xmlExpNewAtom(void) {
32209    int test_ret = 0;
32210
32211
32212    /* missing type support */
32213    return(test_ret);
32214}
32215
32216
32217static int
32218test_xmlExpNewCtxt(void) {
32219    int test_ret = 0;
32220
32221
32222    /* missing type support */
32223    return(test_ret);
32224}
32225
32226
32227static int
32228test_xmlExpNewOr(void) {
32229    int test_ret = 0;
32230
32231
32232    /* missing type support */
32233    return(test_ret);
32234}
32235
32236
32237static int
32238test_xmlExpNewRange(void) {
32239    int test_ret = 0;
32240
32241
32242    /* missing type support */
32243    return(test_ret);
32244}
32245
32246
32247static int
32248test_xmlExpNewSeq(void) {
32249    int test_ret = 0;
32250
32251
32252    /* missing type support */
32253    return(test_ret);
32254}
32255
32256
32257static int
32258test_xmlExpParse(void) {
32259    int test_ret = 0;
32260
32261
32262    /* missing type support */
32263    return(test_ret);
32264}
32265
32266
32267static int
32268test_xmlExpRef(void) {
32269    int test_ret = 0;
32270
32271#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32272    int mem_base;
32273    xmlExpNodePtr exp; /* the expression */
32274    int n_exp;
32275
32276    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32277        mem_base = xmlMemBlocks();
32278        exp = gen_xmlExpNodePtr(n_exp, 0);
32279
32280        xmlExpRef(exp);
32281        call_tests++;
32282        des_xmlExpNodePtr(n_exp, exp, 0);
32283        xmlResetLastError();
32284        if (mem_base != xmlMemBlocks()) {
32285            printf("Leak of %d blocks found in xmlExpRef",
32286	           xmlMemBlocks() - mem_base);
32287	    test_ret++;
32288            printf(" %d", n_exp);
32289            printf("\n");
32290        }
32291    }
32292    function_tests++;
32293#endif
32294
32295    return(test_ret);
32296}
32297
32298
32299static int
32300test_xmlExpStringDerive(void) {
32301    int test_ret = 0;
32302
32303
32304    /* missing type support */
32305    return(test_ret);
32306}
32307
32308
32309static int
32310test_xmlExpSubsume(void) {
32311    int test_ret = 0;
32312
32313#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32314    int mem_base;
32315    int ret_val;
32316    xmlExpCtxtPtr ctxt; /* the expressions context */
32317    int n_ctxt;
32318    xmlExpNodePtr exp; /* the englobing expression */
32319    int n_exp;
32320    xmlExpNodePtr sub; /* the subexpression */
32321    int n_sub;
32322
32323    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32324    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32325    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32326        mem_base = xmlMemBlocks();
32327        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32328        exp = gen_xmlExpNodePtr(n_exp, 1);
32329        sub = gen_xmlExpNodePtr(n_sub, 2);
32330
32331        ret_val = xmlExpSubsume(ctxt, exp, sub);
32332        desret_int(ret_val);
32333        call_tests++;
32334        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32335        des_xmlExpNodePtr(n_exp, exp, 1);
32336        des_xmlExpNodePtr(n_sub, sub, 2);
32337        xmlResetLastError();
32338        if (mem_base != xmlMemBlocks()) {
32339            printf("Leak of %d blocks found in xmlExpSubsume",
32340	           xmlMemBlocks() - mem_base);
32341	    test_ret++;
32342            printf(" %d", n_ctxt);
32343            printf(" %d", n_exp);
32344            printf(" %d", n_sub);
32345            printf("\n");
32346        }
32347    }
32348    }
32349    }
32350    function_tests++;
32351#endif
32352
32353    return(test_ret);
32354}
32355
32356#ifdef LIBXML_REGEXP_ENABLED
32357
32358#define gen_nb_xmlRegExecCtxtPtr 1
32359static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32360    return(NULL);
32361}
32362static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32363}
32364#endif
32365
32366
32367static int
32368test_xmlRegExecErrInfo(void) {
32369    int test_ret = 0;
32370
32371#if defined(LIBXML_REGEXP_ENABLED)
32372    int mem_base;
32373    int ret_val;
32374    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
32375    int n_exec;
32376    xmlChar ** string; /* return value for the error string */
32377    int n_string;
32378    int * nbval; /* pointer to the number of accepted values IN/OUT */
32379    int n_nbval;
32380    int * nbneg; /* return number of negative transitions */
32381    int n_nbneg;
32382    xmlChar ** values; /* pointer to the array of acceptable values */
32383    int n_values;
32384    int * terminal; /* return value if this was a terminal state */
32385    int n_terminal;
32386
32387    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32388    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
32389    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
32390    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
32391    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
32392    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
32393        mem_base = xmlMemBlocks();
32394        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32395        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
32396        nbval = gen_int_ptr(n_nbval, 2);
32397        nbneg = gen_int_ptr(n_nbneg, 3);
32398        values = gen_xmlChar_ptr_ptr(n_values, 4);
32399        terminal = gen_int_ptr(n_terminal, 5);
32400
32401        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
32402        desret_int(ret_val);
32403        call_tests++;
32404        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32405        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
32406        des_int_ptr(n_nbval, nbval, 2);
32407        des_int_ptr(n_nbneg, nbneg, 3);
32408        des_xmlChar_ptr_ptr(n_values, values, 4);
32409        des_int_ptr(n_terminal, terminal, 5);
32410        xmlResetLastError();
32411        if (mem_base != xmlMemBlocks()) {
32412            printf("Leak of %d blocks found in xmlRegExecErrInfo",
32413	           xmlMemBlocks() - mem_base);
32414	    test_ret++;
32415            printf(" %d", n_exec);
32416            printf(" %d", n_string);
32417            printf(" %d", n_nbval);
32418            printf(" %d", n_nbneg);
32419            printf(" %d", n_values);
32420            printf(" %d", n_terminal);
32421            printf("\n");
32422        }
32423    }
32424    }
32425    }
32426    }
32427    }
32428    }
32429    function_tests++;
32430#endif
32431
32432    return(test_ret);
32433}
32434
32435
32436static int
32437test_xmlRegExecNextValues(void) {
32438    int test_ret = 0;
32439
32440#if defined(LIBXML_REGEXP_ENABLED)
32441    int mem_base;
32442    int ret_val;
32443    xmlRegExecCtxtPtr exec; /* a regexp execution context */
32444    int n_exec;
32445    int * nbval; /* pointer to the number of accepted values IN/OUT */
32446    int n_nbval;
32447    int * nbneg; /* return number of negative transitions */
32448    int n_nbneg;
32449    xmlChar ** values; /* pointer to the array of acceptable values */
32450    int n_values;
32451    int * terminal; /* return value if this was a terminal state */
32452    int n_terminal;
32453
32454    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32455    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
32456    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
32457    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
32458    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
32459        mem_base = xmlMemBlocks();
32460        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32461        nbval = gen_int_ptr(n_nbval, 1);
32462        nbneg = gen_int_ptr(n_nbneg, 2);
32463        values = gen_xmlChar_ptr_ptr(n_values, 3);
32464        terminal = gen_int_ptr(n_terminal, 4);
32465
32466        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
32467        desret_int(ret_val);
32468        call_tests++;
32469        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32470        des_int_ptr(n_nbval, nbval, 1);
32471        des_int_ptr(n_nbneg, nbneg, 2);
32472        des_xmlChar_ptr_ptr(n_values, values, 3);
32473        des_int_ptr(n_terminal, terminal, 4);
32474        xmlResetLastError();
32475        if (mem_base != xmlMemBlocks()) {
32476            printf("Leak of %d blocks found in xmlRegExecNextValues",
32477	           xmlMemBlocks() - mem_base);
32478	    test_ret++;
32479            printf(" %d", n_exec);
32480            printf(" %d", n_nbval);
32481            printf(" %d", n_nbneg);
32482            printf(" %d", n_values);
32483            printf(" %d", n_terminal);
32484            printf("\n");
32485        }
32486    }
32487    }
32488    }
32489    }
32490    }
32491    function_tests++;
32492#endif
32493
32494    return(test_ret);
32495}
32496
32497
32498static int
32499test_xmlRegExecPushString(void) {
32500    int test_ret = 0;
32501
32502#if defined(LIBXML_REGEXP_ENABLED)
32503    int mem_base;
32504    int ret_val;
32505    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
32506    int n_exec;
32507    xmlChar * value; /* a string token input */
32508    int n_value;
32509    void * data; /* data associated to the token to reuse in callbacks */
32510    int n_data;
32511
32512    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32513    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32514    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
32515        mem_base = xmlMemBlocks();
32516        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32517        value = gen_const_xmlChar_ptr(n_value, 1);
32518        data = gen_userdata(n_data, 2);
32519
32520        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
32521        desret_int(ret_val);
32522        call_tests++;
32523        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32524        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32525        des_userdata(n_data, data, 2);
32526        xmlResetLastError();
32527        if (mem_base != xmlMemBlocks()) {
32528            printf("Leak of %d blocks found in xmlRegExecPushString",
32529	           xmlMemBlocks() - mem_base);
32530	    test_ret++;
32531            printf(" %d", n_exec);
32532            printf(" %d", n_value);
32533            printf(" %d", n_data);
32534            printf("\n");
32535        }
32536    }
32537    }
32538    }
32539    function_tests++;
32540#endif
32541
32542    return(test_ret);
32543}
32544
32545
32546static int
32547test_xmlRegExecPushString2(void) {
32548    int test_ret = 0;
32549
32550#if defined(LIBXML_REGEXP_ENABLED)
32551    int mem_base;
32552    int ret_val;
32553    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
32554    int n_exec;
32555    xmlChar * value; /* the first string token input */
32556    int n_value;
32557    xmlChar * value2; /* the second string token input */
32558    int n_value2;
32559    void * data; /* data associated to the token to reuse in callbacks */
32560    int n_data;
32561
32562    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32563    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32564    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
32565    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
32566        mem_base = xmlMemBlocks();
32567        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32568        value = gen_const_xmlChar_ptr(n_value, 1);
32569        value2 = gen_const_xmlChar_ptr(n_value2, 2);
32570        data = gen_userdata(n_data, 3);
32571
32572        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
32573        desret_int(ret_val);
32574        call_tests++;
32575        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32576        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32577        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
32578        des_userdata(n_data, data, 3);
32579        xmlResetLastError();
32580        if (mem_base != xmlMemBlocks()) {
32581            printf("Leak of %d blocks found in xmlRegExecPushString2",
32582	           xmlMemBlocks() - mem_base);
32583	    test_ret++;
32584            printf(" %d", n_exec);
32585            printf(" %d", n_value);
32586            printf(" %d", n_value2);
32587            printf(" %d", n_data);
32588            printf("\n");
32589        }
32590    }
32591    }
32592    }
32593    }
32594    function_tests++;
32595#endif
32596
32597    return(test_ret);
32598}
32599
32600#ifdef LIBXML_REGEXP_ENABLED
32601
32602#define gen_nb_xmlRegexpPtr 1
32603static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32604    return(NULL);
32605}
32606static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32607}
32608#endif
32609
32610
32611static int
32612test_xmlRegNewExecCtxt(void) {
32613    int test_ret = 0;
32614
32615
32616    /* missing type support */
32617    return(test_ret);
32618}
32619
32620
32621static int
32622test_xmlRegexpCompile(void) {
32623    int test_ret = 0;
32624
32625
32626    /* missing type support */
32627    return(test_ret);
32628}
32629
32630
32631static int
32632test_xmlRegexpExec(void) {
32633    int test_ret = 0;
32634
32635#if defined(LIBXML_REGEXP_ENABLED)
32636    int mem_base;
32637    int ret_val;
32638    xmlRegexpPtr comp; /* the compiled regular expression */
32639    int n_comp;
32640    xmlChar * content; /* the value to check against the regular expression */
32641    int n_content;
32642
32643    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
32644    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
32645        mem_base = xmlMemBlocks();
32646        comp = gen_xmlRegexpPtr(n_comp, 0);
32647        content = gen_const_xmlChar_ptr(n_content, 1);
32648
32649        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
32650        desret_int(ret_val);
32651        call_tests++;
32652        des_xmlRegexpPtr(n_comp, comp, 0);
32653        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
32654        xmlResetLastError();
32655        if (mem_base != xmlMemBlocks()) {
32656            printf("Leak of %d blocks found in xmlRegexpExec",
32657	           xmlMemBlocks() - mem_base);
32658	    test_ret++;
32659            printf(" %d", n_comp);
32660            printf(" %d", n_content);
32661            printf("\n");
32662        }
32663    }
32664    }
32665    function_tests++;
32666#endif
32667
32668    return(test_ret);
32669}
32670
32671
32672static int
32673test_xmlRegexpIsDeterminist(void) {
32674    int test_ret = 0;
32675
32676#if defined(LIBXML_REGEXP_ENABLED)
32677    int mem_base;
32678    int ret_val;
32679    xmlRegexpPtr comp; /* the compiled regular expression */
32680    int n_comp;
32681
32682    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
32683        mem_base = xmlMemBlocks();
32684        comp = gen_xmlRegexpPtr(n_comp, 0);
32685
32686        ret_val = xmlRegexpIsDeterminist(comp);
32687        desret_int(ret_val);
32688        call_tests++;
32689        des_xmlRegexpPtr(n_comp, comp, 0);
32690        xmlResetLastError();
32691        if (mem_base != xmlMemBlocks()) {
32692            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
32693	           xmlMemBlocks() - mem_base);
32694	    test_ret++;
32695            printf(" %d", n_comp);
32696            printf("\n");
32697        }
32698    }
32699    function_tests++;
32700#endif
32701
32702    return(test_ret);
32703}
32704
32705
32706static int
32707test_xmlRegexpPrint(void) {
32708    int test_ret = 0;
32709
32710#if defined(LIBXML_REGEXP_ENABLED)
32711    int mem_base;
32712    FILE * output; /* the file for the output debug */
32713    int n_output;
32714    xmlRegexpPtr regexp; /* the compiled regexp */
32715    int n_regexp;
32716
32717    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
32718    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
32719        mem_base = xmlMemBlocks();
32720        output = gen_FILE_ptr(n_output, 0);
32721        regexp = gen_xmlRegexpPtr(n_regexp, 1);
32722
32723        xmlRegexpPrint(output, regexp);
32724        call_tests++;
32725        des_FILE_ptr(n_output, output, 0);
32726        des_xmlRegexpPtr(n_regexp, regexp, 1);
32727        xmlResetLastError();
32728        if (mem_base != xmlMemBlocks()) {
32729            printf("Leak of %d blocks found in xmlRegexpPrint",
32730	           xmlMemBlocks() - mem_base);
32731	    test_ret++;
32732            printf(" %d", n_output);
32733            printf(" %d", n_regexp);
32734            printf("\n");
32735        }
32736    }
32737    }
32738    function_tests++;
32739#endif
32740
32741    return(test_ret);
32742}
32743
32744static int
32745test_xmlregexp(void) {
32746    int test_ret = 0;
32747
32748    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
32749    test_ret += test_xmlExpCtxtNbCons();
32750    test_ret += test_xmlExpCtxtNbNodes();
32751    test_ret += test_xmlExpDump();
32752    test_ret += test_xmlExpExpDerive();
32753    test_ret += test_xmlExpGetLanguage();
32754    test_ret += test_xmlExpGetStart();
32755    test_ret += test_xmlExpIsNillable();
32756    test_ret += test_xmlExpMaxToken();
32757    test_ret += test_xmlExpNewAtom();
32758    test_ret += test_xmlExpNewCtxt();
32759    test_ret += test_xmlExpNewOr();
32760    test_ret += test_xmlExpNewRange();
32761    test_ret += test_xmlExpNewSeq();
32762    test_ret += test_xmlExpParse();
32763    test_ret += test_xmlExpRef();
32764    test_ret += test_xmlExpStringDerive();
32765    test_ret += test_xmlExpSubsume();
32766    test_ret += test_xmlRegExecErrInfo();
32767    test_ret += test_xmlRegExecNextValues();
32768    test_ret += test_xmlRegExecPushString();
32769    test_ret += test_xmlRegExecPushString2();
32770    test_ret += test_xmlRegNewExecCtxt();
32771    test_ret += test_xmlRegexpCompile();
32772    test_ret += test_xmlRegexpExec();
32773    test_ret += test_xmlRegexpIsDeterminist();
32774    test_ret += test_xmlRegexpPrint();
32775
32776    if (test_ret != 0)
32777	printf("Module xmlregexp: %d errors\n", test_ret);
32778    return(test_ret);
32779}
32780#ifdef LIBXML_OUTPUT_ENABLED
32781
32782#define gen_nb_xmlSaveCtxtPtr 1
32783static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32784    return(NULL);
32785}
32786static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32787}
32788#endif
32789
32790
32791static int
32792test_xmlSaveClose(void) {
32793    int test_ret = 0;
32794
32795#if defined(LIBXML_OUTPUT_ENABLED)
32796    int mem_base;
32797    int ret_val;
32798    xmlSaveCtxtPtr ctxt; /* a document saving context */
32799    int n_ctxt;
32800
32801    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32802        mem_base = xmlMemBlocks();
32803        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32804
32805        ret_val = xmlSaveClose(ctxt);
32806        desret_int(ret_val);
32807        call_tests++;
32808        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32809        xmlResetLastError();
32810        if (mem_base != xmlMemBlocks()) {
32811            printf("Leak of %d blocks found in xmlSaveClose",
32812	           xmlMemBlocks() - mem_base);
32813	    test_ret++;
32814            printf(" %d", n_ctxt);
32815            printf("\n");
32816        }
32817    }
32818    function_tests++;
32819#endif
32820
32821    return(test_ret);
32822}
32823
32824
32825static int
32826test_xmlSaveDoc(void) {
32827    int test_ret = 0;
32828
32829#if defined(LIBXML_OUTPUT_ENABLED)
32830    int mem_base;
32831    long ret_val;
32832    xmlSaveCtxtPtr ctxt; /* a document saving context */
32833    int n_ctxt;
32834    xmlDocPtr doc; /* a document */
32835    int n_doc;
32836
32837    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32838    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
32839        mem_base = xmlMemBlocks();
32840        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32841        doc = gen_xmlDocPtr(n_doc, 1);
32842
32843        ret_val = xmlSaveDoc(ctxt, doc);
32844        desret_long(ret_val);
32845        call_tests++;
32846        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32847        des_xmlDocPtr(n_doc, doc, 1);
32848        xmlResetLastError();
32849        if (mem_base != xmlMemBlocks()) {
32850            printf("Leak of %d blocks found in xmlSaveDoc",
32851	           xmlMemBlocks() - mem_base);
32852	    test_ret++;
32853            printf(" %d", n_ctxt);
32854            printf(" %d", n_doc);
32855            printf("\n");
32856        }
32857    }
32858    }
32859    function_tests++;
32860#endif
32861
32862    return(test_ret);
32863}
32864
32865
32866static int
32867test_xmlSaveFlush(void) {
32868    int test_ret = 0;
32869
32870#if defined(LIBXML_OUTPUT_ENABLED)
32871    int mem_base;
32872    int ret_val;
32873    xmlSaveCtxtPtr ctxt; /* a document saving context */
32874    int n_ctxt;
32875
32876    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32877        mem_base = xmlMemBlocks();
32878        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32879
32880        ret_val = xmlSaveFlush(ctxt);
32881        desret_int(ret_val);
32882        call_tests++;
32883        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32884        xmlResetLastError();
32885        if (mem_base != xmlMemBlocks()) {
32886            printf("Leak of %d blocks found in xmlSaveFlush",
32887	           xmlMemBlocks() - mem_base);
32888	    test_ret++;
32889            printf(" %d", n_ctxt);
32890            printf("\n");
32891        }
32892    }
32893    function_tests++;
32894#endif
32895
32896    return(test_ret);
32897}
32898
32899
32900static int
32901test_xmlSaveSetAttrEscape(void) {
32902    int test_ret = 0;
32903
32904
32905    /* missing type support */
32906    return(test_ret);
32907}
32908
32909
32910static int
32911test_xmlSaveSetEscape(void) {
32912    int test_ret = 0;
32913
32914
32915    /* missing type support */
32916    return(test_ret);
32917}
32918
32919
32920static int
32921test_xmlSaveToFd(void) {
32922    int test_ret = 0;
32923
32924
32925    /* missing type support */
32926    return(test_ret);
32927}
32928
32929
32930static int
32931test_xmlSaveToFilename(void) {
32932    int test_ret = 0;
32933
32934
32935    /* missing type support */
32936    return(test_ret);
32937}
32938
32939
32940static int
32941test_xmlSaveTree(void) {
32942    int test_ret = 0;
32943
32944#if defined(LIBXML_OUTPUT_ENABLED)
32945    int mem_base;
32946    long ret_val;
32947    xmlSaveCtxtPtr ctxt; /* a document saving context */
32948    int n_ctxt;
32949    xmlNodePtr node; /* a document */
32950    int n_node;
32951
32952    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32953    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
32954        mem_base = xmlMemBlocks();
32955        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32956        node = gen_xmlNodePtr(n_node, 1);
32957
32958        ret_val = xmlSaveTree(ctxt, node);
32959        desret_long(ret_val);
32960        call_tests++;
32961        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32962        des_xmlNodePtr(n_node, node, 1);
32963        xmlResetLastError();
32964        if (mem_base != xmlMemBlocks()) {
32965            printf("Leak of %d blocks found in xmlSaveTree",
32966	           xmlMemBlocks() - mem_base);
32967	    test_ret++;
32968            printf(" %d", n_ctxt);
32969            printf(" %d", n_node);
32970            printf("\n");
32971        }
32972    }
32973    }
32974    function_tests++;
32975#endif
32976
32977    return(test_ret);
32978}
32979
32980static int
32981test_xmlsave(void) {
32982    int test_ret = 0;
32983
32984    if (quiet == 0) printf("Testing xmlsave : 4 of 9 functions ...\n");
32985    test_ret += test_xmlSaveClose();
32986    test_ret += test_xmlSaveDoc();
32987    test_ret += test_xmlSaveFlush();
32988    test_ret += test_xmlSaveSetAttrEscape();
32989    test_ret += test_xmlSaveSetEscape();
32990    test_ret += test_xmlSaveToFd();
32991    test_ret += test_xmlSaveToFilename();
32992    test_ret += test_xmlSaveTree();
32993
32994    if (test_ret != 0)
32995	printf("Module xmlsave: %d errors\n", test_ret);
32996    return(test_ret);
32997}
32998
32999static int
33000test_xmlSchemaDump(void) {
33001    int test_ret = 0;
33002
33003#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33004    int mem_base;
33005    FILE * output; /* the file output */
33006    int n_output;
33007    xmlSchemaPtr schema; /* a schema structure */
33008    int n_schema;
33009
33010    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33011    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33012        mem_base = xmlMemBlocks();
33013        output = gen_FILE_ptr(n_output, 0);
33014        schema = gen_xmlSchemaPtr(n_schema, 1);
33015
33016        xmlSchemaDump(output, schema);
33017        call_tests++;
33018        des_FILE_ptr(n_output, output, 0);
33019        des_xmlSchemaPtr(n_schema, schema, 1);
33020        xmlResetLastError();
33021        if (mem_base != xmlMemBlocks()) {
33022            printf("Leak of %d blocks found in xmlSchemaDump",
33023	           xmlMemBlocks() - mem_base);
33024	    test_ret++;
33025            printf(" %d", n_output);
33026            printf(" %d", n_schema);
33027            printf("\n");
33028        }
33029    }
33030    }
33031    function_tests++;
33032#endif
33033
33034    return(test_ret);
33035}
33036
33037#ifdef LIBXML_SCHEMAS_ENABLED
33038
33039#define gen_nb_xmlSchemaParserCtxtPtr 1
33040static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33041    return(NULL);
33042}
33043static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33044}
33045#endif
33046
33047#ifdef LIBXML_SCHEMAS_ENABLED
33048
33049#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33050static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33051    return(NULL);
33052}
33053static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33054}
33055#endif
33056
33057#ifdef LIBXML_SCHEMAS_ENABLED
33058
33059#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33060static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33061    return(NULL);
33062}
33063static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33064}
33065#endif
33066
33067
33068static int
33069test_xmlSchemaGetParserErrors(void) {
33070    int test_ret = 0;
33071
33072#if defined(LIBXML_SCHEMAS_ENABLED)
33073    int mem_base;
33074    int ret_val;
33075    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33076    int n_ctxt;
33077    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33078    int n_err;
33079    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33080    int n_warn;
33081    void ** ctx; /* contextual data for the callbacks result */
33082    int n_ctx;
33083
33084    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33085    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33086    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33087    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33088        mem_base = xmlMemBlocks();
33089        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33090        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33091        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33092        ctx = gen_void_ptr_ptr(n_ctx, 3);
33093
33094        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33095        desret_int(ret_val);
33096        call_tests++;
33097        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33098        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33099        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33100        des_void_ptr_ptr(n_ctx, ctx, 3);
33101        xmlResetLastError();
33102        if (mem_base != xmlMemBlocks()) {
33103            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33104	           xmlMemBlocks() - mem_base);
33105	    test_ret++;
33106            printf(" %d", n_ctxt);
33107            printf(" %d", n_err);
33108            printf(" %d", n_warn);
33109            printf(" %d", n_ctx);
33110            printf("\n");
33111        }
33112    }
33113    }
33114    }
33115    }
33116    function_tests++;
33117#endif
33118
33119    return(test_ret);
33120}
33121
33122#ifdef LIBXML_SCHEMAS_ENABLED
33123
33124#define gen_nb_xmlSchemaValidCtxtPtr 1
33125static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33126    return(NULL);
33127}
33128static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33129}
33130#endif
33131
33132
33133static int
33134test_xmlSchemaGetValidErrors(void) {
33135    int test_ret = 0;
33136
33137#if defined(LIBXML_SCHEMAS_ENABLED)
33138    int mem_base;
33139    int ret_val;
33140    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33141    int n_ctxt;
33142    xmlSchemaValidityErrorFunc * err; /* the error function result */
33143    int n_err;
33144    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33145    int n_warn;
33146    void ** ctx; /* the functions context result */
33147    int n_ctx;
33148
33149    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33150    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33151    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33152    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33153        mem_base = xmlMemBlocks();
33154        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33155        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33156        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33157        ctx = gen_void_ptr_ptr(n_ctx, 3);
33158
33159        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33160        desret_int(ret_val);
33161        call_tests++;
33162        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33163        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33164        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33165        des_void_ptr_ptr(n_ctx, ctx, 3);
33166        xmlResetLastError();
33167        if (mem_base != xmlMemBlocks()) {
33168            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33169	           xmlMemBlocks() - mem_base);
33170	    test_ret++;
33171            printf(" %d", n_ctxt);
33172            printf(" %d", n_err);
33173            printf(" %d", n_warn);
33174            printf(" %d", n_ctx);
33175            printf("\n");
33176        }
33177    }
33178    }
33179    }
33180    }
33181    function_tests++;
33182#endif
33183
33184    return(test_ret);
33185}
33186
33187
33188static int
33189test_xmlSchemaIsValid(void) {
33190    int test_ret = 0;
33191
33192#if defined(LIBXML_SCHEMAS_ENABLED)
33193    int mem_base;
33194    int ret_val;
33195    xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
33196    int n_ctxt;
33197
33198    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33199        mem_base = xmlMemBlocks();
33200        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33201
33202        ret_val = xmlSchemaIsValid(ctxt);
33203        desret_int(ret_val);
33204        call_tests++;
33205        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33206        xmlResetLastError();
33207        if (mem_base != xmlMemBlocks()) {
33208            printf("Leak of %d blocks found in xmlSchemaIsValid",
33209	           xmlMemBlocks() - mem_base);
33210	    test_ret++;
33211            printf(" %d", n_ctxt);
33212            printf("\n");
33213        }
33214    }
33215    function_tests++;
33216#endif
33217
33218    return(test_ret);
33219}
33220
33221
33222static int
33223test_xmlSchemaNewDocParserCtxt(void) {
33224    int test_ret = 0;
33225
33226#if defined(LIBXML_SCHEMAS_ENABLED)
33227    int mem_base;
33228    xmlSchemaParserCtxtPtr ret_val;
33229    xmlDocPtr doc; /* a preparsed document tree */
33230    int n_doc;
33231
33232    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33233        mem_base = xmlMemBlocks();
33234        doc = gen_xmlDocPtr(n_doc, 0);
33235
33236        ret_val = xmlSchemaNewDocParserCtxt(doc);
33237        desret_xmlSchemaParserCtxtPtr(ret_val);
33238        call_tests++;
33239        des_xmlDocPtr(n_doc, doc, 0);
33240        xmlResetLastError();
33241        if (mem_base != xmlMemBlocks()) {
33242            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33243	           xmlMemBlocks() - mem_base);
33244	    test_ret++;
33245            printf(" %d", n_doc);
33246            printf("\n");
33247        }
33248    }
33249    function_tests++;
33250#endif
33251
33252    return(test_ret);
33253}
33254
33255
33256static int
33257test_xmlSchemaNewMemParserCtxt(void) {
33258    int test_ret = 0;
33259
33260#if defined(LIBXML_SCHEMAS_ENABLED)
33261    int mem_base;
33262    xmlSchemaParserCtxtPtr ret_val;
33263    char * buffer; /* a pointer to a char array containing the schemas */
33264    int n_buffer;
33265    int size; /* the size of the array */
33266    int n_size;
33267
33268    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33269    for (n_size = 0;n_size < gen_nb_int;n_size++) {
33270        mem_base = xmlMemBlocks();
33271        buffer = gen_const_char_ptr(n_buffer, 0);
33272        size = gen_int(n_size, 1);
33273
33274        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33275        desret_xmlSchemaParserCtxtPtr(ret_val);
33276        call_tests++;
33277        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33278        des_int(n_size, size, 1);
33279        xmlResetLastError();
33280        if (mem_base != xmlMemBlocks()) {
33281            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33282	           xmlMemBlocks() - mem_base);
33283	    test_ret++;
33284            printf(" %d", n_buffer);
33285            printf(" %d", n_size);
33286            printf("\n");
33287        }
33288    }
33289    }
33290    function_tests++;
33291#endif
33292
33293    return(test_ret);
33294}
33295
33296
33297static int
33298test_xmlSchemaNewParserCtxt(void) {
33299    int test_ret = 0;
33300
33301#if defined(LIBXML_SCHEMAS_ENABLED)
33302    int mem_base;
33303    xmlSchemaParserCtxtPtr ret_val;
33304    char * URL; /* the location of the schema */
33305    int n_URL;
33306
33307    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33308        mem_base = xmlMemBlocks();
33309        URL = gen_const_char_ptr(n_URL, 0);
33310
33311        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33312        desret_xmlSchemaParserCtxtPtr(ret_val);
33313        call_tests++;
33314        des_const_char_ptr(n_URL, (const char *)URL, 0);
33315        xmlResetLastError();
33316        if (mem_base != xmlMemBlocks()) {
33317            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33318	           xmlMemBlocks() - mem_base);
33319	    test_ret++;
33320            printf(" %d", n_URL);
33321            printf("\n");
33322        }
33323    }
33324    function_tests++;
33325#endif
33326
33327    return(test_ret);
33328}
33329
33330
33331static int
33332test_xmlSchemaNewValidCtxt(void) {
33333    int test_ret = 0;
33334
33335
33336    /* missing type support */
33337    return(test_ret);
33338}
33339
33340
33341static int
33342test_xmlSchemaParse(void) {
33343    int test_ret = 0;
33344
33345
33346    /* missing type support */
33347    return(test_ret);
33348}
33349
33350#ifdef LIBXML_SCHEMAS_ENABLED
33351
33352#define gen_nb_xmlSAXHandlerPtr_ptr 1
33353static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33354    return(NULL);
33355}
33356static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33357}
33358#endif
33359
33360
33361static int
33362test_xmlSchemaSAXPlug(void) {
33363    int test_ret = 0;
33364
33365
33366    /* missing type support */
33367    return(test_ret);
33368}
33369
33370#ifdef LIBXML_SCHEMAS_ENABLED
33371
33372#define gen_nb_xmlSchemaSAXPlugPtr 1
33373static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33374    return(NULL);
33375}
33376static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33377}
33378#endif
33379
33380
33381static int
33382test_xmlSchemaSAXUnplug(void) {
33383    int test_ret = 0;
33384
33385#if defined(LIBXML_SCHEMAS_ENABLED)
33386    int mem_base;
33387    int ret_val;
33388    xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
33389    int n_plug;
33390
33391    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
33392        mem_base = xmlMemBlocks();
33393        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
33394
33395        ret_val = xmlSchemaSAXUnplug(plug);
33396        desret_int(ret_val);
33397        call_tests++;
33398        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
33399        xmlResetLastError();
33400        if (mem_base != xmlMemBlocks()) {
33401            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
33402	           xmlMemBlocks() - mem_base);
33403	    test_ret++;
33404            printf(" %d", n_plug);
33405            printf("\n");
33406        }
33407    }
33408    function_tests++;
33409#endif
33410
33411    return(test_ret);
33412}
33413
33414
33415static int
33416test_xmlSchemaSetParserErrors(void) {
33417    int test_ret = 0;
33418
33419
33420    /* missing type support */
33421    return(test_ret);
33422}
33423
33424
33425static int
33426test_xmlSchemaSetValidErrors(void) {
33427    int test_ret = 0;
33428
33429
33430    /* missing type support */
33431    return(test_ret);
33432}
33433
33434
33435static int
33436test_xmlSchemaSetValidOptions(void) {
33437    int test_ret = 0;
33438
33439#if defined(LIBXML_SCHEMAS_ENABLED)
33440    int mem_base;
33441    int ret_val;
33442    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33443    int n_ctxt;
33444    int options; /* a combination of xmlSchemaValidOption */
33445    int n_options;
33446
33447    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33448    for (n_options = 0;n_options < gen_nb_int;n_options++) {
33449        mem_base = xmlMemBlocks();
33450        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33451        options = gen_int(n_options, 1);
33452
33453        ret_val = xmlSchemaSetValidOptions(ctxt, options);
33454        desret_int(ret_val);
33455        call_tests++;
33456        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33457        des_int(n_options, options, 1);
33458        xmlResetLastError();
33459        if (mem_base != xmlMemBlocks()) {
33460            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
33461	           xmlMemBlocks() - mem_base);
33462	    test_ret++;
33463            printf(" %d", n_ctxt);
33464            printf(" %d", n_options);
33465            printf("\n");
33466        }
33467    }
33468    }
33469    function_tests++;
33470#endif
33471
33472    return(test_ret);
33473}
33474
33475
33476static int
33477test_xmlSchemaSetValidStructuredErrors(void) {
33478    int test_ret = 0;
33479
33480
33481    /* missing type support */
33482    return(test_ret);
33483}
33484
33485
33486static int
33487test_xmlSchemaValidCtxtGetOptions(void) {
33488    int test_ret = 0;
33489
33490#if defined(LIBXML_SCHEMAS_ENABLED)
33491    int mem_base;
33492    int ret_val;
33493    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33494    int n_ctxt;
33495
33496    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33497        mem_base = xmlMemBlocks();
33498        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33499
33500        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
33501        desret_int(ret_val);
33502        call_tests++;
33503        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33504        xmlResetLastError();
33505        if (mem_base != xmlMemBlocks()) {
33506            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
33507	           xmlMemBlocks() - mem_base);
33508	    test_ret++;
33509            printf(" %d", n_ctxt);
33510            printf("\n");
33511        }
33512    }
33513    function_tests++;
33514#endif
33515
33516    return(test_ret);
33517}
33518
33519
33520static int
33521test_xmlSchemaValidateDoc(void) {
33522    int test_ret = 0;
33523
33524#if defined(LIBXML_SCHEMAS_ENABLED)
33525    int mem_base;
33526    int ret_val;
33527    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33528    int n_ctxt;
33529    xmlDocPtr doc; /* a parsed document tree */
33530    int n_doc;
33531
33532    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33533    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33534        mem_base = xmlMemBlocks();
33535        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33536        doc = gen_xmlDocPtr(n_doc, 1);
33537
33538        ret_val = xmlSchemaValidateDoc(ctxt, doc);
33539        desret_int(ret_val);
33540        call_tests++;
33541        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33542        des_xmlDocPtr(n_doc, doc, 1);
33543        xmlResetLastError();
33544        if (mem_base != xmlMemBlocks()) {
33545            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
33546	           xmlMemBlocks() - mem_base);
33547	    test_ret++;
33548            printf(" %d", n_ctxt);
33549            printf(" %d", n_doc);
33550            printf("\n");
33551        }
33552    }
33553    }
33554    function_tests++;
33555#endif
33556
33557    return(test_ret);
33558}
33559
33560
33561static int
33562test_xmlSchemaValidateFile(void) {
33563    int test_ret = 0;
33564
33565#if defined(LIBXML_SCHEMAS_ENABLED)
33566    int mem_base;
33567    int ret_val;
33568    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33569    int n_ctxt;
33570    const char * filename; /* the URI of the instance */
33571    int n_filename;
33572    int options; /* a future set of options, currently unused */
33573    int n_options;
33574
33575    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33576    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
33577    for (n_options = 0;n_options < gen_nb_int;n_options++) {
33578        mem_base = xmlMemBlocks();
33579        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33580        filename = gen_filepath(n_filename, 1);
33581        options = gen_int(n_options, 2);
33582
33583        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
33584        desret_int(ret_val);
33585        call_tests++;
33586        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33587        des_filepath(n_filename, filename, 1);
33588        des_int(n_options, options, 2);
33589        xmlResetLastError();
33590        if (mem_base != xmlMemBlocks()) {
33591            printf("Leak of %d blocks found in xmlSchemaValidateFile",
33592	           xmlMemBlocks() - mem_base);
33593	    test_ret++;
33594            printf(" %d", n_ctxt);
33595            printf(" %d", n_filename);
33596            printf(" %d", n_options);
33597            printf("\n");
33598        }
33599    }
33600    }
33601    }
33602    function_tests++;
33603#endif
33604
33605    return(test_ret);
33606}
33607
33608
33609static int
33610test_xmlSchemaValidateOneElement(void) {
33611    int test_ret = 0;
33612
33613#if defined(LIBXML_SCHEMAS_ENABLED)
33614    int mem_base;
33615    int ret_val;
33616    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33617    int n_ctxt;
33618    xmlNodePtr elem; /* an element node */
33619    int n_elem;
33620
33621    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33622    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
33623        mem_base = xmlMemBlocks();
33624        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33625        elem = gen_xmlNodePtr(n_elem, 1);
33626
33627        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
33628        desret_int(ret_val);
33629        call_tests++;
33630        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33631        des_xmlNodePtr(n_elem, elem, 1);
33632        xmlResetLastError();
33633        if (mem_base != xmlMemBlocks()) {
33634            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
33635	           xmlMemBlocks() - mem_base);
33636	    test_ret++;
33637            printf(" %d", n_ctxt);
33638            printf(" %d", n_elem);
33639            printf("\n");
33640        }
33641    }
33642    }
33643    function_tests++;
33644#endif
33645
33646    return(test_ret);
33647}
33648
33649
33650static int
33651test_xmlSchemaValidateStream(void) {
33652    int test_ret = 0;
33653
33654#if defined(LIBXML_SCHEMAS_ENABLED)
33655    int mem_base;
33656    int ret_val;
33657    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33658    int n_ctxt;
33659    xmlParserInputBufferPtr input; /* the input to use for reading the data */
33660    int n_input;
33661    xmlCharEncoding enc; /* an optional encoding information */
33662    int n_enc;
33663    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
33664    int n_sax;
33665    void * user_data; /* the context to provide to the SAX handler. */
33666    int n_user_data;
33667
33668    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33669    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
33670    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
33671    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
33672    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
33673        mem_base = xmlMemBlocks();
33674        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33675        input = gen_xmlParserInputBufferPtr(n_input, 1);
33676        enc = gen_xmlCharEncoding(n_enc, 2);
33677        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
33678        user_data = gen_userdata(n_user_data, 4);
33679
33680        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
33681        desret_int(ret_val);
33682        call_tests++;
33683        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33684        des_xmlParserInputBufferPtr(n_input, input, 1);
33685        des_xmlCharEncoding(n_enc, enc, 2);
33686        des_xmlSAXHandlerPtr(n_sax, sax, 3);
33687        des_userdata(n_user_data, user_data, 4);
33688        xmlResetLastError();
33689        if (mem_base != xmlMemBlocks()) {
33690            printf("Leak of %d blocks found in xmlSchemaValidateStream",
33691	           xmlMemBlocks() - mem_base);
33692	    test_ret++;
33693            printf(" %d", n_ctxt);
33694            printf(" %d", n_input);
33695            printf(" %d", n_enc);
33696            printf(" %d", n_sax);
33697            printf(" %d", n_user_data);
33698            printf("\n");
33699        }
33700    }
33701    }
33702    }
33703    }
33704    }
33705    function_tests++;
33706#endif
33707
33708    return(test_ret);
33709}
33710
33711static int
33712test_xmlschemas(void) {
33713    int test_ret = 0;
33714
33715    if (quiet == 0) printf("Testing xmlschemas : 14 of 23 functions ...\n");
33716    test_ret += test_xmlSchemaDump();
33717    test_ret += test_xmlSchemaGetParserErrors();
33718    test_ret += test_xmlSchemaGetValidErrors();
33719    test_ret += test_xmlSchemaIsValid();
33720    test_ret += test_xmlSchemaNewDocParserCtxt();
33721    test_ret += test_xmlSchemaNewMemParserCtxt();
33722    test_ret += test_xmlSchemaNewParserCtxt();
33723    test_ret += test_xmlSchemaNewValidCtxt();
33724    test_ret += test_xmlSchemaParse();
33725    test_ret += test_xmlSchemaSAXPlug();
33726    test_ret += test_xmlSchemaSAXUnplug();
33727    test_ret += test_xmlSchemaSetParserErrors();
33728    test_ret += test_xmlSchemaSetValidErrors();
33729    test_ret += test_xmlSchemaSetValidOptions();
33730    test_ret += test_xmlSchemaSetValidStructuredErrors();
33731    test_ret += test_xmlSchemaValidCtxtGetOptions();
33732    test_ret += test_xmlSchemaValidateDoc();
33733    test_ret += test_xmlSchemaValidateFile();
33734    test_ret += test_xmlSchemaValidateOneElement();
33735    test_ret += test_xmlSchemaValidateStream();
33736
33737    if (test_ret != 0)
33738	printf("Module xmlschemas: %d errors\n", test_ret);
33739    return(test_ret);
33740}
33741#ifdef LIBXML_SCHEMAS_ENABLED
33742
33743#define gen_nb_xmlSchemaFacetPtr 1
33744static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33745    return(NULL);
33746}
33747static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33748}
33749#endif
33750
33751#ifdef LIBXML_SCHEMAS_ENABLED
33752
33753#define gen_nb_xmlSchemaTypePtr 1
33754static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33755    return(NULL);
33756}
33757static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33758}
33759#endif
33760
33761
33762static int
33763test_xmlSchemaCheckFacet(void) {
33764    int test_ret = 0;
33765
33766#if defined(LIBXML_SCHEMAS_ENABLED)
33767    int mem_base;
33768    int ret_val;
33769    xmlSchemaFacetPtr facet; /* the facet */
33770    int n_facet;
33771    xmlSchemaTypePtr typeDecl; /* the schema type definition */
33772    int n_typeDecl;
33773    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
33774    int n_pctxt;
33775    xmlChar * name; /* the optional name of the type */
33776    int n_name;
33777
33778    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33779    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
33780    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
33781    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
33782        mem_base = xmlMemBlocks();
33783        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33784        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
33785        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
33786        name = gen_const_xmlChar_ptr(n_name, 3);
33787
33788        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
33789        desret_int(ret_val);
33790        call_tests++;
33791        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33792        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
33793        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
33794        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
33795        xmlResetLastError();
33796        if (mem_base != xmlMemBlocks()) {
33797            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
33798	           xmlMemBlocks() - mem_base);
33799	    test_ret++;
33800            printf(" %d", n_facet);
33801            printf(" %d", n_typeDecl);
33802            printf(" %d", n_pctxt);
33803            printf(" %d", n_name);
33804            printf("\n");
33805        }
33806    }
33807    }
33808    }
33809    }
33810    function_tests++;
33811#endif
33812
33813    return(test_ret);
33814}
33815
33816
33817static int
33818test_xmlSchemaCleanupTypes(void) {
33819    int test_ret = 0;
33820
33821#if defined(LIBXML_SCHEMAS_ENABLED)
33822
33823
33824        xmlSchemaCleanupTypes();
33825        call_tests++;
33826        xmlResetLastError();
33827    function_tests++;
33828#endif
33829
33830    return(test_ret);
33831}
33832
33833
33834static int
33835test_xmlSchemaCollapseString(void) {
33836    int test_ret = 0;
33837
33838#if defined(LIBXML_SCHEMAS_ENABLED)
33839    int mem_base;
33840    xmlChar * ret_val;
33841    xmlChar * value; /* a value */
33842    int n_value;
33843
33844    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33845        mem_base = xmlMemBlocks();
33846        value = gen_const_xmlChar_ptr(n_value, 0);
33847
33848        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
33849        desret_xmlChar_ptr(ret_val);
33850        call_tests++;
33851        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
33852        xmlResetLastError();
33853        if (mem_base != xmlMemBlocks()) {
33854            printf("Leak of %d blocks found in xmlSchemaCollapseString",
33855	           xmlMemBlocks() - mem_base);
33856	    test_ret++;
33857            printf(" %d", n_value);
33858            printf("\n");
33859        }
33860    }
33861    function_tests++;
33862#endif
33863
33864    return(test_ret);
33865}
33866
33867#ifdef LIBXML_SCHEMAS_ENABLED
33868
33869#define gen_nb_xmlSchemaValPtr 1
33870static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33871    return(NULL);
33872}
33873static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33874}
33875#endif
33876
33877
33878static int
33879test_xmlSchemaCompareValues(void) {
33880    int test_ret = 0;
33881
33882#if defined(LIBXML_SCHEMAS_ENABLED)
33883    int mem_base;
33884    int ret_val;
33885    xmlSchemaValPtr x; /* a first value */
33886    int n_x;
33887    xmlSchemaValPtr y; /* a second value */
33888    int n_y;
33889
33890    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
33891    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
33892        mem_base = xmlMemBlocks();
33893        x = gen_xmlSchemaValPtr(n_x, 0);
33894        y = gen_xmlSchemaValPtr(n_y, 1);
33895
33896        ret_val = xmlSchemaCompareValues(x, y);
33897        desret_int(ret_val);
33898        call_tests++;
33899        des_xmlSchemaValPtr(n_x, x, 0);
33900        des_xmlSchemaValPtr(n_y, y, 1);
33901        xmlResetLastError();
33902        if (mem_base != xmlMemBlocks()) {
33903            printf("Leak of %d blocks found in xmlSchemaCompareValues",
33904	           xmlMemBlocks() - mem_base);
33905	    test_ret++;
33906            printf(" %d", n_x);
33907            printf(" %d", n_y);
33908            printf("\n");
33909        }
33910    }
33911    }
33912    function_tests++;
33913#endif
33914
33915    return(test_ret);
33916}
33917
33918
33919static int
33920test_xmlSchemaCompareValuesWhtsp(void) {
33921    int test_ret = 0;
33922
33923#if defined(LIBXML_SCHEMAS_ENABLED)
33924    int mem_base;
33925    int ret_val;
33926    xmlSchemaValPtr x; /* a first value */
33927    int n_x;
33928    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
33929    int n_xws;
33930    xmlSchemaValPtr y; /* a second value */
33931    int n_y;
33932    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
33933    int n_yws;
33934
33935    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
33936    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
33937    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
33938    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
33939        mem_base = xmlMemBlocks();
33940        x = gen_xmlSchemaValPtr(n_x, 0);
33941        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
33942        y = gen_xmlSchemaValPtr(n_y, 2);
33943        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
33944
33945        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
33946        desret_int(ret_val);
33947        call_tests++;
33948        des_xmlSchemaValPtr(n_x, x, 0);
33949        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
33950        des_xmlSchemaValPtr(n_y, y, 2);
33951        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
33952        xmlResetLastError();
33953        if (mem_base != xmlMemBlocks()) {
33954            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
33955	           xmlMemBlocks() - mem_base);
33956	    test_ret++;
33957            printf(" %d", n_x);
33958            printf(" %d", n_xws);
33959            printf(" %d", n_y);
33960            printf(" %d", n_yws);
33961            printf("\n");
33962        }
33963    }
33964    }
33965    }
33966    }
33967    function_tests++;
33968#endif
33969
33970    return(test_ret);
33971}
33972
33973
33974static int
33975test_xmlSchemaCopyValue(void) {
33976    int test_ret = 0;
33977
33978
33979    /* missing type support */
33980    return(test_ret);
33981}
33982
33983
33984static int
33985test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
33986    int test_ret = 0;
33987
33988#if defined(LIBXML_SCHEMAS_ENABLED)
33989    int mem_base;
33990    xmlSchemaTypePtr ret_val;
33991    xmlSchemaTypePtr type; /* the built-in simple type. */
33992    int n_type;
33993
33994    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33995        mem_base = xmlMemBlocks();
33996        type = gen_xmlSchemaTypePtr(n_type, 0);
33997
33998        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
33999        desret_xmlSchemaTypePtr(ret_val);
34000        call_tests++;
34001        des_xmlSchemaTypePtr(n_type, type, 0);
34002        xmlResetLastError();
34003        if (mem_base != xmlMemBlocks()) {
34004            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34005	           xmlMemBlocks() - mem_base);
34006	    test_ret++;
34007            printf(" %d", n_type);
34008            printf("\n");
34009        }
34010    }
34011    function_tests++;
34012#endif
34013
34014    return(test_ret);
34015}
34016
34017
34018static int
34019test_xmlSchemaGetBuiltInType(void) {
34020    int test_ret = 0;
34021
34022#if defined(LIBXML_SCHEMAS_ENABLED)
34023    xmlSchemaTypePtr ret_val;
34024    xmlSchemaValType type; /* the type of the built in type */
34025    int n_type;
34026
34027    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34028        type = gen_xmlSchemaValType(n_type, 0);
34029
34030        ret_val = xmlSchemaGetBuiltInType(type);
34031        desret_xmlSchemaTypePtr(ret_val);
34032        call_tests++;
34033        des_xmlSchemaValType(n_type, type, 0);
34034        xmlResetLastError();
34035    }
34036    function_tests++;
34037#endif
34038
34039    return(test_ret);
34040}
34041
34042
34043static int
34044test_xmlSchemaGetCanonValue(void) {
34045    int test_ret = 0;
34046
34047#if defined(LIBXML_SCHEMAS_ENABLED)
34048    int mem_base;
34049    int ret_val;
34050    xmlSchemaValPtr val; /* the precomputed value */
34051    int n_val;
34052    xmlChar ** retValue; /* the returned value */
34053    int n_retValue;
34054
34055    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34056    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34057        mem_base = xmlMemBlocks();
34058        val = gen_xmlSchemaValPtr(n_val, 0);
34059        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34060
34061        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34062        desret_int(ret_val);
34063        call_tests++;
34064        des_xmlSchemaValPtr(n_val, val, 0);
34065        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34066        xmlResetLastError();
34067        if (mem_base != xmlMemBlocks()) {
34068            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34069	           xmlMemBlocks() - mem_base);
34070	    test_ret++;
34071            printf(" %d", n_val);
34072            printf(" %d", n_retValue);
34073            printf("\n");
34074        }
34075    }
34076    }
34077    function_tests++;
34078#endif
34079
34080    return(test_ret);
34081}
34082
34083
34084static int
34085test_xmlSchemaGetCanonValueWhtsp(void) {
34086    int test_ret = 0;
34087
34088#if defined(LIBXML_SCHEMAS_ENABLED)
34089    int mem_base;
34090    int ret_val;
34091    xmlSchemaValPtr val; /* the precomputed value */
34092    int n_val;
34093    xmlChar ** retValue; /* the returned value */
34094    int n_retValue;
34095    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34096    int n_ws;
34097
34098    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34099    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34100    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34101        mem_base = xmlMemBlocks();
34102        val = gen_xmlSchemaValPtr(n_val, 0);
34103        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34104        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34105
34106        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34107        desret_int(ret_val);
34108        call_tests++;
34109        des_xmlSchemaValPtr(n_val, val, 0);
34110        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34111        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34112        xmlResetLastError();
34113        if (mem_base != xmlMemBlocks()) {
34114            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34115	           xmlMemBlocks() - mem_base);
34116	    test_ret++;
34117            printf(" %d", n_val);
34118            printf(" %d", n_retValue);
34119            printf(" %d", n_ws);
34120            printf("\n");
34121        }
34122    }
34123    }
34124    }
34125    function_tests++;
34126#endif
34127
34128    return(test_ret);
34129}
34130
34131
34132static int
34133test_xmlSchemaGetFacetValueAsULong(void) {
34134    int test_ret = 0;
34135
34136#if defined(LIBXML_SCHEMAS_ENABLED)
34137    int mem_base;
34138    unsigned long ret_val;
34139    xmlSchemaFacetPtr facet; /* an schemas type facet */
34140    int n_facet;
34141
34142    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34143        mem_base = xmlMemBlocks();
34144        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34145
34146        ret_val = xmlSchemaGetFacetValueAsULong(facet);
34147        desret_unsigned_long(ret_val);
34148        call_tests++;
34149        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34150        xmlResetLastError();
34151        if (mem_base != xmlMemBlocks()) {
34152            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34153	           xmlMemBlocks() - mem_base);
34154	    test_ret++;
34155            printf(" %d", n_facet);
34156            printf("\n");
34157        }
34158    }
34159    function_tests++;
34160#endif
34161
34162    return(test_ret);
34163}
34164
34165
34166static int
34167test_xmlSchemaGetPredefinedType(void) {
34168    int test_ret = 0;
34169
34170#if defined(LIBXML_SCHEMAS_ENABLED)
34171    int mem_base;
34172    xmlSchemaTypePtr ret_val;
34173    xmlChar * name; /* the type name */
34174    int n_name;
34175    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34176    int n_ns;
34177
34178    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34179    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34180        mem_base = xmlMemBlocks();
34181        name = gen_const_xmlChar_ptr(n_name, 0);
34182        ns = gen_const_xmlChar_ptr(n_ns, 1);
34183
34184        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34185        desret_xmlSchemaTypePtr(ret_val);
34186        call_tests++;
34187        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34188        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34189        xmlResetLastError();
34190        if (mem_base != xmlMemBlocks()) {
34191            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34192	           xmlMemBlocks() - mem_base);
34193	    test_ret++;
34194            printf(" %d", n_name);
34195            printf(" %d", n_ns);
34196            printf("\n");
34197        }
34198    }
34199    }
34200    function_tests++;
34201#endif
34202
34203    return(test_ret);
34204}
34205
34206
34207static int
34208test_xmlSchemaGetValType(void) {
34209    int test_ret = 0;
34210
34211#if defined(LIBXML_SCHEMAS_ENABLED)
34212    int mem_base;
34213    xmlSchemaValType ret_val;
34214    xmlSchemaValPtr val; /* a schemas value */
34215    int n_val;
34216
34217    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34218        mem_base = xmlMemBlocks();
34219        val = gen_xmlSchemaValPtr(n_val, 0);
34220
34221        ret_val = xmlSchemaGetValType(val);
34222        desret_xmlSchemaValType(ret_val);
34223        call_tests++;
34224        des_xmlSchemaValPtr(n_val, val, 0);
34225        xmlResetLastError();
34226        if (mem_base != xmlMemBlocks()) {
34227            printf("Leak of %d blocks found in xmlSchemaGetValType",
34228	           xmlMemBlocks() - mem_base);
34229	    test_ret++;
34230            printf(" %d", n_val);
34231            printf("\n");
34232        }
34233    }
34234    function_tests++;
34235#endif
34236
34237    return(test_ret);
34238}
34239
34240
34241static int
34242test_xmlSchemaInitTypes(void) {
34243    int test_ret = 0;
34244
34245#if defined(LIBXML_SCHEMAS_ENABLED)
34246
34247
34248        xmlSchemaInitTypes();
34249        call_tests++;
34250        xmlResetLastError();
34251    function_tests++;
34252#endif
34253
34254    return(test_ret);
34255}
34256
34257
34258static int
34259test_xmlSchemaIsBuiltInTypeFacet(void) {
34260    int test_ret = 0;
34261
34262#if defined(LIBXML_SCHEMAS_ENABLED)
34263    int mem_base;
34264    int ret_val;
34265    xmlSchemaTypePtr type; /* the built-in type */
34266    int n_type;
34267    int facetType; /* the facet type */
34268    int n_facetType;
34269
34270    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34271    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34272        mem_base = xmlMemBlocks();
34273        type = gen_xmlSchemaTypePtr(n_type, 0);
34274        facetType = gen_int(n_facetType, 1);
34275
34276        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34277        desret_int(ret_val);
34278        call_tests++;
34279        des_xmlSchemaTypePtr(n_type, type, 0);
34280        des_int(n_facetType, facetType, 1);
34281        xmlResetLastError();
34282        if (mem_base != xmlMemBlocks()) {
34283            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34284	           xmlMemBlocks() - mem_base);
34285	    test_ret++;
34286            printf(" %d", n_type);
34287            printf(" %d", n_facetType);
34288            printf("\n");
34289        }
34290    }
34291    }
34292    function_tests++;
34293#endif
34294
34295    return(test_ret);
34296}
34297
34298
34299static int
34300test_xmlSchemaNewFacet(void) {
34301    int test_ret = 0;
34302
34303
34304    /* missing type support */
34305    return(test_ret);
34306}
34307
34308
34309static int
34310test_xmlSchemaNewNOTATIONValue(void) {
34311    int test_ret = 0;
34312
34313
34314    /* missing type support */
34315    return(test_ret);
34316}
34317
34318
34319static int
34320test_xmlSchemaNewQNameValue(void) {
34321    int test_ret = 0;
34322
34323
34324    /* missing type support */
34325    return(test_ret);
34326}
34327
34328
34329static int
34330test_xmlSchemaNewStringValue(void) {
34331    int test_ret = 0;
34332
34333
34334    /* missing type support */
34335    return(test_ret);
34336}
34337
34338#ifdef LIBXML_SCHEMAS_ENABLED
34339
34340#define gen_nb_xmlSchemaValPtr_ptr 1
34341static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34342    return(NULL);
34343}
34344static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34345}
34346#endif
34347
34348
34349static int
34350test_xmlSchemaValPredefTypeNode(void) {
34351    int test_ret = 0;
34352
34353#if defined(LIBXML_SCHEMAS_ENABLED)
34354    int mem_base;
34355    int ret_val;
34356    xmlSchemaTypePtr type; /* the predefined type */
34357    int n_type;
34358    xmlChar * value; /* the value to check */
34359    int n_value;
34360    xmlSchemaValPtr * val; /* the return computed value */
34361    int n_val;
34362    xmlNodePtr node; /* the node containing the value */
34363    int n_node;
34364
34365    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34366    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34367    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34368    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34369        mem_base = xmlMemBlocks();
34370        type = gen_xmlSchemaTypePtr(n_type, 0);
34371        value = gen_const_xmlChar_ptr(n_value, 1);
34372        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34373        node = gen_xmlNodePtr(n_node, 3);
34374
34375        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
34376        desret_int(ret_val);
34377        call_tests++;
34378        des_xmlSchemaTypePtr(n_type, type, 0);
34379        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34380        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34381        des_xmlNodePtr(n_node, node, 3);
34382        xmlResetLastError();
34383        if (mem_base != xmlMemBlocks()) {
34384            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
34385	           xmlMemBlocks() - mem_base);
34386	    test_ret++;
34387            printf(" %d", n_type);
34388            printf(" %d", n_value);
34389            printf(" %d", n_val);
34390            printf(" %d", n_node);
34391            printf("\n");
34392        }
34393    }
34394    }
34395    }
34396    }
34397    function_tests++;
34398#endif
34399
34400    return(test_ret);
34401}
34402
34403
34404static int
34405test_xmlSchemaValPredefTypeNodeNoNorm(void) {
34406    int test_ret = 0;
34407
34408#if defined(LIBXML_SCHEMAS_ENABLED)
34409    int mem_base;
34410    int ret_val;
34411    xmlSchemaTypePtr type; /* the predefined type */
34412    int n_type;
34413    xmlChar * value; /* the value to check */
34414    int n_value;
34415    xmlSchemaValPtr * val; /* the return computed value */
34416    int n_val;
34417    xmlNodePtr node; /* the node containing the value */
34418    int n_node;
34419
34420    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34421    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34422    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34423    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34424        mem_base = xmlMemBlocks();
34425        type = gen_xmlSchemaTypePtr(n_type, 0);
34426        value = gen_const_xmlChar_ptr(n_value, 1);
34427        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34428        node = gen_xmlNodePtr(n_node, 3);
34429
34430        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
34431        desret_int(ret_val);
34432        call_tests++;
34433        des_xmlSchemaTypePtr(n_type, type, 0);
34434        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34435        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34436        des_xmlNodePtr(n_node, node, 3);
34437        xmlResetLastError();
34438        if (mem_base != xmlMemBlocks()) {
34439            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
34440	           xmlMemBlocks() - mem_base);
34441	    test_ret++;
34442            printf(" %d", n_type);
34443            printf(" %d", n_value);
34444            printf(" %d", n_val);
34445            printf(" %d", n_node);
34446            printf("\n");
34447        }
34448    }
34449    }
34450    }
34451    }
34452    function_tests++;
34453#endif
34454
34455    return(test_ret);
34456}
34457
34458
34459static int
34460test_xmlSchemaValidateFacet(void) {
34461    int test_ret = 0;
34462
34463#if defined(LIBXML_SCHEMAS_ENABLED)
34464    int mem_base;
34465    int ret_val;
34466    xmlSchemaTypePtr base; /* the base type */
34467    int n_base;
34468    xmlSchemaFacetPtr facet; /* the facet to check */
34469    int n_facet;
34470    xmlChar * value; /* the lexical repr of the value to validate */
34471    int n_value;
34472    xmlSchemaValPtr val; /* the precomputed value */
34473    int n_val;
34474
34475    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
34476    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34477    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34478    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34479        mem_base = xmlMemBlocks();
34480        base = gen_xmlSchemaTypePtr(n_base, 0);
34481        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
34482        value = gen_const_xmlChar_ptr(n_value, 2);
34483        val = gen_xmlSchemaValPtr(n_val, 3);
34484
34485        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
34486        desret_int(ret_val);
34487        call_tests++;
34488        des_xmlSchemaTypePtr(n_base, base, 0);
34489        des_xmlSchemaFacetPtr(n_facet, facet, 1);
34490        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
34491        des_xmlSchemaValPtr(n_val, val, 3);
34492        xmlResetLastError();
34493        if (mem_base != xmlMemBlocks()) {
34494            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
34495	           xmlMemBlocks() - mem_base);
34496	    test_ret++;
34497            printf(" %d", n_base);
34498            printf(" %d", n_facet);
34499            printf(" %d", n_value);
34500            printf(" %d", n_val);
34501            printf("\n");
34502        }
34503    }
34504    }
34505    }
34506    }
34507    function_tests++;
34508#endif
34509
34510    return(test_ret);
34511}
34512
34513
34514static int
34515test_xmlSchemaValidateFacetWhtsp(void) {
34516    int test_ret = 0;
34517
34518#if defined(LIBXML_SCHEMAS_ENABLED)
34519    int mem_base;
34520    int ret_val;
34521    xmlSchemaFacetPtr facet; /* the facet to check */
34522    int n_facet;
34523    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
34524    int n_fws;
34525    xmlSchemaValType valType; /* the built-in type of the value */
34526    int n_valType;
34527    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
34528    int n_value;
34529    xmlSchemaValPtr val; /* the precomputed value */
34530    int n_val;
34531    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34532    int n_ws;
34533
34534    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34535    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
34536    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
34537    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34538    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34539    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34540        mem_base = xmlMemBlocks();
34541        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34542        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
34543        valType = gen_xmlSchemaValType(n_valType, 2);
34544        value = gen_const_xmlChar_ptr(n_value, 3);
34545        val = gen_xmlSchemaValPtr(n_val, 4);
34546        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
34547
34548        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
34549        desret_int(ret_val);
34550        call_tests++;
34551        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34552        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
34553        des_xmlSchemaValType(n_valType, valType, 2);
34554        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
34555        des_xmlSchemaValPtr(n_val, val, 4);
34556        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
34557        xmlResetLastError();
34558        if (mem_base != xmlMemBlocks()) {
34559            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
34560	           xmlMemBlocks() - mem_base);
34561	    test_ret++;
34562            printf(" %d", n_facet);
34563            printf(" %d", n_fws);
34564            printf(" %d", n_valType);
34565            printf(" %d", n_value);
34566            printf(" %d", n_val);
34567            printf(" %d", n_ws);
34568            printf("\n");
34569        }
34570    }
34571    }
34572    }
34573    }
34574    }
34575    }
34576    function_tests++;
34577#endif
34578
34579    return(test_ret);
34580}
34581
34582
34583static int
34584test_xmlSchemaValidateLengthFacet(void) {
34585    int test_ret = 0;
34586
34587#if defined(LIBXML_SCHEMAS_ENABLED)
34588    int mem_base;
34589    int ret_val;
34590    xmlSchemaTypePtr type; /* the built-in type */
34591    int n_type;
34592    xmlSchemaFacetPtr facet; /* the facet to check */
34593    int n_facet;
34594    xmlChar * value; /* the lexical repr. of the value to be validated */
34595    int n_value;
34596    xmlSchemaValPtr val; /* the precomputed value */
34597    int n_val;
34598    unsigned long * length; /* the actual length of the value */
34599    int n_length;
34600
34601    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34602    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34603    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34604    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34605    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
34606        mem_base = xmlMemBlocks();
34607        type = gen_xmlSchemaTypePtr(n_type, 0);
34608        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
34609        value = gen_const_xmlChar_ptr(n_value, 2);
34610        val = gen_xmlSchemaValPtr(n_val, 3);
34611        length = gen_unsigned_long_ptr(n_length, 4);
34612
34613        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
34614        desret_int(ret_val);
34615        call_tests++;
34616        des_xmlSchemaTypePtr(n_type, type, 0);
34617        des_xmlSchemaFacetPtr(n_facet, facet, 1);
34618        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
34619        des_xmlSchemaValPtr(n_val, val, 3);
34620        des_unsigned_long_ptr(n_length, length, 4);
34621        xmlResetLastError();
34622        if (mem_base != xmlMemBlocks()) {
34623            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
34624	           xmlMemBlocks() - mem_base);
34625	    test_ret++;
34626            printf(" %d", n_type);
34627            printf(" %d", n_facet);
34628            printf(" %d", n_value);
34629            printf(" %d", n_val);
34630            printf(" %d", n_length);
34631            printf("\n");
34632        }
34633    }
34634    }
34635    }
34636    }
34637    }
34638    function_tests++;
34639#endif
34640
34641    return(test_ret);
34642}
34643
34644
34645static int
34646test_xmlSchemaValidateLengthFacetWhtsp(void) {
34647    int test_ret = 0;
34648
34649#if defined(LIBXML_SCHEMAS_ENABLED)
34650    int mem_base;
34651    int ret_val;
34652    xmlSchemaFacetPtr facet; /* the facet to check */
34653    int n_facet;
34654    xmlSchemaValType valType; /* the built-in type */
34655    int n_valType;
34656    xmlChar * value; /* the lexical repr. of the value to be validated */
34657    int n_value;
34658    xmlSchemaValPtr val; /* the precomputed value */
34659    int n_val;
34660    unsigned long * length; /* the actual length of the value */
34661    int n_length;
34662    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34663    int n_ws;
34664
34665    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34666    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
34667    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34668    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34669    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
34670    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34671        mem_base = xmlMemBlocks();
34672        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34673        valType = gen_xmlSchemaValType(n_valType, 1);
34674        value = gen_const_xmlChar_ptr(n_value, 2);
34675        val = gen_xmlSchemaValPtr(n_val, 3);
34676        length = gen_unsigned_long_ptr(n_length, 4);
34677        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
34678
34679        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
34680        desret_int(ret_val);
34681        call_tests++;
34682        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34683        des_xmlSchemaValType(n_valType, valType, 1);
34684        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
34685        des_xmlSchemaValPtr(n_val, val, 3);
34686        des_unsigned_long_ptr(n_length, length, 4);
34687        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
34688        xmlResetLastError();
34689        if (mem_base != xmlMemBlocks()) {
34690            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
34691	           xmlMemBlocks() - mem_base);
34692	    test_ret++;
34693            printf(" %d", n_facet);
34694            printf(" %d", n_valType);
34695            printf(" %d", n_value);
34696            printf(" %d", n_val);
34697            printf(" %d", n_length);
34698            printf(" %d", n_ws);
34699            printf("\n");
34700        }
34701    }
34702    }
34703    }
34704    }
34705    }
34706    }
34707    function_tests++;
34708#endif
34709
34710    return(test_ret);
34711}
34712
34713
34714static int
34715test_xmlSchemaValidateListSimpleTypeFacet(void) {
34716    int test_ret = 0;
34717
34718#if defined(LIBXML_SCHEMAS_ENABLED)
34719    int mem_base;
34720    int ret_val;
34721    xmlSchemaFacetPtr facet; /* the facet to check */
34722    int n_facet;
34723    xmlChar * value; /* the lexical repr of the value to validate */
34724    int n_value;
34725    unsigned long actualLen; /* the number of list items */
34726    int n_actualLen;
34727    unsigned long * expectedLen; /* the resulting expected number of list items */
34728    int n_expectedLen;
34729
34730    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34731    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34732    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
34733    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
34734        mem_base = xmlMemBlocks();
34735        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34736        value = gen_const_xmlChar_ptr(n_value, 1);
34737        actualLen = gen_unsigned_long(n_actualLen, 2);
34738        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
34739
34740        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
34741        desret_int(ret_val);
34742        call_tests++;
34743        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34744        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34745        des_unsigned_long(n_actualLen, actualLen, 2);
34746        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
34747        xmlResetLastError();
34748        if (mem_base != xmlMemBlocks()) {
34749            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
34750	           xmlMemBlocks() - mem_base);
34751	    test_ret++;
34752            printf(" %d", n_facet);
34753            printf(" %d", n_value);
34754            printf(" %d", n_actualLen);
34755            printf(" %d", n_expectedLen);
34756            printf("\n");
34757        }
34758    }
34759    }
34760    }
34761    }
34762    function_tests++;
34763#endif
34764
34765    return(test_ret);
34766}
34767
34768
34769static int
34770test_xmlSchemaValidatePredefinedType(void) {
34771    int test_ret = 0;
34772
34773#if defined(LIBXML_SCHEMAS_ENABLED)
34774    int mem_base;
34775    int ret_val;
34776    xmlSchemaTypePtr type; /* the predefined type */
34777    int n_type;
34778    xmlChar * value; /* the value to check */
34779    int n_value;
34780    xmlSchemaValPtr * val; /* the return computed value */
34781    int n_val;
34782
34783    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34784    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34785    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34786        mem_base = xmlMemBlocks();
34787        type = gen_xmlSchemaTypePtr(n_type, 0);
34788        value = gen_const_xmlChar_ptr(n_value, 1);
34789        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34790
34791        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
34792        desret_int(ret_val);
34793        call_tests++;
34794        des_xmlSchemaTypePtr(n_type, type, 0);
34795        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34796        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34797        xmlResetLastError();
34798        if (mem_base != xmlMemBlocks()) {
34799            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
34800	           xmlMemBlocks() - mem_base);
34801	    test_ret++;
34802            printf(" %d", n_type);
34803            printf(" %d", n_value);
34804            printf(" %d", n_val);
34805            printf("\n");
34806        }
34807    }
34808    }
34809    }
34810    function_tests++;
34811#endif
34812
34813    return(test_ret);
34814}
34815
34816
34817static int
34818test_xmlSchemaValueAppend(void) {
34819    int test_ret = 0;
34820
34821#if defined(LIBXML_SCHEMAS_ENABLED)
34822    int mem_base;
34823    int ret_val;
34824    xmlSchemaValPtr prev; /* the value */
34825    int n_prev;
34826    xmlSchemaValPtr cur; /* the value to be appended */
34827    int n_cur;
34828
34829    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
34830    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
34831        mem_base = xmlMemBlocks();
34832        prev = gen_xmlSchemaValPtr(n_prev, 0);
34833        cur = gen_xmlSchemaValPtr(n_cur, 1);
34834
34835        ret_val = xmlSchemaValueAppend(prev, cur);
34836        desret_int(ret_val);
34837        call_tests++;
34838        des_xmlSchemaValPtr(n_prev, prev, 0);
34839        des_xmlSchemaValPtr(n_cur, cur, 1);
34840        xmlResetLastError();
34841        if (mem_base != xmlMemBlocks()) {
34842            printf("Leak of %d blocks found in xmlSchemaValueAppend",
34843	           xmlMemBlocks() - mem_base);
34844	    test_ret++;
34845            printf(" %d", n_prev);
34846            printf(" %d", n_cur);
34847            printf("\n");
34848        }
34849    }
34850    }
34851    function_tests++;
34852#endif
34853
34854    return(test_ret);
34855}
34856
34857
34858static int
34859test_xmlSchemaValueGetAsBoolean(void) {
34860    int test_ret = 0;
34861
34862#if defined(LIBXML_SCHEMAS_ENABLED)
34863    int mem_base;
34864    int ret_val;
34865    xmlSchemaValPtr val; /* the value */
34866    int n_val;
34867
34868    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34869        mem_base = xmlMemBlocks();
34870        val = gen_xmlSchemaValPtr(n_val, 0);
34871
34872        ret_val = xmlSchemaValueGetAsBoolean(val);
34873        desret_int(ret_val);
34874        call_tests++;
34875        des_xmlSchemaValPtr(n_val, val, 0);
34876        xmlResetLastError();
34877        if (mem_base != xmlMemBlocks()) {
34878            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
34879	           xmlMemBlocks() - mem_base);
34880	    test_ret++;
34881            printf(" %d", n_val);
34882            printf("\n");
34883        }
34884    }
34885    function_tests++;
34886#endif
34887
34888    return(test_ret);
34889}
34890
34891
34892static int
34893test_xmlSchemaValueGetAsString(void) {
34894    int test_ret = 0;
34895
34896#if defined(LIBXML_SCHEMAS_ENABLED)
34897    int mem_base;
34898    const xmlChar * ret_val;
34899    xmlSchemaValPtr val; /* the value */
34900    int n_val;
34901
34902    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34903        mem_base = xmlMemBlocks();
34904        val = gen_xmlSchemaValPtr(n_val, 0);
34905
34906        ret_val = xmlSchemaValueGetAsString(val);
34907        desret_const_xmlChar_ptr(ret_val);
34908        call_tests++;
34909        des_xmlSchemaValPtr(n_val, val, 0);
34910        xmlResetLastError();
34911        if (mem_base != xmlMemBlocks()) {
34912            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
34913	           xmlMemBlocks() - mem_base);
34914	    test_ret++;
34915            printf(" %d", n_val);
34916            printf("\n");
34917        }
34918    }
34919    function_tests++;
34920#endif
34921
34922    return(test_ret);
34923}
34924
34925
34926static int
34927test_xmlSchemaValueGetNext(void) {
34928    int test_ret = 0;
34929
34930
34931    /* missing type support */
34932    return(test_ret);
34933}
34934
34935
34936static int
34937test_xmlSchemaWhiteSpaceReplace(void) {
34938    int test_ret = 0;
34939
34940#if defined(LIBXML_SCHEMAS_ENABLED)
34941    int mem_base;
34942    xmlChar * ret_val;
34943    xmlChar * value; /* a value */
34944    int n_value;
34945
34946    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34947        mem_base = xmlMemBlocks();
34948        value = gen_const_xmlChar_ptr(n_value, 0);
34949
34950        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
34951        desret_xmlChar_ptr(ret_val);
34952        call_tests++;
34953        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34954        xmlResetLastError();
34955        if (mem_base != xmlMemBlocks()) {
34956            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
34957	           xmlMemBlocks() - mem_base);
34958	    test_ret++;
34959            printf(" %d", n_value);
34960            printf("\n");
34961        }
34962    }
34963    function_tests++;
34964#endif
34965
34966    return(test_ret);
34967}
34968
34969static int
34970test_xmlschemastypes(void) {
34971    int test_ret = 0;
34972
34973    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
34974    test_ret += test_xmlSchemaCheckFacet();
34975    test_ret += test_xmlSchemaCleanupTypes();
34976    test_ret += test_xmlSchemaCollapseString();
34977    test_ret += test_xmlSchemaCompareValues();
34978    test_ret += test_xmlSchemaCompareValuesWhtsp();
34979    test_ret += test_xmlSchemaCopyValue();
34980    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
34981    test_ret += test_xmlSchemaGetBuiltInType();
34982    test_ret += test_xmlSchemaGetCanonValue();
34983    test_ret += test_xmlSchemaGetCanonValueWhtsp();
34984    test_ret += test_xmlSchemaGetFacetValueAsULong();
34985    test_ret += test_xmlSchemaGetPredefinedType();
34986    test_ret += test_xmlSchemaGetValType();
34987    test_ret += test_xmlSchemaInitTypes();
34988    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
34989    test_ret += test_xmlSchemaNewFacet();
34990    test_ret += test_xmlSchemaNewNOTATIONValue();
34991    test_ret += test_xmlSchemaNewQNameValue();
34992    test_ret += test_xmlSchemaNewStringValue();
34993    test_ret += test_xmlSchemaValPredefTypeNode();
34994    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
34995    test_ret += test_xmlSchemaValidateFacet();
34996    test_ret += test_xmlSchemaValidateFacetWhtsp();
34997    test_ret += test_xmlSchemaValidateLengthFacet();
34998    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
34999    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35000    test_ret += test_xmlSchemaValidatePredefinedType();
35001    test_ret += test_xmlSchemaValueAppend();
35002    test_ret += test_xmlSchemaValueGetAsBoolean();
35003    test_ret += test_xmlSchemaValueGetAsString();
35004    test_ret += test_xmlSchemaValueGetNext();
35005    test_ret += test_xmlSchemaWhiteSpaceReplace();
35006
35007    if (test_ret != 0)
35008	printf("Module xmlschemastypes: %d errors\n", test_ret);
35009    return(test_ret);
35010}
35011
35012static int
35013test_xmlCharStrdup(void) {
35014    int test_ret = 0;
35015
35016    int mem_base;
35017    xmlChar * ret_val;
35018    char * cur; /* the input char * */
35019    int n_cur;
35020
35021    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35022        mem_base = xmlMemBlocks();
35023        cur = gen_const_char_ptr(n_cur, 0);
35024
35025        ret_val = xmlCharStrdup((const char *)cur);
35026        desret_xmlChar_ptr(ret_val);
35027        call_tests++;
35028        des_const_char_ptr(n_cur, (const char *)cur, 0);
35029        xmlResetLastError();
35030        if (mem_base != xmlMemBlocks()) {
35031            printf("Leak of %d blocks found in xmlCharStrdup",
35032	           xmlMemBlocks() - mem_base);
35033	    test_ret++;
35034            printf(" %d", n_cur);
35035            printf("\n");
35036        }
35037    }
35038    function_tests++;
35039
35040    return(test_ret);
35041}
35042
35043
35044static int
35045test_xmlCharStrndup(void) {
35046    int test_ret = 0;
35047
35048    int mem_base;
35049    xmlChar * ret_val;
35050    char * cur; /* the input char * */
35051    int n_cur;
35052    int len; /* the len of @cur */
35053    int n_len;
35054
35055    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35056    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35057        mem_base = xmlMemBlocks();
35058        cur = gen_const_char_ptr(n_cur, 0);
35059        len = gen_int(n_len, 1);
35060
35061        ret_val = xmlCharStrndup((const char *)cur, len);
35062        desret_xmlChar_ptr(ret_val);
35063        call_tests++;
35064        des_const_char_ptr(n_cur, (const char *)cur, 0);
35065        des_int(n_len, len, 1);
35066        xmlResetLastError();
35067        if (mem_base != xmlMemBlocks()) {
35068            printf("Leak of %d blocks found in xmlCharStrndup",
35069	           xmlMemBlocks() - mem_base);
35070	    test_ret++;
35071            printf(" %d", n_cur);
35072            printf(" %d", n_len);
35073            printf("\n");
35074        }
35075    }
35076    }
35077    function_tests++;
35078
35079    return(test_ret);
35080}
35081
35082
35083static int
35084test_xmlCheckUTF8(void) {
35085    int test_ret = 0;
35086
35087    int mem_base;
35088    int ret_val;
35089    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35090    int n_utf;
35091
35092    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35093        mem_base = xmlMemBlocks();
35094        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35095
35096        ret_val = xmlCheckUTF8((const unsigned char *)utf);
35097        desret_int(ret_val);
35098        call_tests++;
35099        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35100        xmlResetLastError();
35101        if (mem_base != xmlMemBlocks()) {
35102            printf("Leak of %d blocks found in xmlCheckUTF8",
35103	           xmlMemBlocks() - mem_base);
35104	    test_ret++;
35105            printf(" %d", n_utf);
35106            printf("\n");
35107        }
35108    }
35109    function_tests++;
35110
35111    return(test_ret);
35112}
35113
35114
35115static int
35116test_xmlGetUTF8Char(void) {
35117    int test_ret = 0;
35118
35119    int mem_base;
35120    int ret_val;
35121    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35122    int n_utf;
35123    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. */
35124    int n_len;
35125
35126    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35127    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35128        mem_base = xmlMemBlocks();
35129        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35130        len = gen_int_ptr(n_len, 1);
35131
35132        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35133        desret_int(ret_val);
35134        call_tests++;
35135        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35136        des_int_ptr(n_len, len, 1);
35137        xmlResetLastError();
35138        if (mem_base != xmlMemBlocks()) {
35139            printf("Leak of %d blocks found in xmlGetUTF8Char",
35140	           xmlMemBlocks() - mem_base);
35141	    test_ret++;
35142            printf(" %d", n_utf);
35143            printf(" %d", n_len);
35144            printf("\n");
35145        }
35146    }
35147    }
35148    function_tests++;
35149
35150    return(test_ret);
35151}
35152
35153
35154static int
35155test_xmlStrEqual(void) {
35156    int test_ret = 0;
35157
35158    int mem_base;
35159    int ret_val;
35160    xmlChar * str1; /* the first xmlChar * */
35161    int n_str1;
35162    xmlChar * str2; /* the second xmlChar * */
35163    int n_str2;
35164
35165    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35166    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35167        mem_base = xmlMemBlocks();
35168        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35169        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35170
35171        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35172        desret_int(ret_val);
35173        call_tests++;
35174        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35175        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35176        xmlResetLastError();
35177        if (mem_base != xmlMemBlocks()) {
35178            printf("Leak of %d blocks found in xmlStrEqual",
35179	           xmlMemBlocks() - mem_base);
35180	    test_ret++;
35181            printf(" %d", n_str1);
35182            printf(" %d", n_str2);
35183            printf("\n");
35184        }
35185    }
35186    }
35187    function_tests++;
35188
35189    return(test_ret);
35190}
35191
35192
35193static int
35194test_xmlStrPrintf(void) {
35195    int test_ret = 0;
35196
35197
35198    /* missing type support */
35199    return(test_ret);
35200}
35201
35202
35203static int
35204test_xmlStrQEqual(void) {
35205    int test_ret = 0;
35206
35207    int mem_base;
35208    int ret_val;
35209    xmlChar * pref; /* the prefix of the QName */
35210    int n_pref;
35211    xmlChar * name; /* the localname of the QName */
35212    int n_name;
35213    xmlChar * str; /* the second xmlChar * */
35214    int n_str;
35215
35216    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35217    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35218    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35219        mem_base = xmlMemBlocks();
35220        pref = gen_const_xmlChar_ptr(n_pref, 0);
35221        name = gen_const_xmlChar_ptr(n_name, 1);
35222        str = gen_const_xmlChar_ptr(n_str, 2);
35223
35224        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35225        desret_int(ret_val);
35226        call_tests++;
35227        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35228        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35229        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35230        xmlResetLastError();
35231        if (mem_base != xmlMemBlocks()) {
35232            printf("Leak of %d blocks found in xmlStrQEqual",
35233	           xmlMemBlocks() - mem_base);
35234	    test_ret++;
35235            printf(" %d", n_pref);
35236            printf(" %d", n_name);
35237            printf(" %d", n_str);
35238            printf("\n");
35239        }
35240    }
35241    }
35242    }
35243    function_tests++;
35244
35245    return(test_ret);
35246}
35247
35248
35249static int
35250test_xmlStrVPrintf(void) {
35251    int test_ret = 0;
35252
35253
35254    /* missing type support */
35255    return(test_ret);
35256}
35257
35258
35259static int
35260test_xmlStrcasecmp(void) {
35261    int test_ret = 0;
35262
35263    int mem_base;
35264    int ret_val;
35265    xmlChar * str1; /* the first xmlChar * */
35266    int n_str1;
35267    xmlChar * str2; /* the second xmlChar * */
35268    int n_str2;
35269
35270    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35271    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35272        mem_base = xmlMemBlocks();
35273        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35274        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35275
35276        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35277        desret_int(ret_val);
35278        call_tests++;
35279        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35280        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35281        xmlResetLastError();
35282        if (mem_base != xmlMemBlocks()) {
35283            printf("Leak of %d blocks found in xmlStrcasecmp",
35284	           xmlMemBlocks() - mem_base);
35285	    test_ret++;
35286            printf(" %d", n_str1);
35287            printf(" %d", n_str2);
35288            printf("\n");
35289        }
35290    }
35291    }
35292    function_tests++;
35293
35294    return(test_ret);
35295}
35296
35297
35298static int
35299test_xmlStrcasestr(void) {
35300    int test_ret = 0;
35301
35302    int mem_base;
35303    const xmlChar * ret_val;
35304    xmlChar * str; /* the xmlChar * array (haystack) */
35305    int n_str;
35306    xmlChar * val; /* the xmlChar to search (needle) */
35307    int n_val;
35308
35309    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35310    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35311        mem_base = xmlMemBlocks();
35312        str = gen_const_xmlChar_ptr(n_str, 0);
35313        val = gen_xmlChar_ptr(n_val, 1);
35314
35315        ret_val = xmlStrcasestr((const xmlChar *)str, val);
35316        desret_const_xmlChar_ptr(ret_val);
35317        call_tests++;
35318        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35319        des_xmlChar_ptr(n_val, val, 1);
35320        xmlResetLastError();
35321        if (mem_base != xmlMemBlocks()) {
35322            printf("Leak of %d blocks found in xmlStrcasestr",
35323	           xmlMemBlocks() - mem_base);
35324	    test_ret++;
35325            printf(" %d", n_str);
35326            printf(" %d", n_val);
35327            printf("\n");
35328        }
35329    }
35330    }
35331    function_tests++;
35332
35333    return(test_ret);
35334}
35335
35336
35337static int
35338test_xmlStrchr(void) {
35339    int test_ret = 0;
35340
35341    int mem_base;
35342    const xmlChar * ret_val;
35343    xmlChar * str; /* the xmlChar * array */
35344    int n_str;
35345    xmlChar val; /* the xmlChar to search */
35346    int n_val;
35347
35348    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35349    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
35350        mem_base = xmlMemBlocks();
35351        str = gen_const_xmlChar_ptr(n_str, 0);
35352        val = gen_xmlChar(n_val, 1);
35353
35354        ret_val = xmlStrchr((const xmlChar *)str, val);
35355        desret_const_xmlChar_ptr(ret_val);
35356        call_tests++;
35357        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35358        des_xmlChar(n_val, val, 1);
35359        xmlResetLastError();
35360        if (mem_base != xmlMemBlocks()) {
35361            printf("Leak of %d blocks found in xmlStrchr",
35362	           xmlMemBlocks() - mem_base);
35363	    test_ret++;
35364            printf(" %d", n_str);
35365            printf(" %d", n_val);
35366            printf("\n");
35367        }
35368    }
35369    }
35370    function_tests++;
35371
35372    return(test_ret);
35373}
35374
35375
35376static int
35377test_xmlStrcmp(void) {
35378    int test_ret = 0;
35379
35380    int mem_base;
35381    int ret_val;
35382    xmlChar * str1; /* the first xmlChar * */
35383    int n_str1;
35384    xmlChar * str2; /* the second xmlChar * */
35385    int n_str2;
35386
35387    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35388    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35389        mem_base = xmlMemBlocks();
35390        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35391        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35392
35393        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
35394        desret_int(ret_val);
35395        call_tests++;
35396        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35397        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35398        xmlResetLastError();
35399        if (mem_base != xmlMemBlocks()) {
35400            printf("Leak of %d blocks found in xmlStrcmp",
35401	           xmlMemBlocks() - mem_base);
35402	    test_ret++;
35403            printf(" %d", n_str1);
35404            printf(" %d", n_str2);
35405            printf("\n");
35406        }
35407    }
35408    }
35409    function_tests++;
35410
35411    return(test_ret);
35412}
35413
35414
35415static int
35416test_xmlStrdup(void) {
35417    int test_ret = 0;
35418
35419    int mem_base;
35420    xmlChar * ret_val;
35421    xmlChar * cur; /* the input xmlChar * */
35422    int n_cur;
35423
35424    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
35425        mem_base = xmlMemBlocks();
35426        cur = gen_const_xmlChar_ptr(n_cur, 0);
35427
35428        ret_val = xmlStrdup((const xmlChar *)cur);
35429        desret_xmlChar_ptr(ret_val);
35430        call_tests++;
35431        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
35432        xmlResetLastError();
35433        if (mem_base != xmlMemBlocks()) {
35434            printf("Leak of %d blocks found in xmlStrdup",
35435	           xmlMemBlocks() - mem_base);
35436	    test_ret++;
35437            printf(" %d", n_cur);
35438            printf("\n");
35439        }
35440    }
35441    function_tests++;
35442
35443    return(test_ret);
35444}
35445
35446
35447static int
35448test_xmlStrlen(void) {
35449    int test_ret = 0;
35450
35451    int mem_base;
35452    int ret_val;
35453    xmlChar * str; /* the xmlChar * array */
35454    int n_str;
35455
35456    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35457        mem_base = xmlMemBlocks();
35458        str = gen_const_xmlChar_ptr(n_str, 0);
35459
35460        ret_val = xmlStrlen((const xmlChar *)str);
35461        desret_int(ret_val);
35462        call_tests++;
35463        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35464        xmlResetLastError();
35465        if (mem_base != xmlMemBlocks()) {
35466            printf("Leak of %d blocks found in xmlStrlen",
35467	           xmlMemBlocks() - mem_base);
35468	    test_ret++;
35469            printf(" %d", n_str);
35470            printf("\n");
35471        }
35472    }
35473    function_tests++;
35474
35475    return(test_ret);
35476}
35477
35478
35479static int
35480test_xmlStrncasecmp(void) {
35481    int test_ret = 0;
35482
35483    int mem_base;
35484    int ret_val;
35485    xmlChar * str1; /* the first xmlChar * */
35486    int n_str1;
35487    xmlChar * str2; /* the second xmlChar * */
35488    int n_str2;
35489    int len; /* the max comparison length */
35490    int n_len;
35491
35492    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35493    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35494    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35495        mem_base = xmlMemBlocks();
35496        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35497        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35498        len = gen_int(n_len, 2);
35499
35500        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
35501        desret_int(ret_val);
35502        call_tests++;
35503        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35504        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35505        des_int(n_len, len, 2);
35506        xmlResetLastError();
35507        if (mem_base != xmlMemBlocks()) {
35508            printf("Leak of %d blocks found in xmlStrncasecmp",
35509	           xmlMemBlocks() - mem_base);
35510	    test_ret++;
35511            printf(" %d", n_str1);
35512            printf(" %d", n_str2);
35513            printf(" %d", n_len);
35514            printf("\n");
35515        }
35516    }
35517    }
35518    }
35519    function_tests++;
35520
35521    return(test_ret);
35522}
35523
35524
35525static int
35526test_xmlStrncatNew(void) {
35527    int test_ret = 0;
35528
35529    int mem_base;
35530    xmlChar * ret_val;
35531    xmlChar * str1; /* first xmlChar string */
35532    int n_str1;
35533    xmlChar * str2; /* second xmlChar string */
35534    int n_str2;
35535    int len; /* the len of @str2 */
35536    int n_len;
35537
35538    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35539    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35540    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35541        mem_base = xmlMemBlocks();
35542        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35543        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35544        len = gen_int(n_len, 2);
35545
35546        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
35547        desret_xmlChar_ptr(ret_val);
35548        call_tests++;
35549        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35550        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35551        des_int(n_len, len, 2);
35552        xmlResetLastError();
35553        if (mem_base != xmlMemBlocks()) {
35554            printf("Leak of %d blocks found in xmlStrncatNew",
35555	           xmlMemBlocks() - mem_base);
35556	    test_ret++;
35557            printf(" %d", n_str1);
35558            printf(" %d", n_str2);
35559            printf(" %d", n_len);
35560            printf("\n");
35561        }
35562    }
35563    }
35564    }
35565    function_tests++;
35566
35567    return(test_ret);
35568}
35569
35570
35571static int
35572test_xmlStrncmp(void) {
35573    int test_ret = 0;
35574
35575    int mem_base;
35576    int ret_val;
35577    xmlChar * str1; /* the first xmlChar * */
35578    int n_str1;
35579    xmlChar * str2; /* the second xmlChar * */
35580    int n_str2;
35581    int len; /* the max comparison length */
35582    int n_len;
35583
35584    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35585    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35586    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35587        mem_base = xmlMemBlocks();
35588        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35589        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35590        len = gen_int(n_len, 2);
35591
35592        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
35593        desret_int(ret_val);
35594        call_tests++;
35595        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35596        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35597        des_int(n_len, len, 2);
35598        xmlResetLastError();
35599        if (mem_base != xmlMemBlocks()) {
35600            printf("Leak of %d blocks found in xmlStrncmp",
35601	           xmlMemBlocks() - mem_base);
35602	    test_ret++;
35603            printf(" %d", n_str1);
35604            printf(" %d", n_str2);
35605            printf(" %d", n_len);
35606            printf("\n");
35607        }
35608    }
35609    }
35610    }
35611    function_tests++;
35612
35613    return(test_ret);
35614}
35615
35616
35617static int
35618test_xmlStrndup(void) {
35619    int test_ret = 0;
35620
35621    int mem_base;
35622    xmlChar * ret_val;
35623    xmlChar * cur; /* the input xmlChar * */
35624    int n_cur;
35625    int len; /* the len of @cur */
35626    int n_len;
35627
35628    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
35629    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35630        mem_base = xmlMemBlocks();
35631        cur = gen_const_xmlChar_ptr(n_cur, 0);
35632        len = gen_int(n_len, 1);
35633
35634        ret_val = xmlStrndup((const xmlChar *)cur, len);
35635        desret_xmlChar_ptr(ret_val);
35636        call_tests++;
35637        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
35638        des_int(n_len, len, 1);
35639        xmlResetLastError();
35640        if (mem_base != xmlMemBlocks()) {
35641            printf("Leak of %d blocks found in xmlStrndup",
35642	           xmlMemBlocks() - mem_base);
35643	    test_ret++;
35644            printf(" %d", n_cur);
35645            printf(" %d", n_len);
35646            printf("\n");
35647        }
35648    }
35649    }
35650    function_tests++;
35651
35652    return(test_ret);
35653}
35654
35655
35656static int
35657test_xmlStrstr(void) {
35658    int test_ret = 0;
35659
35660    int mem_base;
35661    const xmlChar * ret_val;
35662    xmlChar * str; /* the xmlChar * array (haystack) */
35663    int n_str;
35664    xmlChar * val; /* the xmlChar to search (needle) */
35665    int n_val;
35666
35667    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35668    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
35669        mem_base = xmlMemBlocks();
35670        str = gen_const_xmlChar_ptr(n_str, 0);
35671        val = gen_const_xmlChar_ptr(n_val, 1);
35672
35673        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
35674        desret_const_xmlChar_ptr(ret_val);
35675        call_tests++;
35676        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35677        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
35678        xmlResetLastError();
35679        if (mem_base != xmlMemBlocks()) {
35680            printf("Leak of %d blocks found in xmlStrstr",
35681	           xmlMemBlocks() - mem_base);
35682	    test_ret++;
35683            printf(" %d", n_str);
35684            printf(" %d", n_val);
35685            printf("\n");
35686        }
35687    }
35688    }
35689    function_tests++;
35690
35691    return(test_ret);
35692}
35693
35694
35695static int
35696test_xmlStrsub(void) {
35697    int test_ret = 0;
35698
35699    int mem_base;
35700    xmlChar * ret_val;
35701    xmlChar * str; /* the xmlChar * array (haystack) */
35702    int n_str;
35703    int start; /* the index of the first char (zero based) */
35704    int n_start;
35705    int len; /* the length of the substring */
35706    int n_len;
35707
35708    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35709    for (n_start = 0;n_start < gen_nb_int;n_start++) {
35710    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35711        mem_base = xmlMemBlocks();
35712        str = gen_const_xmlChar_ptr(n_str, 0);
35713        start = gen_int(n_start, 1);
35714        len = gen_int(n_len, 2);
35715
35716        ret_val = xmlStrsub((const xmlChar *)str, start, len);
35717        desret_xmlChar_ptr(ret_val);
35718        call_tests++;
35719        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35720        des_int(n_start, start, 1);
35721        des_int(n_len, len, 2);
35722        xmlResetLastError();
35723        if (mem_base != xmlMemBlocks()) {
35724            printf("Leak of %d blocks found in xmlStrsub",
35725	           xmlMemBlocks() - mem_base);
35726	    test_ret++;
35727            printf(" %d", n_str);
35728            printf(" %d", n_start);
35729            printf(" %d", n_len);
35730            printf("\n");
35731        }
35732    }
35733    }
35734    }
35735    function_tests++;
35736
35737    return(test_ret);
35738}
35739
35740
35741static int
35742test_xmlUTF8Charcmp(void) {
35743    int test_ret = 0;
35744
35745    int mem_base;
35746    int ret_val;
35747    xmlChar * utf1; /* pointer to first UTF8 char */
35748    int n_utf1;
35749    xmlChar * utf2; /* pointer to second UTF8 char */
35750    int n_utf2;
35751
35752    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
35753    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
35754        mem_base = xmlMemBlocks();
35755        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
35756        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
35757
35758        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
35759        desret_int(ret_val);
35760        call_tests++;
35761        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
35762        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
35763        xmlResetLastError();
35764        if (mem_base != xmlMemBlocks()) {
35765            printf("Leak of %d blocks found in xmlUTF8Charcmp",
35766	           xmlMemBlocks() - mem_base);
35767	    test_ret++;
35768            printf(" %d", n_utf1);
35769            printf(" %d", n_utf2);
35770            printf("\n");
35771        }
35772    }
35773    }
35774    function_tests++;
35775
35776    return(test_ret);
35777}
35778
35779
35780static int
35781test_xmlUTF8Size(void) {
35782    int test_ret = 0;
35783
35784    int mem_base;
35785    int ret_val;
35786    xmlChar * utf; /* pointer to the UTF8 character */
35787    int n_utf;
35788
35789    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35790        mem_base = xmlMemBlocks();
35791        utf = gen_const_xmlChar_ptr(n_utf, 0);
35792
35793        ret_val = xmlUTF8Size((const xmlChar *)utf);
35794        desret_int(ret_val);
35795        call_tests++;
35796        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35797        xmlResetLastError();
35798        if (mem_base != xmlMemBlocks()) {
35799            printf("Leak of %d blocks found in xmlUTF8Size",
35800	           xmlMemBlocks() - mem_base);
35801	    test_ret++;
35802            printf(" %d", n_utf);
35803            printf("\n");
35804        }
35805    }
35806    function_tests++;
35807
35808    return(test_ret);
35809}
35810
35811
35812static int
35813test_xmlUTF8Strlen(void) {
35814    int test_ret = 0;
35815
35816    int mem_base;
35817    int ret_val;
35818    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
35819    int n_utf;
35820
35821    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35822        mem_base = xmlMemBlocks();
35823        utf = gen_const_xmlChar_ptr(n_utf, 0);
35824
35825        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
35826        desret_int(ret_val);
35827        call_tests++;
35828        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35829        xmlResetLastError();
35830        if (mem_base != xmlMemBlocks()) {
35831            printf("Leak of %d blocks found in xmlUTF8Strlen",
35832	           xmlMemBlocks() - mem_base);
35833	    test_ret++;
35834            printf(" %d", n_utf);
35835            printf("\n");
35836        }
35837    }
35838    function_tests++;
35839
35840    return(test_ret);
35841}
35842
35843
35844static int
35845test_xmlUTF8Strloc(void) {
35846    int test_ret = 0;
35847
35848    int mem_base;
35849    int ret_val;
35850    xmlChar * utf; /* the input UTF8 * */
35851    int n_utf;
35852    xmlChar * utfchar; /* the UTF8 character to be found */
35853    int n_utfchar;
35854
35855    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35856    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
35857        mem_base = xmlMemBlocks();
35858        utf = gen_const_xmlChar_ptr(n_utf, 0);
35859        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
35860
35861        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
35862        desret_int(ret_val);
35863        call_tests++;
35864        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35865        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
35866        xmlResetLastError();
35867        if (mem_base != xmlMemBlocks()) {
35868            printf("Leak of %d blocks found in xmlUTF8Strloc",
35869	           xmlMemBlocks() - mem_base);
35870	    test_ret++;
35871            printf(" %d", n_utf);
35872            printf(" %d", n_utfchar);
35873            printf("\n");
35874        }
35875    }
35876    }
35877    function_tests++;
35878
35879    return(test_ret);
35880}
35881
35882
35883static int
35884test_xmlUTF8Strndup(void) {
35885    int test_ret = 0;
35886
35887    int mem_base;
35888    xmlChar * ret_val;
35889    xmlChar * utf; /* the input UTF8 * */
35890    int n_utf;
35891    int len; /* the len of @utf (in chars) */
35892    int n_len;
35893
35894    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35895    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35896        mem_base = xmlMemBlocks();
35897        utf = gen_const_xmlChar_ptr(n_utf, 0);
35898        len = gen_int(n_len, 1);
35899
35900        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
35901        desret_xmlChar_ptr(ret_val);
35902        call_tests++;
35903        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35904        des_int(n_len, len, 1);
35905        xmlResetLastError();
35906        if (mem_base != xmlMemBlocks()) {
35907            printf("Leak of %d blocks found in xmlUTF8Strndup",
35908	           xmlMemBlocks() - mem_base);
35909	    test_ret++;
35910            printf(" %d", n_utf);
35911            printf(" %d", n_len);
35912            printf("\n");
35913        }
35914    }
35915    }
35916    function_tests++;
35917
35918    return(test_ret);
35919}
35920
35921
35922static int
35923test_xmlUTF8Strpos(void) {
35924    int test_ret = 0;
35925
35926    int mem_base;
35927    const xmlChar * ret_val;
35928    xmlChar * utf; /* the input UTF8 * */
35929    int n_utf;
35930    int pos; /* the position of the desired UTF8 char (in chars) */
35931    int n_pos;
35932
35933    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35934    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
35935        mem_base = xmlMemBlocks();
35936        utf = gen_const_xmlChar_ptr(n_utf, 0);
35937        pos = gen_int(n_pos, 1);
35938
35939        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
35940        desret_const_xmlChar_ptr(ret_val);
35941        call_tests++;
35942        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35943        des_int(n_pos, pos, 1);
35944        xmlResetLastError();
35945        if (mem_base != xmlMemBlocks()) {
35946            printf("Leak of %d blocks found in xmlUTF8Strpos",
35947	           xmlMemBlocks() - mem_base);
35948	    test_ret++;
35949            printf(" %d", n_utf);
35950            printf(" %d", n_pos);
35951            printf("\n");
35952        }
35953    }
35954    }
35955    function_tests++;
35956
35957    return(test_ret);
35958}
35959
35960
35961static int
35962test_xmlUTF8Strsize(void) {
35963    int test_ret = 0;
35964
35965    int mem_base;
35966    int ret_val;
35967    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
35968    int n_utf;
35969    int len; /* the number of characters in the array */
35970    int n_len;
35971
35972    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35973    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35974        mem_base = xmlMemBlocks();
35975        utf = gen_const_xmlChar_ptr(n_utf, 0);
35976        len = gen_int(n_len, 1);
35977
35978        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
35979        desret_int(ret_val);
35980        call_tests++;
35981        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35982        des_int(n_len, len, 1);
35983        xmlResetLastError();
35984        if (mem_base != xmlMemBlocks()) {
35985            printf("Leak of %d blocks found in xmlUTF8Strsize",
35986	           xmlMemBlocks() - mem_base);
35987	    test_ret++;
35988            printf(" %d", n_utf);
35989            printf(" %d", n_len);
35990            printf("\n");
35991        }
35992    }
35993    }
35994    function_tests++;
35995
35996    return(test_ret);
35997}
35998
35999
36000static int
36001test_xmlUTF8Strsub(void) {
36002    int test_ret = 0;
36003
36004    int mem_base;
36005    xmlChar * ret_val;
36006    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36007    int n_utf;
36008    int start; /* relative pos of first char */
36009    int n_start;
36010    int len; /* total number to copy */
36011    int n_len;
36012
36013    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36014    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36015    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36016        mem_base = xmlMemBlocks();
36017        utf = gen_const_xmlChar_ptr(n_utf, 0);
36018        start = gen_int(n_start, 1);
36019        len = gen_int(n_len, 2);
36020
36021        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36022        desret_xmlChar_ptr(ret_val);
36023        call_tests++;
36024        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36025        des_int(n_start, start, 1);
36026        des_int(n_len, len, 2);
36027        xmlResetLastError();
36028        if (mem_base != xmlMemBlocks()) {
36029            printf("Leak of %d blocks found in xmlUTF8Strsub",
36030	           xmlMemBlocks() - mem_base);
36031	    test_ret++;
36032            printf(" %d", n_utf);
36033            printf(" %d", n_start);
36034            printf(" %d", n_len);
36035            printf("\n");
36036        }
36037    }
36038    }
36039    }
36040    function_tests++;
36041
36042    return(test_ret);
36043}
36044
36045static int
36046test_xmlstring(void) {
36047    int test_ret = 0;
36048
36049    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36050    test_ret += test_xmlCharStrdup();
36051    test_ret += test_xmlCharStrndup();
36052    test_ret += test_xmlCheckUTF8();
36053    test_ret += test_xmlGetUTF8Char();
36054    test_ret += test_xmlStrEqual();
36055    test_ret += test_xmlStrPrintf();
36056    test_ret += test_xmlStrQEqual();
36057    test_ret += test_xmlStrVPrintf();
36058    test_ret += test_xmlStrcasecmp();
36059    test_ret += test_xmlStrcasestr();
36060    test_ret += test_xmlStrchr();
36061    test_ret += test_xmlStrcmp();
36062    test_ret += test_xmlStrdup();
36063    test_ret += test_xmlStrlen();
36064    test_ret += test_xmlStrncasecmp();
36065    test_ret += test_xmlStrncatNew();
36066    test_ret += test_xmlStrncmp();
36067    test_ret += test_xmlStrndup();
36068    test_ret += test_xmlStrstr();
36069    test_ret += test_xmlStrsub();
36070    test_ret += test_xmlUTF8Charcmp();
36071    test_ret += test_xmlUTF8Size();
36072    test_ret += test_xmlUTF8Strlen();
36073    test_ret += test_xmlUTF8Strloc();
36074    test_ret += test_xmlUTF8Strndup();
36075    test_ret += test_xmlUTF8Strpos();
36076    test_ret += test_xmlUTF8Strsize();
36077    test_ret += test_xmlUTF8Strsub();
36078
36079    if (test_ret != 0)
36080	printf("Module xmlstring: %d errors\n", test_ret);
36081    return(test_ret);
36082}
36083
36084static int
36085test_xmlUCSIsAegeanNumbers(void) {
36086    int test_ret = 0;
36087
36088#if defined(LIBXML_UNICODE_ENABLED)
36089    int mem_base;
36090    int ret_val;
36091    int code; /* UCS code point */
36092    int n_code;
36093
36094    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36095        mem_base = xmlMemBlocks();
36096        code = gen_int(n_code, 0);
36097
36098        ret_val = xmlUCSIsAegeanNumbers(code);
36099        desret_int(ret_val);
36100        call_tests++;
36101        des_int(n_code, code, 0);
36102        xmlResetLastError();
36103        if (mem_base != xmlMemBlocks()) {
36104            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36105	           xmlMemBlocks() - mem_base);
36106	    test_ret++;
36107            printf(" %d", n_code);
36108            printf("\n");
36109        }
36110    }
36111    function_tests++;
36112#endif
36113
36114    return(test_ret);
36115}
36116
36117
36118static int
36119test_xmlUCSIsAlphabeticPresentationForms(void) {
36120    int test_ret = 0;
36121
36122#if defined(LIBXML_UNICODE_ENABLED)
36123    int mem_base;
36124    int ret_val;
36125    int code; /* UCS code point */
36126    int n_code;
36127
36128    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36129        mem_base = xmlMemBlocks();
36130        code = gen_int(n_code, 0);
36131
36132        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36133        desret_int(ret_val);
36134        call_tests++;
36135        des_int(n_code, code, 0);
36136        xmlResetLastError();
36137        if (mem_base != xmlMemBlocks()) {
36138            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36139	           xmlMemBlocks() - mem_base);
36140	    test_ret++;
36141            printf(" %d", n_code);
36142            printf("\n");
36143        }
36144    }
36145    function_tests++;
36146#endif
36147
36148    return(test_ret);
36149}
36150
36151
36152static int
36153test_xmlUCSIsArabic(void) {
36154    int test_ret = 0;
36155
36156#if defined(LIBXML_UNICODE_ENABLED)
36157    int mem_base;
36158    int ret_val;
36159    int code; /* UCS code point */
36160    int n_code;
36161
36162    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36163        mem_base = xmlMemBlocks();
36164        code = gen_int(n_code, 0);
36165
36166        ret_val = xmlUCSIsArabic(code);
36167        desret_int(ret_val);
36168        call_tests++;
36169        des_int(n_code, code, 0);
36170        xmlResetLastError();
36171        if (mem_base != xmlMemBlocks()) {
36172            printf("Leak of %d blocks found in xmlUCSIsArabic",
36173	           xmlMemBlocks() - mem_base);
36174	    test_ret++;
36175            printf(" %d", n_code);
36176            printf("\n");
36177        }
36178    }
36179    function_tests++;
36180#endif
36181
36182    return(test_ret);
36183}
36184
36185
36186static int
36187test_xmlUCSIsArabicPresentationFormsA(void) {
36188    int test_ret = 0;
36189
36190#if defined(LIBXML_UNICODE_ENABLED)
36191    int mem_base;
36192    int ret_val;
36193    int code; /* UCS code point */
36194    int n_code;
36195
36196    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36197        mem_base = xmlMemBlocks();
36198        code = gen_int(n_code, 0);
36199
36200        ret_val = xmlUCSIsArabicPresentationFormsA(code);
36201        desret_int(ret_val);
36202        call_tests++;
36203        des_int(n_code, code, 0);
36204        xmlResetLastError();
36205        if (mem_base != xmlMemBlocks()) {
36206            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36207	           xmlMemBlocks() - mem_base);
36208	    test_ret++;
36209            printf(" %d", n_code);
36210            printf("\n");
36211        }
36212    }
36213    function_tests++;
36214#endif
36215
36216    return(test_ret);
36217}
36218
36219
36220static int
36221test_xmlUCSIsArabicPresentationFormsB(void) {
36222    int test_ret = 0;
36223
36224#if defined(LIBXML_UNICODE_ENABLED)
36225    int mem_base;
36226    int ret_val;
36227    int code; /* UCS code point */
36228    int n_code;
36229
36230    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36231        mem_base = xmlMemBlocks();
36232        code = gen_int(n_code, 0);
36233
36234        ret_val = xmlUCSIsArabicPresentationFormsB(code);
36235        desret_int(ret_val);
36236        call_tests++;
36237        des_int(n_code, code, 0);
36238        xmlResetLastError();
36239        if (mem_base != xmlMemBlocks()) {
36240            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36241	           xmlMemBlocks() - mem_base);
36242	    test_ret++;
36243            printf(" %d", n_code);
36244            printf("\n");
36245        }
36246    }
36247    function_tests++;
36248#endif
36249
36250    return(test_ret);
36251}
36252
36253
36254static int
36255test_xmlUCSIsArmenian(void) {
36256    int test_ret = 0;
36257
36258#if defined(LIBXML_UNICODE_ENABLED)
36259    int mem_base;
36260    int ret_val;
36261    int code; /* UCS code point */
36262    int n_code;
36263
36264    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36265        mem_base = xmlMemBlocks();
36266        code = gen_int(n_code, 0);
36267
36268        ret_val = xmlUCSIsArmenian(code);
36269        desret_int(ret_val);
36270        call_tests++;
36271        des_int(n_code, code, 0);
36272        xmlResetLastError();
36273        if (mem_base != xmlMemBlocks()) {
36274            printf("Leak of %d blocks found in xmlUCSIsArmenian",
36275	           xmlMemBlocks() - mem_base);
36276	    test_ret++;
36277            printf(" %d", n_code);
36278            printf("\n");
36279        }
36280    }
36281    function_tests++;
36282#endif
36283
36284    return(test_ret);
36285}
36286
36287
36288static int
36289test_xmlUCSIsArrows(void) {
36290    int test_ret = 0;
36291
36292#if defined(LIBXML_UNICODE_ENABLED)
36293    int mem_base;
36294    int ret_val;
36295    int code; /* UCS code point */
36296    int n_code;
36297
36298    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36299        mem_base = xmlMemBlocks();
36300        code = gen_int(n_code, 0);
36301
36302        ret_val = xmlUCSIsArrows(code);
36303        desret_int(ret_val);
36304        call_tests++;
36305        des_int(n_code, code, 0);
36306        xmlResetLastError();
36307        if (mem_base != xmlMemBlocks()) {
36308            printf("Leak of %d blocks found in xmlUCSIsArrows",
36309	           xmlMemBlocks() - mem_base);
36310	    test_ret++;
36311            printf(" %d", n_code);
36312            printf("\n");
36313        }
36314    }
36315    function_tests++;
36316#endif
36317
36318    return(test_ret);
36319}
36320
36321
36322static int
36323test_xmlUCSIsBasicLatin(void) {
36324    int test_ret = 0;
36325
36326#if defined(LIBXML_UNICODE_ENABLED)
36327    int mem_base;
36328    int ret_val;
36329    int code; /* UCS code point */
36330    int n_code;
36331
36332    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36333        mem_base = xmlMemBlocks();
36334        code = gen_int(n_code, 0);
36335
36336        ret_val = xmlUCSIsBasicLatin(code);
36337        desret_int(ret_val);
36338        call_tests++;
36339        des_int(n_code, code, 0);
36340        xmlResetLastError();
36341        if (mem_base != xmlMemBlocks()) {
36342            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
36343	           xmlMemBlocks() - mem_base);
36344	    test_ret++;
36345            printf(" %d", n_code);
36346            printf("\n");
36347        }
36348    }
36349    function_tests++;
36350#endif
36351
36352    return(test_ret);
36353}
36354
36355
36356static int
36357test_xmlUCSIsBengali(void) {
36358    int test_ret = 0;
36359
36360#if defined(LIBXML_UNICODE_ENABLED)
36361    int mem_base;
36362    int ret_val;
36363    int code; /* UCS code point */
36364    int n_code;
36365
36366    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36367        mem_base = xmlMemBlocks();
36368        code = gen_int(n_code, 0);
36369
36370        ret_val = xmlUCSIsBengali(code);
36371        desret_int(ret_val);
36372        call_tests++;
36373        des_int(n_code, code, 0);
36374        xmlResetLastError();
36375        if (mem_base != xmlMemBlocks()) {
36376            printf("Leak of %d blocks found in xmlUCSIsBengali",
36377	           xmlMemBlocks() - mem_base);
36378	    test_ret++;
36379            printf(" %d", n_code);
36380            printf("\n");
36381        }
36382    }
36383    function_tests++;
36384#endif
36385
36386    return(test_ret);
36387}
36388
36389
36390static int
36391test_xmlUCSIsBlock(void) {
36392    int test_ret = 0;
36393
36394#if defined(LIBXML_UNICODE_ENABLED)
36395    int mem_base;
36396    int ret_val;
36397    int code; /* UCS code point */
36398    int n_code;
36399    char * block; /* UCS block name */
36400    int n_block;
36401
36402    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36403    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
36404        mem_base = xmlMemBlocks();
36405        code = gen_int(n_code, 0);
36406        block = gen_const_char_ptr(n_block, 1);
36407
36408        ret_val = xmlUCSIsBlock(code, (const char *)block);
36409        desret_int(ret_val);
36410        call_tests++;
36411        des_int(n_code, code, 0);
36412        des_const_char_ptr(n_block, (const char *)block, 1);
36413        xmlResetLastError();
36414        if (mem_base != xmlMemBlocks()) {
36415            printf("Leak of %d blocks found in xmlUCSIsBlock",
36416	           xmlMemBlocks() - mem_base);
36417	    test_ret++;
36418            printf(" %d", n_code);
36419            printf(" %d", n_block);
36420            printf("\n");
36421        }
36422    }
36423    }
36424    function_tests++;
36425#endif
36426
36427    return(test_ret);
36428}
36429
36430
36431static int
36432test_xmlUCSIsBlockElements(void) {
36433    int test_ret = 0;
36434
36435#if defined(LIBXML_UNICODE_ENABLED)
36436    int mem_base;
36437    int ret_val;
36438    int code; /* UCS code point */
36439    int n_code;
36440
36441    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36442        mem_base = xmlMemBlocks();
36443        code = gen_int(n_code, 0);
36444
36445        ret_val = xmlUCSIsBlockElements(code);
36446        desret_int(ret_val);
36447        call_tests++;
36448        des_int(n_code, code, 0);
36449        xmlResetLastError();
36450        if (mem_base != xmlMemBlocks()) {
36451            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
36452	           xmlMemBlocks() - mem_base);
36453	    test_ret++;
36454            printf(" %d", n_code);
36455            printf("\n");
36456        }
36457    }
36458    function_tests++;
36459#endif
36460
36461    return(test_ret);
36462}
36463
36464
36465static int
36466test_xmlUCSIsBopomofo(void) {
36467    int test_ret = 0;
36468
36469#if defined(LIBXML_UNICODE_ENABLED)
36470    int mem_base;
36471    int ret_val;
36472    int code; /* UCS code point */
36473    int n_code;
36474
36475    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36476        mem_base = xmlMemBlocks();
36477        code = gen_int(n_code, 0);
36478
36479        ret_val = xmlUCSIsBopomofo(code);
36480        desret_int(ret_val);
36481        call_tests++;
36482        des_int(n_code, code, 0);
36483        xmlResetLastError();
36484        if (mem_base != xmlMemBlocks()) {
36485            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
36486	           xmlMemBlocks() - mem_base);
36487	    test_ret++;
36488            printf(" %d", n_code);
36489            printf("\n");
36490        }
36491    }
36492    function_tests++;
36493#endif
36494
36495    return(test_ret);
36496}
36497
36498
36499static int
36500test_xmlUCSIsBopomofoExtended(void) {
36501    int test_ret = 0;
36502
36503#if defined(LIBXML_UNICODE_ENABLED)
36504    int mem_base;
36505    int ret_val;
36506    int code; /* UCS code point */
36507    int n_code;
36508
36509    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36510        mem_base = xmlMemBlocks();
36511        code = gen_int(n_code, 0);
36512
36513        ret_val = xmlUCSIsBopomofoExtended(code);
36514        desret_int(ret_val);
36515        call_tests++;
36516        des_int(n_code, code, 0);
36517        xmlResetLastError();
36518        if (mem_base != xmlMemBlocks()) {
36519            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
36520	           xmlMemBlocks() - mem_base);
36521	    test_ret++;
36522            printf(" %d", n_code);
36523            printf("\n");
36524        }
36525    }
36526    function_tests++;
36527#endif
36528
36529    return(test_ret);
36530}
36531
36532
36533static int
36534test_xmlUCSIsBoxDrawing(void) {
36535    int test_ret = 0;
36536
36537#if defined(LIBXML_UNICODE_ENABLED)
36538    int mem_base;
36539    int ret_val;
36540    int code; /* UCS code point */
36541    int n_code;
36542
36543    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36544        mem_base = xmlMemBlocks();
36545        code = gen_int(n_code, 0);
36546
36547        ret_val = xmlUCSIsBoxDrawing(code);
36548        desret_int(ret_val);
36549        call_tests++;
36550        des_int(n_code, code, 0);
36551        xmlResetLastError();
36552        if (mem_base != xmlMemBlocks()) {
36553            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
36554	           xmlMemBlocks() - mem_base);
36555	    test_ret++;
36556            printf(" %d", n_code);
36557            printf("\n");
36558        }
36559    }
36560    function_tests++;
36561#endif
36562
36563    return(test_ret);
36564}
36565
36566
36567static int
36568test_xmlUCSIsBraillePatterns(void) {
36569    int test_ret = 0;
36570
36571#if defined(LIBXML_UNICODE_ENABLED)
36572    int mem_base;
36573    int ret_val;
36574    int code; /* UCS code point */
36575    int n_code;
36576
36577    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36578        mem_base = xmlMemBlocks();
36579        code = gen_int(n_code, 0);
36580
36581        ret_val = xmlUCSIsBraillePatterns(code);
36582        desret_int(ret_val);
36583        call_tests++;
36584        des_int(n_code, code, 0);
36585        xmlResetLastError();
36586        if (mem_base != xmlMemBlocks()) {
36587            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
36588	           xmlMemBlocks() - mem_base);
36589	    test_ret++;
36590            printf(" %d", n_code);
36591            printf("\n");
36592        }
36593    }
36594    function_tests++;
36595#endif
36596
36597    return(test_ret);
36598}
36599
36600
36601static int
36602test_xmlUCSIsBuhid(void) {
36603    int test_ret = 0;
36604
36605#if defined(LIBXML_UNICODE_ENABLED)
36606    int mem_base;
36607    int ret_val;
36608    int code; /* UCS code point */
36609    int n_code;
36610
36611    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36612        mem_base = xmlMemBlocks();
36613        code = gen_int(n_code, 0);
36614
36615        ret_val = xmlUCSIsBuhid(code);
36616        desret_int(ret_val);
36617        call_tests++;
36618        des_int(n_code, code, 0);
36619        xmlResetLastError();
36620        if (mem_base != xmlMemBlocks()) {
36621            printf("Leak of %d blocks found in xmlUCSIsBuhid",
36622	           xmlMemBlocks() - mem_base);
36623	    test_ret++;
36624            printf(" %d", n_code);
36625            printf("\n");
36626        }
36627    }
36628    function_tests++;
36629#endif
36630
36631    return(test_ret);
36632}
36633
36634
36635static int
36636test_xmlUCSIsByzantineMusicalSymbols(void) {
36637    int test_ret = 0;
36638
36639#if defined(LIBXML_UNICODE_ENABLED)
36640    int mem_base;
36641    int ret_val;
36642    int code; /* UCS code point */
36643    int n_code;
36644
36645    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36646        mem_base = xmlMemBlocks();
36647        code = gen_int(n_code, 0);
36648
36649        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
36650        desret_int(ret_val);
36651        call_tests++;
36652        des_int(n_code, code, 0);
36653        xmlResetLastError();
36654        if (mem_base != xmlMemBlocks()) {
36655            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
36656	           xmlMemBlocks() - mem_base);
36657	    test_ret++;
36658            printf(" %d", n_code);
36659            printf("\n");
36660        }
36661    }
36662    function_tests++;
36663#endif
36664
36665    return(test_ret);
36666}
36667
36668
36669static int
36670test_xmlUCSIsCJKCompatibility(void) {
36671    int test_ret = 0;
36672
36673#if defined(LIBXML_UNICODE_ENABLED)
36674    int mem_base;
36675    int ret_val;
36676    int code; /* UCS code point */
36677    int n_code;
36678
36679    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36680        mem_base = xmlMemBlocks();
36681        code = gen_int(n_code, 0);
36682
36683        ret_val = xmlUCSIsCJKCompatibility(code);
36684        desret_int(ret_val);
36685        call_tests++;
36686        des_int(n_code, code, 0);
36687        xmlResetLastError();
36688        if (mem_base != xmlMemBlocks()) {
36689            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
36690	           xmlMemBlocks() - mem_base);
36691	    test_ret++;
36692            printf(" %d", n_code);
36693            printf("\n");
36694        }
36695    }
36696    function_tests++;
36697#endif
36698
36699    return(test_ret);
36700}
36701
36702
36703static int
36704test_xmlUCSIsCJKCompatibilityForms(void) {
36705    int test_ret = 0;
36706
36707#if defined(LIBXML_UNICODE_ENABLED)
36708    int mem_base;
36709    int ret_val;
36710    int code; /* UCS code point */
36711    int n_code;
36712
36713    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36714        mem_base = xmlMemBlocks();
36715        code = gen_int(n_code, 0);
36716
36717        ret_val = xmlUCSIsCJKCompatibilityForms(code);
36718        desret_int(ret_val);
36719        call_tests++;
36720        des_int(n_code, code, 0);
36721        xmlResetLastError();
36722        if (mem_base != xmlMemBlocks()) {
36723            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
36724	           xmlMemBlocks() - mem_base);
36725	    test_ret++;
36726            printf(" %d", n_code);
36727            printf("\n");
36728        }
36729    }
36730    function_tests++;
36731#endif
36732
36733    return(test_ret);
36734}
36735
36736
36737static int
36738test_xmlUCSIsCJKCompatibilityIdeographs(void) {
36739    int test_ret = 0;
36740
36741#if defined(LIBXML_UNICODE_ENABLED)
36742    int mem_base;
36743    int ret_val;
36744    int code; /* UCS code point */
36745    int n_code;
36746
36747    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36748        mem_base = xmlMemBlocks();
36749        code = gen_int(n_code, 0);
36750
36751        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
36752        desret_int(ret_val);
36753        call_tests++;
36754        des_int(n_code, code, 0);
36755        xmlResetLastError();
36756        if (mem_base != xmlMemBlocks()) {
36757            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
36758	           xmlMemBlocks() - mem_base);
36759	    test_ret++;
36760            printf(" %d", n_code);
36761            printf("\n");
36762        }
36763    }
36764    function_tests++;
36765#endif
36766
36767    return(test_ret);
36768}
36769
36770
36771static int
36772test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
36773    int test_ret = 0;
36774
36775#if defined(LIBXML_UNICODE_ENABLED)
36776    int mem_base;
36777    int ret_val;
36778    int code; /* UCS code point */
36779    int n_code;
36780
36781    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36782        mem_base = xmlMemBlocks();
36783        code = gen_int(n_code, 0);
36784
36785        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
36786        desret_int(ret_val);
36787        call_tests++;
36788        des_int(n_code, code, 0);
36789        xmlResetLastError();
36790        if (mem_base != xmlMemBlocks()) {
36791            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
36792	           xmlMemBlocks() - mem_base);
36793	    test_ret++;
36794            printf(" %d", n_code);
36795            printf("\n");
36796        }
36797    }
36798    function_tests++;
36799#endif
36800
36801    return(test_ret);
36802}
36803
36804
36805static int
36806test_xmlUCSIsCJKRadicalsSupplement(void) {
36807    int test_ret = 0;
36808
36809#if defined(LIBXML_UNICODE_ENABLED)
36810    int mem_base;
36811    int ret_val;
36812    int code; /* UCS code point */
36813    int n_code;
36814
36815    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36816        mem_base = xmlMemBlocks();
36817        code = gen_int(n_code, 0);
36818
36819        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
36820        desret_int(ret_val);
36821        call_tests++;
36822        des_int(n_code, code, 0);
36823        xmlResetLastError();
36824        if (mem_base != xmlMemBlocks()) {
36825            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
36826	           xmlMemBlocks() - mem_base);
36827	    test_ret++;
36828            printf(" %d", n_code);
36829            printf("\n");
36830        }
36831    }
36832    function_tests++;
36833#endif
36834
36835    return(test_ret);
36836}
36837
36838
36839static int
36840test_xmlUCSIsCJKSymbolsandPunctuation(void) {
36841    int test_ret = 0;
36842
36843#if defined(LIBXML_UNICODE_ENABLED)
36844    int mem_base;
36845    int ret_val;
36846    int code; /* UCS code point */
36847    int n_code;
36848
36849    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36850        mem_base = xmlMemBlocks();
36851        code = gen_int(n_code, 0);
36852
36853        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
36854        desret_int(ret_val);
36855        call_tests++;
36856        des_int(n_code, code, 0);
36857        xmlResetLastError();
36858        if (mem_base != xmlMemBlocks()) {
36859            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
36860	           xmlMemBlocks() - mem_base);
36861	    test_ret++;
36862            printf(" %d", n_code);
36863            printf("\n");
36864        }
36865    }
36866    function_tests++;
36867#endif
36868
36869    return(test_ret);
36870}
36871
36872
36873static int
36874test_xmlUCSIsCJKUnifiedIdeographs(void) {
36875    int test_ret = 0;
36876
36877#if defined(LIBXML_UNICODE_ENABLED)
36878    int mem_base;
36879    int ret_val;
36880    int code; /* UCS code point */
36881    int n_code;
36882
36883    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36884        mem_base = xmlMemBlocks();
36885        code = gen_int(n_code, 0);
36886
36887        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
36888        desret_int(ret_val);
36889        call_tests++;
36890        des_int(n_code, code, 0);
36891        xmlResetLastError();
36892        if (mem_base != xmlMemBlocks()) {
36893            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
36894	           xmlMemBlocks() - mem_base);
36895	    test_ret++;
36896            printf(" %d", n_code);
36897            printf("\n");
36898        }
36899    }
36900    function_tests++;
36901#endif
36902
36903    return(test_ret);
36904}
36905
36906
36907static int
36908test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
36909    int test_ret = 0;
36910
36911#if defined(LIBXML_UNICODE_ENABLED)
36912    int mem_base;
36913    int ret_val;
36914    int code; /* UCS code point */
36915    int n_code;
36916
36917    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36918        mem_base = xmlMemBlocks();
36919        code = gen_int(n_code, 0);
36920
36921        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
36922        desret_int(ret_val);
36923        call_tests++;
36924        des_int(n_code, code, 0);
36925        xmlResetLastError();
36926        if (mem_base != xmlMemBlocks()) {
36927            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
36928	           xmlMemBlocks() - mem_base);
36929	    test_ret++;
36930            printf(" %d", n_code);
36931            printf("\n");
36932        }
36933    }
36934    function_tests++;
36935#endif
36936
36937    return(test_ret);
36938}
36939
36940
36941static int
36942test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
36943    int test_ret = 0;
36944
36945#if defined(LIBXML_UNICODE_ENABLED)
36946    int mem_base;
36947    int ret_val;
36948    int code; /* UCS code point */
36949    int n_code;
36950
36951    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36952        mem_base = xmlMemBlocks();
36953        code = gen_int(n_code, 0);
36954
36955        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
36956        desret_int(ret_val);
36957        call_tests++;
36958        des_int(n_code, code, 0);
36959        xmlResetLastError();
36960        if (mem_base != xmlMemBlocks()) {
36961            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
36962	           xmlMemBlocks() - mem_base);
36963	    test_ret++;
36964            printf(" %d", n_code);
36965            printf("\n");
36966        }
36967    }
36968    function_tests++;
36969#endif
36970
36971    return(test_ret);
36972}
36973
36974
36975static int
36976test_xmlUCSIsCat(void) {
36977    int test_ret = 0;
36978
36979#if defined(LIBXML_UNICODE_ENABLED)
36980    int mem_base;
36981    int ret_val;
36982    int code; /* UCS code point */
36983    int n_code;
36984    char * cat; /* UCS Category name */
36985    int n_cat;
36986
36987    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36988    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
36989        mem_base = xmlMemBlocks();
36990        code = gen_int(n_code, 0);
36991        cat = gen_const_char_ptr(n_cat, 1);
36992
36993        ret_val = xmlUCSIsCat(code, (const char *)cat);
36994        desret_int(ret_val);
36995        call_tests++;
36996        des_int(n_code, code, 0);
36997        des_const_char_ptr(n_cat, (const char *)cat, 1);
36998        xmlResetLastError();
36999        if (mem_base != xmlMemBlocks()) {
37000            printf("Leak of %d blocks found in xmlUCSIsCat",
37001	           xmlMemBlocks() - mem_base);
37002	    test_ret++;
37003            printf(" %d", n_code);
37004            printf(" %d", n_cat);
37005            printf("\n");
37006        }
37007    }
37008    }
37009    function_tests++;
37010#endif
37011
37012    return(test_ret);
37013}
37014
37015
37016static int
37017test_xmlUCSIsCatC(void) {
37018    int test_ret = 0;
37019
37020#if defined(LIBXML_UNICODE_ENABLED)
37021    int mem_base;
37022    int ret_val;
37023    int code; /* UCS code point */
37024    int n_code;
37025
37026    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37027        mem_base = xmlMemBlocks();
37028        code = gen_int(n_code, 0);
37029
37030        ret_val = xmlUCSIsCatC(code);
37031        desret_int(ret_val);
37032        call_tests++;
37033        des_int(n_code, code, 0);
37034        xmlResetLastError();
37035        if (mem_base != xmlMemBlocks()) {
37036            printf("Leak of %d blocks found in xmlUCSIsCatC",
37037	           xmlMemBlocks() - mem_base);
37038	    test_ret++;
37039            printf(" %d", n_code);
37040            printf("\n");
37041        }
37042    }
37043    function_tests++;
37044#endif
37045
37046    return(test_ret);
37047}
37048
37049
37050static int
37051test_xmlUCSIsCatCc(void) {
37052    int test_ret = 0;
37053
37054#if defined(LIBXML_UNICODE_ENABLED)
37055    int mem_base;
37056    int ret_val;
37057    int code; /* UCS code point */
37058    int n_code;
37059
37060    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37061        mem_base = xmlMemBlocks();
37062        code = gen_int(n_code, 0);
37063
37064        ret_val = xmlUCSIsCatCc(code);
37065        desret_int(ret_val);
37066        call_tests++;
37067        des_int(n_code, code, 0);
37068        xmlResetLastError();
37069        if (mem_base != xmlMemBlocks()) {
37070            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37071	           xmlMemBlocks() - mem_base);
37072	    test_ret++;
37073            printf(" %d", n_code);
37074            printf("\n");
37075        }
37076    }
37077    function_tests++;
37078#endif
37079
37080    return(test_ret);
37081}
37082
37083
37084static int
37085test_xmlUCSIsCatCf(void) {
37086    int test_ret = 0;
37087
37088#if defined(LIBXML_UNICODE_ENABLED)
37089    int mem_base;
37090    int ret_val;
37091    int code; /* UCS code point */
37092    int n_code;
37093
37094    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37095        mem_base = xmlMemBlocks();
37096        code = gen_int(n_code, 0);
37097
37098        ret_val = xmlUCSIsCatCf(code);
37099        desret_int(ret_val);
37100        call_tests++;
37101        des_int(n_code, code, 0);
37102        xmlResetLastError();
37103        if (mem_base != xmlMemBlocks()) {
37104            printf("Leak of %d blocks found in xmlUCSIsCatCf",
37105	           xmlMemBlocks() - mem_base);
37106	    test_ret++;
37107            printf(" %d", n_code);
37108            printf("\n");
37109        }
37110    }
37111    function_tests++;
37112#endif
37113
37114    return(test_ret);
37115}
37116
37117
37118static int
37119test_xmlUCSIsCatCo(void) {
37120    int test_ret = 0;
37121
37122#if defined(LIBXML_UNICODE_ENABLED)
37123    int mem_base;
37124    int ret_val;
37125    int code; /* UCS code point */
37126    int n_code;
37127
37128    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37129        mem_base = xmlMemBlocks();
37130        code = gen_int(n_code, 0);
37131
37132        ret_val = xmlUCSIsCatCo(code);
37133        desret_int(ret_val);
37134        call_tests++;
37135        des_int(n_code, code, 0);
37136        xmlResetLastError();
37137        if (mem_base != xmlMemBlocks()) {
37138            printf("Leak of %d blocks found in xmlUCSIsCatCo",
37139	           xmlMemBlocks() - mem_base);
37140	    test_ret++;
37141            printf(" %d", n_code);
37142            printf("\n");
37143        }
37144    }
37145    function_tests++;
37146#endif
37147
37148    return(test_ret);
37149}
37150
37151
37152static int
37153test_xmlUCSIsCatCs(void) {
37154    int test_ret = 0;
37155
37156#if defined(LIBXML_UNICODE_ENABLED)
37157    int mem_base;
37158    int ret_val;
37159    int code; /* UCS code point */
37160    int n_code;
37161
37162    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37163        mem_base = xmlMemBlocks();
37164        code = gen_int(n_code, 0);
37165
37166        ret_val = xmlUCSIsCatCs(code);
37167        desret_int(ret_val);
37168        call_tests++;
37169        des_int(n_code, code, 0);
37170        xmlResetLastError();
37171        if (mem_base != xmlMemBlocks()) {
37172            printf("Leak of %d blocks found in xmlUCSIsCatCs",
37173	           xmlMemBlocks() - mem_base);
37174	    test_ret++;
37175            printf(" %d", n_code);
37176            printf("\n");
37177        }
37178    }
37179    function_tests++;
37180#endif
37181
37182    return(test_ret);
37183}
37184
37185
37186static int
37187test_xmlUCSIsCatL(void) {
37188    int test_ret = 0;
37189
37190#if defined(LIBXML_UNICODE_ENABLED)
37191    int mem_base;
37192    int ret_val;
37193    int code; /* UCS code point */
37194    int n_code;
37195
37196    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37197        mem_base = xmlMemBlocks();
37198        code = gen_int(n_code, 0);
37199
37200        ret_val = xmlUCSIsCatL(code);
37201        desret_int(ret_val);
37202        call_tests++;
37203        des_int(n_code, code, 0);
37204        xmlResetLastError();
37205        if (mem_base != xmlMemBlocks()) {
37206            printf("Leak of %d blocks found in xmlUCSIsCatL",
37207	           xmlMemBlocks() - mem_base);
37208	    test_ret++;
37209            printf(" %d", n_code);
37210            printf("\n");
37211        }
37212    }
37213    function_tests++;
37214#endif
37215
37216    return(test_ret);
37217}
37218
37219
37220static int
37221test_xmlUCSIsCatLl(void) {
37222    int test_ret = 0;
37223
37224#if defined(LIBXML_UNICODE_ENABLED)
37225    int mem_base;
37226    int ret_val;
37227    int code; /* UCS code point */
37228    int n_code;
37229
37230    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37231        mem_base = xmlMemBlocks();
37232        code = gen_int(n_code, 0);
37233
37234        ret_val = xmlUCSIsCatLl(code);
37235        desret_int(ret_val);
37236        call_tests++;
37237        des_int(n_code, code, 0);
37238        xmlResetLastError();
37239        if (mem_base != xmlMemBlocks()) {
37240            printf("Leak of %d blocks found in xmlUCSIsCatLl",
37241	           xmlMemBlocks() - mem_base);
37242	    test_ret++;
37243            printf(" %d", n_code);
37244            printf("\n");
37245        }
37246    }
37247    function_tests++;
37248#endif
37249
37250    return(test_ret);
37251}
37252
37253
37254static int
37255test_xmlUCSIsCatLm(void) {
37256    int test_ret = 0;
37257
37258#if defined(LIBXML_UNICODE_ENABLED)
37259    int mem_base;
37260    int ret_val;
37261    int code; /* UCS code point */
37262    int n_code;
37263
37264    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37265        mem_base = xmlMemBlocks();
37266        code = gen_int(n_code, 0);
37267
37268        ret_val = xmlUCSIsCatLm(code);
37269        desret_int(ret_val);
37270        call_tests++;
37271        des_int(n_code, code, 0);
37272        xmlResetLastError();
37273        if (mem_base != xmlMemBlocks()) {
37274            printf("Leak of %d blocks found in xmlUCSIsCatLm",
37275	           xmlMemBlocks() - mem_base);
37276	    test_ret++;
37277            printf(" %d", n_code);
37278            printf("\n");
37279        }
37280    }
37281    function_tests++;
37282#endif
37283
37284    return(test_ret);
37285}
37286
37287
37288static int
37289test_xmlUCSIsCatLo(void) {
37290    int test_ret = 0;
37291
37292#if defined(LIBXML_UNICODE_ENABLED)
37293    int mem_base;
37294    int ret_val;
37295    int code; /* UCS code point */
37296    int n_code;
37297
37298    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37299        mem_base = xmlMemBlocks();
37300        code = gen_int(n_code, 0);
37301
37302        ret_val = xmlUCSIsCatLo(code);
37303        desret_int(ret_val);
37304        call_tests++;
37305        des_int(n_code, code, 0);
37306        xmlResetLastError();
37307        if (mem_base != xmlMemBlocks()) {
37308            printf("Leak of %d blocks found in xmlUCSIsCatLo",
37309	           xmlMemBlocks() - mem_base);
37310	    test_ret++;
37311            printf(" %d", n_code);
37312            printf("\n");
37313        }
37314    }
37315    function_tests++;
37316#endif
37317
37318    return(test_ret);
37319}
37320
37321
37322static int
37323test_xmlUCSIsCatLt(void) {
37324    int test_ret = 0;
37325
37326#if defined(LIBXML_UNICODE_ENABLED)
37327    int mem_base;
37328    int ret_val;
37329    int code; /* UCS code point */
37330    int n_code;
37331
37332    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37333        mem_base = xmlMemBlocks();
37334        code = gen_int(n_code, 0);
37335
37336        ret_val = xmlUCSIsCatLt(code);
37337        desret_int(ret_val);
37338        call_tests++;
37339        des_int(n_code, code, 0);
37340        xmlResetLastError();
37341        if (mem_base != xmlMemBlocks()) {
37342            printf("Leak of %d blocks found in xmlUCSIsCatLt",
37343	           xmlMemBlocks() - mem_base);
37344	    test_ret++;
37345            printf(" %d", n_code);
37346            printf("\n");
37347        }
37348    }
37349    function_tests++;
37350#endif
37351
37352    return(test_ret);
37353}
37354
37355
37356static int
37357test_xmlUCSIsCatLu(void) {
37358    int test_ret = 0;
37359
37360#if defined(LIBXML_UNICODE_ENABLED)
37361    int mem_base;
37362    int ret_val;
37363    int code; /* UCS code point */
37364    int n_code;
37365
37366    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37367        mem_base = xmlMemBlocks();
37368        code = gen_int(n_code, 0);
37369
37370        ret_val = xmlUCSIsCatLu(code);
37371        desret_int(ret_val);
37372        call_tests++;
37373        des_int(n_code, code, 0);
37374        xmlResetLastError();
37375        if (mem_base != xmlMemBlocks()) {
37376            printf("Leak of %d blocks found in xmlUCSIsCatLu",
37377	           xmlMemBlocks() - mem_base);
37378	    test_ret++;
37379            printf(" %d", n_code);
37380            printf("\n");
37381        }
37382    }
37383    function_tests++;
37384#endif
37385
37386    return(test_ret);
37387}
37388
37389
37390static int
37391test_xmlUCSIsCatM(void) {
37392    int test_ret = 0;
37393
37394#if defined(LIBXML_UNICODE_ENABLED)
37395    int mem_base;
37396    int ret_val;
37397    int code; /* UCS code point */
37398    int n_code;
37399
37400    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37401        mem_base = xmlMemBlocks();
37402        code = gen_int(n_code, 0);
37403
37404        ret_val = xmlUCSIsCatM(code);
37405        desret_int(ret_val);
37406        call_tests++;
37407        des_int(n_code, code, 0);
37408        xmlResetLastError();
37409        if (mem_base != xmlMemBlocks()) {
37410            printf("Leak of %d blocks found in xmlUCSIsCatM",
37411	           xmlMemBlocks() - mem_base);
37412	    test_ret++;
37413            printf(" %d", n_code);
37414            printf("\n");
37415        }
37416    }
37417    function_tests++;
37418#endif
37419
37420    return(test_ret);
37421}
37422
37423
37424static int
37425test_xmlUCSIsCatMc(void) {
37426    int test_ret = 0;
37427
37428#if defined(LIBXML_UNICODE_ENABLED)
37429    int mem_base;
37430    int ret_val;
37431    int code; /* UCS code point */
37432    int n_code;
37433
37434    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37435        mem_base = xmlMemBlocks();
37436        code = gen_int(n_code, 0);
37437
37438        ret_val = xmlUCSIsCatMc(code);
37439        desret_int(ret_val);
37440        call_tests++;
37441        des_int(n_code, code, 0);
37442        xmlResetLastError();
37443        if (mem_base != xmlMemBlocks()) {
37444            printf("Leak of %d blocks found in xmlUCSIsCatMc",
37445	           xmlMemBlocks() - mem_base);
37446	    test_ret++;
37447            printf(" %d", n_code);
37448            printf("\n");
37449        }
37450    }
37451    function_tests++;
37452#endif
37453
37454    return(test_ret);
37455}
37456
37457
37458static int
37459test_xmlUCSIsCatMe(void) {
37460    int test_ret = 0;
37461
37462#if defined(LIBXML_UNICODE_ENABLED)
37463    int mem_base;
37464    int ret_val;
37465    int code; /* UCS code point */
37466    int n_code;
37467
37468    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37469        mem_base = xmlMemBlocks();
37470        code = gen_int(n_code, 0);
37471
37472        ret_val = xmlUCSIsCatMe(code);
37473        desret_int(ret_val);
37474        call_tests++;
37475        des_int(n_code, code, 0);
37476        xmlResetLastError();
37477        if (mem_base != xmlMemBlocks()) {
37478            printf("Leak of %d blocks found in xmlUCSIsCatMe",
37479	           xmlMemBlocks() - mem_base);
37480	    test_ret++;
37481            printf(" %d", n_code);
37482            printf("\n");
37483        }
37484    }
37485    function_tests++;
37486#endif
37487
37488    return(test_ret);
37489}
37490
37491
37492static int
37493test_xmlUCSIsCatMn(void) {
37494    int test_ret = 0;
37495
37496#if defined(LIBXML_UNICODE_ENABLED)
37497    int mem_base;
37498    int ret_val;
37499    int code; /* UCS code point */
37500    int n_code;
37501
37502    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37503        mem_base = xmlMemBlocks();
37504        code = gen_int(n_code, 0);
37505
37506        ret_val = xmlUCSIsCatMn(code);
37507        desret_int(ret_val);
37508        call_tests++;
37509        des_int(n_code, code, 0);
37510        xmlResetLastError();
37511        if (mem_base != xmlMemBlocks()) {
37512            printf("Leak of %d blocks found in xmlUCSIsCatMn",
37513	           xmlMemBlocks() - mem_base);
37514	    test_ret++;
37515            printf(" %d", n_code);
37516            printf("\n");
37517        }
37518    }
37519    function_tests++;
37520#endif
37521
37522    return(test_ret);
37523}
37524
37525
37526static int
37527test_xmlUCSIsCatN(void) {
37528    int test_ret = 0;
37529
37530#if defined(LIBXML_UNICODE_ENABLED)
37531    int mem_base;
37532    int ret_val;
37533    int code; /* UCS code point */
37534    int n_code;
37535
37536    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37537        mem_base = xmlMemBlocks();
37538        code = gen_int(n_code, 0);
37539
37540        ret_val = xmlUCSIsCatN(code);
37541        desret_int(ret_val);
37542        call_tests++;
37543        des_int(n_code, code, 0);
37544        xmlResetLastError();
37545        if (mem_base != xmlMemBlocks()) {
37546            printf("Leak of %d blocks found in xmlUCSIsCatN",
37547	           xmlMemBlocks() - mem_base);
37548	    test_ret++;
37549            printf(" %d", n_code);
37550            printf("\n");
37551        }
37552    }
37553    function_tests++;
37554#endif
37555
37556    return(test_ret);
37557}
37558
37559
37560static int
37561test_xmlUCSIsCatNd(void) {
37562    int test_ret = 0;
37563
37564#if defined(LIBXML_UNICODE_ENABLED)
37565    int mem_base;
37566    int ret_val;
37567    int code; /* UCS code point */
37568    int n_code;
37569
37570    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37571        mem_base = xmlMemBlocks();
37572        code = gen_int(n_code, 0);
37573
37574        ret_val = xmlUCSIsCatNd(code);
37575        desret_int(ret_val);
37576        call_tests++;
37577        des_int(n_code, code, 0);
37578        xmlResetLastError();
37579        if (mem_base != xmlMemBlocks()) {
37580            printf("Leak of %d blocks found in xmlUCSIsCatNd",
37581	           xmlMemBlocks() - mem_base);
37582	    test_ret++;
37583            printf(" %d", n_code);
37584            printf("\n");
37585        }
37586    }
37587    function_tests++;
37588#endif
37589
37590    return(test_ret);
37591}
37592
37593
37594static int
37595test_xmlUCSIsCatNl(void) {
37596    int test_ret = 0;
37597
37598#if defined(LIBXML_UNICODE_ENABLED)
37599    int mem_base;
37600    int ret_val;
37601    int code; /* UCS code point */
37602    int n_code;
37603
37604    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37605        mem_base = xmlMemBlocks();
37606        code = gen_int(n_code, 0);
37607
37608        ret_val = xmlUCSIsCatNl(code);
37609        desret_int(ret_val);
37610        call_tests++;
37611        des_int(n_code, code, 0);
37612        xmlResetLastError();
37613        if (mem_base != xmlMemBlocks()) {
37614            printf("Leak of %d blocks found in xmlUCSIsCatNl",
37615	           xmlMemBlocks() - mem_base);
37616	    test_ret++;
37617            printf(" %d", n_code);
37618            printf("\n");
37619        }
37620    }
37621    function_tests++;
37622#endif
37623
37624    return(test_ret);
37625}
37626
37627
37628static int
37629test_xmlUCSIsCatNo(void) {
37630    int test_ret = 0;
37631
37632#if defined(LIBXML_UNICODE_ENABLED)
37633    int mem_base;
37634    int ret_val;
37635    int code; /* UCS code point */
37636    int n_code;
37637
37638    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37639        mem_base = xmlMemBlocks();
37640        code = gen_int(n_code, 0);
37641
37642        ret_val = xmlUCSIsCatNo(code);
37643        desret_int(ret_val);
37644        call_tests++;
37645        des_int(n_code, code, 0);
37646        xmlResetLastError();
37647        if (mem_base != xmlMemBlocks()) {
37648            printf("Leak of %d blocks found in xmlUCSIsCatNo",
37649	           xmlMemBlocks() - mem_base);
37650	    test_ret++;
37651            printf(" %d", n_code);
37652            printf("\n");
37653        }
37654    }
37655    function_tests++;
37656#endif
37657
37658    return(test_ret);
37659}
37660
37661
37662static int
37663test_xmlUCSIsCatP(void) {
37664    int test_ret = 0;
37665
37666#if defined(LIBXML_UNICODE_ENABLED)
37667    int mem_base;
37668    int ret_val;
37669    int code; /* UCS code point */
37670    int n_code;
37671
37672    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37673        mem_base = xmlMemBlocks();
37674        code = gen_int(n_code, 0);
37675
37676        ret_val = xmlUCSIsCatP(code);
37677        desret_int(ret_val);
37678        call_tests++;
37679        des_int(n_code, code, 0);
37680        xmlResetLastError();
37681        if (mem_base != xmlMemBlocks()) {
37682            printf("Leak of %d blocks found in xmlUCSIsCatP",
37683	           xmlMemBlocks() - mem_base);
37684	    test_ret++;
37685            printf(" %d", n_code);
37686            printf("\n");
37687        }
37688    }
37689    function_tests++;
37690#endif
37691
37692    return(test_ret);
37693}
37694
37695
37696static int
37697test_xmlUCSIsCatPc(void) {
37698    int test_ret = 0;
37699
37700#if defined(LIBXML_UNICODE_ENABLED)
37701    int mem_base;
37702    int ret_val;
37703    int code; /* UCS code point */
37704    int n_code;
37705
37706    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37707        mem_base = xmlMemBlocks();
37708        code = gen_int(n_code, 0);
37709
37710        ret_val = xmlUCSIsCatPc(code);
37711        desret_int(ret_val);
37712        call_tests++;
37713        des_int(n_code, code, 0);
37714        xmlResetLastError();
37715        if (mem_base != xmlMemBlocks()) {
37716            printf("Leak of %d blocks found in xmlUCSIsCatPc",
37717	           xmlMemBlocks() - mem_base);
37718	    test_ret++;
37719            printf(" %d", n_code);
37720            printf("\n");
37721        }
37722    }
37723    function_tests++;
37724#endif
37725
37726    return(test_ret);
37727}
37728
37729
37730static int
37731test_xmlUCSIsCatPd(void) {
37732    int test_ret = 0;
37733
37734#if defined(LIBXML_UNICODE_ENABLED)
37735    int mem_base;
37736    int ret_val;
37737    int code; /* UCS code point */
37738    int n_code;
37739
37740    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37741        mem_base = xmlMemBlocks();
37742        code = gen_int(n_code, 0);
37743
37744        ret_val = xmlUCSIsCatPd(code);
37745        desret_int(ret_val);
37746        call_tests++;
37747        des_int(n_code, code, 0);
37748        xmlResetLastError();
37749        if (mem_base != xmlMemBlocks()) {
37750            printf("Leak of %d blocks found in xmlUCSIsCatPd",
37751	           xmlMemBlocks() - mem_base);
37752	    test_ret++;
37753            printf(" %d", n_code);
37754            printf("\n");
37755        }
37756    }
37757    function_tests++;
37758#endif
37759
37760    return(test_ret);
37761}
37762
37763
37764static int
37765test_xmlUCSIsCatPe(void) {
37766    int test_ret = 0;
37767
37768#if defined(LIBXML_UNICODE_ENABLED)
37769    int mem_base;
37770    int ret_val;
37771    int code; /* UCS code point */
37772    int n_code;
37773
37774    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37775        mem_base = xmlMemBlocks();
37776        code = gen_int(n_code, 0);
37777
37778        ret_val = xmlUCSIsCatPe(code);
37779        desret_int(ret_val);
37780        call_tests++;
37781        des_int(n_code, code, 0);
37782        xmlResetLastError();
37783        if (mem_base != xmlMemBlocks()) {
37784            printf("Leak of %d blocks found in xmlUCSIsCatPe",
37785	           xmlMemBlocks() - mem_base);
37786	    test_ret++;
37787            printf(" %d", n_code);
37788            printf("\n");
37789        }
37790    }
37791    function_tests++;
37792#endif
37793
37794    return(test_ret);
37795}
37796
37797
37798static int
37799test_xmlUCSIsCatPf(void) {
37800    int test_ret = 0;
37801
37802#if defined(LIBXML_UNICODE_ENABLED)
37803    int mem_base;
37804    int ret_val;
37805    int code; /* UCS code point */
37806    int n_code;
37807
37808    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37809        mem_base = xmlMemBlocks();
37810        code = gen_int(n_code, 0);
37811
37812        ret_val = xmlUCSIsCatPf(code);
37813        desret_int(ret_val);
37814        call_tests++;
37815        des_int(n_code, code, 0);
37816        xmlResetLastError();
37817        if (mem_base != xmlMemBlocks()) {
37818            printf("Leak of %d blocks found in xmlUCSIsCatPf",
37819	           xmlMemBlocks() - mem_base);
37820	    test_ret++;
37821            printf(" %d", n_code);
37822            printf("\n");
37823        }
37824    }
37825    function_tests++;
37826#endif
37827
37828    return(test_ret);
37829}
37830
37831
37832static int
37833test_xmlUCSIsCatPi(void) {
37834    int test_ret = 0;
37835
37836#if defined(LIBXML_UNICODE_ENABLED)
37837    int mem_base;
37838    int ret_val;
37839    int code; /* UCS code point */
37840    int n_code;
37841
37842    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37843        mem_base = xmlMemBlocks();
37844        code = gen_int(n_code, 0);
37845
37846        ret_val = xmlUCSIsCatPi(code);
37847        desret_int(ret_val);
37848        call_tests++;
37849        des_int(n_code, code, 0);
37850        xmlResetLastError();
37851        if (mem_base != xmlMemBlocks()) {
37852            printf("Leak of %d blocks found in xmlUCSIsCatPi",
37853	           xmlMemBlocks() - mem_base);
37854	    test_ret++;
37855            printf(" %d", n_code);
37856            printf("\n");
37857        }
37858    }
37859    function_tests++;
37860#endif
37861
37862    return(test_ret);
37863}
37864
37865
37866static int
37867test_xmlUCSIsCatPo(void) {
37868    int test_ret = 0;
37869
37870#if defined(LIBXML_UNICODE_ENABLED)
37871    int mem_base;
37872    int ret_val;
37873    int code; /* UCS code point */
37874    int n_code;
37875
37876    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37877        mem_base = xmlMemBlocks();
37878        code = gen_int(n_code, 0);
37879
37880        ret_val = xmlUCSIsCatPo(code);
37881        desret_int(ret_val);
37882        call_tests++;
37883        des_int(n_code, code, 0);
37884        xmlResetLastError();
37885        if (mem_base != xmlMemBlocks()) {
37886            printf("Leak of %d blocks found in xmlUCSIsCatPo",
37887	           xmlMemBlocks() - mem_base);
37888	    test_ret++;
37889            printf(" %d", n_code);
37890            printf("\n");
37891        }
37892    }
37893    function_tests++;
37894#endif
37895
37896    return(test_ret);
37897}
37898
37899
37900static int
37901test_xmlUCSIsCatPs(void) {
37902    int test_ret = 0;
37903
37904#if defined(LIBXML_UNICODE_ENABLED)
37905    int mem_base;
37906    int ret_val;
37907    int code; /* UCS code point */
37908    int n_code;
37909
37910    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37911        mem_base = xmlMemBlocks();
37912        code = gen_int(n_code, 0);
37913
37914        ret_val = xmlUCSIsCatPs(code);
37915        desret_int(ret_val);
37916        call_tests++;
37917        des_int(n_code, code, 0);
37918        xmlResetLastError();
37919        if (mem_base != xmlMemBlocks()) {
37920            printf("Leak of %d blocks found in xmlUCSIsCatPs",
37921	           xmlMemBlocks() - mem_base);
37922	    test_ret++;
37923            printf(" %d", n_code);
37924            printf("\n");
37925        }
37926    }
37927    function_tests++;
37928#endif
37929
37930    return(test_ret);
37931}
37932
37933
37934static int
37935test_xmlUCSIsCatS(void) {
37936    int test_ret = 0;
37937
37938#if defined(LIBXML_UNICODE_ENABLED)
37939    int mem_base;
37940    int ret_val;
37941    int code; /* UCS code point */
37942    int n_code;
37943
37944    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37945        mem_base = xmlMemBlocks();
37946        code = gen_int(n_code, 0);
37947
37948        ret_val = xmlUCSIsCatS(code);
37949        desret_int(ret_val);
37950        call_tests++;
37951        des_int(n_code, code, 0);
37952        xmlResetLastError();
37953        if (mem_base != xmlMemBlocks()) {
37954            printf("Leak of %d blocks found in xmlUCSIsCatS",
37955	           xmlMemBlocks() - mem_base);
37956	    test_ret++;
37957            printf(" %d", n_code);
37958            printf("\n");
37959        }
37960    }
37961    function_tests++;
37962#endif
37963
37964    return(test_ret);
37965}
37966
37967
37968static int
37969test_xmlUCSIsCatSc(void) {
37970    int test_ret = 0;
37971
37972#if defined(LIBXML_UNICODE_ENABLED)
37973    int mem_base;
37974    int ret_val;
37975    int code; /* UCS code point */
37976    int n_code;
37977
37978    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37979        mem_base = xmlMemBlocks();
37980        code = gen_int(n_code, 0);
37981
37982        ret_val = xmlUCSIsCatSc(code);
37983        desret_int(ret_val);
37984        call_tests++;
37985        des_int(n_code, code, 0);
37986        xmlResetLastError();
37987        if (mem_base != xmlMemBlocks()) {
37988            printf("Leak of %d blocks found in xmlUCSIsCatSc",
37989	           xmlMemBlocks() - mem_base);
37990	    test_ret++;
37991            printf(" %d", n_code);
37992            printf("\n");
37993        }
37994    }
37995    function_tests++;
37996#endif
37997
37998    return(test_ret);
37999}
38000
38001
38002static int
38003test_xmlUCSIsCatSk(void) {
38004    int test_ret = 0;
38005
38006#if defined(LIBXML_UNICODE_ENABLED)
38007    int mem_base;
38008    int ret_val;
38009    int code; /* UCS code point */
38010    int n_code;
38011
38012    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38013        mem_base = xmlMemBlocks();
38014        code = gen_int(n_code, 0);
38015
38016        ret_val = xmlUCSIsCatSk(code);
38017        desret_int(ret_val);
38018        call_tests++;
38019        des_int(n_code, code, 0);
38020        xmlResetLastError();
38021        if (mem_base != xmlMemBlocks()) {
38022            printf("Leak of %d blocks found in xmlUCSIsCatSk",
38023	           xmlMemBlocks() - mem_base);
38024	    test_ret++;
38025            printf(" %d", n_code);
38026            printf("\n");
38027        }
38028    }
38029    function_tests++;
38030#endif
38031
38032    return(test_ret);
38033}
38034
38035
38036static int
38037test_xmlUCSIsCatSm(void) {
38038    int test_ret = 0;
38039
38040#if defined(LIBXML_UNICODE_ENABLED)
38041    int mem_base;
38042    int ret_val;
38043    int code; /* UCS code point */
38044    int n_code;
38045
38046    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38047        mem_base = xmlMemBlocks();
38048        code = gen_int(n_code, 0);
38049
38050        ret_val = xmlUCSIsCatSm(code);
38051        desret_int(ret_val);
38052        call_tests++;
38053        des_int(n_code, code, 0);
38054        xmlResetLastError();
38055        if (mem_base != xmlMemBlocks()) {
38056            printf("Leak of %d blocks found in xmlUCSIsCatSm",
38057	           xmlMemBlocks() - mem_base);
38058	    test_ret++;
38059            printf(" %d", n_code);
38060            printf("\n");
38061        }
38062    }
38063    function_tests++;
38064#endif
38065
38066    return(test_ret);
38067}
38068
38069
38070static int
38071test_xmlUCSIsCatSo(void) {
38072    int test_ret = 0;
38073
38074#if defined(LIBXML_UNICODE_ENABLED)
38075    int mem_base;
38076    int ret_val;
38077    int code; /* UCS code point */
38078    int n_code;
38079
38080    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38081        mem_base = xmlMemBlocks();
38082        code = gen_int(n_code, 0);
38083
38084        ret_val = xmlUCSIsCatSo(code);
38085        desret_int(ret_val);
38086        call_tests++;
38087        des_int(n_code, code, 0);
38088        xmlResetLastError();
38089        if (mem_base != xmlMemBlocks()) {
38090            printf("Leak of %d blocks found in xmlUCSIsCatSo",
38091	           xmlMemBlocks() - mem_base);
38092	    test_ret++;
38093            printf(" %d", n_code);
38094            printf("\n");
38095        }
38096    }
38097    function_tests++;
38098#endif
38099
38100    return(test_ret);
38101}
38102
38103
38104static int
38105test_xmlUCSIsCatZ(void) {
38106    int test_ret = 0;
38107
38108#if defined(LIBXML_UNICODE_ENABLED)
38109    int mem_base;
38110    int ret_val;
38111    int code; /* UCS code point */
38112    int n_code;
38113
38114    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38115        mem_base = xmlMemBlocks();
38116        code = gen_int(n_code, 0);
38117
38118        ret_val = xmlUCSIsCatZ(code);
38119        desret_int(ret_val);
38120        call_tests++;
38121        des_int(n_code, code, 0);
38122        xmlResetLastError();
38123        if (mem_base != xmlMemBlocks()) {
38124            printf("Leak of %d blocks found in xmlUCSIsCatZ",
38125	           xmlMemBlocks() - mem_base);
38126	    test_ret++;
38127            printf(" %d", n_code);
38128            printf("\n");
38129        }
38130    }
38131    function_tests++;
38132#endif
38133
38134    return(test_ret);
38135}
38136
38137
38138static int
38139test_xmlUCSIsCatZl(void) {
38140    int test_ret = 0;
38141
38142#if defined(LIBXML_UNICODE_ENABLED)
38143    int mem_base;
38144    int ret_val;
38145    int code; /* UCS code point */
38146    int n_code;
38147
38148    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38149        mem_base = xmlMemBlocks();
38150        code = gen_int(n_code, 0);
38151
38152        ret_val = xmlUCSIsCatZl(code);
38153        desret_int(ret_val);
38154        call_tests++;
38155        des_int(n_code, code, 0);
38156        xmlResetLastError();
38157        if (mem_base != xmlMemBlocks()) {
38158            printf("Leak of %d blocks found in xmlUCSIsCatZl",
38159	           xmlMemBlocks() - mem_base);
38160	    test_ret++;
38161            printf(" %d", n_code);
38162            printf("\n");
38163        }
38164    }
38165    function_tests++;
38166#endif
38167
38168    return(test_ret);
38169}
38170
38171
38172static int
38173test_xmlUCSIsCatZp(void) {
38174    int test_ret = 0;
38175
38176#if defined(LIBXML_UNICODE_ENABLED)
38177    int mem_base;
38178    int ret_val;
38179    int code; /* UCS code point */
38180    int n_code;
38181
38182    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38183        mem_base = xmlMemBlocks();
38184        code = gen_int(n_code, 0);
38185
38186        ret_val = xmlUCSIsCatZp(code);
38187        desret_int(ret_val);
38188        call_tests++;
38189        des_int(n_code, code, 0);
38190        xmlResetLastError();
38191        if (mem_base != xmlMemBlocks()) {
38192            printf("Leak of %d blocks found in xmlUCSIsCatZp",
38193	           xmlMemBlocks() - mem_base);
38194	    test_ret++;
38195            printf(" %d", n_code);
38196            printf("\n");
38197        }
38198    }
38199    function_tests++;
38200#endif
38201
38202    return(test_ret);
38203}
38204
38205
38206static int
38207test_xmlUCSIsCatZs(void) {
38208    int test_ret = 0;
38209
38210#if defined(LIBXML_UNICODE_ENABLED)
38211    int mem_base;
38212    int ret_val;
38213    int code; /* UCS code point */
38214    int n_code;
38215
38216    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38217        mem_base = xmlMemBlocks();
38218        code = gen_int(n_code, 0);
38219
38220        ret_val = xmlUCSIsCatZs(code);
38221        desret_int(ret_val);
38222        call_tests++;
38223        des_int(n_code, code, 0);
38224        xmlResetLastError();
38225        if (mem_base != xmlMemBlocks()) {
38226            printf("Leak of %d blocks found in xmlUCSIsCatZs",
38227	           xmlMemBlocks() - mem_base);
38228	    test_ret++;
38229            printf(" %d", n_code);
38230            printf("\n");
38231        }
38232    }
38233    function_tests++;
38234#endif
38235
38236    return(test_ret);
38237}
38238
38239
38240static int
38241test_xmlUCSIsCherokee(void) {
38242    int test_ret = 0;
38243
38244#if defined(LIBXML_UNICODE_ENABLED)
38245    int mem_base;
38246    int ret_val;
38247    int code; /* UCS code point */
38248    int n_code;
38249
38250    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38251        mem_base = xmlMemBlocks();
38252        code = gen_int(n_code, 0);
38253
38254        ret_val = xmlUCSIsCherokee(code);
38255        desret_int(ret_val);
38256        call_tests++;
38257        des_int(n_code, code, 0);
38258        xmlResetLastError();
38259        if (mem_base != xmlMemBlocks()) {
38260            printf("Leak of %d blocks found in xmlUCSIsCherokee",
38261	           xmlMemBlocks() - mem_base);
38262	    test_ret++;
38263            printf(" %d", n_code);
38264            printf("\n");
38265        }
38266    }
38267    function_tests++;
38268#endif
38269
38270    return(test_ret);
38271}
38272
38273
38274static int
38275test_xmlUCSIsCombiningDiacriticalMarks(void) {
38276    int test_ret = 0;
38277
38278#if defined(LIBXML_UNICODE_ENABLED)
38279    int mem_base;
38280    int ret_val;
38281    int code; /* UCS code point */
38282    int n_code;
38283
38284    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38285        mem_base = xmlMemBlocks();
38286        code = gen_int(n_code, 0);
38287
38288        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
38289        desret_int(ret_val);
38290        call_tests++;
38291        des_int(n_code, code, 0);
38292        xmlResetLastError();
38293        if (mem_base != xmlMemBlocks()) {
38294            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
38295	           xmlMemBlocks() - mem_base);
38296	    test_ret++;
38297            printf(" %d", n_code);
38298            printf("\n");
38299        }
38300    }
38301    function_tests++;
38302#endif
38303
38304    return(test_ret);
38305}
38306
38307
38308static int
38309test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
38310    int test_ret = 0;
38311
38312#if defined(LIBXML_UNICODE_ENABLED)
38313    int mem_base;
38314    int ret_val;
38315    int code; /* UCS code point */
38316    int n_code;
38317
38318    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38319        mem_base = xmlMemBlocks();
38320        code = gen_int(n_code, 0);
38321
38322        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
38323        desret_int(ret_val);
38324        call_tests++;
38325        des_int(n_code, code, 0);
38326        xmlResetLastError();
38327        if (mem_base != xmlMemBlocks()) {
38328            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
38329	           xmlMemBlocks() - mem_base);
38330	    test_ret++;
38331            printf(" %d", n_code);
38332            printf("\n");
38333        }
38334    }
38335    function_tests++;
38336#endif
38337
38338    return(test_ret);
38339}
38340
38341
38342static int
38343test_xmlUCSIsCombiningHalfMarks(void) {
38344    int test_ret = 0;
38345
38346#if defined(LIBXML_UNICODE_ENABLED)
38347    int mem_base;
38348    int ret_val;
38349    int code; /* UCS code point */
38350    int n_code;
38351
38352    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38353        mem_base = xmlMemBlocks();
38354        code = gen_int(n_code, 0);
38355
38356        ret_val = xmlUCSIsCombiningHalfMarks(code);
38357        desret_int(ret_val);
38358        call_tests++;
38359        des_int(n_code, code, 0);
38360        xmlResetLastError();
38361        if (mem_base != xmlMemBlocks()) {
38362            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
38363	           xmlMemBlocks() - mem_base);
38364	    test_ret++;
38365            printf(" %d", n_code);
38366            printf("\n");
38367        }
38368    }
38369    function_tests++;
38370#endif
38371
38372    return(test_ret);
38373}
38374
38375
38376static int
38377test_xmlUCSIsCombiningMarksforSymbols(void) {
38378    int test_ret = 0;
38379
38380#if defined(LIBXML_UNICODE_ENABLED)
38381    int mem_base;
38382    int ret_val;
38383    int code; /* UCS code point */
38384    int n_code;
38385
38386    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38387        mem_base = xmlMemBlocks();
38388        code = gen_int(n_code, 0);
38389
38390        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
38391        desret_int(ret_val);
38392        call_tests++;
38393        des_int(n_code, code, 0);
38394        xmlResetLastError();
38395        if (mem_base != xmlMemBlocks()) {
38396            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
38397	           xmlMemBlocks() - mem_base);
38398	    test_ret++;
38399            printf(" %d", n_code);
38400            printf("\n");
38401        }
38402    }
38403    function_tests++;
38404#endif
38405
38406    return(test_ret);
38407}
38408
38409
38410static int
38411test_xmlUCSIsControlPictures(void) {
38412    int test_ret = 0;
38413
38414#if defined(LIBXML_UNICODE_ENABLED)
38415    int mem_base;
38416    int ret_val;
38417    int code; /* UCS code point */
38418    int n_code;
38419
38420    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38421        mem_base = xmlMemBlocks();
38422        code = gen_int(n_code, 0);
38423
38424        ret_val = xmlUCSIsControlPictures(code);
38425        desret_int(ret_val);
38426        call_tests++;
38427        des_int(n_code, code, 0);
38428        xmlResetLastError();
38429        if (mem_base != xmlMemBlocks()) {
38430            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
38431	           xmlMemBlocks() - mem_base);
38432	    test_ret++;
38433            printf(" %d", n_code);
38434            printf("\n");
38435        }
38436    }
38437    function_tests++;
38438#endif
38439
38440    return(test_ret);
38441}
38442
38443
38444static int
38445test_xmlUCSIsCurrencySymbols(void) {
38446    int test_ret = 0;
38447
38448#if defined(LIBXML_UNICODE_ENABLED)
38449    int mem_base;
38450    int ret_val;
38451    int code; /* UCS code point */
38452    int n_code;
38453
38454    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38455        mem_base = xmlMemBlocks();
38456        code = gen_int(n_code, 0);
38457
38458        ret_val = xmlUCSIsCurrencySymbols(code);
38459        desret_int(ret_val);
38460        call_tests++;
38461        des_int(n_code, code, 0);
38462        xmlResetLastError();
38463        if (mem_base != xmlMemBlocks()) {
38464            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
38465	           xmlMemBlocks() - mem_base);
38466	    test_ret++;
38467            printf(" %d", n_code);
38468            printf("\n");
38469        }
38470    }
38471    function_tests++;
38472#endif
38473
38474    return(test_ret);
38475}
38476
38477
38478static int
38479test_xmlUCSIsCypriotSyllabary(void) {
38480    int test_ret = 0;
38481
38482#if defined(LIBXML_UNICODE_ENABLED)
38483    int mem_base;
38484    int ret_val;
38485    int code; /* UCS code point */
38486    int n_code;
38487
38488    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38489        mem_base = xmlMemBlocks();
38490        code = gen_int(n_code, 0);
38491
38492        ret_val = xmlUCSIsCypriotSyllabary(code);
38493        desret_int(ret_val);
38494        call_tests++;
38495        des_int(n_code, code, 0);
38496        xmlResetLastError();
38497        if (mem_base != xmlMemBlocks()) {
38498            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
38499	           xmlMemBlocks() - mem_base);
38500	    test_ret++;
38501            printf(" %d", n_code);
38502            printf("\n");
38503        }
38504    }
38505    function_tests++;
38506#endif
38507
38508    return(test_ret);
38509}
38510
38511
38512static int
38513test_xmlUCSIsCyrillic(void) {
38514    int test_ret = 0;
38515
38516#if defined(LIBXML_UNICODE_ENABLED)
38517    int mem_base;
38518    int ret_val;
38519    int code; /* UCS code point */
38520    int n_code;
38521
38522    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38523        mem_base = xmlMemBlocks();
38524        code = gen_int(n_code, 0);
38525
38526        ret_val = xmlUCSIsCyrillic(code);
38527        desret_int(ret_val);
38528        call_tests++;
38529        des_int(n_code, code, 0);
38530        xmlResetLastError();
38531        if (mem_base != xmlMemBlocks()) {
38532            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
38533	           xmlMemBlocks() - mem_base);
38534	    test_ret++;
38535            printf(" %d", n_code);
38536            printf("\n");
38537        }
38538    }
38539    function_tests++;
38540#endif
38541
38542    return(test_ret);
38543}
38544
38545
38546static int
38547test_xmlUCSIsCyrillicSupplement(void) {
38548    int test_ret = 0;
38549
38550#if defined(LIBXML_UNICODE_ENABLED)
38551    int mem_base;
38552    int ret_val;
38553    int code; /* UCS code point */
38554    int n_code;
38555
38556    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38557        mem_base = xmlMemBlocks();
38558        code = gen_int(n_code, 0);
38559
38560        ret_val = xmlUCSIsCyrillicSupplement(code);
38561        desret_int(ret_val);
38562        call_tests++;
38563        des_int(n_code, code, 0);
38564        xmlResetLastError();
38565        if (mem_base != xmlMemBlocks()) {
38566            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
38567	           xmlMemBlocks() - mem_base);
38568	    test_ret++;
38569            printf(" %d", n_code);
38570            printf("\n");
38571        }
38572    }
38573    function_tests++;
38574#endif
38575
38576    return(test_ret);
38577}
38578
38579
38580static int
38581test_xmlUCSIsDeseret(void) {
38582    int test_ret = 0;
38583
38584#if defined(LIBXML_UNICODE_ENABLED)
38585    int mem_base;
38586    int ret_val;
38587    int code; /* UCS code point */
38588    int n_code;
38589
38590    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38591        mem_base = xmlMemBlocks();
38592        code = gen_int(n_code, 0);
38593
38594        ret_val = xmlUCSIsDeseret(code);
38595        desret_int(ret_val);
38596        call_tests++;
38597        des_int(n_code, code, 0);
38598        xmlResetLastError();
38599        if (mem_base != xmlMemBlocks()) {
38600            printf("Leak of %d blocks found in xmlUCSIsDeseret",
38601	           xmlMemBlocks() - mem_base);
38602	    test_ret++;
38603            printf(" %d", n_code);
38604            printf("\n");
38605        }
38606    }
38607    function_tests++;
38608#endif
38609
38610    return(test_ret);
38611}
38612
38613
38614static int
38615test_xmlUCSIsDevanagari(void) {
38616    int test_ret = 0;
38617
38618#if defined(LIBXML_UNICODE_ENABLED)
38619    int mem_base;
38620    int ret_val;
38621    int code; /* UCS code point */
38622    int n_code;
38623
38624    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38625        mem_base = xmlMemBlocks();
38626        code = gen_int(n_code, 0);
38627
38628        ret_val = xmlUCSIsDevanagari(code);
38629        desret_int(ret_val);
38630        call_tests++;
38631        des_int(n_code, code, 0);
38632        xmlResetLastError();
38633        if (mem_base != xmlMemBlocks()) {
38634            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
38635	           xmlMemBlocks() - mem_base);
38636	    test_ret++;
38637            printf(" %d", n_code);
38638            printf("\n");
38639        }
38640    }
38641    function_tests++;
38642#endif
38643
38644    return(test_ret);
38645}
38646
38647
38648static int
38649test_xmlUCSIsDingbats(void) {
38650    int test_ret = 0;
38651
38652#if defined(LIBXML_UNICODE_ENABLED)
38653    int mem_base;
38654    int ret_val;
38655    int code; /* UCS code point */
38656    int n_code;
38657
38658    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38659        mem_base = xmlMemBlocks();
38660        code = gen_int(n_code, 0);
38661
38662        ret_val = xmlUCSIsDingbats(code);
38663        desret_int(ret_val);
38664        call_tests++;
38665        des_int(n_code, code, 0);
38666        xmlResetLastError();
38667        if (mem_base != xmlMemBlocks()) {
38668            printf("Leak of %d blocks found in xmlUCSIsDingbats",
38669	           xmlMemBlocks() - mem_base);
38670	    test_ret++;
38671            printf(" %d", n_code);
38672            printf("\n");
38673        }
38674    }
38675    function_tests++;
38676#endif
38677
38678    return(test_ret);
38679}
38680
38681
38682static int
38683test_xmlUCSIsEnclosedAlphanumerics(void) {
38684    int test_ret = 0;
38685
38686#if defined(LIBXML_UNICODE_ENABLED)
38687    int mem_base;
38688    int ret_val;
38689    int code; /* UCS code point */
38690    int n_code;
38691
38692    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38693        mem_base = xmlMemBlocks();
38694        code = gen_int(n_code, 0);
38695
38696        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
38697        desret_int(ret_val);
38698        call_tests++;
38699        des_int(n_code, code, 0);
38700        xmlResetLastError();
38701        if (mem_base != xmlMemBlocks()) {
38702            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
38703	           xmlMemBlocks() - mem_base);
38704	    test_ret++;
38705            printf(" %d", n_code);
38706            printf("\n");
38707        }
38708    }
38709    function_tests++;
38710#endif
38711
38712    return(test_ret);
38713}
38714
38715
38716static int
38717test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
38718    int test_ret = 0;
38719
38720#if defined(LIBXML_UNICODE_ENABLED)
38721    int mem_base;
38722    int ret_val;
38723    int code; /* UCS code point */
38724    int n_code;
38725
38726    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38727        mem_base = xmlMemBlocks();
38728        code = gen_int(n_code, 0);
38729
38730        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
38731        desret_int(ret_val);
38732        call_tests++;
38733        des_int(n_code, code, 0);
38734        xmlResetLastError();
38735        if (mem_base != xmlMemBlocks()) {
38736            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
38737	           xmlMemBlocks() - mem_base);
38738	    test_ret++;
38739            printf(" %d", n_code);
38740            printf("\n");
38741        }
38742    }
38743    function_tests++;
38744#endif
38745
38746    return(test_ret);
38747}
38748
38749
38750static int
38751test_xmlUCSIsEthiopic(void) {
38752    int test_ret = 0;
38753
38754#if defined(LIBXML_UNICODE_ENABLED)
38755    int mem_base;
38756    int ret_val;
38757    int code; /* UCS code point */
38758    int n_code;
38759
38760    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38761        mem_base = xmlMemBlocks();
38762        code = gen_int(n_code, 0);
38763
38764        ret_val = xmlUCSIsEthiopic(code);
38765        desret_int(ret_val);
38766        call_tests++;
38767        des_int(n_code, code, 0);
38768        xmlResetLastError();
38769        if (mem_base != xmlMemBlocks()) {
38770            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
38771	           xmlMemBlocks() - mem_base);
38772	    test_ret++;
38773            printf(" %d", n_code);
38774            printf("\n");
38775        }
38776    }
38777    function_tests++;
38778#endif
38779
38780    return(test_ret);
38781}
38782
38783
38784static int
38785test_xmlUCSIsGeneralPunctuation(void) {
38786    int test_ret = 0;
38787
38788#if defined(LIBXML_UNICODE_ENABLED)
38789    int mem_base;
38790    int ret_val;
38791    int code; /* UCS code point */
38792    int n_code;
38793
38794    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38795        mem_base = xmlMemBlocks();
38796        code = gen_int(n_code, 0);
38797
38798        ret_val = xmlUCSIsGeneralPunctuation(code);
38799        desret_int(ret_val);
38800        call_tests++;
38801        des_int(n_code, code, 0);
38802        xmlResetLastError();
38803        if (mem_base != xmlMemBlocks()) {
38804            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
38805	           xmlMemBlocks() - mem_base);
38806	    test_ret++;
38807            printf(" %d", n_code);
38808            printf("\n");
38809        }
38810    }
38811    function_tests++;
38812#endif
38813
38814    return(test_ret);
38815}
38816
38817
38818static int
38819test_xmlUCSIsGeometricShapes(void) {
38820    int test_ret = 0;
38821
38822#if defined(LIBXML_UNICODE_ENABLED)
38823    int mem_base;
38824    int ret_val;
38825    int code; /* UCS code point */
38826    int n_code;
38827
38828    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38829        mem_base = xmlMemBlocks();
38830        code = gen_int(n_code, 0);
38831
38832        ret_val = xmlUCSIsGeometricShapes(code);
38833        desret_int(ret_val);
38834        call_tests++;
38835        des_int(n_code, code, 0);
38836        xmlResetLastError();
38837        if (mem_base != xmlMemBlocks()) {
38838            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
38839	           xmlMemBlocks() - mem_base);
38840	    test_ret++;
38841            printf(" %d", n_code);
38842            printf("\n");
38843        }
38844    }
38845    function_tests++;
38846#endif
38847
38848    return(test_ret);
38849}
38850
38851
38852static int
38853test_xmlUCSIsGeorgian(void) {
38854    int test_ret = 0;
38855
38856#if defined(LIBXML_UNICODE_ENABLED)
38857    int mem_base;
38858    int ret_val;
38859    int code; /* UCS code point */
38860    int n_code;
38861
38862    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38863        mem_base = xmlMemBlocks();
38864        code = gen_int(n_code, 0);
38865
38866        ret_val = xmlUCSIsGeorgian(code);
38867        desret_int(ret_val);
38868        call_tests++;
38869        des_int(n_code, code, 0);
38870        xmlResetLastError();
38871        if (mem_base != xmlMemBlocks()) {
38872            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
38873	           xmlMemBlocks() - mem_base);
38874	    test_ret++;
38875            printf(" %d", n_code);
38876            printf("\n");
38877        }
38878    }
38879    function_tests++;
38880#endif
38881
38882    return(test_ret);
38883}
38884
38885
38886static int
38887test_xmlUCSIsGothic(void) {
38888    int test_ret = 0;
38889
38890#if defined(LIBXML_UNICODE_ENABLED)
38891    int mem_base;
38892    int ret_val;
38893    int code; /* UCS code point */
38894    int n_code;
38895
38896    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38897        mem_base = xmlMemBlocks();
38898        code = gen_int(n_code, 0);
38899
38900        ret_val = xmlUCSIsGothic(code);
38901        desret_int(ret_val);
38902        call_tests++;
38903        des_int(n_code, code, 0);
38904        xmlResetLastError();
38905        if (mem_base != xmlMemBlocks()) {
38906            printf("Leak of %d blocks found in xmlUCSIsGothic",
38907	           xmlMemBlocks() - mem_base);
38908	    test_ret++;
38909            printf(" %d", n_code);
38910            printf("\n");
38911        }
38912    }
38913    function_tests++;
38914#endif
38915
38916    return(test_ret);
38917}
38918
38919
38920static int
38921test_xmlUCSIsGreek(void) {
38922    int test_ret = 0;
38923
38924#if defined(LIBXML_UNICODE_ENABLED)
38925    int mem_base;
38926    int ret_val;
38927    int code; /* UCS code point */
38928    int n_code;
38929
38930    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38931        mem_base = xmlMemBlocks();
38932        code = gen_int(n_code, 0);
38933
38934        ret_val = xmlUCSIsGreek(code);
38935        desret_int(ret_val);
38936        call_tests++;
38937        des_int(n_code, code, 0);
38938        xmlResetLastError();
38939        if (mem_base != xmlMemBlocks()) {
38940            printf("Leak of %d blocks found in xmlUCSIsGreek",
38941	           xmlMemBlocks() - mem_base);
38942	    test_ret++;
38943            printf(" %d", n_code);
38944            printf("\n");
38945        }
38946    }
38947    function_tests++;
38948#endif
38949
38950    return(test_ret);
38951}
38952
38953
38954static int
38955test_xmlUCSIsGreekExtended(void) {
38956    int test_ret = 0;
38957
38958#if defined(LIBXML_UNICODE_ENABLED)
38959    int mem_base;
38960    int ret_val;
38961    int code; /* UCS code point */
38962    int n_code;
38963
38964    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38965        mem_base = xmlMemBlocks();
38966        code = gen_int(n_code, 0);
38967
38968        ret_val = xmlUCSIsGreekExtended(code);
38969        desret_int(ret_val);
38970        call_tests++;
38971        des_int(n_code, code, 0);
38972        xmlResetLastError();
38973        if (mem_base != xmlMemBlocks()) {
38974            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
38975	           xmlMemBlocks() - mem_base);
38976	    test_ret++;
38977            printf(" %d", n_code);
38978            printf("\n");
38979        }
38980    }
38981    function_tests++;
38982#endif
38983
38984    return(test_ret);
38985}
38986
38987
38988static int
38989test_xmlUCSIsGreekandCoptic(void) {
38990    int test_ret = 0;
38991
38992#if defined(LIBXML_UNICODE_ENABLED)
38993    int mem_base;
38994    int ret_val;
38995    int code; /* UCS code point */
38996    int n_code;
38997
38998    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38999        mem_base = xmlMemBlocks();
39000        code = gen_int(n_code, 0);
39001
39002        ret_val = xmlUCSIsGreekandCoptic(code);
39003        desret_int(ret_val);
39004        call_tests++;
39005        des_int(n_code, code, 0);
39006        xmlResetLastError();
39007        if (mem_base != xmlMemBlocks()) {
39008            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39009	           xmlMemBlocks() - mem_base);
39010	    test_ret++;
39011            printf(" %d", n_code);
39012            printf("\n");
39013        }
39014    }
39015    function_tests++;
39016#endif
39017
39018    return(test_ret);
39019}
39020
39021
39022static int
39023test_xmlUCSIsGujarati(void) {
39024    int test_ret = 0;
39025
39026#if defined(LIBXML_UNICODE_ENABLED)
39027    int mem_base;
39028    int ret_val;
39029    int code; /* UCS code point */
39030    int n_code;
39031
39032    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39033        mem_base = xmlMemBlocks();
39034        code = gen_int(n_code, 0);
39035
39036        ret_val = xmlUCSIsGujarati(code);
39037        desret_int(ret_val);
39038        call_tests++;
39039        des_int(n_code, code, 0);
39040        xmlResetLastError();
39041        if (mem_base != xmlMemBlocks()) {
39042            printf("Leak of %d blocks found in xmlUCSIsGujarati",
39043	           xmlMemBlocks() - mem_base);
39044	    test_ret++;
39045            printf(" %d", n_code);
39046            printf("\n");
39047        }
39048    }
39049    function_tests++;
39050#endif
39051
39052    return(test_ret);
39053}
39054
39055
39056static int
39057test_xmlUCSIsGurmukhi(void) {
39058    int test_ret = 0;
39059
39060#if defined(LIBXML_UNICODE_ENABLED)
39061    int mem_base;
39062    int ret_val;
39063    int code; /* UCS code point */
39064    int n_code;
39065
39066    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39067        mem_base = xmlMemBlocks();
39068        code = gen_int(n_code, 0);
39069
39070        ret_val = xmlUCSIsGurmukhi(code);
39071        desret_int(ret_val);
39072        call_tests++;
39073        des_int(n_code, code, 0);
39074        xmlResetLastError();
39075        if (mem_base != xmlMemBlocks()) {
39076            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39077	           xmlMemBlocks() - mem_base);
39078	    test_ret++;
39079            printf(" %d", n_code);
39080            printf("\n");
39081        }
39082    }
39083    function_tests++;
39084#endif
39085
39086    return(test_ret);
39087}
39088
39089
39090static int
39091test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39092    int test_ret = 0;
39093
39094#if defined(LIBXML_UNICODE_ENABLED)
39095    int mem_base;
39096    int ret_val;
39097    int code; /* UCS code point */
39098    int n_code;
39099
39100    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39101        mem_base = xmlMemBlocks();
39102        code = gen_int(n_code, 0);
39103
39104        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39105        desret_int(ret_val);
39106        call_tests++;
39107        des_int(n_code, code, 0);
39108        xmlResetLastError();
39109        if (mem_base != xmlMemBlocks()) {
39110            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39111	           xmlMemBlocks() - mem_base);
39112	    test_ret++;
39113            printf(" %d", n_code);
39114            printf("\n");
39115        }
39116    }
39117    function_tests++;
39118#endif
39119
39120    return(test_ret);
39121}
39122
39123
39124static int
39125test_xmlUCSIsHangulCompatibilityJamo(void) {
39126    int test_ret = 0;
39127
39128#if defined(LIBXML_UNICODE_ENABLED)
39129    int mem_base;
39130    int ret_val;
39131    int code; /* UCS code point */
39132    int n_code;
39133
39134    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39135        mem_base = xmlMemBlocks();
39136        code = gen_int(n_code, 0);
39137
39138        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39139        desret_int(ret_val);
39140        call_tests++;
39141        des_int(n_code, code, 0);
39142        xmlResetLastError();
39143        if (mem_base != xmlMemBlocks()) {
39144            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39145	           xmlMemBlocks() - mem_base);
39146	    test_ret++;
39147            printf(" %d", n_code);
39148            printf("\n");
39149        }
39150    }
39151    function_tests++;
39152#endif
39153
39154    return(test_ret);
39155}
39156
39157
39158static int
39159test_xmlUCSIsHangulJamo(void) {
39160    int test_ret = 0;
39161
39162#if defined(LIBXML_UNICODE_ENABLED)
39163    int mem_base;
39164    int ret_val;
39165    int code; /* UCS code point */
39166    int n_code;
39167
39168    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39169        mem_base = xmlMemBlocks();
39170        code = gen_int(n_code, 0);
39171
39172        ret_val = xmlUCSIsHangulJamo(code);
39173        desret_int(ret_val);
39174        call_tests++;
39175        des_int(n_code, code, 0);
39176        xmlResetLastError();
39177        if (mem_base != xmlMemBlocks()) {
39178            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
39179	           xmlMemBlocks() - mem_base);
39180	    test_ret++;
39181            printf(" %d", n_code);
39182            printf("\n");
39183        }
39184    }
39185    function_tests++;
39186#endif
39187
39188    return(test_ret);
39189}
39190
39191
39192static int
39193test_xmlUCSIsHangulSyllables(void) {
39194    int test_ret = 0;
39195
39196#if defined(LIBXML_UNICODE_ENABLED)
39197    int mem_base;
39198    int ret_val;
39199    int code; /* UCS code point */
39200    int n_code;
39201
39202    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39203        mem_base = xmlMemBlocks();
39204        code = gen_int(n_code, 0);
39205
39206        ret_val = xmlUCSIsHangulSyllables(code);
39207        desret_int(ret_val);
39208        call_tests++;
39209        des_int(n_code, code, 0);
39210        xmlResetLastError();
39211        if (mem_base != xmlMemBlocks()) {
39212            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
39213	           xmlMemBlocks() - mem_base);
39214	    test_ret++;
39215            printf(" %d", n_code);
39216            printf("\n");
39217        }
39218    }
39219    function_tests++;
39220#endif
39221
39222    return(test_ret);
39223}
39224
39225
39226static int
39227test_xmlUCSIsHanunoo(void) {
39228    int test_ret = 0;
39229
39230#if defined(LIBXML_UNICODE_ENABLED)
39231    int mem_base;
39232    int ret_val;
39233    int code; /* UCS code point */
39234    int n_code;
39235
39236    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39237        mem_base = xmlMemBlocks();
39238        code = gen_int(n_code, 0);
39239
39240        ret_val = xmlUCSIsHanunoo(code);
39241        desret_int(ret_val);
39242        call_tests++;
39243        des_int(n_code, code, 0);
39244        xmlResetLastError();
39245        if (mem_base != xmlMemBlocks()) {
39246            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
39247	           xmlMemBlocks() - mem_base);
39248	    test_ret++;
39249            printf(" %d", n_code);
39250            printf("\n");
39251        }
39252    }
39253    function_tests++;
39254#endif
39255
39256    return(test_ret);
39257}
39258
39259
39260static int
39261test_xmlUCSIsHebrew(void) {
39262    int test_ret = 0;
39263
39264#if defined(LIBXML_UNICODE_ENABLED)
39265    int mem_base;
39266    int ret_val;
39267    int code; /* UCS code point */
39268    int n_code;
39269
39270    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39271        mem_base = xmlMemBlocks();
39272        code = gen_int(n_code, 0);
39273
39274        ret_val = xmlUCSIsHebrew(code);
39275        desret_int(ret_val);
39276        call_tests++;
39277        des_int(n_code, code, 0);
39278        xmlResetLastError();
39279        if (mem_base != xmlMemBlocks()) {
39280            printf("Leak of %d blocks found in xmlUCSIsHebrew",
39281	           xmlMemBlocks() - mem_base);
39282	    test_ret++;
39283            printf(" %d", n_code);
39284            printf("\n");
39285        }
39286    }
39287    function_tests++;
39288#endif
39289
39290    return(test_ret);
39291}
39292
39293
39294static int
39295test_xmlUCSIsHighPrivateUseSurrogates(void) {
39296    int test_ret = 0;
39297
39298#if defined(LIBXML_UNICODE_ENABLED)
39299    int mem_base;
39300    int ret_val;
39301    int code; /* UCS code point */
39302    int n_code;
39303
39304    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39305        mem_base = xmlMemBlocks();
39306        code = gen_int(n_code, 0);
39307
39308        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
39309        desret_int(ret_val);
39310        call_tests++;
39311        des_int(n_code, code, 0);
39312        xmlResetLastError();
39313        if (mem_base != xmlMemBlocks()) {
39314            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
39315	           xmlMemBlocks() - mem_base);
39316	    test_ret++;
39317            printf(" %d", n_code);
39318            printf("\n");
39319        }
39320    }
39321    function_tests++;
39322#endif
39323
39324    return(test_ret);
39325}
39326
39327
39328static int
39329test_xmlUCSIsHighSurrogates(void) {
39330    int test_ret = 0;
39331
39332#if defined(LIBXML_UNICODE_ENABLED)
39333    int mem_base;
39334    int ret_val;
39335    int code; /* UCS code point */
39336    int n_code;
39337
39338    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39339        mem_base = xmlMemBlocks();
39340        code = gen_int(n_code, 0);
39341
39342        ret_val = xmlUCSIsHighSurrogates(code);
39343        desret_int(ret_val);
39344        call_tests++;
39345        des_int(n_code, code, 0);
39346        xmlResetLastError();
39347        if (mem_base != xmlMemBlocks()) {
39348            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
39349	           xmlMemBlocks() - mem_base);
39350	    test_ret++;
39351            printf(" %d", n_code);
39352            printf("\n");
39353        }
39354    }
39355    function_tests++;
39356#endif
39357
39358    return(test_ret);
39359}
39360
39361
39362static int
39363test_xmlUCSIsHiragana(void) {
39364    int test_ret = 0;
39365
39366#if defined(LIBXML_UNICODE_ENABLED)
39367    int mem_base;
39368    int ret_val;
39369    int code; /* UCS code point */
39370    int n_code;
39371
39372    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39373        mem_base = xmlMemBlocks();
39374        code = gen_int(n_code, 0);
39375
39376        ret_val = xmlUCSIsHiragana(code);
39377        desret_int(ret_val);
39378        call_tests++;
39379        des_int(n_code, code, 0);
39380        xmlResetLastError();
39381        if (mem_base != xmlMemBlocks()) {
39382            printf("Leak of %d blocks found in xmlUCSIsHiragana",
39383	           xmlMemBlocks() - mem_base);
39384	    test_ret++;
39385            printf(" %d", n_code);
39386            printf("\n");
39387        }
39388    }
39389    function_tests++;
39390#endif
39391
39392    return(test_ret);
39393}
39394
39395
39396static int
39397test_xmlUCSIsIPAExtensions(void) {
39398    int test_ret = 0;
39399
39400#if defined(LIBXML_UNICODE_ENABLED)
39401    int mem_base;
39402    int ret_val;
39403    int code; /* UCS code point */
39404    int n_code;
39405
39406    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39407        mem_base = xmlMemBlocks();
39408        code = gen_int(n_code, 0);
39409
39410        ret_val = xmlUCSIsIPAExtensions(code);
39411        desret_int(ret_val);
39412        call_tests++;
39413        des_int(n_code, code, 0);
39414        xmlResetLastError();
39415        if (mem_base != xmlMemBlocks()) {
39416            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
39417	           xmlMemBlocks() - mem_base);
39418	    test_ret++;
39419            printf(" %d", n_code);
39420            printf("\n");
39421        }
39422    }
39423    function_tests++;
39424#endif
39425
39426    return(test_ret);
39427}
39428
39429
39430static int
39431test_xmlUCSIsIdeographicDescriptionCharacters(void) {
39432    int test_ret = 0;
39433
39434#if defined(LIBXML_UNICODE_ENABLED)
39435    int mem_base;
39436    int ret_val;
39437    int code; /* UCS code point */
39438    int n_code;
39439
39440    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39441        mem_base = xmlMemBlocks();
39442        code = gen_int(n_code, 0);
39443
39444        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
39445        desret_int(ret_val);
39446        call_tests++;
39447        des_int(n_code, code, 0);
39448        xmlResetLastError();
39449        if (mem_base != xmlMemBlocks()) {
39450            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
39451	           xmlMemBlocks() - mem_base);
39452	    test_ret++;
39453            printf(" %d", n_code);
39454            printf("\n");
39455        }
39456    }
39457    function_tests++;
39458#endif
39459
39460    return(test_ret);
39461}
39462
39463
39464static int
39465test_xmlUCSIsKanbun(void) {
39466    int test_ret = 0;
39467
39468#if defined(LIBXML_UNICODE_ENABLED)
39469    int mem_base;
39470    int ret_val;
39471    int code; /* UCS code point */
39472    int n_code;
39473
39474    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39475        mem_base = xmlMemBlocks();
39476        code = gen_int(n_code, 0);
39477
39478        ret_val = xmlUCSIsKanbun(code);
39479        desret_int(ret_val);
39480        call_tests++;
39481        des_int(n_code, code, 0);
39482        xmlResetLastError();
39483        if (mem_base != xmlMemBlocks()) {
39484            printf("Leak of %d blocks found in xmlUCSIsKanbun",
39485	           xmlMemBlocks() - mem_base);
39486	    test_ret++;
39487            printf(" %d", n_code);
39488            printf("\n");
39489        }
39490    }
39491    function_tests++;
39492#endif
39493
39494    return(test_ret);
39495}
39496
39497
39498static int
39499test_xmlUCSIsKangxiRadicals(void) {
39500    int test_ret = 0;
39501
39502#if defined(LIBXML_UNICODE_ENABLED)
39503    int mem_base;
39504    int ret_val;
39505    int code; /* UCS code point */
39506    int n_code;
39507
39508    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39509        mem_base = xmlMemBlocks();
39510        code = gen_int(n_code, 0);
39511
39512        ret_val = xmlUCSIsKangxiRadicals(code);
39513        desret_int(ret_val);
39514        call_tests++;
39515        des_int(n_code, code, 0);
39516        xmlResetLastError();
39517        if (mem_base != xmlMemBlocks()) {
39518            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
39519	           xmlMemBlocks() - mem_base);
39520	    test_ret++;
39521            printf(" %d", n_code);
39522            printf("\n");
39523        }
39524    }
39525    function_tests++;
39526#endif
39527
39528    return(test_ret);
39529}
39530
39531
39532static int
39533test_xmlUCSIsKannada(void) {
39534    int test_ret = 0;
39535
39536#if defined(LIBXML_UNICODE_ENABLED)
39537    int mem_base;
39538    int ret_val;
39539    int code; /* UCS code point */
39540    int n_code;
39541
39542    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39543        mem_base = xmlMemBlocks();
39544        code = gen_int(n_code, 0);
39545
39546        ret_val = xmlUCSIsKannada(code);
39547        desret_int(ret_val);
39548        call_tests++;
39549        des_int(n_code, code, 0);
39550        xmlResetLastError();
39551        if (mem_base != xmlMemBlocks()) {
39552            printf("Leak of %d blocks found in xmlUCSIsKannada",
39553	           xmlMemBlocks() - mem_base);
39554	    test_ret++;
39555            printf(" %d", n_code);
39556            printf("\n");
39557        }
39558    }
39559    function_tests++;
39560#endif
39561
39562    return(test_ret);
39563}
39564
39565
39566static int
39567test_xmlUCSIsKatakana(void) {
39568    int test_ret = 0;
39569
39570#if defined(LIBXML_UNICODE_ENABLED)
39571    int mem_base;
39572    int ret_val;
39573    int code; /* UCS code point */
39574    int n_code;
39575
39576    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39577        mem_base = xmlMemBlocks();
39578        code = gen_int(n_code, 0);
39579
39580        ret_val = xmlUCSIsKatakana(code);
39581        desret_int(ret_val);
39582        call_tests++;
39583        des_int(n_code, code, 0);
39584        xmlResetLastError();
39585        if (mem_base != xmlMemBlocks()) {
39586            printf("Leak of %d blocks found in xmlUCSIsKatakana",
39587	           xmlMemBlocks() - mem_base);
39588	    test_ret++;
39589            printf(" %d", n_code);
39590            printf("\n");
39591        }
39592    }
39593    function_tests++;
39594#endif
39595
39596    return(test_ret);
39597}
39598
39599
39600static int
39601test_xmlUCSIsKatakanaPhoneticExtensions(void) {
39602    int test_ret = 0;
39603
39604#if defined(LIBXML_UNICODE_ENABLED)
39605    int mem_base;
39606    int ret_val;
39607    int code; /* UCS code point */
39608    int n_code;
39609
39610    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39611        mem_base = xmlMemBlocks();
39612        code = gen_int(n_code, 0);
39613
39614        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
39615        desret_int(ret_val);
39616        call_tests++;
39617        des_int(n_code, code, 0);
39618        xmlResetLastError();
39619        if (mem_base != xmlMemBlocks()) {
39620            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
39621	           xmlMemBlocks() - mem_base);
39622	    test_ret++;
39623            printf(" %d", n_code);
39624            printf("\n");
39625        }
39626    }
39627    function_tests++;
39628#endif
39629
39630    return(test_ret);
39631}
39632
39633
39634static int
39635test_xmlUCSIsKhmer(void) {
39636    int test_ret = 0;
39637
39638#if defined(LIBXML_UNICODE_ENABLED)
39639    int mem_base;
39640    int ret_val;
39641    int code; /* UCS code point */
39642    int n_code;
39643
39644    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39645        mem_base = xmlMemBlocks();
39646        code = gen_int(n_code, 0);
39647
39648        ret_val = xmlUCSIsKhmer(code);
39649        desret_int(ret_val);
39650        call_tests++;
39651        des_int(n_code, code, 0);
39652        xmlResetLastError();
39653        if (mem_base != xmlMemBlocks()) {
39654            printf("Leak of %d blocks found in xmlUCSIsKhmer",
39655	           xmlMemBlocks() - mem_base);
39656	    test_ret++;
39657            printf(" %d", n_code);
39658            printf("\n");
39659        }
39660    }
39661    function_tests++;
39662#endif
39663
39664    return(test_ret);
39665}
39666
39667
39668static int
39669test_xmlUCSIsKhmerSymbols(void) {
39670    int test_ret = 0;
39671
39672#if defined(LIBXML_UNICODE_ENABLED)
39673    int mem_base;
39674    int ret_val;
39675    int code; /* UCS code point */
39676    int n_code;
39677
39678    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39679        mem_base = xmlMemBlocks();
39680        code = gen_int(n_code, 0);
39681
39682        ret_val = xmlUCSIsKhmerSymbols(code);
39683        desret_int(ret_val);
39684        call_tests++;
39685        des_int(n_code, code, 0);
39686        xmlResetLastError();
39687        if (mem_base != xmlMemBlocks()) {
39688            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
39689	           xmlMemBlocks() - mem_base);
39690	    test_ret++;
39691            printf(" %d", n_code);
39692            printf("\n");
39693        }
39694    }
39695    function_tests++;
39696#endif
39697
39698    return(test_ret);
39699}
39700
39701
39702static int
39703test_xmlUCSIsLao(void) {
39704    int test_ret = 0;
39705
39706#if defined(LIBXML_UNICODE_ENABLED)
39707    int mem_base;
39708    int ret_val;
39709    int code; /* UCS code point */
39710    int n_code;
39711
39712    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39713        mem_base = xmlMemBlocks();
39714        code = gen_int(n_code, 0);
39715
39716        ret_val = xmlUCSIsLao(code);
39717        desret_int(ret_val);
39718        call_tests++;
39719        des_int(n_code, code, 0);
39720        xmlResetLastError();
39721        if (mem_base != xmlMemBlocks()) {
39722            printf("Leak of %d blocks found in xmlUCSIsLao",
39723	           xmlMemBlocks() - mem_base);
39724	    test_ret++;
39725            printf(" %d", n_code);
39726            printf("\n");
39727        }
39728    }
39729    function_tests++;
39730#endif
39731
39732    return(test_ret);
39733}
39734
39735
39736static int
39737test_xmlUCSIsLatin1Supplement(void) {
39738    int test_ret = 0;
39739
39740#if defined(LIBXML_UNICODE_ENABLED)
39741    int mem_base;
39742    int ret_val;
39743    int code; /* UCS code point */
39744    int n_code;
39745
39746    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39747        mem_base = xmlMemBlocks();
39748        code = gen_int(n_code, 0);
39749
39750        ret_val = xmlUCSIsLatin1Supplement(code);
39751        desret_int(ret_val);
39752        call_tests++;
39753        des_int(n_code, code, 0);
39754        xmlResetLastError();
39755        if (mem_base != xmlMemBlocks()) {
39756            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
39757	           xmlMemBlocks() - mem_base);
39758	    test_ret++;
39759            printf(" %d", n_code);
39760            printf("\n");
39761        }
39762    }
39763    function_tests++;
39764#endif
39765
39766    return(test_ret);
39767}
39768
39769
39770static int
39771test_xmlUCSIsLatinExtendedA(void) {
39772    int test_ret = 0;
39773
39774#if defined(LIBXML_UNICODE_ENABLED)
39775    int mem_base;
39776    int ret_val;
39777    int code; /* UCS code point */
39778    int n_code;
39779
39780    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39781        mem_base = xmlMemBlocks();
39782        code = gen_int(n_code, 0);
39783
39784        ret_val = xmlUCSIsLatinExtendedA(code);
39785        desret_int(ret_val);
39786        call_tests++;
39787        des_int(n_code, code, 0);
39788        xmlResetLastError();
39789        if (mem_base != xmlMemBlocks()) {
39790            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
39791	           xmlMemBlocks() - mem_base);
39792	    test_ret++;
39793            printf(" %d", n_code);
39794            printf("\n");
39795        }
39796    }
39797    function_tests++;
39798#endif
39799
39800    return(test_ret);
39801}
39802
39803
39804static int
39805test_xmlUCSIsLatinExtendedAdditional(void) {
39806    int test_ret = 0;
39807
39808#if defined(LIBXML_UNICODE_ENABLED)
39809    int mem_base;
39810    int ret_val;
39811    int code; /* UCS code point */
39812    int n_code;
39813
39814    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39815        mem_base = xmlMemBlocks();
39816        code = gen_int(n_code, 0);
39817
39818        ret_val = xmlUCSIsLatinExtendedAdditional(code);
39819        desret_int(ret_val);
39820        call_tests++;
39821        des_int(n_code, code, 0);
39822        xmlResetLastError();
39823        if (mem_base != xmlMemBlocks()) {
39824            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
39825	           xmlMemBlocks() - mem_base);
39826	    test_ret++;
39827            printf(" %d", n_code);
39828            printf("\n");
39829        }
39830    }
39831    function_tests++;
39832#endif
39833
39834    return(test_ret);
39835}
39836
39837
39838static int
39839test_xmlUCSIsLatinExtendedB(void) {
39840    int test_ret = 0;
39841
39842#if defined(LIBXML_UNICODE_ENABLED)
39843    int mem_base;
39844    int ret_val;
39845    int code; /* UCS code point */
39846    int n_code;
39847
39848    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39849        mem_base = xmlMemBlocks();
39850        code = gen_int(n_code, 0);
39851
39852        ret_val = xmlUCSIsLatinExtendedB(code);
39853        desret_int(ret_val);
39854        call_tests++;
39855        des_int(n_code, code, 0);
39856        xmlResetLastError();
39857        if (mem_base != xmlMemBlocks()) {
39858            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
39859	           xmlMemBlocks() - mem_base);
39860	    test_ret++;
39861            printf(" %d", n_code);
39862            printf("\n");
39863        }
39864    }
39865    function_tests++;
39866#endif
39867
39868    return(test_ret);
39869}
39870
39871
39872static int
39873test_xmlUCSIsLetterlikeSymbols(void) {
39874    int test_ret = 0;
39875
39876#if defined(LIBXML_UNICODE_ENABLED)
39877    int mem_base;
39878    int ret_val;
39879    int code; /* UCS code point */
39880    int n_code;
39881
39882    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39883        mem_base = xmlMemBlocks();
39884        code = gen_int(n_code, 0);
39885
39886        ret_val = xmlUCSIsLetterlikeSymbols(code);
39887        desret_int(ret_val);
39888        call_tests++;
39889        des_int(n_code, code, 0);
39890        xmlResetLastError();
39891        if (mem_base != xmlMemBlocks()) {
39892            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
39893	           xmlMemBlocks() - mem_base);
39894	    test_ret++;
39895            printf(" %d", n_code);
39896            printf("\n");
39897        }
39898    }
39899    function_tests++;
39900#endif
39901
39902    return(test_ret);
39903}
39904
39905
39906static int
39907test_xmlUCSIsLimbu(void) {
39908    int test_ret = 0;
39909
39910#if defined(LIBXML_UNICODE_ENABLED)
39911    int mem_base;
39912    int ret_val;
39913    int code; /* UCS code point */
39914    int n_code;
39915
39916    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39917        mem_base = xmlMemBlocks();
39918        code = gen_int(n_code, 0);
39919
39920        ret_val = xmlUCSIsLimbu(code);
39921        desret_int(ret_val);
39922        call_tests++;
39923        des_int(n_code, code, 0);
39924        xmlResetLastError();
39925        if (mem_base != xmlMemBlocks()) {
39926            printf("Leak of %d blocks found in xmlUCSIsLimbu",
39927	           xmlMemBlocks() - mem_base);
39928	    test_ret++;
39929            printf(" %d", n_code);
39930            printf("\n");
39931        }
39932    }
39933    function_tests++;
39934#endif
39935
39936    return(test_ret);
39937}
39938
39939
39940static int
39941test_xmlUCSIsLinearBIdeograms(void) {
39942    int test_ret = 0;
39943
39944#if defined(LIBXML_UNICODE_ENABLED)
39945    int mem_base;
39946    int ret_val;
39947    int code; /* UCS code point */
39948    int n_code;
39949
39950    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39951        mem_base = xmlMemBlocks();
39952        code = gen_int(n_code, 0);
39953
39954        ret_val = xmlUCSIsLinearBIdeograms(code);
39955        desret_int(ret_val);
39956        call_tests++;
39957        des_int(n_code, code, 0);
39958        xmlResetLastError();
39959        if (mem_base != xmlMemBlocks()) {
39960            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
39961	           xmlMemBlocks() - mem_base);
39962	    test_ret++;
39963            printf(" %d", n_code);
39964            printf("\n");
39965        }
39966    }
39967    function_tests++;
39968#endif
39969
39970    return(test_ret);
39971}
39972
39973
39974static int
39975test_xmlUCSIsLinearBSyllabary(void) {
39976    int test_ret = 0;
39977
39978#if defined(LIBXML_UNICODE_ENABLED)
39979    int mem_base;
39980    int ret_val;
39981    int code; /* UCS code point */
39982    int n_code;
39983
39984    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39985        mem_base = xmlMemBlocks();
39986        code = gen_int(n_code, 0);
39987
39988        ret_val = xmlUCSIsLinearBSyllabary(code);
39989        desret_int(ret_val);
39990        call_tests++;
39991        des_int(n_code, code, 0);
39992        xmlResetLastError();
39993        if (mem_base != xmlMemBlocks()) {
39994            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
39995	           xmlMemBlocks() - mem_base);
39996	    test_ret++;
39997            printf(" %d", n_code);
39998            printf("\n");
39999        }
40000    }
40001    function_tests++;
40002#endif
40003
40004    return(test_ret);
40005}
40006
40007
40008static int
40009test_xmlUCSIsLowSurrogates(void) {
40010    int test_ret = 0;
40011
40012#if defined(LIBXML_UNICODE_ENABLED)
40013    int mem_base;
40014    int ret_val;
40015    int code; /* UCS code point */
40016    int n_code;
40017
40018    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40019        mem_base = xmlMemBlocks();
40020        code = gen_int(n_code, 0);
40021
40022        ret_val = xmlUCSIsLowSurrogates(code);
40023        desret_int(ret_val);
40024        call_tests++;
40025        des_int(n_code, code, 0);
40026        xmlResetLastError();
40027        if (mem_base != xmlMemBlocks()) {
40028            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40029	           xmlMemBlocks() - mem_base);
40030	    test_ret++;
40031            printf(" %d", n_code);
40032            printf("\n");
40033        }
40034    }
40035    function_tests++;
40036#endif
40037
40038    return(test_ret);
40039}
40040
40041
40042static int
40043test_xmlUCSIsMalayalam(void) {
40044    int test_ret = 0;
40045
40046#if defined(LIBXML_UNICODE_ENABLED)
40047    int mem_base;
40048    int ret_val;
40049    int code; /* UCS code point */
40050    int n_code;
40051
40052    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40053        mem_base = xmlMemBlocks();
40054        code = gen_int(n_code, 0);
40055
40056        ret_val = xmlUCSIsMalayalam(code);
40057        desret_int(ret_val);
40058        call_tests++;
40059        des_int(n_code, code, 0);
40060        xmlResetLastError();
40061        if (mem_base != xmlMemBlocks()) {
40062            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40063	           xmlMemBlocks() - mem_base);
40064	    test_ret++;
40065            printf(" %d", n_code);
40066            printf("\n");
40067        }
40068    }
40069    function_tests++;
40070#endif
40071
40072    return(test_ret);
40073}
40074
40075
40076static int
40077test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40078    int test_ret = 0;
40079
40080#if defined(LIBXML_UNICODE_ENABLED)
40081    int mem_base;
40082    int ret_val;
40083    int code; /* UCS code point */
40084    int n_code;
40085
40086    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40087        mem_base = xmlMemBlocks();
40088        code = gen_int(n_code, 0);
40089
40090        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40091        desret_int(ret_val);
40092        call_tests++;
40093        des_int(n_code, code, 0);
40094        xmlResetLastError();
40095        if (mem_base != xmlMemBlocks()) {
40096            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40097	           xmlMemBlocks() - mem_base);
40098	    test_ret++;
40099            printf(" %d", n_code);
40100            printf("\n");
40101        }
40102    }
40103    function_tests++;
40104#endif
40105
40106    return(test_ret);
40107}
40108
40109
40110static int
40111test_xmlUCSIsMathematicalOperators(void) {
40112    int test_ret = 0;
40113
40114#if defined(LIBXML_UNICODE_ENABLED)
40115    int mem_base;
40116    int ret_val;
40117    int code; /* UCS code point */
40118    int n_code;
40119
40120    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40121        mem_base = xmlMemBlocks();
40122        code = gen_int(n_code, 0);
40123
40124        ret_val = xmlUCSIsMathematicalOperators(code);
40125        desret_int(ret_val);
40126        call_tests++;
40127        des_int(n_code, code, 0);
40128        xmlResetLastError();
40129        if (mem_base != xmlMemBlocks()) {
40130            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40131	           xmlMemBlocks() - mem_base);
40132	    test_ret++;
40133            printf(" %d", n_code);
40134            printf("\n");
40135        }
40136    }
40137    function_tests++;
40138#endif
40139
40140    return(test_ret);
40141}
40142
40143
40144static int
40145test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40146    int test_ret = 0;
40147
40148#if defined(LIBXML_UNICODE_ENABLED)
40149    int mem_base;
40150    int ret_val;
40151    int code; /* UCS code point */
40152    int n_code;
40153
40154    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40155        mem_base = xmlMemBlocks();
40156        code = gen_int(n_code, 0);
40157
40158        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
40159        desret_int(ret_val);
40160        call_tests++;
40161        des_int(n_code, code, 0);
40162        xmlResetLastError();
40163        if (mem_base != xmlMemBlocks()) {
40164            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
40165	           xmlMemBlocks() - mem_base);
40166	    test_ret++;
40167            printf(" %d", n_code);
40168            printf("\n");
40169        }
40170    }
40171    function_tests++;
40172#endif
40173
40174    return(test_ret);
40175}
40176
40177
40178static int
40179test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
40180    int test_ret = 0;
40181
40182#if defined(LIBXML_UNICODE_ENABLED)
40183    int mem_base;
40184    int ret_val;
40185    int code; /* UCS code point */
40186    int n_code;
40187
40188    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40189        mem_base = xmlMemBlocks();
40190        code = gen_int(n_code, 0);
40191
40192        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
40193        desret_int(ret_val);
40194        call_tests++;
40195        des_int(n_code, code, 0);
40196        xmlResetLastError();
40197        if (mem_base != xmlMemBlocks()) {
40198            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
40199	           xmlMemBlocks() - mem_base);
40200	    test_ret++;
40201            printf(" %d", n_code);
40202            printf("\n");
40203        }
40204    }
40205    function_tests++;
40206#endif
40207
40208    return(test_ret);
40209}
40210
40211
40212static int
40213test_xmlUCSIsMiscellaneousSymbols(void) {
40214    int test_ret = 0;
40215
40216#if defined(LIBXML_UNICODE_ENABLED)
40217    int mem_base;
40218    int ret_val;
40219    int code; /* UCS code point */
40220    int n_code;
40221
40222    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40223        mem_base = xmlMemBlocks();
40224        code = gen_int(n_code, 0);
40225
40226        ret_val = xmlUCSIsMiscellaneousSymbols(code);
40227        desret_int(ret_val);
40228        call_tests++;
40229        des_int(n_code, code, 0);
40230        xmlResetLastError();
40231        if (mem_base != xmlMemBlocks()) {
40232            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
40233	           xmlMemBlocks() - mem_base);
40234	    test_ret++;
40235            printf(" %d", n_code);
40236            printf("\n");
40237        }
40238    }
40239    function_tests++;
40240#endif
40241
40242    return(test_ret);
40243}
40244
40245
40246static int
40247test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
40248    int test_ret = 0;
40249
40250#if defined(LIBXML_UNICODE_ENABLED)
40251    int mem_base;
40252    int ret_val;
40253    int code; /* UCS code point */
40254    int n_code;
40255
40256    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40257        mem_base = xmlMemBlocks();
40258        code = gen_int(n_code, 0);
40259
40260        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
40261        desret_int(ret_val);
40262        call_tests++;
40263        des_int(n_code, code, 0);
40264        xmlResetLastError();
40265        if (mem_base != xmlMemBlocks()) {
40266            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
40267	           xmlMemBlocks() - mem_base);
40268	    test_ret++;
40269            printf(" %d", n_code);
40270            printf("\n");
40271        }
40272    }
40273    function_tests++;
40274#endif
40275
40276    return(test_ret);
40277}
40278
40279
40280static int
40281test_xmlUCSIsMiscellaneousTechnical(void) {
40282    int test_ret = 0;
40283
40284#if defined(LIBXML_UNICODE_ENABLED)
40285    int mem_base;
40286    int ret_val;
40287    int code; /* UCS code point */
40288    int n_code;
40289
40290    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40291        mem_base = xmlMemBlocks();
40292        code = gen_int(n_code, 0);
40293
40294        ret_val = xmlUCSIsMiscellaneousTechnical(code);
40295        desret_int(ret_val);
40296        call_tests++;
40297        des_int(n_code, code, 0);
40298        xmlResetLastError();
40299        if (mem_base != xmlMemBlocks()) {
40300            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
40301	           xmlMemBlocks() - mem_base);
40302	    test_ret++;
40303            printf(" %d", n_code);
40304            printf("\n");
40305        }
40306    }
40307    function_tests++;
40308#endif
40309
40310    return(test_ret);
40311}
40312
40313
40314static int
40315test_xmlUCSIsMongolian(void) {
40316    int test_ret = 0;
40317
40318#if defined(LIBXML_UNICODE_ENABLED)
40319    int mem_base;
40320    int ret_val;
40321    int code; /* UCS code point */
40322    int n_code;
40323
40324    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40325        mem_base = xmlMemBlocks();
40326        code = gen_int(n_code, 0);
40327
40328        ret_val = xmlUCSIsMongolian(code);
40329        desret_int(ret_val);
40330        call_tests++;
40331        des_int(n_code, code, 0);
40332        xmlResetLastError();
40333        if (mem_base != xmlMemBlocks()) {
40334            printf("Leak of %d blocks found in xmlUCSIsMongolian",
40335	           xmlMemBlocks() - mem_base);
40336	    test_ret++;
40337            printf(" %d", n_code);
40338            printf("\n");
40339        }
40340    }
40341    function_tests++;
40342#endif
40343
40344    return(test_ret);
40345}
40346
40347
40348static int
40349test_xmlUCSIsMusicalSymbols(void) {
40350    int test_ret = 0;
40351
40352#if defined(LIBXML_UNICODE_ENABLED)
40353    int mem_base;
40354    int ret_val;
40355    int code; /* UCS code point */
40356    int n_code;
40357
40358    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40359        mem_base = xmlMemBlocks();
40360        code = gen_int(n_code, 0);
40361
40362        ret_val = xmlUCSIsMusicalSymbols(code);
40363        desret_int(ret_val);
40364        call_tests++;
40365        des_int(n_code, code, 0);
40366        xmlResetLastError();
40367        if (mem_base != xmlMemBlocks()) {
40368            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
40369	           xmlMemBlocks() - mem_base);
40370	    test_ret++;
40371            printf(" %d", n_code);
40372            printf("\n");
40373        }
40374    }
40375    function_tests++;
40376#endif
40377
40378    return(test_ret);
40379}
40380
40381
40382static int
40383test_xmlUCSIsMyanmar(void) {
40384    int test_ret = 0;
40385
40386#if defined(LIBXML_UNICODE_ENABLED)
40387    int mem_base;
40388    int ret_val;
40389    int code; /* UCS code point */
40390    int n_code;
40391
40392    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40393        mem_base = xmlMemBlocks();
40394        code = gen_int(n_code, 0);
40395
40396        ret_val = xmlUCSIsMyanmar(code);
40397        desret_int(ret_val);
40398        call_tests++;
40399        des_int(n_code, code, 0);
40400        xmlResetLastError();
40401        if (mem_base != xmlMemBlocks()) {
40402            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
40403	           xmlMemBlocks() - mem_base);
40404	    test_ret++;
40405            printf(" %d", n_code);
40406            printf("\n");
40407        }
40408    }
40409    function_tests++;
40410#endif
40411
40412    return(test_ret);
40413}
40414
40415
40416static int
40417test_xmlUCSIsNumberForms(void) {
40418    int test_ret = 0;
40419
40420#if defined(LIBXML_UNICODE_ENABLED)
40421    int mem_base;
40422    int ret_val;
40423    int code; /* UCS code point */
40424    int n_code;
40425
40426    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40427        mem_base = xmlMemBlocks();
40428        code = gen_int(n_code, 0);
40429
40430        ret_val = xmlUCSIsNumberForms(code);
40431        desret_int(ret_val);
40432        call_tests++;
40433        des_int(n_code, code, 0);
40434        xmlResetLastError();
40435        if (mem_base != xmlMemBlocks()) {
40436            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
40437	           xmlMemBlocks() - mem_base);
40438	    test_ret++;
40439            printf(" %d", n_code);
40440            printf("\n");
40441        }
40442    }
40443    function_tests++;
40444#endif
40445
40446    return(test_ret);
40447}
40448
40449
40450static int
40451test_xmlUCSIsOgham(void) {
40452    int test_ret = 0;
40453
40454#if defined(LIBXML_UNICODE_ENABLED)
40455    int mem_base;
40456    int ret_val;
40457    int code; /* UCS code point */
40458    int n_code;
40459
40460    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40461        mem_base = xmlMemBlocks();
40462        code = gen_int(n_code, 0);
40463
40464        ret_val = xmlUCSIsOgham(code);
40465        desret_int(ret_val);
40466        call_tests++;
40467        des_int(n_code, code, 0);
40468        xmlResetLastError();
40469        if (mem_base != xmlMemBlocks()) {
40470            printf("Leak of %d blocks found in xmlUCSIsOgham",
40471	           xmlMemBlocks() - mem_base);
40472	    test_ret++;
40473            printf(" %d", n_code);
40474            printf("\n");
40475        }
40476    }
40477    function_tests++;
40478#endif
40479
40480    return(test_ret);
40481}
40482
40483
40484static int
40485test_xmlUCSIsOldItalic(void) {
40486    int test_ret = 0;
40487
40488#if defined(LIBXML_UNICODE_ENABLED)
40489    int mem_base;
40490    int ret_val;
40491    int code; /* UCS code point */
40492    int n_code;
40493
40494    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40495        mem_base = xmlMemBlocks();
40496        code = gen_int(n_code, 0);
40497
40498        ret_val = xmlUCSIsOldItalic(code);
40499        desret_int(ret_val);
40500        call_tests++;
40501        des_int(n_code, code, 0);
40502        xmlResetLastError();
40503        if (mem_base != xmlMemBlocks()) {
40504            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
40505	           xmlMemBlocks() - mem_base);
40506	    test_ret++;
40507            printf(" %d", n_code);
40508            printf("\n");
40509        }
40510    }
40511    function_tests++;
40512#endif
40513
40514    return(test_ret);
40515}
40516
40517
40518static int
40519test_xmlUCSIsOpticalCharacterRecognition(void) {
40520    int test_ret = 0;
40521
40522#if defined(LIBXML_UNICODE_ENABLED)
40523    int mem_base;
40524    int ret_val;
40525    int code; /* UCS code point */
40526    int n_code;
40527
40528    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40529        mem_base = xmlMemBlocks();
40530        code = gen_int(n_code, 0);
40531
40532        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
40533        desret_int(ret_val);
40534        call_tests++;
40535        des_int(n_code, code, 0);
40536        xmlResetLastError();
40537        if (mem_base != xmlMemBlocks()) {
40538            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
40539	           xmlMemBlocks() - mem_base);
40540	    test_ret++;
40541            printf(" %d", n_code);
40542            printf("\n");
40543        }
40544    }
40545    function_tests++;
40546#endif
40547
40548    return(test_ret);
40549}
40550
40551
40552static int
40553test_xmlUCSIsOriya(void) {
40554    int test_ret = 0;
40555
40556#if defined(LIBXML_UNICODE_ENABLED)
40557    int mem_base;
40558    int ret_val;
40559    int code; /* UCS code point */
40560    int n_code;
40561
40562    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40563        mem_base = xmlMemBlocks();
40564        code = gen_int(n_code, 0);
40565
40566        ret_val = xmlUCSIsOriya(code);
40567        desret_int(ret_val);
40568        call_tests++;
40569        des_int(n_code, code, 0);
40570        xmlResetLastError();
40571        if (mem_base != xmlMemBlocks()) {
40572            printf("Leak of %d blocks found in xmlUCSIsOriya",
40573	           xmlMemBlocks() - mem_base);
40574	    test_ret++;
40575            printf(" %d", n_code);
40576            printf("\n");
40577        }
40578    }
40579    function_tests++;
40580#endif
40581
40582    return(test_ret);
40583}
40584
40585
40586static int
40587test_xmlUCSIsOsmanya(void) {
40588    int test_ret = 0;
40589
40590#if defined(LIBXML_UNICODE_ENABLED)
40591    int mem_base;
40592    int ret_val;
40593    int code; /* UCS code point */
40594    int n_code;
40595
40596    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40597        mem_base = xmlMemBlocks();
40598        code = gen_int(n_code, 0);
40599
40600        ret_val = xmlUCSIsOsmanya(code);
40601        desret_int(ret_val);
40602        call_tests++;
40603        des_int(n_code, code, 0);
40604        xmlResetLastError();
40605        if (mem_base != xmlMemBlocks()) {
40606            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
40607	           xmlMemBlocks() - mem_base);
40608	    test_ret++;
40609            printf(" %d", n_code);
40610            printf("\n");
40611        }
40612    }
40613    function_tests++;
40614#endif
40615
40616    return(test_ret);
40617}
40618
40619
40620static int
40621test_xmlUCSIsPhoneticExtensions(void) {
40622    int test_ret = 0;
40623
40624#if defined(LIBXML_UNICODE_ENABLED)
40625    int mem_base;
40626    int ret_val;
40627    int code; /* UCS code point */
40628    int n_code;
40629
40630    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40631        mem_base = xmlMemBlocks();
40632        code = gen_int(n_code, 0);
40633
40634        ret_val = xmlUCSIsPhoneticExtensions(code);
40635        desret_int(ret_val);
40636        call_tests++;
40637        des_int(n_code, code, 0);
40638        xmlResetLastError();
40639        if (mem_base != xmlMemBlocks()) {
40640            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
40641	           xmlMemBlocks() - mem_base);
40642	    test_ret++;
40643            printf(" %d", n_code);
40644            printf("\n");
40645        }
40646    }
40647    function_tests++;
40648#endif
40649
40650    return(test_ret);
40651}
40652
40653
40654static int
40655test_xmlUCSIsPrivateUse(void) {
40656    int test_ret = 0;
40657
40658#if defined(LIBXML_UNICODE_ENABLED)
40659    int mem_base;
40660    int ret_val;
40661    int code; /* UCS code point */
40662    int n_code;
40663
40664    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40665        mem_base = xmlMemBlocks();
40666        code = gen_int(n_code, 0);
40667
40668        ret_val = xmlUCSIsPrivateUse(code);
40669        desret_int(ret_val);
40670        call_tests++;
40671        des_int(n_code, code, 0);
40672        xmlResetLastError();
40673        if (mem_base != xmlMemBlocks()) {
40674            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
40675	           xmlMemBlocks() - mem_base);
40676	    test_ret++;
40677            printf(" %d", n_code);
40678            printf("\n");
40679        }
40680    }
40681    function_tests++;
40682#endif
40683
40684    return(test_ret);
40685}
40686
40687
40688static int
40689test_xmlUCSIsPrivateUseArea(void) {
40690    int test_ret = 0;
40691
40692#if defined(LIBXML_UNICODE_ENABLED)
40693    int mem_base;
40694    int ret_val;
40695    int code; /* UCS code point */
40696    int n_code;
40697
40698    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40699        mem_base = xmlMemBlocks();
40700        code = gen_int(n_code, 0);
40701
40702        ret_val = xmlUCSIsPrivateUseArea(code);
40703        desret_int(ret_val);
40704        call_tests++;
40705        des_int(n_code, code, 0);
40706        xmlResetLastError();
40707        if (mem_base != xmlMemBlocks()) {
40708            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
40709	           xmlMemBlocks() - mem_base);
40710	    test_ret++;
40711            printf(" %d", n_code);
40712            printf("\n");
40713        }
40714    }
40715    function_tests++;
40716#endif
40717
40718    return(test_ret);
40719}
40720
40721
40722static int
40723test_xmlUCSIsRunic(void) {
40724    int test_ret = 0;
40725
40726#if defined(LIBXML_UNICODE_ENABLED)
40727    int mem_base;
40728    int ret_val;
40729    int code; /* UCS code point */
40730    int n_code;
40731
40732    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40733        mem_base = xmlMemBlocks();
40734        code = gen_int(n_code, 0);
40735
40736        ret_val = xmlUCSIsRunic(code);
40737        desret_int(ret_val);
40738        call_tests++;
40739        des_int(n_code, code, 0);
40740        xmlResetLastError();
40741        if (mem_base != xmlMemBlocks()) {
40742            printf("Leak of %d blocks found in xmlUCSIsRunic",
40743	           xmlMemBlocks() - mem_base);
40744	    test_ret++;
40745            printf(" %d", n_code);
40746            printf("\n");
40747        }
40748    }
40749    function_tests++;
40750#endif
40751
40752    return(test_ret);
40753}
40754
40755
40756static int
40757test_xmlUCSIsShavian(void) {
40758    int test_ret = 0;
40759
40760#if defined(LIBXML_UNICODE_ENABLED)
40761    int mem_base;
40762    int ret_val;
40763    int code; /* UCS code point */
40764    int n_code;
40765
40766    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40767        mem_base = xmlMemBlocks();
40768        code = gen_int(n_code, 0);
40769
40770        ret_val = xmlUCSIsShavian(code);
40771        desret_int(ret_val);
40772        call_tests++;
40773        des_int(n_code, code, 0);
40774        xmlResetLastError();
40775        if (mem_base != xmlMemBlocks()) {
40776            printf("Leak of %d blocks found in xmlUCSIsShavian",
40777	           xmlMemBlocks() - mem_base);
40778	    test_ret++;
40779            printf(" %d", n_code);
40780            printf("\n");
40781        }
40782    }
40783    function_tests++;
40784#endif
40785
40786    return(test_ret);
40787}
40788
40789
40790static int
40791test_xmlUCSIsSinhala(void) {
40792    int test_ret = 0;
40793
40794#if defined(LIBXML_UNICODE_ENABLED)
40795    int mem_base;
40796    int ret_val;
40797    int code; /* UCS code point */
40798    int n_code;
40799
40800    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40801        mem_base = xmlMemBlocks();
40802        code = gen_int(n_code, 0);
40803
40804        ret_val = xmlUCSIsSinhala(code);
40805        desret_int(ret_val);
40806        call_tests++;
40807        des_int(n_code, code, 0);
40808        xmlResetLastError();
40809        if (mem_base != xmlMemBlocks()) {
40810            printf("Leak of %d blocks found in xmlUCSIsSinhala",
40811	           xmlMemBlocks() - mem_base);
40812	    test_ret++;
40813            printf(" %d", n_code);
40814            printf("\n");
40815        }
40816    }
40817    function_tests++;
40818#endif
40819
40820    return(test_ret);
40821}
40822
40823
40824static int
40825test_xmlUCSIsSmallFormVariants(void) {
40826    int test_ret = 0;
40827
40828#if defined(LIBXML_UNICODE_ENABLED)
40829    int mem_base;
40830    int ret_val;
40831    int code; /* UCS code point */
40832    int n_code;
40833
40834    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40835        mem_base = xmlMemBlocks();
40836        code = gen_int(n_code, 0);
40837
40838        ret_val = xmlUCSIsSmallFormVariants(code);
40839        desret_int(ret_val);
40840        call_tests++;
40841        des_int(n_code, code, 0);
40842        xmlResetLastError();
40843        if (mem_base != xmlMemBlocks()) {
40844            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
40845	           xmlMemBlocks() - mem_base);
40846	    test_ret++;
40847            printf(" %d", n_code);
40848            printf("\n");
40849        }
40850    }
40851    function_tests++;
40852#endif
40853
40854    return(test_ret);
40855}
40856
40857
40858static int
40859test_xmlUCSIsSpacingModifierLetters(void) {
40860    int test_ret = 0;
40861
40862#if defined(LIBXML_UNICODE_ENABLED)
40863    int mem_base;
40864    int ret_val;
40865    int code; /* UCS code point */
40866    int n_code;
40867
40868    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40869        mem_base = xmlMemBlocks();
40870        code = gen_int(n_code, 0);
40871
40872        ret_val = xmlUCSIsSpacingModifierLetters(code);
40873        desret_int(ret_val);
40874        call_tests++;
40875        des_int(n_code, code, 0);
40876        xmlResetLastError();
40877        if (mem_base != xmlMemBlocks()) {
40878            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
40879	           xmlMemBlocks() - mem_base);
40880	    test_ret++;
40881            printf(" %d", n_code);
40882            printf("\n");
40883        }
40884    }
40885    function_tests++;
40886#endif
40887
40888    return(test_ret);
40889}
40890
40891
40892static int
40893test_xmlUCSIsSpecials(void) {
40894    int test_ret = 0;
40895
40896#if defined(LIBXML_UNICODE_ENABLED)
40897    int mem_base;
40898    int ret_val;
40899    int code; /* UCS code point */
40900    int n_code;
40901
40902    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40903        mem_base = xmlMemBlocks();
40904        code = gen_int(n_code, 0);
40905
40906        ret_val = xmlUCSIsSpecials(code);
40907        desret_int(ret_val);
40908        call_tests++;
40909        des_int(n_code, code, 0);
40910        xmlResetLastError();
40911        if (mem_base != xmlMemBlocks()) {
40912            printf("Leak of %d blocks found in xmlUCSIsSpecials",
40913	           xmlMemBlocks() - mem_base);
40914	    test_ret++;
40915            printf(" %d", n_code);
40916            printf("\n");
40917        }
40918    }
40919    function_tests++;
40920#endif
40921
40922    return(test_ret);
40923}
40924
40925
40926static int
40927test_xmlUCSIsSuperscriptsandSubscripts(void) {
40928    int test_ret = 0;
40929
40930#if defined(LIBXML_UNICODE_ENABLED)
40931    int mem_base;
40932    int ret_val;
40933    int code; /* UCS code point */
40934    int n_code;
40935
40936    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40937        mem_base = xmlMemBlocks();
40938        code = gen_int(n_code, 0);
40939
40940        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
40941        desret_int(ret_val);
40942        call_tests++;
40943        des_int(n_code, code, 0);
40944        xmlResetLastError();
40945        if (mem_base != xmlMemBlocks()) {
40946            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
40947	           xmlMemBlocks() - mem_base);
40948	    test_ret++;
40949            printf(" %d", n_code);
40950            printf("\n");
40951        }
40952    }
40953    function_tests++;
40954#endif
40955
40956    return(test_ret);
40957}
40958
40959
40960static int
40961test_xmlUCSIsSupplementalArrowsA(void) {
40962    int test_ret = 0;
40963
40964#if defined(LIBXML_UNICODE_ENABLED)
40965    int mem_base;
40966    int ret_val;
40967    int code; /* UCS code point */
40968    int n_code;
40969
40970    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40971        mem_base = xmlMemBlocks();
40972        code = gen_int(n_code, 0);
40973
40974        ret_val = xmlUCSIsSupplementalArrowsA(code);
40975        desret_int(ret_val);
40976        call_tests++;
40977        des_int(n_code, code, 0);
40978        xmlResetLastError();
40979        if (mem_base != xmlMemBlocks()) {
40980            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
40981	           xmlMemBlocks() - mem_base);
40982	    test_ret++;
40983            printf(" %d", n_code);
40984            printf("\n");
40985        }
40986    }
40987    function_tests++;
40988#endif
40989
40990    return(test_ret);
40991}
40992
40993
40994static int
40995test_xmlUCSIsSupplementalArrowsB(void) {
40996    int test_ret = 0;
40997
40998#if defined(LIBXML_UNICODE_ENABLED)
40999    int mem_base;
41000    int ret_val;
41001    int code; /* UCS code point */
41002    int n_code;
41003
41004    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41005        mem_base = xmlMemBlocks();
41006        code = gen_int(n_code, 0);
41007
41008        ret_val = xmlUCSIsSupplementalArrowsB(code);
41009        desret_int(ret_val);
41010        call_tests++;
41011        des_int(n_code, code, 0);
41012        xmlResetLastError();
41013        if (mem_base != xmlMemBlocks()) {
41014            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41015	           xmlMemBlocks() - mem_base);
41016	    test_ret++;
41017            printf(" %d", n_code);
41018            printf("\n");
41019        }
41020    }
41021    function_tests++;
41022#endif
41023
41024    return(test_ret);
41025}
41026
41027
41028static int
41029test_xmlUCSIsSupplementalMathematicalOperators(void) {
41030    int test_ret = 0;
41031
41032#if defined(LIBXML_UNICODE_ENABLED)
41033    int mem_base;
41034    int ret_val;
41035    int code; /* UCS code point */
41036    int n_code;
41037
41038    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41039        mem_base = xmlMemBlocks();
41040        code = gen_int(n_code, 0);
41041
41042        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41043        desret_int(ret_val);
41044        call_tests++;
41045        des_int(n_code, code, 0);
41046        xmlResetLastError();
41047        if (mem_base != xmlMemBlocks()) {
41048            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41049	           xmlMemBlocks() - mem_base);
41050	    test_ret++;
41051            printf(" %d", n_code);
41052            printf("\n");
41053        }
41054    }
41055    function_tests++;
41056#endif
41057
41058    return(test_ret);
41059}
41060
41061
41062static int
41063test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41064    int test_ret = 0;
41065
41066#if defined(LIBXML_UNICODE_ENABLED)
41067    int mem_base;
41068    int ret_val;
41069    int code; /* UCS code point */
41070    int n_code;
41071
41072    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41073        mem_base = xmlMemBlocks();
41074        code = gen_int(n_code, 0);
41075
41076        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41077        desret_int(ret_val);
41078        call_tests++;
41079        des_int(n_code, code, 0);
41080        xmlResetLastError();
41081        if (mem_base != xmlMemBlocks()) {
41082            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41083	           xmlMemBlocks() - mem_base);
41084	    test_ret++;
41085            printf(" %d", n_code);
41086            printf("\n");
41087        }
41088    }
41089    function_tests++;
41090#endif
41091
41092    return(test_ret);
41093}
41094
41095
41096static int
41097test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41098    int test_ret = 0;
41099
41100#if defined(LIBXML_UNICODE_ENABLED)
41101    int mem_base;
41102    int ret_val;
41103    int code; /* UCS code point */
41104    int n_code;
41105
41106    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41107        mem_base = xmlMemBlocks();
41108        code = gen_int(n_code, 0);
41109
41110        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41111        desret_int(ret_val);
41112        call_tests++;
41113        des_int(n_code, code, 0);
41114        xmlResetLastError();
41115        if (mem_base != xmlMemBlocks()) {
41116            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41117	           xmlMemBlocks() - mem_base);
41118	    test_ret++;
41119            printf(" %d", n_code);
41120            printf("\n");
41121        }
41122    }
41123    function_tests++;
41124#endif
41125
41126    return(test_ret);
41127}
41128
41129
41130static int
41131test_xmlUCSIsSyriac(void) {
41132    int test_ret = 0;
41133
41134#if defined(LIBXML_UNICODE_ENABLED)
41135    int mem_base;
41136    int ret_val;
41137    int code; /* UCS code point */
41138    int n_code;
41139
41140    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41141        mem_base = xmlMemBlocks();
41142        code = gen_int(n_code, 0);
41143
41144        ret_val = xmlUCSIsSyriac(code);
41145        desret_int(ret_val);
41146        call_tests++;
41147        des_int(n_code, code, 0);
41148        xmlResetLastError();
41149        if (mem_base != xmlMemBlocks()) {
41150            printf("Leak of %d blocks found in xmlUCSIsSyriac",
41151	           xmlMemBlocks() - mem_base);
41152	    test_ret++;
41153            printf(" %d", n_code);
41154            printf("\n");
41155        }
41156    }
41157    function_tests++;
41158#endif
41159
41160    return(test_ret);
41161}
41162
41163
41164static int
41165test_xmlUCSIsTagalog(void) {
41166    int test_ret = 0;
41167
41168#if defined(LIBXML_UNICODE_ENABLED)
41169    int mem_base;
41170    int ret_val;
41171    int code; /* UCS code point */
41172    int n_code;
41173
41174    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41175        mem_base = xmlMemBlocks();
41176        code = gen_int(n_code, 0);
41177
41178        ret_val = xmlUCSIsTagalog(code);
41179        desret_int(ret_val);
41180        call_tests++;
41181        des_int(n_code, code, 0);
41182        xmlResetLastError();
41183        if (mem_base != xmlMemBlocks()) {
41184            printf("Leak of %d blocks found in xmlUCSIsTagalog",
41185	           xmlMemBlocks() - mem_base);
41186	    test_ret++;
41187            printf(" %d", n_code);
41188            printf("\n");
41189        }
41190    }
41191    function_tests++;
41192#endif
41193
41194    return(test_ret);
41195}
41196
41197
41198static int
41199test_xmlUCSIsTagbanwa(void) {
41200    int test_ret = 0;
41201
41202#if defined(LIBXML_UNICODE_ENABLED)
41203    int mem_base;
41204    int ret_val;
41205    int code; /* UCS code point */
41206    int n_code;
41207
41208    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41209        mem_base = xmlMemBlocks();
41210        code = gen_int(n_code, 0);
41211
41212        ret_val = xmlUCSIsTagbanwa(code);
41213        desret_int(ret_val);
41214        call_tests++;
41215        des_int(n_code, code, 0);
41216        xmlResetLastError();
41217        if (mem_base != xmlMemBlocks()) {
41218            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
41219	           xmlMemBlocks() - mem_base);
41220	    test_ret++;
41221            printf(" %d", n_code);
41222            printf("\n");
41223        }
41224    }
41225    function_tests++;
41226#endif
41227
41228    return(test_ret);
41229}
41230
41231
41232static int
41233test_xmlUCSIsTags(void) {
41234    int test_ret = 0;
41235
41236#if defined(LIBXML_UNICODE_ENABLED)
41237    int mem_base;
41238    int ret_val;
41239    int code; /* UCS code point */
41240    int n_code;
41241
41242    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41243        mem_base = xmlMemBlocks();
41244        code = gen_int(n_code, 0);
41245
41246        ret_val = xmlUCSIsTags(code);
41247        desret_int(ret_val);
41248        call_tests++;
41249        des_int(n_code, code, 0);
41250        xmlResetLastError();
41251        if (mem_base != xmlMemBlocks()) {
41252            printf("Leak of %d blocks found in xmlUCSIsTags",
41253	           xmlMemBlocks() - mem_base);
41254	    test_ret++;
41255            printf(" %d", n_code);
41256            printf("\n");
41257        }
41258    }
41259    function_tests++;
41260#endif
41261
41262    return(test_ret);
41263}
41264
41265
41266static int
41267test_xmlUCSIsTaiLe(void) {
41268    int test_ret = 0;
41269
41270#if defined(LIBXML_UNICODE_ENABLED)
41271    int mem_base;
41272    int ret_val;
41273    int code; /* UCS code point */
41274    int n_code;
41275
41276    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41277        mem_base = xmlMemBlocks();
41278        code = gen_int(n_code, 0);
41279
41280        ret_val = xmlUCSIsTaiLe(code);
41281        desret_int(ret_val);
41282        call_tests++;
41283        des_int(n_code, code, 0);
41284        xmlResetLastError();
41285        if (mem_base != xmlMemBlocks()) {
41286            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
41287	           xmlMemBlocks() - mem_base);
41288	    test_ret++;
41289            printf(" %d", n_code);
41290            printf("\n");
41291        }
41292    }
41293    function_tests++;
41294#endif
41295
41296    return(test_ret);
41297}
41298
41299
41300static int
41301test_xmlUCSIsTaiXuanJingSymbols(void) {
41302    int test_ret = 0;
41303
41304#if defined(LIBXML_UNICODE_ENABLED)
41305    int mem_base;
41306    int ret_val;
41307    int code; /* UCS code point */
41308    int n_code;
41309
41310    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41311        mem_base = xmlMemBlocks();
41312        code = gen_int(n_code, 0);
41313
41314        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
41315        desret_int(ret_val);
41316        call_tests++;
41317        des_int(n_code, code, 0);
41318        xmlResetLastError();
41319        if (mem_base != xmlMemBlocks()) {
41320            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
41321	           xmlMemBlocks() - mem_base);
41322	    test_ret++;
41323            printf(" %d", n_code);
41324            printf("\n");
41325        }
41326    }
41327    function_tests++;
41328#endif
41329
41330    return(test_ret);
41331}
41332
41333
41334static int
41335test_xmlUCSIsTamil(void) {
41336    int test_ret = 0;
41337
41338#if defined(LIBXML_UNICODE_ENABLED)
41339    int mem_base;
41340    int ret_val;
41341    int code; /* UCS code point */
41342    int n_code;
41343
41344    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41345        mem_base = xmlMemBlocks();
41346        code = gen_int(n_code, 0);
41347
41348        ret_val = xmlUCSIsTamil(code);
41349        desret_int(ret_val);
41350        call_tests++;
41351        des_int(n_code, code, 0);
41352        xmlResetLastError();
41353        if (mem_base != xmlMemBlocks()) {
41354            printf("Leak of %d blocks found in xmlUCSIsTamil",
41355	           xmlMemBlocks() - mem_base);
41356	    test_ret++;
41357            printf(" %d", n_code);
41358            printf("\n");
41359        }
41360    }
41361    function_tests++;
41362#endif
41363
41364    return(test_ret);
41365}
41366
41367
41368static int
41369test_xmlUCSIsTelugu(void) {
41370    int test_ret = 0;
41371
41372#if defined(LIBXML_UNICODE_ENABLED)
41373    int mem_base;
41374    int ret_val;
41375    int code; /* UCS code point */
41376    int n_code;
41377
41378    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41379        mem_base = xmlMemBlocks();
41380        code = gen_int(n_code, 0);
41381
41382        ret_val = xmlUCSIsTelugu(code);
41383        desret_int(ret_val);
41384        call_tests++;
41385        des_int(n_code, code, 0);
41386        xmlResetLastError();
41387        if (mem_base != xmlMemBlocks()) {
41388            printf("Leak of %d blocks found in xmlUCSIsTelugu",
41389	           xmlMemBlocks() - mem_base);
41390	    test_ret++;
41391            printf(" %d", n_code);
41392            printf("\n");
41393        }
41394    }
41395    function_tests++;
41396#endif
41397
41398    return(test_ret);
41399}
41400
41401
41402static int
41403test_xmlUCSIsThaana(void) {
41404    int test_ret = 0;
41405
41406#if defined(LIBXML_UNICODE_ENABLED)
41407    int mem_base;
41408    int ret_val;
41409    int code; /* UCS code point */
41410    int n_code;
41411
41412    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41413        mem_base = xmlMemBlocks();
41414        code = gen_int(n_code, 0);
41415
41416        ret_val = xmlUCSIsThaana(code);
41417        desret_int(ret_val);
41418        call_tests++;
41419        des_int(n_code, code, 0);
41420        xmlResetLastError();
41421        if (mem_base != xmlMemBlocks()) {
41422            printf("Leak of %d blocks found in xmlUCSIsThaana",
41423	           xmlMemBlocks() - mem_base);
41424	    test_ret++;
41425            printf(" %d", n_code);
41426            printf("\n");
41427        }
41428    }
41429    function_tests++;
41430#endif
41431
41432    return(test_ret);
41433}
41434
41435
41436static int
41437test_xmlUCSIsThai(void) {
41438    int test_ret = 0;
41439
41440#if defined(LIBXML_UNICODE_ENABLED)
41441    int mem_base;
41442    int ret_val;
41443    int code; /* UCS code point */
41444    int n_code;
41445
41446    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41447        mem_base = xmlMemBlocks();
41448        code = gen_int(n_code, 0);
41449
41450        ret_val = xmlUCSIsThai(code);
41451        desret_int(ret_val);
41452        call_tests++;
41453        des_int(n_code, code, 0);
41454        xmlResetLastError();
41455        if (mem_base != xmlMemBlocks()) {
41456            printf("Leak of %d blocks found in xmlUCSIsThai",
41457	           xmlMemBlocks() - mem_base);
41458	    test_ret++;
41459            printf(" %d", n_code);
41460            printf("\n");
41461        }
41462    }
41463    function_tests++;
41464#endif
41465
41466    return(test_ret);
41467}
41468
41469
41470static int
41471test_xmlUCSIsTibetan(void) {
41472    int test_ret = 0;
41473
41474#if defined(LIBXML_UNICODE_ENABLED)
41475    int mem_base;
41476    int ret_val;
41477    int code; /* UCS code point */
41478    int n_code;
41479
41480    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41481        mem_base = xmlMemBlocks();
41482        code = gen_int(n_code, 0);
41483
41484        ret_val = xmlUCSIsTibetan(code);
41485        desret_int(ret_val);
41486        call_tests++;
41487        des_int(n_code, code, 0);
41488        xmlResetLastError();
41489        if (mem_base != xmlMemBlocks()) {
41490            printf("Leak of %d blocks found in xmlUCSIsTibetan",
41491	           xmlMemBlocks() - mem_base);
41492	    test_ret++;
41493            printf(" %d", n_code);
41494            printf("\n");
41495        }
41496    }
41497    function_tests++;
41498#endif
41499
41500    return(test_ret);
41501}
41502
41503
41504static int
41505test_xmlUCSIsUgaritic(void) {
41506    int test_ret = 0;
41507
41508#if defined(LIBXML_UNICODE_ENABLED)
41509    int mem_base;
41510    int ret_val;
41511    int code; /* UCS code point */
41512    int n_code;
41513
41514    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41515        mem_base = xmlMemBlocks();
41516        code = gen_int(n_code, 0);
41517
41518        ret_val = xmlUCSIsUgaritic(code);
41519        desret_int(ret_val);
41520        call_tests++;
41521        des_int(n_code, code, 0);
41522        xmlResetLastError();
41523        if (mem_base != xmlMemBlocks()) {
41524            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
41525	           xmlMemBlocks() - mem_base);
41526	    test_ret++;
41527            printf(" %d", n_code);
41528            printf("\n");
41529        }
41530    }
41531    function_tests++;
41532#endif
41533
41534    return(test_ret);
41535}
41536
41537
41538static int
41539test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
41540    int test_ret = 0;
41541
41542#if defined(LIBXML_UNICODE_ENABLED)
41543    int mem_base;
41544    int ret_val;
41545    int code; /* UCS code point */
41546    int n_code;
41547
41548    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41549        mem_base = xmlMemBlocks();
41550        code = gen_int(n_code, 0);
41551
41552        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
41553        desret_int(ret_val);
41554        call_tests++;
41555        des_int(n_code, code, 0);
41556        xmlResetLastError();
41557        if (mem_base != xmlMemBlocks()) {
41558            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
41559	           xmlMemBlocks() - mem_base);
41560	    test_ret++;
41561            printf(" %d", n_code);
41562            printf("\n");
41563        }
41564    }
41565    function_tests++;
41566#endif
41567
41568    return(test_ret);
41569}
41570
41571
41572static int
41573test_xmlUCSIsVariationSelectors(void) {
41574    int test_ret = 0;
41575
41576#if defined(LIBXML_UNICODE_ENABLED)
41577    int mem_base;
41578    int ret_val;
41579    int code; /* UCS code point */
41580    int n_code;
41581
41582    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41583        mem_base = xmlMemBlocks();
41584        code = gen_int(n_code, 0);
41585
41586        ret_val = xmlUCSIsVariationSelectors(code);
41587        desret_int(ret_val);
41588        call_tests++;
41589        des_int(n_code, code, 0);
41590        xmlResetLastError();
41591        if (mem_base != xmlMemBlocks()) {
41592            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
41593	           xmlMemBlocks() - mem_base);
41594	    test_ret++;
41595            printf(" %d", n_code);
41596            printf("\n");
41597        }
41598    }
41599    function_tests++;
41600#endif
41601
41602    return(test_ret);
41603}
41604
41605
41606static int
41607test_xmlUCSIsVariationSelectorsSupplement(void) {
41608    int test_ret = 0;
41609
41610#if defined(LIBXML_UNICODE_ENABLED)
41611    int mem_base;
41612    int ret_val;
41613    int code; /* UCS code point */
41614    int n_code;
41615
41616    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41617        mem_base = xmlMemBlocks();
41618        code = gen_int(n_code, 0);
41619
41620        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
41621        desret_int(ret_val);
41622        call_tests++;
41623        des_int(n_code, code, 0);
41624        xmlResetLastError();
41625        if (mem_base != xmlMemBlocks()) {
41626            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
41627	           xmlMemBlocks() - mem_base);
41628	    test_ret++;
41629            printf(" %d", n_code);
41630            printf("\n");
41631        }
41632    }
41633    function_tests++;
41634#endif
41635
41636    return(test_ret);
41637}
41638
41639
41640static int
41641test_xmlUCSIsYiRadicals(void) {
41642    int test_ret = 0;
41643
41644#if defined(LIBXML_UNICODE_ENABLED)
41645    int mem_base;
41646    int ret_val;
41647    int code; /* UCS code point */
41648    int n_code;
41649
41650    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41651        mem_base = xmlMemBlocks();
41652        code = gen_int(n_code, 0);
41653
41654        ret_val = xmlUCSIsYiRadicals(code);
41655        desret_int(ret_val);
41656        call_tests++;
41657        des_int(n_code, code, 0);
41658        xmlResetLastError();
41659        if (mem_base != xmlMemBlocks()) {
41660            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
41661	           xmlMemBlocks() - mem_base);
41662	    test_ret++;
41663            printf(" %d", n_code);
41664            printf("\n");
41665        }
41666    }
41667    function_tests++;
41668#endif
41669
41670    return(test_ret);
41671}
41672
41673
41674static int
41675test_xmlUCSIsYiSyllables(void) {
41676    int test_ret = 0;
41677
41678#if defined(LIBXML_UNICODE_ENABLED)
41679    int mem_base;
41680    int ret_val;
41681    int code; /* UCS code point */
41682    int n_code;
41683
41684    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41685        mem_base = xmlMemBlocks();
41686        code = gen_int(n_code, 0);
41687
41688        ret_val = xmlUCSIsYiSyllables(code);
41689        desret_int(ret_val);
41690        call_tests++;
41691        des_int(n_code, code, 0);
41692        xmlResetLastError();
41693        if (mem_base != xmlMemBlocks()) {
41694            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
41695	           xmlMemBlocks() - mem_base);
41696	    test_ret++;
41697            printf(" %d", n_code);
41698            printf("\n");
41699        }
41700    }
41701    function_tests++;
41702#endif
41703
41704    return(test_ret);
41705}
41706
41707
41708static int
41709test_xmlUCSIsYijingHexagramSymbols(void) {
41710    int test_ret = 0;
41711
41712#if defined(LIBXML_UNICODE_ENABLED)
41713    int mem_base;
41714    int ret_val;
41715    int code; /* UCS code point */
41716    int n_code;
41717
41718    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41719        mem_base = xmlMemBlocks();
41720        code = gen_int(n_code, 0);
41721
41722        ret_val = xmlUCSIsYijingHexagramSymbols(code);
41723        desret_int(ret_val);
41724        call_tests++;
41725        des_int(n_code, code, 0);
41726        xmlResetLastError();
41727        if (mem_base != xmlMemBlocks()) {
41728            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
41729	           xmlMemBlocks() - mem_base);
41730	    test_ret++;
41731            printf(" %d", n_code);
41732            printf("\n");
41733        }
41734    }
41735    function_tests++;
41736#endif
41737
41738    return(test_ret);
41739}
41740
41741static int
41742test_xmlunicode(void) {
41743    int test_ret = 0;
41744
41745    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
41746    test_ret += test_xmlUCSIsAegeanNumbers();
41747    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
41748    test_ret += test_xmlUCSIsArabic();
41749    test_ret += test_xmlUCSIsArabicPresentationFormsA();
41750    test_ret += test_xmlUCSIsArabicPresentationFormsB();
41751    test_ret += test_xmlUCSIsArmenian();
41752    test_ret += test_xmlUCSIsArrows();
41753    test_ret += test_xmlUCSIsBasicLatin();
41754    test_ret += test_xmlUCSIsBengali();
41755    test_ret += test_xmlUCSIsBlock();
41756    test_ret += test_xmlUCSIsBlockElements();
41757    test_ret += test_xmlUCSIsBopomofo();
41758    test_ret += test_xmlUCSIsBopomofoExtended();
41759    test_ret += test_xmlUCSIsBoxDrawing();
41760    test_ret += test_xmlUCSIsBraillePatterns();
41761    test_ret += test_xmlUCSIsBuhid();
41762    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
41763    test_ret += test_xmlUCSIsCJKCompatibility();
41764    test_ret += test_xmlUCSIsCJKCompatibilityForms();
41765    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
41766    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
41767    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
41768    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
41769    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
41770    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
41771    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
41772    test_ret += test_xmlUCSIsCat();
41773    test_ret += test_xmlUCSIsCatC();
41774    test_ret += test_xmlUCSIsCatCc();
41775    test_ret += test_xmlUCSIsCatCf();
41776    test_ret += test_xmlUCSIsCatCo();
41777    test_ret += test_xmlUCSIsCatCs();
41778    test_ret += test_xmlUCSIsCatL();
41779    test_ret += test_xmlUCSIsCatLl();
41780    test_ret += test_xmlUCSIsCatLm();
41781    test_ret += test_xmlUCSIsCatLo();
41782    test_ret += test_xmlUCSIsCatLt();
41783    test_ret += test_xmlUCSIsCatLu();
41784    test_ret += test_xmlUCSIsCatM();
41785    test_ret += test_xmlUCSIsCatMc();
41786    test_ret += test_xmlUCSIsCatMe();
41787    test_ret += test_xmlUCSIsCatMn();
41788    test_ret += test_xmlUCSIsCatN();
41789    test_ret += test_xmlUCSIsCatNd();
41790    test_ret += test_xmlUCSIsCatNl();
41791    test_ret += test_xmlUCSIsCatNo();
41792    test_ret += test_xmlUCSIsCatP();
41793    test_ret += test_xmlUCSIsCatPc();
41794    test_ret += test_xmlUCSIsCatPd();
41795    test_ret += test_xmlUCSIsCatPe();
41796    test_ret += test_xmlUCSIsCatPf();
41797    test_ret += test_xmlUCSIsCatPi();
41798    test_ret += test_xmlUCSIsCatPo();
41799    test_ret += test_xmlUCSIsCatPs();
41800    test_ret += test_xmlUCSIsCatS();
41801    test_ret += test_xmlUCSIsCatSc();
41802    test_ret += test_xmlUCSIsCatSk();
41803    test_ret += test_xmlUCSIsCatSm();
41804    test_ret += test_xmlUCSIsCatSo();
41805    test_ret += test_xmlUCSIsCatZ();
41806    test_ret += test_xmlUCSIsCatZl();
41807    test_ret += test_xmlUCSIsCatZp();
41808    test_ret += test_xmlUCSIsCatZs();
41809    test_ret += test_xmlUCSIsCherokee();
41810    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
41811    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
41812    test_ret += test_xmlUCSIsCombiningHalfMarks();
41813    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
41814    test_ret += test_xmlUCSIsControlPictures();
41815    test_ret += test_xmlUCSIsCurrencySymbols();
41816    test_ret += test_xmlUCSIsCypriotSyllabary();
41817    test_ret += test_xmlUCSIsCyrillic();
41818    test_ret += test_xmlUCSIsCyrillicSupplement();
41819    test_ret += test_xmlUCSIsDeseret();
41820    test_ret += test_xmlUCSIsDevanagari();
41821    test_ret += test_xmlUCSIsDingbats();
41822    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
41823    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
41824    test_ret += test_xmlUCSIsEthiopic();
41825    test_ret += test_xmlUCSIsGeneralPunctuation();
41826    test_ret += test_xmlUCSIsGeometricShapes();
41827    test_ret += test_xmlUCSIsGeorgian();
41828    test_ret += test_xmlUCSIsGothic();
41829    test_ret += test_xmlUCSIsGreek();
41830    test_ret += test_xmlUCSIsGreekExtended();
41831    test_ret += test_xmlUCSIsGreekandCoptic();
41832    test_ret += test_xmlUCSIsGujarati();
41833    test_ret += test_xmlUCSIsGurmukhi();
41834    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
41835    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
41836    test_ret += test_xmlUCSIsHangulJamo();
41837    test_ret += test_xmlUCSIsHangulSyllables();
41838    test_ret += test_xmlUCSIsHanunoo();
41839    test_ret += test_xmlUCSIsHebrew();
41840    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
41841    test_ret += test_xmlUCSIsHighSurrogates();
41842    test_ret += test_xmlUCSIsHiragana();
41843    test_ret += test_xmlUCSIsIPAExtensions();
41844    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
41845    test_ret += test_xmlUCSIsKanbun();
41846    test_ret += test_xmlUCSIsKangxiRadicals();
41847    test_ret += test_xmlUCSIsKannada();
41848    test_ret += test_xmlUCSIsKatakana();
41849    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
41850    test_ret += test_xmlUCSIsKhmer();
41851    test_ret += test_xmlUCSIsKhmerSymbols();
41852    test_ret += test_xmlUCSIsLao();
41853    test_ret += test_xmlUCSIsLatin1Supplement();
41854    test_ret += test_xmlUCSIsLatinExtendedA();
41855    test_ret += test_xmlUCSIsLatinExtendedAdditional();
41856    test_ret += test_xmlUCSIsLatinExtendedB();
41857    test_ret += test_xmlUCSIsLetterlikeSymbols();
41858    test_ret += test_xmlUCSIsLimbu();
41859    test_ret += test_xmlUCSIsLinearBIdeograms();
41860    test_ret += test_xmlUCSIsLinearBSyllabary();
41861    test_ret += test_xmlUCSIsLowSurrogates();
41862    test_ret += test_xmlUCSIsMalayalam();
41863    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
41864    test_ret += test_xmlUCSIsMathematicalOperators();
41865    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
41866    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
41867    test_ret += test_xmlUCSIsMiscellaneousSymbols();
41868    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
41869    test_ret += test_xmlUCSIsMiscellaneousTechnical();
41870    test_ret += test_xmlUCSIsMongolian();
41871    test_ret += test_xmlUCSIsMusicalSymbols();
41872    test_ret += test_xmlUCSIsMyanmar();
41873    test_ret += test_xmlUCSIsNumberForms();
41874    test_ret += test_xmlUCSIsOgham();
41875    test_ret += test_xmlUCSIsOldItalic();
41876    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
41877    test_ret += test_xmlUCSIsOriya();
41878    test_ret += test_xmlUCSIsOsmanya();
41879    test_ret += test_xmlUCSIsPhoneticExtensions();
41880    test_ret += test_xmlUCSIsPrivateUse();
41881    test_ret += test_xmlUCSIsPrivateUseArea();
41882    test_ret += test_xmlUCSIsRunic();
41883    test_ret += test_xmlUCSIsShavian();
41884    test_ret += test_xmlUCSIsSinhala();
41885    test_ret += test_xmlUCSIsSmallFormVariants();
41886    test_ret += test_xmlUCSIsSpacingModifierLetters();
41887    test_ret += test_xmlUCSIsSpecials();
41888    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
41889    test_ret += test_xmlUCSIsSupplementalArrowsA();
41890    test_ret += test_xmlUCSIsSupplementalArrowsB();
41891    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
41892    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
41893    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
41894    test_ret += test_xmlUCSIsSyriac();
41895    test_ret += test_xmlUCSIsTagalog();
41896    test_ret += test_xmlUCSIsTagbanwa();
41897    test_ret += test_xmlUCSIsTags();
41898    test_ret += test_xmlUCSIsTaiLe();
41899    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
41900    test_ret += test_xmlUCSIsTamil();
41901    test_ret += test_xmlUCSIsTelugu();
41902    test_ret += test_xmlUCSIsThaana();
41903    test_ret += test_xmlUCSIsThai();
41904    test_ret += test_xmlUCSIsTibetan();
41905    test_ret += test_xmlUCSIsUgaritic();
41906    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
41907    test_ret += test_xmlUCSIsVariationSelectors();
41908    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
41909    test_ret += test_xmlUCSIsYiRadicals();
41910    test_ret += test_xmlUCSIsYiSyllables();
41911    test_ret += test_xmlUCSIsYijingHexagramSymbols();
41912
41913    if (test_ret != 0)
41914	printf("Module xmlunicode: %d errors\n", test_ret);
41915    return(test_ret);
41916}
41917
41918static int
41919test_xmlNewTextWriter(void) {
41920    int test_ret = 0;
41921
41922#if defined(LIBXML_WRITER_ENABLED)
41923    int mem_base;
41924    xmlTextWriterPtr ret_val;
41925    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
41926    int n_out;
41927
41928    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
41929        mem_base = xmlMemBlocks();
41930        out = gen_xmlOutputBufferPtr(n_out, 0);
41931
41932        ret_val = xmlNewTextWriter(out);
41933        if (ret_val != NULL) out = NULL;
41934        desret_xmlTextWriterPtr(ret_val);
41935        call_tests++;
41936        des_xmlOutputBufferPtr(n_out, out, 0);
41937        xmlResetLastError();
41938        if (mem_base != xmlMemBlocks()) {
41939            printf("Leak of %d blocks found in xmlNewTextWriter",
41940	           xmlMemBlocks() - mem_base);
41941	    test_ret++;
41942            printf(" %d", n_out);
41943            printf("\n");
41944        }
41945    }
41946    function_tests++;
41947#endif
41948
41949    return(test_ret);
41950}
41951
41952
41953static int
41954test_xmlNewTextWriterFilename(void) {
41955    int test_ret = 0;
41956
41957#if defined(LIBXML_WRITER_ENABLED)
41958    int mem_base;
41959    xmlTextWriterPtr ret_val;
41960    const char * uri; /* the URI of the resource for the output */
41961    int n_uri;
41962    int compression; /* compress the output? */
41963    int n_compression;
41964
41965    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
41966    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
41967        mem_base = xmlMemBlocks();
41968        uri = gen_fileoutput(n_uri, 0);
41969        compression = gen_int(n_compression, 1);
41970
41971        ret_val = xmlNewTextWriterFilename(uri, compression);
41972        desret_xmlTextWriterPtr(ret_val);
41973        call_tests++;
41974        des_fileoutput(n_uri, uri, 0);
41975        des_int(n_compression, compression, 1);
41976        xmlResetLastError();
41977        if (mem_base != xmlMemBlocks()) {
41978            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
41979	           xmlMemBlocks() - mem_base);
41980	    test_ret++;
41981            printf(" %d", n_uri);
41982            printf(" %d", n_compression);
41983            printf("\n");
41984        }
41985    }
41986    }
41987    function_tests++;
41988#endif
41989
41990    return(test_ret);
41991}
41992
41993
41994static int
41995test_xmlNewTextWriterMemory(void) {
41996    int test_ret = 0;
41997
41998#if defined(LIBXML_WRITER_ENABLED)
41999    int mem_base;
42000    xmlTextWriterPtr ret_val;
42001    xmlBufferPtr buf; /* xmlBufferPtr */
42002    int n_buf;
42003    int compression; /* compress the output? */
42004    int n_compression;
42005
42006    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42007    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42008        mem_base = xmlMemBlocks();
42009        buf = gen_xmlBufferPtr(n_buf, 0);
42010        compression = gen_int(n_compression, 1);
42011
42012        ret_val = xmlNewTextWriterMemory(buf, compression);
42013        desret_xmlTextWriterPtr(ret_val);
42014        call_tests++;
42015        des_xmlBufferPtr(n_buf, buf, 0);
42016        des_int(n_compression, compression, 1);
42017        xmlResetLastError();
42018        if (mem_base != xmlMemBlocks()) {
42019            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42020	           xmlMemBlocks() - mem_base);
42021	    test_ret++;
42022            printf(" %d", n_buf);
42023            printf(" %d", n_compression);
42024            printf("\n");
42025        }
42026    }
42027    }
42028    function_tests++;
42029#endif
42030
42031    return(test_ret);
42032}
42033
42034
42035static int
42036test_xmlNewTextWriterPushParser(void) {
42037    int test_ret = 0;
42038
42039#if defined(LIBXML_WRITER_ENABLED)
42040    int mem_base;
42041    xmlTextWriterPtr ret_val;
42042    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42043    int n_ctxt;
42044    int compression; /* compress the output? */
42045    int n_compression;
42046
42047    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42048    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42049        mem_base = xmlMemBlocks();
42050        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42051        compression = gen_int(n_compression, 1);
42052
42053        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42054        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42055        desret_xmlTextWriterPtr(ret_val);
42056        call_tests++;
42057        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42058        des_int(n_compression, compression, 1);
42059        xmlResetLastError();
42060        if (mem_base != xmlMemBlocks()) {
42061            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42062	           xmlMemBlocks() - mem_base);
42063	    test_ret++;
42064            printf(" %d", n_ctxt);
42065            printf(" %d", n_compression);
42066            printf("\n");
42067        }
42068    }
42069    }
42070    function_tests++;
42071#endif
42072
42073    return(test_ret);
42074}
42075
42076
42077static int
42078test_xmlNewTextWriterTree(void) {
42079    int test_ret = 0;
42080
42081#if defined(LIBXML_WRITER_ENABLED)
42082    int mem_base;
42083    xmlTextWriterPtr ret_val;
42084    xmlDocPtr doc; /* xmlDocPtr */
42085    int n_doc;
42086    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42087    int n_node;
42088    int compression; /* compress the output? */
42089    int n_compression;
42090
42091    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42092    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42093    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42094        mem_base = xmlMemBlocks();
42095        doc = gen_xmlDocPtr(n_doc, 0);
42096        node = gen_xmlNodePtr(n_node, 1);
42097        compression = gen_int(n_compression, 2);
42098
42099        ret_val = xmlNewTextWriterTree(doc, node, compression);
42100        desret_xmlTextWriterPtr(ret_val);
42101        call_tests++;
42102        des_xmlDocPtr(n_doc, doc, 0);
42103        des_xmlNodePtr(n_node, node, 1);
42104        des_int(n_compression, compression, 2);
42105        xmlResetLastError();
42106        if (mem_base != xmlMemBlocks()) {
42107            printf("Leak of %d blocks found in xmlNewTextWriterTree",
42108	           xmlMemBlocks() - mem_base);
42109	    test_ret++;
42110            printf(" %d", n_doc);
42111            printf(" %d", n_node);
42112            printf(" %d", n_compression);
42113            printf("\n");
42114        }
42115    }
42116    }
42117    }
42118    function_tests++;
42119#endif
42120
42121    return(test_ret);
42122}
42123
42124
42125static int
42126test_xmlTextWriterEndAttribute(void) {
42127    int test_ret = 0;
42128
42129#if defined(LIBXML_WRITER_ENABLED)
42130    int mem_base;
42131    int ret_val;
42132    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42133    int n_writer;
42134
42135    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42136        mem_base = xmlMemBlocks();
42137        writer = gen_xmlTextWriterPtr(n_writer, 0);
42138
42139        ret_val = xmlTextWriterEndAttribute(writer);
42140        desret_int(ret_val);
42141        call_tests++;
42142        des_xmlTextWriterPtr(n_writer, writer, 0);
42143        xmlResetLastError();
42144        if (mem_base != xmlMemBlocks()) {
42145            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42146	           xmlMemBlocks() - mem_base);
42147	    test_ret++;
42148            printf(" %d", n_writer);
42149            printf("\n");
42150        }
42151    }
42152    function_tests++;
42153#endif
42154
42155    return(test_ret);
42156}
42157
42158
42159static int
42160test_xmlTextWriterEndCDATA(void) {
42161    int test_ret = 0;
42162
42163#if defined(LIBXML_WRITER_ENABLED)
42164    int mem_base;
42165    int ret_val;
42166    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42167    int n_writer;
42168
42169    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42170        mem_base = xmlMemBlocks();
42171        writer = gen_xmlTextWriterPtr(n_writer, 0);
42172
42173        ret_val = xmlTextWriterEndCDATA(writer);
42174        desret_int(ret_val);
42175        call_tests++;
42176        des_xmlTextWriterPtr(n_writer, writer, 0);
42177        xmlResetLastError();
42178        if (mem_base != xmlMemBlocks()) {
42179            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42180	           xmlMemBlocks() - mem_base);
42181	    test_ret++;
42182            printf(" %d", n_writer);
42183            printf("\n");
42184        }
42185    }
42186    function_tests++;
42187#endif
42188
42189    return(test_ret);
42190}
42191
42192
42193static int
42194test_xmlTextWriterEndComment(void) {
42195    int test_ret = 0;
42196
42197#if defined(LIBXML_WRITER_ENABLED)
42198    int mem_base;
42199    int ret_val;
42200    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42201    int n_writer;
42202
42203    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42204        mem_base = xmlMemBlocks();
42205        writer = gen_xmlTextWriterPtr(n_writer, 0);
42206
42207        ret_val = xmlTextWriterEndComment(writer);
42208        desret_int(ret_val);
42209        call_tests++;
42210        des_xmlTextWriterPtr(n_writer, writer, 0);
42211        xmlResetLastError();
42212        if (mem_base != xmlMemBlocks()) {
42213            printf("Leak of %d blocks found in xmlTextWriterEndComment",
42214	           xmlMemBlocks() - mem_base);
42215	    test_ret++;
42216            printf(" %d", n_writer);
42217            printf("\n");
42218        }
42219    }
42220    function_tests++;
42221#endif
42222
42223    return(test_ret);
42224}
42225
42226
42227static int
42228test_xmlTextWriterEndDTD(void) {
42229    int test_ret = 0;
42230
42231#if defined(LIBXML_WRITER_ENABLED)
42232    int mem_base;
42233    int ret_val;
42234    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42235    int n_writer;
42236
42237    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42238        mem_base = xmlMemBlocks();
42239        writer = gen_xmlTextWriterPtr(n_writer, 0);
42240
42241        ret_val = xmlTextWriterEndDTD(writer);
42242        desret_int(ret_val);
42243        call_tests++;
42244        des_xmlTextWriterPtr(n_writer, writer, 0);
42245        xmlResetLastError();
42246        if (mem_base != xmlMemBlocks()) {
42247            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42248	           xmlMemBlocks() - mem_base);
42249	    test_ret++;
42250            printf(" %d", n_writer);
42251            printf("\n");
42252        }
42253    }
42254    function_tests++;
42255#endif
42256
42257    return(test_ret);
42258}
42259
42260
42261static int
42262test_xmlTextWriterEndDTDAttlist(void) {
42263    int test_ret = 0;
42264
42265#if defined(LIBXML_WRITER_ENABLED)
42266    int mem_base;
42267    int ret_val;
42268    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42269    int n_writer;
42270
42271    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42272        mem_base = xmlMemBlocks();
42273        writer = gen_xmlTextWriterPtr(n_writer, 0);
42274
42275        ret_val = xmlTextWriterEndDTDAttlist(writer);
42276        desret_int(ret_val);
42277        call_tests++;
42278        des_xmlTextWriterPtr(n_writer, writer, 0);
42279        xmlResetLastError();
42280        if (mem_base != xmlMemBlocks()) {
42281            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42282	           xmlMemBlocks() - mem_base);
42283	    test_ret++;
42284            printf(" %d", n_writer);
42285            printf("\n");
42286        }
42287    }
42288    function_tests++;
42289#endif
42290
42291    return(test_ret);
42292}
42293
42294
42295static int
42296test_xmlTextWriterEndDTDElement(void) {
42297    int test_ret = 0;
42298
42299#if defined(LIBXML_WRITER_ENABLED)
42300    int mem_base;
42301    int ret_val;
42302    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42303    int n_writer;
42304
42305    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42306        mem_base = xmlMemBlocks();
42307        writer = gen_xmlTextWriterPtr(n_writer, 0);
42308
42309        ret_val = xmlTextWriterEndDTDElement(writer);
42310        desret_int(ret_val);
42311        call_tests++;
42312        des_xmlTextWriterPtr(n_writer, writer, 0);
42313        xmlResetLastError();
42314        if (mem_base != xmlMemBlocks()) {
42315            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
42316	           xmlMemBlocks() - mem_base);
42317	    test_ret++;
42318            printf(" %d", n_writer);
42319            printf("\n");
42320        }
42321    }
42322    function_tests++;
42323#endif
42324
42325    return(test_ret);
42326}
42327
42328
42329static int
42330test_xmlTextWriterEndDTDEntity(void) {
42331    int test_ret = 0;
42332
42333#if defined(LIBXML_WRITER_ENABLED)
42334    int mem_base;
42335    int ret_val;
42336    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42337    int n_writer;
42338
42339    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42340        mem_base = xmlMemBlocks();
42341        writer = gen_xmlTextWriterPtr(n_writer, 0);
42342
42343        ret_val = xmlTextWriterEndDTDEntity(writer);
42344        desret_int(ret_val);
42345        call_tests++;
42346        des_xmlTextWriterPtr(n_writer, writer, 0);
42347        xmlResetLastError();
42348        if (mem_base != xmlMemBlocks()) {
42349            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
42350	           xmlMemBlocks() - mem_base);
42351	    test_ret++;
42352            printf(" %d", n_writer);
42353            printf("\n");
42354        }
42355    }
42356    function_tests++;
42357#endif
42358
42359    return(test_ret);
42360}
42361
42362
42363static int
42364test_xmlTextWriterEndDocument(void) {
42365    int test_ret = 0;
42366
42367#if defined(LIBXML_WRITER_ENABLED)
42368    int mem_base;
42369    int ret_val;
42370    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42371    int n_writer;
42372
42373    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42374        mem_base = xmlMemBlocks();
42375        writer = gen_xmlTextWriterPtr(n_writer, 0);
42376
42377        ret_val = xmlTextWriterEndDocument(writer);
42378        desret_int(ret_val);
42379        call_tests++;
42380        des_xmlTextWriterPtr(n_writer, writer, 0);
42381        xmlResetLastError();
42382        if (mem_base != xmlMemBlocks()) {
42383            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
42384	           xmlMemBlocks() - mem_base);
42385	    test_ret++;
42386            printf(" %d", n_writer);
42387            printf("\n");
42388        }
42389    }
42390    function_tests++;
42391#endif
42392
42393    return(test_ret);
42394}
42395
42396
42397static int
42398test_xmlTextWriterEndElement(void) {
42399    int test_ret = 0;
42400
42401#if defined(LIBXML_WRITER_ENABLED)
42402    int mem_base;
42403    int ret_val;
42404    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42405    int n_writer;
42406
42407    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42408        mem_base = xmlMemBlocks();
42409        writer = gen_xmlTextWriterPtr(n_writer, 0);
42410
42411        ret_val = xmlTextWriterEndElement(writer);
42412        desret_int(ret_val);
42413        call_tests++;
42414        des_xmlTextWriterPtr(n_writer, writer, 0);
42415        xmlResetLastError();
42416        if (mem_base != xmlMemBlocks()) {
42417            printf("Leak of %d blocks found in xmlTextWriterEndElement",
42418	           xmlMemBlocks() - mem_base);
42419	    test_ret++;
42420            printf(" %d", n_writer);
42421            printf("\n");
42422        }
42423    }
42424    function_tests++;
42425#endif
42426
42427    return(test_ret);
42428}
42429
42430
42431static int
42432test_xmlTextWriterEndPI(void) {
42433    int test_ret = 0;
42434
42435#if defined(LIBXML_WRITER_ENABLED)
42436    int mem_base;
42437    int ret_val;
42438    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42439    int n_writer;
42440
42441    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42442        mem_base = xmlMemBlocks();
42443        writer = gen_xmlTextWriterPtr(n_writer, 0);
42444
42445        ret_val = xmlTextWriterEndPI(writer);
42446        desret_int(ret_val);
42447        call_tests++;
42448        des_xmlTextWriterPtr(n_writer, writer, 0);
42449        xmlResetLastError();
42450        if (mem_base != xmlMemBlocks()) {
42451            printf("Leak of %d blocks found in xmlTextWriterEndPI",
42452	           xmlMemBlocks() - mem_base);
42453	    test_ret++;
42454            printf(" %d", n_writer);
42455            printf("\n");
42456        }
42457    }
42458    function_tests++;
42459#endif
42460
42461    return(test_ret);
42462}
42463
42464
42465static int
42466test_xmlTextWriterFlush(void) {
42467    int test_ret = 0;
42468
42469#if defined(LIBXML_WRITER_ENABLED)
42470    int mem_base;
42471    int ret_val;
42472    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42473    int n_writer;
42474
42475    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42476        mem_base = xmlMemBlocks();
42477        writer = gen_xmlTextWriterPtr(n_writer, 0);
42478
42479        ret_val = xmlTextWriterFlush(writer);
42480        desret_int(ret_val);
42481        call_tests++;
42482        des_xmlTextWriterPtr(n_writer, writer, 0);
42483        xmlResetLastError();
42484        if (mem_base != xmlMemBlocks()) {
42485            printf("Leak of %d blocks found in xmlTextWriterFlush",
42486	           xmlMemBlocks() - mem_base);
42487	    test_ret++;
42488            printf(" %d", n_writer);
42489            printf("\n");
42490        }
42491    }
42492    function_tests++;
42493#endif
42494
42495    return(test_ret);
42496}
42497
42498
42499static int
42500test_xmlTextWriterFullEndElement(void) {
42501    int test_ret = 0;
42502
42503#if defined(LIBXML_WRITER_ENABLED)
42504    int mem_base;
42505    int ret_val;
42506    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42507    int n_writer;
42508
42509    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42510        mem_base = xmlMemBlocks();
42511        writer = gen_xmlTextWriterPtr(n_writer, 0);
42512
42513        ret_val = xmlTextWriterFullEndElement(writer);
42514        desret_int(ret_val);
42515        call_tests++;
42516        des_xmlTextWriterPtr(n_writer, writer, 0);
42517        xmlResetLastError();
42518        if (mem_base != xmlMemBlocks()) {
42519            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
42520	           xmlMemBlocks() - mem_base);
42521	    test_ret++;
42522            printf(" %d", n_writer);
42523            printf("\n");
42524        }
42525    }
42526    function_tests++;
42527#endif
42528
42529    return(test_ret);
42530}
42531
42532
42533static int
42534test_xmlTextWriterSetIndent(void) {
42535    int test_ret = 0;
42536
42537#if defined(LIBXML_WRITER_ENABLED)
42538    int mem_base;
42539    int ret_val;
42540    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42541    int n_writer;
42542    int indent; /* do indentation? */
42543    int n_indent;
42544
42545    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42546    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
42547        mem_base = xmlMemBlocks();
42548        writer = gen_xmlTextWriterPtr(n_writer, 0);
42549        indent = gen_int(n_indent, 1);
42550
42551        ret_val = xmlTextWriterSetIndent(writer, indent);
42552        desret_int(ret_val);
42553        call_tests++;
42554        des_xmlTextWriterPtr(n_writer, writer, 0);
42555        des_int(n_indent, indent, 1);
42556        xmlResetLastError();
42557        if (mem_base != xmlMemBlocks()) {
42558            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
42559	           xmlMemBlocks() - mem_base);
42560	    test_ret++;
42561            printf(" %d", n_writer);
42562            printf(" %d", n_indent);
42563            printf("\n");
42564        }
42565    }
42566    }
42567    function_tests++;
42568#endif
42569
42570    return(test_ret);
42571}
42572
42573
42574static int
42575test_xmlTextWriterSetIndentString(void) {
42576    int test_ret = 0;
42577
42578#if defined(LIBXML_WRITER_ENABLED)
42579    int mem_base;
42580    int ret_val;
42581    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42582    int n_writer;
42583    xmlChar * str; /* the xmlChar string */
42584    int n_str;
42585
42586    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42587    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
42588        mem_base = xmlMemBlocks();
42589        writer = gen_xmlTextWriterPtr(n_writer, 0);
42590        str = gen_const_xmlChar_ptr(n_str, 1);
42591
42592        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
42593        desret_int(ret_val);
42594        call_tests++;
42595        des_xmlTextWriterPtr(n_writer, writer, 0);
42596        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
42597        xmlResetLastError();
42598        if (mem_base != xmlMemBlocks()) {
42599            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
42600	           xmlMemBlocks() - mem_base);
42601	    test_ret++;
42602            printf(" %d", n_writer);
42603            printf(" %d", n_str);
42604            printf("\n");
42605        }
42606    }
42607    }
42608    function_tests++;
42609#endif
42610
42611    return(test_ret);
42612}
42613
42614
42615static int
42616test_xmlTextWriterStartAttribute(void) {
42617    int test_ret = 0;
42618
42619#if defined(LIBXML_WRITER_ENABLED)
42620    int mem_base;
42621    int ret_val;
42622    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42623    int n_writer;
42624    xmlChar * name; /* element name */
42625    int n_name;
42626
42627    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42628    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42629        mem_base = xmlMemBlocks();
42630        writer = gen_xmlTextWriterPtr(n_writer, 0);
42631        name = gen_const_xmlChar_ptr(n_name, 1);
42632
42633        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
42634        desret_int(ret_val);
42635        call_tests++;
42636        des_xmlTextWriterPtr(n_writer, writer, 0);
42637        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42638        xmlResetLastError();
42639        if (mem_base != xmlMemBlocks()) {
42640            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
42641	           xmlMemBlocks() - mem_base);
42642	    test_ret++;
42643            printf(" %d", n_writer);
42644            printf(" %d", n_name);
42645            printf("\n");
42646        }
42647    }
42648    }
42649    function_tests++;
42650#endif
42651
42652    return(test_ret);
42653}
42654
42655
42656static int
42657test_xmlTextWriterStartAttributeNS(void) {
42658    int test_ret = 0;
42659
42660#if defined(LIBXML_WRITER_ENABLED)
42661    int mem_base;
42662    int ret_val;
42663    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42664    int n_writer;
42665    xmlChar * prefix; /* namespace prefix or NULL */
42666    int n_prefix;
42667    xmlChar * name; /* element local name */
42668    int n_name;
42669    xmlChar * namespaceURI; /* namespace URI or NULL */
42670    int n_namespaceURI;
42671
42672    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42673    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
42674    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42675    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
42676        mem_base = xmlMemBlocks();
42677        writer = gen_xmlTextWriterPtr(n_writer, 0);
42678        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
42679        name = gen_const_xmlChar_ptr(n_name, 2);
42680        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
42681
42682        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
42683        desret_int(ret_val);
42684        call_tests++;
42685        des_xmlTextWriterPtr(n_writer, writer, 0);
42686        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
42687        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42688        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
42689        xmlResetLastError();
42690        if (mem_base != xmlMemBlocks()) {
42691            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
42692	           xmlMemBlocks() - mem_base);
42693	    test_ret++;
42694            printf(" %d", n_writer);
42695            printf(" %d", n_prefix);
42696            printf(" %d", n_name);
42697            printf(" %d", n_namespaceURI);
42698            printf("\n");
42699        }
42700    }
42701    }
42702    }
42703    }
42704    function_tests++;
42705#endif
42706
42707    return(test_ret);
42708}
42709
42710
42711static int
42712test_xmlTextWriterStartCDATA(void) {
42713    int test_ret = 0;
42714
42715#if defined(LIBXML_WRITER_ENABLED)
42716    int mem_base;
42717    int ret_val;
42718    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42719    int n_writer;
42720
42721    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42722        mem_base = xmlMemBlocks();
42723        writer = gen_xmlTextWriterPtr(n_writer, 0);
42724
42725        ret_val = xmlTextWriterStartCDATA(writer);
42726        desret_int(ret_val);
42727        call_tests++;
42728        des_xmlTextWriterPtr(n_writer, writer, 0);
42729        xmlResetLastError();
42730        if (mem_base != xmlMemBlocks()) {
42731            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
42732	           xmlMemBlocks() - mem_base);
42733	    test_ret++;
42734            printf(" %d", n_writer);
42735            printf("\n");
42736        }
42737    }
42738    function_tests++;
42739#endif
42740
42741    return(test_ret);
42742}
42743
42744
42745static int
42746test_xmlTextWriterStartComment(void) {
42747    int test_ret = 0;
42748
42749#if defined(LIBXML_WRITER_ENABLED)
42750    int mem_base;
42751    int ret_val;
42752    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42753    int n_writer;
42754
42755    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42756        mem_base = xmlMemBlocks();
42757        writer = gen_xmlTextWriterPtr(n_writer, 0);
42758
42759        ret_val = xmlTextWriterStartComment(writer);
42760        desret_int(ret_val);
42761        call_tests++;
42762        des_xmlTextWriterPtr(n_writer, writer, 0);
42763        xmlResetLastError();
42764        if (mem_base != xmlMemBlocks()) {
42765            printf("Leak of %d blocks found in xmlTextWriterStartComment",
42766	           xmlMemBlocks() - mem_base);
42767	    test_ret++;
42768            printf(" %d", n_writer);
42769            printf("\n");
42770        }
42771    }
42772    function_tests++;
42773#endif
42774
42775    return(test_ret);
42776}
42777
42778
42779static int
42780test_xmlTextWriterStartDTD(void) {
42781    int test_ret = 0;
42782
42783#if defined(LIBXML_WRITER_ENABLED)
42784    int mem_base;
42785    int ret_val;
42786    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42787    int n_writer;
42788    xmlChar * name; /* the name of the DTD */
42789    int n_name;
42790    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42791    int n_pubid;
42792    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42793    int n_sysid;
42794
42795    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42796    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42797    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42798    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42799        mem_base = xmlMemBlocks();
42800        writer = gen_xmlTextWriterPtr(n_writer, 0);
42801        name = gen_const_xmlChar_ptr(n_name, 1);
42802        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
42803        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
42804
42805        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
42806        desret_int(ret_val);
42807        call_tests++;
42808        des_xmlTextWriterPtr(n_writer, writer, 0);
42809        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42810        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
42811        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
42812        xmlResetLastError();
42813        if (mem_base != xmlMemBlocks()) {
42814            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
42815	           xmlMemBlocks() - mem_base);
42816	    test_ret++;
42817            printf(" %d", n_writer);
42818            printf(" %d", n_name);
42819            printf(" %d", n_pubid);
42820            printf(" %d", n_sysid);
42821            printf("\n");
42822        }
42823    }
42824    }
42825    }
42826    }
42827    function_tests++;
42828#endif
42829
42830    return(test_ret);
42831}
42832
42833
42834static int
42835test_xmlTextWriterStartDTDAttlist(void) {
42836    int test_ret = 0;
42837
42838#if defined(LIBXML_WRITER_ENABLED)
42839    int mem_base;
42840    int ret_val;
42841    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42842    int n_writer;
42843    xmlChar * name; /* the name of the DTD ATTLIST */
42844    int n_name;
42845
42846    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42847    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42848        mem_base = xmlMemBlocks();
42849        writer = gen_xmlTextWriterPtr(n_writer, 0);
42850        name = gen_const_xmlChar_ptr(n_name, 1);
42851
42852        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
42853        desret_int(ret_val);
42854        call_tests++;
42855        des_xmlTextWriterPtr(n_writer, writer, 0);
42856        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42857        xmlResetLastError();
42858        if (mem_base != xmlMemBlocks()) {
42859            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
42860	           xmlMemBlocks() - mem_base);
42861	    test_ret++;
42862            printf(" %d", n_writer);
42863            printf(" %d", n_name);
42864            printf("\n");
42865        }
42866    }
42867    }
42868    function_tests++;
42869#endif
42870
42871    return(test_ret);
42872}
42873
42874
42875static int
42876test_xmlTextWriterStartDTDElement(void) {
42877    int test_ret = 0;
42878
42879#if defined(LIBXML_WRITER_ENABLED)
42880    int mem_base;
42881    int ret_val;
42882    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42883    int n_writer;
42884    xmlChar * name; /* the name of the DTD element */
42885    int n_name;
42886
42887    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42888    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42889        mem_base = xmlMemBlocks();
42890        writer = gen_xmlTextWriterPtr(n_writer, 0);
42891        name = gen_const_xmlChar_ptr(n_name, 1);
42892
42893        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
42894        desret_int(ret_val);
42895        call_tests++;
42896        des_xmlTextWriterPtr(n_writer, writer, 0);
42897        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42898        xmlResetLastError();
42899        if (mem_base != xmlMemBlocks()) {
42900            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
42901	           xmlMemBlocks() - mem_base);
42902	    test_ret++;
42903            printf(" %d", n_writer);
42904            printf(" %d", n_name);
42905            printf("\n");
42906        }
42907    }
42908    }
42909    function_tests++;
42910#endif
42911
42912    return(test_ret);
42913}
42914
42915
42916static int
42917test_xmlTextWriterStartDTDEntity(void) {
42918    int test_ret = 0;
42919
42920#if defined(LIBXML_WRITER_ENABLED)
42921    int mem_base;
42922    int ret_val;
42923    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42924    int n_writer;
42925    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42926    int n_pe;
42927    xmlChar * name; /* the name of the DTD ATTLIST */
42928    int n_name;
42929
42930    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42931    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42932    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42933        mem_base = xmlMemBlocks();
42934        writer = gen_xmlTextWriterPtr(n_writer, 0);
42935        pe = gen_int(n_pe, 1);
42936        name = gen_const_xmlChar_ptr(n_name, 2);
42937
42938        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
42939        desret_int(ret_val);
42940        call_tests++;
42941        des_xmlTextWriterPtr(n_writer, writer, 0);
42942        des_int(n_pe, pe, 1);
42943        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42944        xmlResetLastError();
42945        if (mem_base != xmlMemBlocks()) {
42946            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
42947	           xmlMemBlocks() - mem_base);
42948	    test_ret++;
42949            printf(" %d", n_writer);
42950            printf(" %d", n_pe);
42951            printf(" %d", n_name);
42952            printf("\n");
42953        }
42954    }
42955    }
42956    }
42957    function_tests++;
42958#endif
42959
42960    return(test_ret);
42961}
42962
42963
42964static int
42965test_xmlTextWriterStartDocument(void) {
42966    int test_ret = 0;
42967
42968#if defined(LIBXML_WRITER_ENABLED)
42969    int mem_base;
42970    int ret_val;
42971    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42972    int n_writer;
42973    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
42974    int n_version;
42975    char * encoding; /* the encoding or NULL for default */
42976    int n_encoding;
42977    char * standalone; /* "yes" or "no" or NULL for default */
42978    int n_standalone;
42979
42980    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42981    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
42982    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
42983    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
42984        mem_base = xmlMemBlocks();
42985        writer = gen_xmlTextWriterPtr(n_writer, 0);
42986        version = gen_const_char_ptr(n_version, 1);
42987        encoding = gen_const_char_ptr(n_encoding, 2);
42988        standalone = gen_const_char_ptr(n_standalone, 3);
42989
42990        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
42991        desret_int(ret_val);
42992        call_tests++;
42993        des_xmlTextWriterPtr(n_writer, writer, 0);
42994        des_const_char_ptr(n_version, (const char *)version, 1);
42995        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
42996        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
42997        xmlResetLastError();
42998        if (mem_base != xmlMemBlocks()) {
42999            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43000	           xmlMemBlocks() - mem_base);
43001	    test_ret++;
43002            printf(" %d", n_writer);
43003            printf(" %d", n_version);
43004            printf(" %d", n_encoding);
43005            printf(" %d", n_standalone);
43006            printf("\n");
43007        }
43008    }
43009    }
43010    }
43011    }
43012    function_tests++;
43013#endif
43014
43015    return(test_ret);
43016}
43017
43018
43019static int
43020test_xmlTextWriterStartElement(void) {
43021    int test_ret = 0;
43022
43023#if defined(LIBXML_WRITER_ENABLED)
43024    int mem_base;
43025    int ret_val;
43026    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43027    int n_writer;
43028    xmlChar * name; /* element name */
43029    int n_name;
43030
43031    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43032    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43033        mem_base = xmlMemBlocks();
43034        writer = gen_xmlTextWriterPtr(n_writer, 0);
43035        name = gen_const_xmlChar_ptr(n_name, 1);
43036
43037        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43038        desret_int(ret_val);
43039        call_tests++;
43040        des_xmlTextWriterPtr(n_writer, writer, 0);
43041        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43042        xmlResetLastError();
43043        if (mem_base != xmlMemBlocks()) {
43044            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43045	           xmlMemBlocks() - mem_base);
43046	    test_ret++;
43047            printf(" %d", n_writer);
43048            printf(" %d", n_name);
43049            printf("\n");
43050        }
43051    }
43052    }
43053    function_tests++;
43054#endif
43055
43056    return(test_ret);
43057}
43058
43059
43060static int
43061test_xmlTextWriterStartElementNS(void) {
43062    int test_ret = 0;
43063
43064#if defined(LIBXML_WRITER_ENABLED)
43065    int mem_base;
43066    int ret_val;
43067    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43068    int n_writer;
43069    xmlChar * prefix; /* namespace prefix or NULL */
43070    int n_prefix;
43071    xmlChar * name; /* element local name */
43072    int n_name;
43073    xmlChar * namespaceURI; /* namespace URI or NULL */
43074    int n_namespaceURI;
43075
43076    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43077    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43078    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43079    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43080        mem_base = xmlMemBlocks();
43081        writer = gen_xmlTextWriterPtr(n_writer, 0);
43082        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43083        name = gen_const_xmlChar_ptr(n_name, 2);
43084        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43085
43086        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43087        desret_int(ret_val);
43088        call_tests++;
43089        des_xmlTextWriterPtr(n_writer, writer, 0);
43090        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43091        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43092        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43093        xmlResetLastError();
43094        if (mem_base != xmlMemBlocks()) {
43095            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43096	           xmlMemBlocks() - mem_base);
43097	    test_ret++;
43098            printf(" %d", n_writer);
43099            printf(" %d", n_prefix);
43100            printf(" %d", n_name);
43101            printf(" %d", n_namespaceURI);
43102            printf("\n");
43103        }
43104    }
43105    }
43106    }
43107    }
43108    function_tests++;
43109#endif
43110
43111    return(test_ret);
43112}
43113
43114
43115static int
43116test_xmlTextWriterStartPI(void) {
43117    int test_ret = 0;
43118
43119#if defined(LIBXML_WRITER_ENABLED)
43120    int mem_base;
43121    int ret_val;
43122    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43123    int n_writer;
43124    xmlChar * target; /* PI target */
43125    int n_target;
43126
43127    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43128    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43129        mem_base = xmlMemBlocks();
43130        writer = gen_xmlTextWriterPtr(n_writer, 0);
43131        target = gen_const_xmlChar_ptr(n_target, 1);
43132
43133        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43134        desret_int(ret_val);
43135        call_tests++;
43136        des_xmlTextWriterPtr(n_writer, writer, 0);
43137        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43138        xmlResetLastError();
43139        if (mem_base != xmlMemBlocks()) {
43140            printf("Leak of %d blocks found in xmlTextWriterStartPI",
43141	           xmlMemBlocks() - mem_base);
43142	    test_ret++;
43143            printf(" %d", n_writer);
43144            printf(" %d", n_target);
43145            printf("\n");
43146        }
43147    }
43148    }
43149    function_tests++;
43150#endif
43151
43152    return(test_ret);
43153}
43154
43155
43156static int
43157test_xmlTextWriterWriteAttribute(void) {
43158    int test_ret = 0;
43159
43160#if defined(LIBXML_WRITER_ENABLED)
43161    int mem_base;
43162    int ret_val;
43163    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43164    int n_writer;
43165    xmlChar * name; /* attribute name */
43166    int n_name;
43167    xmlChar * content; /* attribute content */
43168    int n_content;
43169
43170    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43171    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43172    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43173        mem_base = xmlMemBlocks();
43174        writer = gen_xmlTextWriterPtr(n_writer, 0);
43175        name = gen_const_xmlChar_ptr(n_name, 1);
43176        content = gen_const_xmlChar_ptr(n_content, 2);
43177
43178        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43179        desret_int(ret_val);
43180        call_tests++;
43181        des_xmlTextWriterPtr(n_writer, writer, 0);
43182        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43183        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43184        xmlResetLastError();
43185        if (mem_base != xmlMemBlocks()) {
43186            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43187	           xmlMemBlocks() - mem_base);
43188	    test_ret++;
43189            printf(" %d", n_writer);
43190            printf(" %d", n_name);
43191            printf(" %d", n_content);
43192            printf("\n");
43193        }
43194    }
43195    }
43196    }
43197    function_tests++;
43198#endif
43199
43200    return(test_ret);
43201}
43202
43203
43204static int
43205test_xmlTextWriterWriteAttributeNS(void) {
43206    int test_ret = 0;
43207
43208#if defined(LIBXML_WRITER_ENABLED)
43209    int mem_base;
43210    int ret_val;
43211    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43212    int n_writer;
43213    xmlChar * prefix; /* namespace prefix */
43214    int n_prefix;
43215    xmlChar * name; /* attribute local name */
43216    int n_name;
43217    xmlChar * namespaceURI; /* namespace URI */
43218    int n_namespaceURI;
43219    xmlChar * content; /* attribute content */
43220    int n_content;
43221
43222    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43223    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43224    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43225    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43226    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43227        mem_base = xmlMemBlocks();
43228        writer = gen_xmlTextWriterPtr(n_writer, 0);
43229        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43230        name = gen_const_xmlChar_ptr(n_name, 2);
43231        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43232        content = gen_const_xmlChar_ptr(n_content, 4);
43233
43234        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43235        desret_int(ret_val);
43236        call_tests++;
43237        des_xmlTextWriterPtr(n_writer, writer, 0);
43238        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43239        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43240        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43241        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43242        xmlResetLastError();
43243        if (mem_base != xmlMemBlocks()) {
43244            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43245	           xmlMemBlocks() - mem_base);
43246	    test_ret++;
43247            printf(" %d", n_writer);
43248            printf(" %d", n_prefix);
43249            printf(" %d", n_name);
43250            printf(" %d", n_namespaceURI);
43251            printf(" %d", n_content);
43252            printf("\n");
43253        }
43254    }
43255    }
43256    }
43257    }
43258    }
43259    function_tests++;
43260#endif
43261
43262    return(test_ret);
43263}
43264
43265
43266static int
43267test_xmlTextWriterWriteBase64(void) {
43268    int test_ret = 0;
43269
43270#if defined(LIBXML_WRITER_ENABLED)
43271    int mem_base;
43272    int ret_val;
43273    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43274    int n_writer;
43275    char * data; /* binary data */
43276    int n_data;
43277    int start; /* the position within the data of the first byte to encode */
43278    int n_start;
43279    int len; /* the number of bytes to encode */
43280    int n_len;
43281
43282    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43283    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43284    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43285    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43286        mem_base = xmlMemBlocks();
43287        writer = gen_xmlTextWriterPtr(n_writer, 0);
43288        data = gen_const_char_ptr(n_data, 1);
43289        start = gen_int(n_start, 2);
43290        len = gen_int(n_len, 3);
43291
43292        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43293        desret_int(ret_val);
43294        call_tests++;
43295        des_xmlTextWriterPtr(n_writer, writer, 0);
43296        des_const_char_ptr(n_data, (const char *)data, 1);
43297        des_int(n_start, start, 2);
43298        des_int(n_len, len, 3);
43299        xmlResetLastError();
43300        if (mem_base != xmlMemBlocks()) {
43301            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43302	           xmlMemBlocks() - mem_base);
43303	    test_ret++;
43304            printf(" %d", n_writer);
43305            printf(" %d", n_data);
43306            printf(" %d", n_start);
43307            printf(" %d", n_len);
43308            printf("\n");
43309        }
43310    }
43311    }
43312    }
43313    }
43314    function_tests++;
43315#endif
43316
43317    return(test_ret);
43318}
43319
43320
43321static int
43322test_xmlTextWriterWriteBinHex(void) {
43323    int test_ret = 0;
43324
43325#if defined(LIBXML_WRITER_ENABLED)
43326    int mem_base;
43327    int ret_val;
43328    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43329    int n_writer;
43330    char * data; /* binary data */
43331    int n_data;
43332    int start; /* the position within the data of the first byte to encode */
43333    int n_start;
43334    int len; /* the number of bytes to encode */
43335    int n_len;
43336
43337    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43338    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43339    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43340    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43341        mem_base = xmlMemBlocks();
43342        writer = gen_xmlTextWriterPtr(n_writer, 0);
43343        data = gen_const_char_ptr(n_data, 1);
43344        start = gen_int(n_start, 2);
43345        len = gen_int(n_len, 3);
43346
43347        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
43348        desret_int(ret_val);
43349        call_tests++;
43350        des_xmlTextWriterPtr(n_writer, writer, 0);
43351        des_const_char_ptr(n_data, (const char *)data, 1);
43352        des_int(n_start, start, 2);
43353        des_int(n_len, len, 3);
43354        xmlResetLastError();
43355        if (mem_base != xmlMemBlocks()) {
43356            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
43357	           xmlMemBlocks() - mem_base);
43358	    test_ret++;
43359            printf(" %d", n_writer);
43360            printf(" %d", n_data);
43361            printf(" %d", n_start);
43362            printf(" %d", n_len);
43363            printf("\n");
43364        }
43365    }
43366    }
43367    }
43368    }
43369    function_tests++;
43370#endif
43371
43372    return(test_ret);
43373}
43374
43375
43376static int
43377test_xmlTextWriterWriteCDATA(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    xmlChar * content; /* CDATA content */
43386    int n_content;
43387
43388    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43389    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43390        mem_base = xmlMemBlocks();
43391        writer = gen_xmlTextWriterPtr(n_writer, 0);
43392        content = gen_const_xmlChar_ptr(n_content, 1);
43393
43394        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
43395        desret_int(ret_val);
43396        call_tests++;
43397        des_xmlTextWriterPtr(n_writer, writer, 0);
43398        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43399        xmlResetLastError();
43400        if (mem_base != xmlMemBlocks()) {
43401            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
43402	           xmlMemBlocks() - mem_base);
43403	    test_ret++;
43404            printf(" %d", n_writer);
43405            printf(" %d", n_content);
43406            printf("\n");
43407        }
43408    }
43409    }
43410    function_tests++;
43411#endif
43412
43413    return(test_ret);
43414}
43415
43416
43417static int
43418test_xmlTextWriterWriteComment(void) {
43419    int test_ret = 0;
43420
43421#if defined(LIBXML_WRITER_ENABLED)
43422    int mem_base;
43423    int ret_val;
43424    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43425    int n_writer;
43426    xmlChar * content; /* comment string */
43427    int n_content;
43428
43429    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43430    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43431        mem_base = xmlMemBlocks();
43432        writer = gen_xmlTextWriterPtr(n_writer, 0);
43433        content = gen_const_xmlChar_ptr(n_content, 1);
43434
43435        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
43436        desret_int(ret_val);
43437        call_tests++;
43438        des_xmlTextWriterPtr(n_writer, writer, 0);
43439        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43440        xmlResetLastError();
43441        if (mem_base != xmlMemBlocks()) {
43442            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
43443	           xmlMemBlocks() - mem_base);
43444	    test_ret++;
43445            printf(" %d", n_writer);
43446            printf(" %d", n_content);
43447            printf("\n");
43448        }
43449    }
43450    }
43451    function_tests++;
43452#endif
43453
43454    return(test_ret);
43455}
43456
43457
43458static int
43459test_xmlTextWriterWriteDTD(void) {
43460    int test_ret = 0;
43461
43462#if defined(LIBXML_WRITER_ENABLED)
43463    int mem_base;
43464    int ret_val;
43465    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43466    int n_writer;
43467    xmlChar * name; /* the name of the DTD */
43468    int n_name;
43469    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43470    int n_pubid;
43471    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43472    int n_sysid;
43473    xmlChar * subset; /* string content of the DTD */
43474    int n_subset;
43475
43476    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43477    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43478    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43479    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43480    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
43481        mem_base = xmlMemBlocks();
43482        writer = gen_xmlTextWriterPtr(n_writer, 0);
43483        name = gen_const_xmlChar_ptr(n_name, 1);
43484        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43485        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43486        subset = gen_const_xmlChar_ptr(n_subset, 4);
43487
43488        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
43489        desret_int(ret_val);
43490        call_tests++;
43491        des_xmlTextWriterPtr(n_writer, writer, 0);
43492        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43493        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43494        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43495        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
43496        xmlResetLastError();
43497        if (mem_base != xmlMemBlocks()) {
43498            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
43499	           xmlMemBlocks() - mem_base);
43500	    test_ret++;
43501            printf(" %d", n_writer);
43502            printf(" %d", n_name);
43503            printf(" %d", n_pubid);
43504            printf(" %d", n_sysid);
43505            printf(" %d", n_subset);
43506            printf("\n");
43507        }
43508    }
43509    }
43510    }
43511    }
43512    }
43513    function_tests++;
43514#endif
43515
43516    return(test_ret);
43517}
43518
43519
43520static int
43521test_xmlTextWriterWriteDTDAttlist(void) {
43522    int test_ret = 0;
43523
43524#if defined(LIBXML_WRITER_ENABLED)
43525    int mem_base;
43526    int ret_val;
43527    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43528    int n_writer;
43529    xmlChar * name; /* the name of the DTD ATTLIST */
43530    int n_name;
43531    xmlChar * content; /* content of the ATTLIST */
43532    int n_content;
43533
43534    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43535    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43536    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43537        mem_base = xmlMemBlocks();
43538        writer = gen_xmlTextWriterPtr(n_writer, 0);
43539        name = gen_const_xmlChar_ptr(n_name, 1);
43540        content = gen_const_xmlChar_ptr(n_content, 2);
43541
43542        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
43543        desret_int(ret_val);
43544        call_tests++;
43545        des_xmlTextWriterPtr(n_writer, writer, 0);
43546        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43547        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43548        xmlResetLastError();
43549        if (mem_base != xmlMemBlocks()) {
43550            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
43551	           xmlMemBlocks() - mem_base);
43552	    test_ret++;
43553            printf(" %d", n_writer);
43554            printf(" %d", n_name);
43555            printf(" %d", n_content);
43556            printf("\n");
43557        }
43558    }
43559    }
43560    }
43561    function_tests++;
43562#endif
43563
43564    return(test_ret);
43565}
43566
43567
43568static int
43569test_xmlTextWriterWriteDTDElement(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; /* the name of the DTD element */
43578    int n_name;
43579    xmlChar * content; /* content of the element */
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 = xmlTextWriterWriteDTDElement(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 xmlTextWriterWriteDTDElement",
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_xmlTextWriterWriteDTDEntity(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    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43626    int n_pe;
43627    xmlChar * name; /* the name of the DTD entity */
43628    int n_name;
43629    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43630    int n_pubid;
43631    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43632    int n_sysid;
43633    xmlChar * ndataid; /* the xml notation name. */
43634    int n_ndataid;
43635    xmlChar * content; /* content of the entity */
43636    int n_content;
43637
43638    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43639    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43640    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43641    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43642    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43643    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
43644    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43645        mem_base = xmlMemBlocks();
43646        writer = gen_xmlTextWriterPtr(n_writer, 0);
43647        pe = gen_int(n_pe, 1);
43648        name = gen_const_xmlChar_ptr(n_name, 2);
43649        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
43650        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
43651        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
43652        content = gen_const_xmlChar_ptr(n_content, 6);
43653
43654        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
43655        desret_int(ret_val);
43656        call_tests++;
43657        des_xmlTextWriterPtr(n_writer, writer, 0);
43658        des_int(n_pe, pe, 1);
43659        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43660        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
43661        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
43662        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
43663        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
43664        xmlResetLastError();
43665        if (mem_base != xmlMemBlocks()) {
43666            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
43667	           xmlMemBlocks() - mem_base);
43668	    test_ret++;
43669            printf(" %d", n_writer);
43670            printf(" %d", n_pe);
43671            printf(" %d", n_name);
43672            printf(" %d", n_pubid);
43673            printf(" %d", n_sysid);
43674            printf(" %d", n_ndataid);
43675            printf(" %d", n_content);
43676            printf("\n");
43677        }
43678    }
43679    }
43680    }
43681    }
43682    }
43683    }
43684    }
43685    function_tests++;
43686#endif
43687
43688    return(test_ret);
43689}
43690
43691
43692static int
43693test_xmlTextWriterWriteDTDExternalEntity(void) {
43694    int test_ret = 0;
43695
43696#if defined(LIBXML_WRITER_ENABLED)
43697    int mem_base;
43698    int ret_val;
43699    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43700    int n_writer;
43701    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43702    int n_pe;
43703    xmlChar * name; /* the name of the DTD entity */
43704    int n_name;
43705    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43706    int n_pubid;
43707    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43708    int n_sysid;
43709    xmlChar * ndataid; /* the xml notation name. */
43710    int n_ndataid;
43711
43712    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43713    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43714    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43715    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43716    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43717    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
43718        mem_base = xmlMemBlocks();
43719        writer = gen_xmlTextWriterPtr(n_writer, 0);
43720        pe = gen_int(n_pe, 1);
43721        name = gen_const_xmlChar_ptr(n_name, 2);
43722        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
43723        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
43724        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
43725
43726        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
43727        desret_int(ret_val);
43728        call_tests++;
43729        des_xmlTextWriterPtr(n_writer, writer, 0);
43730        des_int(n_pe, pe, 1);
43731        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43732        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
43733        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
43734        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
43735        xmlResetLastError();
43736        if (mem_base != xmlMemBlocks()) {
43737            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
43738	           xmlMemBlocks() - mem_base);
43739	    test_ret++;
43740            printf(" %d", n_writer);
43741            printf(" %d", n_pe);
43742            printf(" %d", n_name);
43743            printf(" %d", n_pubid);
43744            printf(" %d", n_sysid);
43745            printf(" %d", n_ndataid);
43746            printf("\n");
43747        }
43748    }
43749    }
43750    }
43751    }
43752    }
43753    }
43754    function_tests++;
43755#endif
43756
43757    return(test_ret);
43758}
43759
43760
43761static int
43762test_xmlTextWriterWriteDTDExternalEntityContents(void) {
43763    int test_ret = 0;
43764
43765#if defined(LIBXML_WRITER_ENABLED)
43766    int mem_base;
43767    int ret_val;
43768    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43769    int n_writer;
43770    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43771    int n_pubid;
43772    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43773    int n_sysid;
43774    xmlChar * ndataid; /* the xml notation name. */
43775    int n_ndataid;
43776
43777    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43778    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43779    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43780    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
43781        mem_base = xmlMemBlocks();
43782        writer = gen_xmlTextWriterPtr(n_writer, 0);
43783        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
43784        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
43785        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
43786
43787        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
43788        desret_int(ret_val);
43789        call_tests++;
43790        des_xmlTextWriterPtr(n_writer, writer, 0);
43791        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
43792        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
43793        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
43794        xmlResetLastError();
43795        if (mem_base != xmlMemBlocks()) {
43796            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
43797	           xmlMemBlocks() - mem_base);
43798	    test_ret++;
43799            printf(" %d", n_writer);
43800            printf(" %d", n_pubid);
43801            printf(" %d", n_sysid);
43802            printf(" %d", n_ndataid);
43803            printf("\n");
43804        }
43805    }
43806    }
43807    }
43808    }
43809    function_tests++;
43810#endif
43811
43812    return(test_ret);
43813}
43814
43815
43816static int
43817test_xmlTextWriterWriteDTDInternalEntity(void) {
43818    int test_ret = 0;
43819
43820#if defined(LIBXML_WRITER_ENABLED)
43821    int mem_base;
43822    int ret_val;
43823    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43824    int n_writer;
43825    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43826    int n_pe;
43827    xmlChar * name; /* the name of the DTD entity */
43828    int n_name;
43829    xmlChar * content; /* content of the entity */
43830    int n_content;
43831
43832    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43833    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43834    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43835    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43836        mem_base = xmlMemBlocks();
43837        writer = gen_xmlTextWriterPtr(n_writer, 0);
43838        pe = gen_int(n_pe, 1);
43839        name = gen_const_xmlChar_ptr(n_name, 2);
43840        content = gen_const_xmlChar_ptr(n_content, 3);
43841
43842        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
43843        desret_int(ret_val);
43844        call_tests++;
43845        des_xmlTextWriterPtr(n_writer, writer, 0);
43846        des_int(n_pe, pe, 1);
43847        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43848        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
43849        xmlResetLastError();
43850        if (mem_base != xmlMemBlocks()) {
43851            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
43852	           xmlMemBlocks() - mem_base);
43853	    test_ret++;
43854            printf(" %d", n_writer);
43855            printf(" %d", n_pe);
43856            printf(" %d", n_name);
43857            printf(" %d", n_content);
43858            printf("\n");
43859        }
43860    }
43861    }
43862    }
43863    }
43864    function_tests++;
43865#endif
43866
43867    return(test_ret);
43868}
43869
43870
43871static int
43872test_xmlTextWriterWriteDTDNotation(void) {
43873    int test_ret = 0;
43874
43875#if defined(LIBXML_WRITER_ENABLED)
43876    int mem_base;
43877    int ret_val;
43878    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43879    int n_writer;
43880    xmlChar * name; /* the name of the xml notation */
43881    int n_name;
43882    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43883    int n_pubid;
43884    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43885    int n_sysid;
43886
43887    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43888    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43889    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43890    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43891        mem_base = xmlMemBlocks();
43892        writer = gen_xmlTextWriterPtr(n_writer, 0);
43893        name = gen_const_xmlChar_ptr(n_name, 1);
43894        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43895        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43896
43897        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43898        desret_int(ret_val);
43899        call_tests++;
43900        des_xmlTextWriterPtr(n_writer, writer, 0);
43901        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43902        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43903        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43904        xmlResetLastError();
43905        if (mem_base != xmlMemBlocks()) {
43906            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
43907	           xmlMemBlocks() - mem_base);
43908	    test_ret++;
43909            printf(" %d", n_writer);
43910            printf(" %d", n_name);
43911            printf(" %d", n_pubid);
43912            printf(" %d", n_sysid);
43913            printf("\n");
43914        }
43915    }
43916    }
43917    }
43918    }
43919    function_tests++;
43920#endif
43921
43922    return(test_ret);
43923}
43924
43925
43926static int
43927test_xmlTextWriterWriteElement(void) {
43928    int test_ret = 0;
43929
43930#if defined(LIBXML_WRITER_ENABLED)
43931    int mem_base;
43932    int ret_val;
43933    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43934    int n_writer;
43935    xmlChar * name; /* element name */
43936    int n_name;
43937    xmlChar * content; /* element content */
43938    int n_content;
43939
43940    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43941    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43942    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43943        mem_base = xmlMemBlocks();
43944        writer = gen_xmlTextWriterPtr(n_writer, 0);
43945        name = gen_const_xmlChar_ptr(n_name, 1);
43946        content = gen_const_xmlChar_ptr(n_content, 2);
43947
43948        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
43949        desret_int(ret_val);
43950        call_tests++;
43951        des_xmlTextWriterPtr(n_writer, writer, 0);
43952        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43953        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43954        xmlResetLastError();
43955        if (mem_base != xmlMemBlocks()) {
43956            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
43957	           xmlMemBlocks() - mem_base);
43958	    test_ret++;
43959            printf(" %d", n_writer);
43960            printf(" %d", n_name);
43961            printf(" %d", n_content);
43962            printf("\n");
43963        }
43964    }
43965    }
43966    }
43967    function_tests++;
43968#endif
43969
43970    return(test_ret);
43971}
43972
43973
43974static int
43975test_xmlTextWriterWriteElementNS(void) {
43976    int test_ret = 0;
43977
43978#if defined(LIBXML_WRITER_ENABLED)
43979    int mem_base;
43980    int ret_val;
43981    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43982    int n_writer;
43983    xmlChar * prefix; /* namespace prefix */
43984    int n_prefix;
43985    xmlChar * name; /* element local name */
43986    int n_name;
43987    xmlChar * namespaceURI; /* namespace URI */
43988    int n_namespaceURI;
43989    xmlChar * content; /* element content */
43990    int n_content;
43991
43992    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43993    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43994    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43995    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
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        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44000        name = gen_const_xmlChar_ptr(n_name, 2);
44001        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44002        content = gen_const_xmlChar_ptr(n_content, 4);
44003
44004        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44005        desret_int(ret_val);
44006        call_tests++;
44007        des_xmlTextWriterPtr(n_writer, writer, 0);
44008        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44009        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44010        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44011        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44012        xmlResetLastError();
44013        if (mem_base != xmlMemBlocks()) {
44014            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44015	           xmlMemBlocks() - mem_base);
44016	    test_ret++;
44017            printf(" %d", n_writer);
44018            printf(" %d", n_prefix);
44019            printf(" %d", n_name);
44020            printf(" %d", n_namespaceURI);
44021            printf(" %d", n_content);
44022            printf("\n");
44023        }
44024    }
44025    }
44026    }
44027    }
44028    }
44029    function_tests++;
44030#endif
44031
44032    return(test_ret);
44033}
44034
44035
44036static int
44037test_xmlTextWriterWriteFormatAttribute(void) {
44038    int test_ret = 0;
44039
44040
44041    /* missing type support */
44042    return(test_ret);
44043}
44044
44045
44046static int
44047test_xmlTextWriterWriteFormatAttributeNS(void) {
44048    int test_ret = 0;
44049
44050
44051    /* missing type support */
44052    return(test_ret);
44053}
44054
44055
44056static int
44057test_xmlTextWriterWriteFormatCDATA(void) {
44058    int test_ret = 0;
44059
44060
44061    /* missing type support */
44062    return(test_ret);
44063}
44064
44065
44066static int
44067test_xmlTextWriterWriteFormatComment(void) {
44068    int test_ret = 0;
44069
44070
44071    /* missing type support */
44072    return(test_ret);
44073}
44074
44075
44076static int
44077test_xmlTextWriterWriteFormatDTD(void) {
44078    int test_ret = 0;
44079
44080
44081    /* missing type support */
44082    return(test_ret);
44083}
44084
44085
44086static int
44087test_xmlTextWriterWriteFormatDTDAttlist(void) {
44088    int test_ret = 0;
44089
44090
44091    /* missing type support */
44092    return(test_ret);
44093}
44094
44095
44096static int
44097test_xmlTextWriterWriteFormatDTDElement(void) {
44098    int test_ret = 0;
44099
44100
44101    /* missing type support */
44102    return(test_ret);
44103}
44104
44105
44106static int
44107test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44108    int test_ret = 0;
44109
44110
44111    /* missing type support */
44112    return(test_ret);
44113}
44114
44115
44116static int
44117test_xmlTextWriterWriteFormatElement(void) {
44118    int test_ret = 0;
44119
44120
44121    /* missing type support */
44122    return(test_ret);
44123}
44124
44125
44126static int
44127test_xmlTextWriterWriteFormatElementNS(void) {
44128    int test_ret = 0;
44129
44130
44131    /* missing type support */
44132    return(test_ret);
44133}
44134
44135
44136static int
44137test_xmlTextWriterWriteFormatPI(void) {
44138    int test_ret = 0;
44139
44140
44141    /* missing type support */
44142    return(test_ret);
44143}
44144
44145
44146static int
44147test_xmlTextWriterWriteFormatRaw(void) {
44148    int test_ret = 0;
44149
44150
44151    /* missing type support */
44152    return(test_ret);
44153}
44154
44155
44156static int
44157test_xmlTextWriterWriteFormatString(void) {
44158    int test_ret = 0;
44159
44160
44161    /* missing type support */
44162    return(test_ret);
44163}
44164
44165
44166static int
44167test_xmlTextWriterWritePI(void) {
44168    int test_ret = 0;
44169
44170#if defined(LIBXML_WRITER_ENABLED)
44171    int mem_base;
44172    int ret_val;
44173    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44174    int n_writer;
44175    xmlChar * target; /* PI target */
44176    int n_target;
44177    xmlChar * content; /* PI content */
44178    int n_content;
44179
44180    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44181    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44182    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44183        mem_base = xmlMemBlocks();
44184        writer = gen_xmlTextWriterPtr(n_writer, 0);
44185        target = gen_const_xmlChar_ptr(n_target, 1);
44186        content = gen_const_xmlChar_ptr(n_content, 2);
44187
44188        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44189        desret_int(ret_val);
44190        call_tests++;
44191        des_xmlTextWriterPtr(n_writer, writer, 0);
44192        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44193        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44194        xmlResetLastError();
44195        if (mem_base != xmlMemBlocks()) {
44196            printf("Leak of %d blocks found in xmlTextWriterWritePI",
44197	           xmlMemBlocks() - mem_base);
44198	    test_ret++;
44199            printf(" %d", n_writer);
44200            printf(" %d", n_target);
44201            printf(" %d", n_content);
44202            printf("\n");
44203        }
44204    }
44205    }
44206    }
44207    function_tests++;
44208#endif
44209
44210    return(test_ret);
44211}
44212
44213
44214static int
44215test_xmlTextWriterWriteRaw(void) {
44216    int test_ret = 0;
44217
44218#if defined(LIBXML_WRITER_ENABLED)
44219    int mem_base;
44220    int ret_val;
44221    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44222    int n_writer;
44223    xmlChar * content; /* text string */
44224    int n_content;
44225
44226    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44227    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44228        mem_base = xmlMemBlocks();
44229        writer = gen_xmlTextWriterPtr(n_writer, 0);
44230        content = gen_const_xmlChar_ptr(n_content, 1);
44231
44232        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44233        desret_int(ret_val);
44234        call_tests++;
44235        des_xmlTextWriterPtr(n_writer, writer, 0);
44236        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44237        xmlResetLastError();
44238        if (mem_base != xmlMemBlocks()) {
44239            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44240	           xmlMemBlocks() - mem_base);
44241	    test_ret++;
44242            printf(" %d", n_writer);
44243            printf(" %d", n_content);
44244            printf("\n");
44245        }
44246    }
44247    }
44248    function_tests++;
44249#endif
44250
44251    return(test_ret);
44252}
44253
44254
44255static int
44256test_xmlTextWriterWriteRawLen(void) {
44257    int test_ret = 0;
44258
44259#if defined(LIBXML_WRITER_ENABLED)
44260    int mem_base;
44261    int ret_val;
44262    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44263    int n_writer;
44264    xmlChar * content; /* text string */
44265    int n_content;
44266    int len; /* length of the text string */
44267    int n_len;
44268
44269    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44270    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44271    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44272        mem_base = xmlMemBlocks();
44273        writer = gen_xmlTextWriterPtr(n_writer, 0);
44274        content = gen_const_xmlChar_ptr(n_content, 1);
44275        len = gen_int(n_len, 2);
44276
44277        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44278        desret_int(ret_val);
44279        call_tests++;
44280        des_xmlTextWriterPtr(n_writer, writer, 0);
44281        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44282        des_int(n_len, len, 2);
44283        xmlResetLastError();
44284        if (mem_base != xmlMemBlocks()) {
44285            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44286	           xmlMemBlocks() - mem_base);
44287	    test_ret++;
44288            printf(" %d", n_writer);
44289            printf(" %d", n_content);
44290            printf(" %d", n_len);
44291            printf("\n");
44292        }
44293    }
44294    }
44295    }
44296    function_tests++;
44297#endif
44298
44299    return(test_ret);
44300}
44301
44302
44303static int
44304test_xmlTextWriterWriteString(void) {
44305    int test_ret = 0;
44306
44307#if defined(LIBXML_WRITER_ENABLED)
44308    int mem_base;
44309    int ret_val;
44310    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44311    int n_writer;
44312    xmlChar * content; /* text string */
44313    int n_content;
44314
44315    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44316    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44317        mem_base = xmlMemBlocks();
44318        writer = gen_xmlTextWriterPtr(n_writer, 0);
44319        content = gen_const_xmlChar_ptr(n_content, 1);
44320
44321        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
44322        desret_int(ret_val);
44323        call_tests++;
44324        des_xmlTextWriterPtr(n_writer, writer, 0);
44325        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44326        xmlResetLastError();
44327        if (mem_base != xmlMemBlocks()) {
44328            printf("Leak of %d blocks found in xmlTextWriterWriteString",
44329	           xmlMemBlocks() - mem_base);
44330	    test_ret++;
44331            printf(" %d", n_writer);
44332            printf(" %d", n_content);
44333            printf("\n");
44334        }
44335    }
44336    }
44337    function_tests++;
44338#endif
44339
44340    return(test_ret);
44341}
44342
44343
44344static int
44345test_xmlTextWriterWriteVFormatAttribute(void) {
44346    int test_ret = 0;
44347
44348
44349    /* missing type support */
44350    return(test_ret);
44351}
44352
44353
44354static int
44355test_xmlTextWriterWriteVFormatAttributeNS(void) {
44356    int test_ret = 0;
44357
44358
44359    /* missing type support */
44360    return(test_ret);
44361}
44362
44363
44364static int
44365test_xmlTextWriterWriteVFormatCDATA(void) {
44366    int test_ret = 0;
44367
44368
44369    /* missing type support */
44370    return(test_ret);
44371}
44372
44373
44374static int
44375test_xmlTextWriterWriteVFormatComment(void) {
44376    int test_ret = 0;
44377
44378
44379    /* missing type support */
44380    return(test_ret);
44381}
44382
44383
44384static int
44385test_xmlTextWriterWriteVFormatDTD(void) {
44386    int test_ret = 0;
44387
44388
44389    /* missing type support */
44390    return(test_ret);
44391}
44392
44393
44394static int
44395test_xmlTextWriterWriteVFormatDTDAttlist(void) {
44396    int test_ret = 0;
44397
44398
44399    /* missing type support */
44400    return(test_ret);
44401}
44402
44403
44404static int
44405test_xmlTextWriterWriteVFormatDTDElement(void) {
44406    int test_ret = 0;
44407
44408
44409    /* missing type support */
44410    return(test_ret);
44411}
44412
44413
44414static int
44415test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
44416    int test_ret = 0;
44417
44418
44419    /* missing type support */
44420    return(test_ret);
44421}
44422
44423
44424static int
44425test_xmlTextWriterWriteVFormatElement(void) {
44426    int test_ret = 0;
44427
44428
44429    /* missing type support */
44430    return(test_ret);
44431}
44432
44433
44434static int
44435test_xmlTextWriterWriteVFormatElementNS(void) {
44436    int test_ret = 0;
44437
44438
44439    /* missing type support */
44440    return(test_ret);
44441}
44442
44443
44444static int
44445test_xmlTextWriterWriteVFormatPI(void) {
44446    int test_ret = 0;
44447
44448
44449    /* missing type support */
44450    return(test_ret);
44451}
44452
44453
44454static int
44455test_xmlTextWriterWriteVFormatRaw(void) {
44456    int test_ret = 0;
44457
44458
44459    /* missing type support */
44460    return(test_ret);
44461}
44462
44463
44464static int
44465test_xmlTextWriterWriteVFormatString(void) {
44466    int test_ret = 0;
44467
44468
44469    /* missing type support */
44470    return(test_ret);
44471}
44472
44473static int
44474test_xmlwriter(void) {
44475    int test_ret = 0;
44476
44477    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
44478    test_ret += test_xmlNewTextWriter();
44479    test_ret += test_xmlNewTextWriterFilename();
44480    test_ret += test_xmlNewTextWriterMemory();
44481    test_ret += test_xmlNewTextWriterPushParser();
44482    test_ret += test_xmlNewTextWriterTree();
44483    test_ret += test_xmlTextWriterEndAttribute();
44484    test_ret += test_xmlTextWriterEndCDATA();
44485    test_ret += test_xmlTextWriterEndComment();
44486    test_ret += test_xmlTextWriterEndDTD();
44487    test_ret += test_xmlTextWriterEndDTDAttlist();
44488    test_ret += test_xmlTextWriterEndDTDElement();
44489    test_ret += test_xmlTextWriterEndDTDEntity();
44490    test_ret += test_xmlTextWriterEndDocument();
44491    test_ret += test_xmlTextWriterEndElement();
44492    test_ret += test_xmlTextWriterEndPI();
44493    test_ret += test_xmlTextWriterFlush();
44494    test_ret += test_xmlTextWriterFullEndElement();
44495    test_ret += test_xmlTextWriterSetIndent();
44496    test_ret += test_xmlTextWriterSetIndentString();
44497    test_ret += test_xmlTextWriterStartAttribute();
44498    test_ret += test_xmlTextWriterStartAttributeNS();
44499    test_ret += test_xmlTextWriterStartCDATA();
44500    test_ret += test_xmlTextWriterStartComment();
44501    test_ret += test_xmlTextWriterStartDTD();
44502    test_ret += test_xmlTextWriterStartDTDAttlist();
44503    test_ret += test_xmlTextWriterStartDTDElement();
44504    test_ret += test_xmlTextWriterStartDTDEntity();
44505    test_ret += test_xmlTextWriterStartDocument();
44506    test_ret += test_xmlTextWriterStartElement();
44507    test_ret += test_xmlTextWriterStartElementNS();
44508    test_ret += test_xmlTextWriterStartPI();
44509    test_ret += test_xmlTextWriterWriteAttribute();
44510    test_ret += test_xmlTextWriterWriteAttributeNS();
44511    test_ret += test_xmlTextWriterWriteBase64();
44512    test_ret += test_xmlTextWriterWriteBinHex();
44513    test_ret += test_xmlTextWriterWriteCDATA();
44514    test_ret += test_xmlTextWriterWriteComment();
44515    test_ret += test_xmlTextWriterWriteDTD();
44516    test_ret += test_xmlTextWriterWriteDTDAttlist();
44517    test_ret += test_xmlTextWriterWriteDTDElement();
44518    test_ret += test_xmlTextWriterWriteDTDEntity();
44519    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
44520    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
44521    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
44522    test_ret += test_xmlTextWriterWriteDTDNotation();
44523    test_ret += test_xmlTextWriterWriteElement();
44524    test_ret += test_xmlTextWriterWriteElementNS();
44525    test_ret += test_xmlTextWriterWriteFormatAttribute();
44526    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
44527    test_ret += test_xmlTextWriterWriteFormatCDATA();
44528    test_ret += test_xmlTextWriterWriteFormatComment();
44529    test_ret += test_xmlTextWriterWriteFormatDTD();
44530    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
44531    test_ret += test_xmlTextWriterWriteFormatDTDElement();
44532    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
44533    test_ret += test_xmlTextWriterWriteFormatElement();
44534    test_ret += test_xmlTextWriterWriteFormatElementNS();
44535    test_ret += test_xmlTextWriterWriteFormatPI();
44536    test_ret += test_xmlTextWriterWriteFormatRaw();
44537    test_ret += test_xmlTextWriterWriteFormatString();
44538    test_ret += test_xmlTextWriterWritePI();
44539    test_ret += test_xmlTextWriterWriteRaw();
44540    test_ret += test_xmlTextWriterWriteRawLen();
44541    test_ret += test_xmlTextWriterWriteString();
44542    test_ret += test_xmlTextWriterWriteVFormatAttribute();
44543    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
44544    test_ret += test_xmlTextWriterWriteVFormatCDATA();
44545    test_ret += test_xmlTextWriterWriteVFormatComment();
44546    test_ret += test_xmlTextWriterWriteVFormatDTD();
44547    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
44548    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
44549    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
44550    test_ret += test_xmlTextWriterWriteVFormatElement();
44551    test_ret += test_xmlTextWriterWriteVFormatElementNS();
44552    test_ret += test_xmlTextWriterWriteVFormatPI();
44553    test_ret += test_xmlTextWriterWriteVFormatRaw();
44554    test_ret += test_xmlTextWriterWriteVFormatString();
44555
44556    if (test_ret != 0)
44557	printf("Module xmlwriter: %d errors\n", test_ret);
44558    return(test_ret);
44559}
44560
44561static int
44562test_xmlXPathCastBooleanToNumber(void) {
44563    int test_ret = 0;
44564
44565#if defined(LIBXML_XPATH_ENABLED)
44566    int mem_base;
44567    double ret_val;
44568    int val; /* a boolean */
44569    int n_val;
44570
44571    for (n_val = 0;n_val < gen_nb_int;n_val++) {
44572        mem_base = xmlMemBlocks();
44573        val = gen_int(n_val, 0);
44574
44575        ret_val = xmlXPathCastBooleanToNumber(val);
44576        desret_double(ret_val);
44577        call_tests++;
44578        des_int(n_val, val, 0);
44579        xmlResetLastError();
44580        if (mem_base != xmlMemBlocks()) {
44581            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
44582	           xmlMemBlocks() - mem_base);
44583	    test_ret++;
44584            printf(" %d", n_val);
44585            printf("\n");
44586        }
44587    }
44588    function_tests++;
44589#endif
44590
44591    return(test_ret);
44592}
44593
44594
44595static int
44596test_xmlXPathCastBooleanToString(void) {
44597    int test_ret = 0;
44598
44599#if defined(LIBXML_XPATH_ENABLED)
44600    int mem_base;
44601    xmlChar * ret_val;
44602    int val; /* a boolean */
44603    int n_val;
44604
44605    for (n_val = 0;n_val < gen_nb_int;n_val++) {
44606        mem_base = xmlMemBlocks();
44607        val = gen_int(n_val, 0);
44608
44609        ret_val = xmlXPathCastBooleanToString(val);
44610        desret_xmlChar_ptr(ret_val);
44611        call_tests++;
44612        des_int(n_val, val, 0);
44613        xmlResetLastError();
44614        if (mem_base != xmlMemBlocks()) {
44615            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
44616	           xmlMemBlocks() - mem_base);
44617	    test_ret++;
44618            printf(" %d", n_val);
44619            printf("\n");
44620        }
44621    }
44622    function_tests++;
44623#endif
44624
44625    return(test_ret);
44626}
44627
44628
44629static int
44630test_xmlXPathCastNodeSetToBoolean(void) {
44631    int test_ret = 0;
44632
44633#if defined(LIBXML_XPATH_ENABLED)
44634    int mem_base;
44635    int ret_val;
44636    xmlNodeSetPtr ns; /* a node-set */
44637    int n_ns;
44638
44639    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
44640        mem_base = xmlMemBlocks();
44641        ns = gen_xmlNodeSetPtr(n_ns, 0);
44642
44643        ret_val = xmlXPathCastNodeSetToBoolean(ns);
44644        desret_int(ret_val);
44645        call_tests++;
44646        des_xmlNodeSetPtr(n_ns, ns, 0);
44647        xmlResetLastError();
44648        if (mem_base != xmlMemBlocks()) {
44649            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
44650	           xmlMemBlocks() - mem_base);
44651	    test_ret++;
44652            printf(" %d", n_ns);
44653            printf("\n");
44654        }
44655    }
44656    function_tests++;
44657#endif
44658
44659    return(test_ret);
44660}
44661
44662
44663static int
44664test_xmlXPathCastNodeSetToNumber(void) {
44665    int test_ret = 0;
44666
44667#if defined(LIBXML_XPATH_ENABLED)
44668    int mem_base;
44669    double ret_val;
44670    xmlNodeSetPtr ns; /* a node-set */
44671    int n_ns;
44672
44673    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
44674        mem_base = xmlMemBlocks();
44675        ns = gen_xmlNodeSetPtr(n_ns, 0);
44676
44677        ret_val = xmlXPathCastNodeSetToNumber(ns);
44678        desret_double(ret_val);
44679        call_tests++;
44680        des_xmlNodeSetPtr(n_ns, ns, 0);
44681        xmlResetLastError();
44682        if (mem_base != xmlMemBlocks()) {
44683            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
44684	           xmlMemBlocks() - mem_base);
44685	    test_ret++;
44686            printf(" %d", n_ns);
44687            printf("\n");
44688        }
44689    }
44690    function_tests++;
44691#endif
44692
44693    return(test_ret);
44694}
44695
44696
44697static int
44698test_xmlXPathCastNodeSetToString(void) {
44699    int test_ret = 0;
44700
44701#if defined(LIBXML_XPATH_ENABLED)
44702    int mem_base;
44703    xmlChar * ret_val;
44704    xmlNodeSetPtr ns; /* a node-set */
44705    int n_ns;
44706
44707    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
44708        mem_base = xmlMemBlocks();
44709        ns = gen_xmlNodeSetPtr(n_ns, 0);
44710
44711        ret_val = xmlXPathCastNodeSetToString(ns);
44712        desret_xmlChar_ptr(ret_val);
44713        call_tests++;
44714        des_xmlNodeSetPtr(n_ns, ns, 0);
44715        xmlResetLastError();
44716        if (mem_base != xmlMemBlocks()) {
44717            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
44718	           xmlMemBlocks() - mem_base);
44719	    test_ret++;
44720            printf(" %d", n_ns);
44721            printf("\n");
44722        }
44723    }
44724    function_tests++;
44725#endif
44726
44727    return(test_ret);
44728}
44729
44730
44731static int
44732test_xmlXPathCastNodeToNumber(void) {
44733    int test_ret = 0;
44734
44735#if defined(LIBXML_XPATH_ENABLED)
44736    int mem_base;
44737    double ret_val;
44738    xmlNodePtr node; /* a node */
44739    int n_node;
44740
44741    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
44742        mem_base = xmlMemBlocks();
44743        node = gen_xmlNodePtr(n_node, 0);
44744
44745        ret_val = xmlXPathCastNodeToNumber(node);
44746        desret_double(ret_val);
44747        call_tests++;
44748        des_xmlNodePtr(n_node, node, 0);
44749        xmlResetLastError();
44750        if (mem_base != xmlMemBlocks()) {
44751            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
44752	           xmlMemBlocks() - mem_base);
44753	    test_ret++;
44754            printf(" %d", n_node);
44755            printf("\n");
44756        }
44757    }
44758    function_tests++;
44759#endif
44760
44761    return(test_ret);
44762}
44763
44764
44765static int
44766test_xmlXPathCastNodeToString(void) {
44767    int test_ret = 0;
44768
44769#if defined(LIBXML_XPATH_ENABLED)
44770    int mem_base;
44771    xmlChar * ret_val;
44772    xmlNodePtr node; /* a node */
44773    int n_node;
44774
44775    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
44776        mem_base = xmlMemBlocks();
44777        node = gen_xmlNodePtr(n_node, 0);
44778
44779        ret_val = xmlXPathCastNodeToString(node);
44780        desret_xmlChar_ptr(ret_val);
44781        call_tests++;
44782        des_xmlNodePtr(n_node, node, 0);
44783        xmlResetLastError();
44784        if (mem_base != xmlMemBlocks()) {
44785            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
44786	           xmlMemBlocks() - mem_base);
44787	    test_ret++;
44788            printf(" %d", n_node);
44789            printf("\n");
44790        }
44791    }
44792    function_tests++;
44793#endif
44794
44795    return(test_ret);
44796}
44797
44798
44799static int
44800test_xmlXPathCastNumberToBoolean(void) {
44801    int test_ret = 0;
44802
44803#if defined(LIBXML_XPATH_ENABLED)
44804    int mem_base;
44805    int ret_val;
44806    double val; /* a number */
44807    int n_val;
44808
44809    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44810        mem_base = xmlMemBlocks();
44811        val = gen_double(n_val, 0);
44812
44813        ret_val = xmlXPathCastNumberToBoolean(val);
44814        desret_int(ret_val);
44815        call_tests++;
44816        des_double(n_val, val, 0);
44817        xmlResetLastError();
44818        if (mem_base != xmlMemBlocks()) {
44819            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
44820	           xmlMemBlocks() - mem_base);
44821	    test_ret++;
44822            printf(" %d", n_val);
44823            printf("\n");
44824        }
44825    }
44826    function_tests++;
44827#endif
44828
44829    return(test_ret);
44830}
44831
44832
44833static int
44834test_xmlXPathCastNumberToString(void) {
44835    int test_ret = 0;
44836
44837#if defined(LIBXML_XPATH_ENABLED)
44838    int mem_base;
44839    xmlChar * ret_val;
44840    double val; /* a number */
44841    int n_val;
44842
44843    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44844        mem_base = xmlMemBlocks();
44845        val = gen_double(n_val, 0);
44846
44847        ret_val = xmlXPathCastNumberToString(val);
44848        desret_xmlChar_ptr(ret_val);
44849        call_tests++;
44850        des_double(n_val, val, 0);
44851        xmlResetLastError();
44852        if (mem_base != xmlMemBlocks()) {
44853            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
44854	           xmlMemBlocks() - mem_base);
44855	    test_ret++;
44856            printf(" %d", n_val);
44857            printf("\n");
44858        }
44859    }
44860    function_tests++;
44861#endif
44862
44863    return(test_ret);
44864}
44865
44866
44867static int
44868test_xmlXPathCastStringToBoolean(void) {
44869    int test_ret = 0;
44870
44871#if defined(LIBXML_XPATH_ENABLED)
44872    int mem_base;
44873    int ret_val;
44874    xmlChar * val; /* a string */
44875    int n_val;
44876
44877    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
44878        mem_base = xmlMemBlocks();
44879        val = gen_const_xmlChar_ptr(n_val, 0);
44880
44881        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
44882        desret_int(ret_val);
44883        call_tests++;
44884        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
44885        xmlResetLastError();
44886        if (mem_base != xmlMemBlocks()) {
44887            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
44888	           xmlMemBlocks() - mem_base);
44889	    test_ret++;
44890            printf(" %d", n_val);
44891            printf("\n");
44892        }
44893    }
44894    function_tests++;
44895#endif
44896
44897    return(test_ret);
44898}
44899
44900
44901static int
44902test_xmlXPathCastStringToNumber(void) {
44903    int test_ret = 0;
44904
44905#if defined(LIBXML_XPATH_ENABLED)
44906    int mem_base;
44907    double ret_val;
44908    xmlChar * val; /* a string */
44909    int n_val;
44910
44911    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
44912        mem_base = xmlMemBlocks();
44913        val = gen_const_xmlChar_ptr(n_val, 0);
44914
44915        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
44916        desret_double(ret_val);
44917        call_tests++;
44918        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
44919        xmlResetLastError();
44920        if (mem_base != xmlMemBlocks()) {
44921            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
44922	           xmlMemBlocks() - mem_base);
44923	    test_ret++;
44924            printf(" %d", n_val);
44925            printf("\n");
44926        }
44927    }
44928    function_tests++;
44929#endif
44930
44931    return(test_ret);
44932}
44933
44934
44935static int
44936test_xmlXPathCastToBoolean(void) {
44937    int test_ret = 0;
44938
44939#if defined(LIBXML_XPATH_ENABLED)
44940    int mem_base;
44941    int ret_val;
44942    xmlXPathObjectPtr val; /* an XPath object */
44943    int n_val;
44944
44945    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
44946        mem_base = xmlMemBlocks();
44947        val = gen_xmlXPathObjectPtr(n_val, 0);
44948
44949        ret_val = xmlXPathCastToBoolean(val);
44950        desret_int(ret_val);
44951        call_tests++;
44952        des_xmlXPathObjectPtr(n_val, val, 0);
44953        xmlResetLastError();
44954        if (mem_base != xmlMemBlocks()) {
44955            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
44956	           xmlMemBlocks() - mem_base);
44957	    test_ret++;
44958            printf(" %d", n_val);
44959            printf("\n");
44960        }
44961    }
44962    function_tests++;
44963#endif
44964
44965    return(test_ret);
44966}
44967
44968
44969static int
44970test_xmlXPathCastToNumber(void) {
44971    int test_ret = 0;
44972
44973#if defined(LIBXML_XPATH_ENABLED)
44974    int mem_base;
44975    double ret_val;
44976    xmlXPathObjectPtr val; /* an XPath object */
44977    int n_val;
44978
44979    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
44980        mem_base = xmlMemBlocks();
44981        val = gen_xmlXPathObjectPtr(n_val, 0);
44982
44983        ret_val = xmlXPathCastToNumber(val);
44984        desret_double(ret_val);
44985        call_tests++;
44986        des_xmlXPathObjectPtr(n_val, val, 0);
44987        xmlResetLastError();
44988        if (mem_base != xmlMemBlocks()) {
44989            printf("Leak of %d blocks found in xmlXPathCastToNumber",
44990	           xmlMemBlocks() - mem_base);
44991	    test_ret++;
44992            printf(" %d", n_val);
44993            printf("\n");
44994        }
44995    }
44996    function_tests++;
44997#endif
44998
44999    return(test_ret);
45000}
45001
45002
45003static int
45004test_xmlXPathCastToString(void) {
45005    int test_ret = 0;
45006
45007#if defined(LIBXML_XPATH_ENABLED)
45008    int mem_base;
45009    xmlChar * ret_val;
45010    xmlXPathObjectPtr val; /* an XPath object */
45011    int n_val;
45012
45013    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45014        mem_base = xmlMemBlocks();
45015        val = gen_xmlXPathObjectPtr(n_val, 0);
45016
45017        ret_val = xmlXPathCastToString(val);
45018        desret_xmlChar_ptr(ret_val);
45019        call_tests++;
45020        des_xmlXPathObjectPtr(n_val, val, 0);
45021        xmlResetLastError();
45022        if (mem_base != xmlMemBlocks()) {
45023            printf("Leak of %d blocks found in xmlXPathCastToString",
45024	           xmlMemBlocks() - mem_base);
45025	    test_ret++;
45026            printf(" %d", n_val);
45027            printf("\n");
45028        }
45029    }
45030    function_tests++;
45031#endif
45032
45033    return(test_ret);
45034}
45035
45036
45037static int
45038test_xmlXPathCmpNodes(void) {
45039    int test_ret = 0;
45040
45041#if defined(LIBXML_XPATH_ENABLED)
45042    int mem_base;
45043    int ret_val;
45044    xmlNodePtr node1; /* the first node */
45045    int n_node1;
45046    xmlNodePtr node2; /* the second node */
45047    int n_node2;
45048
45049    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45050    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45051        mem_base = xmlMemBlocks();
45052        node1 = gen_xmlNodePtr(n_node1, 0);
45053        node2 = gen_xmlNodePtr(n_node2, 1);
45054
45055        ret_val = xmlXPathCmpNodes(node1, node2);
45056        desret_int(ret_val);
45057        call_tests++;
45058        des_xmlNodePtr(n_node1, node1, 0);
45059        des_xmlNodePtr(n_node2, node2, 1);
45060        xmlResetLastError();
45061        if (mem_base != xmlMemBlocks()) {
45062            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45063	           xmlMemBlocks() - mem_base);
45064	    test_ret++;
45065            printf(" %d", n_node1);
45066            printf(" %d", n_node2);
45067            printf("\n");
45068        }
45069    }
45070    }
45071    function_tests++;
45072#endif
45073
45074    return(test_ret);
45075}
45076
45077
45078static int
45079test_xmlXPathCompile(void) {
45080    int test_ret = 0;
45081
45082
45083    /* missing type support */
45084    return(test_ret);
45085}
45086
45087#ifdef LIBXML_XPATH_ENABLED
45088
45089#define gen_nb_xmlXPathCompExprPtr 1
45090static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45091    return(NULL);
45092}
45093static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45094}
45095#endif
45096
45097#ifdef LIBXML_XPATH_ENABLED
45098
45099#define gen_nb_xmlXPathContextPtr 1
45100static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45101    return(NULL);
45102}
45103static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45104}
45105#endif
45106
45107
45108static int
45109test_xmlXPathCompiledEval(void) {
45110    int test_ret = 0;
45111
45112#if defined(LIBXML_XPATH_ENABLED)
45113    int mem_base;
45114    xmlXPathObjectPtr ret_val;
45115    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45116    int n_comp;
45117    xmlXPathContextPtr ctx; /* the XPath context */
45118    int n_ctx;
45119
45120    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45121    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45122        mem_base = xmlMemBlocks();
45123        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45124        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45125
45126        ret_val = xmlXPathCompiledEval(comp, ctx);
45127        desret_xmlXPathObjectPtr(ret_val);
45128        call_tests++;
45129        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45130        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45131        xmlResetLastError();
45132        if (mem_base != xmlMemBlocks()) {
45133            printf("Leak of %d blocks found in xmlXPathCompiledEval",
45134	           xmlMemBlocks() - mem_base);
45135	    test_ret++;
45136            printf(" %d", n_comp);
45137            printf(" %d", n_ctx);
45138            printf("\n");
45139        }
45140    }
45141    }
45142    function_tests++;
45143#endif
45144
45145    return(test_ret);
45146}
45147
45148
45149static int
45150test_xmlXPathConvertBoolean(void) {
45151    int test_ret = 0;
45152
45153#if defined(LIBXML_XPATH_ENABLED)
45154    int mem_base;
45155    xmlXPathObjectPtr ret_val;
45156    xmlXPathObjectPtr val; /* an XPath object */
45157    int n_val;
45158
45159    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45160        mem_base = xmlMemBlocks();
45161        val = gen_xmlXPathObjectPtr(n_val, 0);
45162
45163        ret_val = xmlXPathConvertBoolean(val);
45164        val = NULL;
45165        desret_xmlXPathObjectPtr(ret_val);
45166        call_tests++;
45167        des_xmlXPathObjectPtr(n_val, val, 0);
45168        xmlResetLastError();
45169        if (mem_base != xmlMemBlocks()) {
45170            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45171	           xmlMemBlocks() - mem_base);
45172	    test_ret++;
45173            printf(" %d", n_val);
45174            printf("\n");
45175        }
45176    }
45177    function_tests++;
45178#endif
45179
45180    return(test_ret);
45181}
45182
45183
45184static int
45185test_xmlXPathConvertNumber(void) {
45186    int test_ret = 0;
45187
45188#if defined(LIBXML_XPATH_ENABLED)
45189    int mem_base;
45190    xmlXPathObjectPtr ret_val;
45191    xmlXPathObjectPtr val; /* an XPath object */
45192    int n_val;
45193
45194    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45195        mem_base = xmlMemBlocks();
45196        val = gen_xmlXPathObjectPtr(n_val, 0);
45197
45198        ret_val = xmlXPathConvertNumber(val);
45199        val = NULL;
45200        desret_xmlXPathObjectPtr(ret_val);
45201        call_tests++;
45202        des_xmlXPathObjectPtr(n_val, val, 0);
45203        xmlResetLastError();
45204        if (mem_base != xmlMemBlocks()) {
45205            printf("Leak of %d blocks found in xmlXPathConvertNumber",
45206	           xmlMemBlocks() - mem_base);
45207	    test_ret++;
45208            printf(" %d", n_val);
45209            printf("\n");
45210        }
45211    }
45212    function_tests++;
45213#endif
45214
45215    return(test_ret);
45216}
45217
45218
45219static int
45220test_xmlXPathConvertString(void) {
45221    int test_ret = 0;
45222
45223#if defined(LIBXML_XPATH_ENABLED)
45224    int mem_base;
45225    xmlXPathObjectPtr ret_val;
45226    xmlXPathObjectPtr val; /* an XPath object */
45227    int n_val;
45228
45229    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45230        mem_base = xmlMemBlocks();
45231        val = gen_xmlXPathObjectPtr(n_val, 0);
45232
45233        ret_val = xmlXPathConvertString(val);
45234        val = NULL;
45235        desret_xmlXPathObjectPtr(ret_val);
45236        call_tests++;
45237        des_xmlXPathObjectPtr(n_val, val, 0);
45238        xmlResetLastError();
45239        if (mem_base != xmlMemBlocks()) {
45240            printf("Leak of %d blocks found in xmlXPathConvertString",
45241	           xmlMemBlocks() - mem_base);
45242	    test_ret++;
45243            printf(" %d", n_val);
45244            printf("\n");
45245        }
45246    }
45247    function_tests++;
45248#endif
45249
45250    return(test_ret);
45251}
45252
45253
45254static int
45255test_xmlXPathCtxtCompile(void) {
45256    int test_ret = 0;
45257
45258
45259    /* missing type support */
45260    return(test_ret);
45261}
45262
45263
45264static int
45265test_xmlXPathEval(void) {
45266    int test_ret = 0;
45267
45268#if defined(LIBXML_XPATH_ENABLED)
45269    int mem_base;
45270    xmlXPathObjectPtr ret_val;
45271    xmlChar * str; /* the XPath expression */
45272    int n_str;
45273    xmlXPathContextPtr ctx; /* the XPath context */
45274    int n_ctx;
45275
45276    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45277    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45278        mem_base = xmlMemBlocks();
45279        str = gen_const_xmlChar_ptr(n_str, 0);
45280        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45281
45282        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
45283        desret_xmlXPathObjectPtr(ret_val);
45284        call_tests++;
45285        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
45286        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45287        xmlResetLastError();
45288        if (mem_base != xmlMemBlocks()) {
45289            printf("Leak of %d blocks found in xmlXPathEval",
45290	           xmlMemBlocks() - mem_base);
45291	    test_ret++;
45292            printf(" %d", n_str);
45293            printf(" %d", n_ctx);
45294            printf("\n");
45295        }
45296    }
45297    }
45298    function_tests++;
45299#endif
45300
45301    return(test_ret);
45302}
45303
45304
45305static int
45306test_xmlXPathEvalExpression(void) {
45307    int test_ret = 0;
45308
45309#if defined(LIBXML_XPATH_ENABLED)
45310    int mem_base;
45311    xmlXPathObjectPtr ret_val;
45312    xmlChar * str; /* the XPath expression */
45313    int n_str;
45314    xmlXPathContextPtr ctxt; /* the XPath context */
45315    int n_ctxt;
45316
45317    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45318    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45319        mem_base = xmlMemBlocks();
45320        str = gen_const_xmlChar_ptr(n_str, 0);
45321        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45322
45323        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
45324        desret_xmlXPathObjectPtr(ret_val);
45325        call_tests++;
45326        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
45327        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45328        xmlResetLastError();
45329        if (mem_base != xmlMemBlocks()) {
45330            printf("Leak of %d blocks found in xmlXPathEvalExpression",
45331	           xmlMemBlocks() - mem_base);
45332	    test_ret++;
45333            printf(" %d", n_str);
45334            printf(" %d", n_ctxt);
45335            printf("\n");
45336        }
45337    }
45338    }
45339    function_tests++;
45340#endif
45341
45342    return(test_ret);
45343}
45344
45345
45346static int
45347test_xmlXPathEvalPredicate(void) {
45348    int test_ret = 0;
45349
45350#if defined(LIBXML_XPATH_ENABLED)
45351    int mem_base;
45352    int ret_val;
45353    xmlXPathContextPtr ctxt; /* the XPath context */
45354    int n_ctxt;
45355    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
45356    int n_res;
45357
45358    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45359    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
45360        mem_base = xmlMemBlocks();
45361        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45362        res = gen_xmlXPathObjectPtr(n_res, 1);
45363
45364        ret_val = xmlXPathEvalPredicate(ctxt, res);
45365        desret_int(ret_val);
45366        call_tests++;
45367        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45368        des_xmlXPathObjectPtr(n_res, res, 1);
45369        xmlResetLastError();
45370        if (mem_base != xmlMemBlocks()) {
45371            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
45372	           xmlMemBlocks() - mem_base);
45373	    test_ret++;
45374            printf(" %d", n_ctxt);
45375            printf(" %d", n_res);
45376            printf("\n");
45377        }
45378    }
45379    }
45380    function_tests++;
45381#endif
45382
45383    return(test_ret);
45384}
45385
45386
45387static int
45388test_xmlXPathInit(void) {
45389    int test_ret = 0;
45390
45391#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45392    int mem_base;
45393
45394        mem_base = xmlMemBlocks();
45395
45396        xmlXPathInit();
45397        call_tests++;
45398        xmlResetLastError();
45399        if (mem_base != xmlMemBlocks()) {
45400            printf("Leak of %d blocks found in xmlXPathInit",
45401	           xmlMemBlocks() - mem_base);
45402	    test_ret++;
45403            printf("\n");
45404        }
45405    function_tests++;
45406#endif
45407
45408    return(test_ret);
45409}
45410
45411
45412static int
45413test_xmlXPathIsInf(void) {
45414    int test_ret = 0;
45415
45416#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45417    int mem_base;
45418    int ret_val;
45419    double val; /* a double value */
45420    int n_val;
45421
45422    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45423        mem_base = xmlMemBlocks();
45424        val = gen_double(n_val, 0);
45425
45426        ret_val = xmlXPathIsInf(val);
45427        desret_int(ret_val);
45428        call_tests++;
45429        des_double(n_val, val, 0);
45430        xmlResetLastError();
45431        if (mem_base != xmlMemBlocks()) {
45432            printf("Leak of %d blocks found in xmlXPathIsInf",
45433	           xmlMemBlocks() - mem_base);
45434	    test_ret++;
45435            printf(" %d", n_val);
45436            printf("\n");
45437        }
45438    }
45439    function_tests++;
45440#endif
45441
45442    return(test_ret);
45443}
45444
45445
45446static int
45447test_xmlXPathIsNaN(void) {
45448    int test_ret = 0;
45449
45450#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45451    int mem_base;
45452    int ret_val;
45453    double val; /* a double value */
45454    int n_val;
45455
45456    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45457        mem_base = xmlMemBlocks();
45458        val = gen_double(n_val, 0);
45459
45460        ret_val = xmlXPathIsNaN(val);
45461        desret_int(ret_val);
45462        call_tests++;
45463        des_double(n_val, val, 0);
45464        xmlResetLastError();
45465        if (mem_base != xmlMemBlocks()) {
45466            printf("Leak of %d blocks found in xmlXPathIsNaN",
45467	           xmlMemBlocks() - mem_base);
45468	    test_ret++;
45469            printf(" %d", n_val);
45470            printf("\n");
45471        }
45472    }
45473    function_tests++;
45474#endif
45475
45476    return(test_ret);
45477}
45478
45479
45480static int
45481test_xmlXPathNewContext(void) {
45482    int test_ret = 0;
45483
45484
45485    /* missing type support */
45486    return(test_ret);
45487}
45488
45489
45490static int
45491test_xmlXPathNodeSetCreate(void) {
45492    int test_ret = 0;
45493
45494#if defined(LIBXML_XPATH_ENABLED)
45495    int mem_base;
45496    xmlNodeSetPtr ret_val;
45497    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
45498    int n_val;
45499
45500    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45501        mem_base = xmlMemBlocks();
45502        val = gen_xmlNodePtr(n_val, 0);
45503
45504        ret_val = xmlXPathNodeSetCreate(val);
45505        desret_xmlNodeSetPtr(ret_val);
45506        call_tests++;
45507        des_xmlNodePtr(n_val, val, 0);
45508        xmlResetLastError();
45509        if (mem_base != xmlMemBlocks()) {
45510            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
45511	           xmlMemBlocks() - mem_base);
45512	    test_ret++;
45513            printf(" %d", n_val);
45514            printf("\n");
45515        }
45516    }
45517    function_tests++;
45518#endif
45519
45520    return(test_ret);
45521}
45522
45523
45524static int
45525test_xmlXPathObjectCopy(void) {
45526    int test_ret = 0;
45527
45528#if defined(LIBXML_XPATH_ENABLED)
45529    int mem_base;
45530    xmlXPathObjectPtr ret_val;
45531    xmlXPathObjectPtr val; /* the original object */
45532    int n_val;
45533
45534    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45535        mem_base = xmlMemBlocks();
45536        val = gen_xmlXPathObjectPtr(n_val, 0);
45537
45538        ret_val = xmlXPathObjectCopy(val);
45539        desret_xmlXPathObjectPtr(ret_val);
45540        call_tests++;
45541        des_xmlXPathObjectPtr(n_val, val, 0);
45542        xmlResetLastError();
45543        if (mem_base != xmlMemBlocks()) {
45544            printf("Leak of %d blocks found in xmlXPathObjectCopy",
45545	           xmlMemBlocks() - mem_base);
45546	    test_ret++;
45547            printf(" %d", n_val);
45548            printf("\n");
45549        }
45550    }
45551    function_tests++;
45552#endif
45553
45554    return(test_ret);
45555}
45556
45557
45558static int
45559test_xmlXPathOrderDocElems(void) {
45560    int test_ret = 0;
45561
45562#if defined(LIBXML_XPATH_ENABLED)
45563    int mem_base;
45564    long ret_val;
45565    xmlDocPtr doc; /* an input document */
45566    int n_doc;
45567
45568    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
45569        mem_base = xmlMemBlocks();
45570        doc = gen_xmlDocPtr(n_doc, 0);
45571
45572        ret_val = xmlXPathOrderDocElems(doc);
45573        desret_long(ret_val);
45574        call_tests++;
45575        des_xmlDocPtr(n_doc, doc, 0);
45576        xmlResetLastError();
45577        if (mem_base != xmlMemBlocks()) {
45578            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
45579	           xmlMemBlocks() - mem_base);
45580	    test_ret++;
45581            printf(" %d", n_doc);
45582            printf("\n");
45583        }
45584    }
45585    function_tests++;
45586#endif
45587
45588    return(test_ret);
45589}
45590
45591static int
45592test_xpath(void) {
45593    int test_ret = 0;
45594
45595    if (quiet == 0) printf("Testing xpath : 28 of 36 functions ...\n");
45596    test_ret += test_xmlXPathCastBooleanToNumber();
45597    test_ret += test_xmlXPathCastBooleanToString();
45598    test_ret += test_xmlXPathCastNodeSetToBoolean();
45599    test_ret += test_xmlXPathCastNodeSetToNumber();
45600    test_ret += test_xmlXPathCastNodeSetToString();
45601    test_ret += test_xmlXPathCastNodeToNumber();
45602    test_ret += test_xmlXPathCastNodeToString();
45603    test_ret += test_xmlXPathCastNumberToBoolean();
45604    test_ret += test_xmlXPathCastNumberToString();
45605    test_ret += test_xmlXPathCastStringToBoolean();
45606    test_ret += test_xmlXPathCastStringToNumber();
45607    test_ret += test_xmlXPathCastToBoolean();
45608    test_ret += test_xmlXPathCastToNumber();
45609    test_ret += test_xmlXPathCastToString();
45610    test_ret += test_xmlXPathCmpNodes();
45611    test_ret += test_xmlXPathCompile();
45612    test_ret += test_xmlXPathCompiledEval();
45613    test_ret += test_xmlXPathConvertBoolean();
45614    test_ret += test_xmlXPathConvertNumber();
45615    test_ret += test_xmlXPathConvertString();
45616    test_ret += test_xmlXPathCtxtCompile();
45617    test_ret += test_xmlXPathEval();
45618    test_ret += test_xmlXPathEvalExpression();
45619    test_ret += test_xmlXPathEvalPredicate();
45620    test_ret += test_xmlXPathInit();
45621    test_ret += test_xmlXPathIsInf();
45622    test_ret += test_xmlXPathIsNaN();
45623    test_ret += test_xmlXPathNewContext();
45624    test_ret += test_xmlXPathNodeSetCreate();
45625    test_ret += test_xmlXPathObjectCopy();
45626    test_ret += test_xmlXPathOrderDocElems();
45627
45628    if (test_ret != 0)
45629	printf("Module xpath: %d errors\n", test_ret);
45630    return(test_ret);
45631}
45632#ifdef LIBXML_XPATH_ENABLED
45633
45634#define gen_nb_xmlXPathParserContextPtr 1
45635static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45636    return(NULL);
45637}
45638static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45639}
45640#endif
45641
45642
45643static int
45644test_valuePop(void) {
45645    int test_ret = 0;
45646
45647#if defined(LIBXML_XPATH_ENABLED)
45648    int mem_base;
45649    xmlXPathObjectPtr ret_val;
45650    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
45651    int n_ctxt;
45652
45653    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45654        mem_base = xmlMemBlocks();
45655        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45656
45657        ret_val = valuePop(ctxt);
45658        desret_xmlXPathObjectPtr(ret_val);
45659        call_tests++;
45660        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45661        xmlResetLastError();
45662        if (mem_base != xmlMemBlocks()) {
45663            printf("Leak of %d blocks found in valuePop",
45664	           xmlMemBlocks() - mem_base);
45665	    test_ret++;
45666            printf(" %d", n_ctxt);
45667            printf("\n");
45668        }
45669    }
45670    function_tests++;
45671#endif
45672
45673    return(test_ret);
45674}
45675
45676
45677static int
45678test_valuePush(void) {
45679    int test_ret = 0;
45680
45681#if defined(LIBXML_XPATH_ENABLED)
45682    int mem_base;
45683    int ret_val;
45684    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
45685    int n_ctxt;
45686    xmlXPathObjectPtr value; /* the XPath object */
45687    int n_value;
45688
45689    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45690    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
45691        mem_base = xmlMemBlocks();
45692        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45693        value = gen_xmlXPathObjectPtr(n_value, 1);
45694
45695        ret_val = valuePush(ctxt, value);
45696        desret_int(ret_val);
45697        call_tests++;
45698        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45699        des_xmlXPathObjectPtr(n_value, value, 1);
45700        xmlResetLastError();
45701        if (mem_base != xmlMemBlocks()) {
45702            printf("Leak of %d blocks found in valuePush",
45703	           xmlMemBlocks() - mem_base);
45704	    test_ret++;
45705            printf(" %d", n_ctxt);
45706            printf(" %d", n_value);
45707            printf("\n");
45708        }
45709    }
45710    }
45711    function_tests++;
45712#endif
45713
45714    return(test_ret);
45715}
45716
45717
45718static int
45719test_xmlXPathAddValues(void) {
45720    int test_ret = 0;
45721
45722#if defined(LIBXML_XPATH_ENABLED)
45723    int mem_base;
45724    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45725    int n_ctxt;
45726
45727    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45728        mem_base = xmlMemBlocks();
45729        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45730
45731        xmlXPathAddValues(ctxt);
45732        call_tests++;
45733        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45734        xmlResetLastError();
45735        if (mem_base != xmlMemBlocks()) {
45736            printf("Leak of %d blocks found in xmlXPathAddValues",
45737	           xmlMemBlocks() - mem_base);
45738	    test_ret++;
45739            printf(" %d", n_ctxt);
45740            printf("\n");
45741        }
45742    }
45743    function_tests++;
45744#endif
45745
45746    return(test_ret);
45747}
45748
45749
45750static int
45751test_xmlXPathBooleanFunction(void) {
45752    int test_ret = 0;
45753
45754#if defined(LIBXML_XPATH_ENABLED)
45755    int mem_base;
45756    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45757    int n_ctxt;
45758    int nargs; /* the number of arguments */
45759    int n_nargs;
45760
45761    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45762    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45763        mem_base = xmlMemBlocks();
45764        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45765        nargs = gen_int(n_nargs, 1);
45766
45767        xmlXPathBooleanFunction(ctxt, nargs);
45768        call_tests++;
45769        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45770        des_int(n_nargs, nargs, 1);
45771        xmlResetLastError();
45772        if (mem_base != xmlMemBlocks()) {
45773            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
45774	           xmlMemBlocks() - mem_base);
45775	    test_ret++;
45776            printf(" %d", n_ctxt);
45777            printf(" %d", n_nargs);
45778            printf("\n");
45779        }
45780    }
45781    }
45782    function_tests++;
45783#endif
45784
45785    return(test_ret);
45786}
45787
45788
45789static int
45790test_xmlXPathCeilingFunction(void) {
45791    int test_ret = 0;
45792
45793#if defined(LIBXML_XPATH_ENABLED)
45794    int mem_base;
45795    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45796    int n_ctxt;
45797    int nargs; /* the number of arguments */
45798    int n_nargs;
45799
45800    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45801    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45802        mem_base = xmlMemBlocks();
45803        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45804        nargs = gen_int(n_nargs, 1);
45805
45806        xmlXPathCeilingFunction(ctxt, nargs);
45807        call_tests++;
45808        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45809        des_int(n_nargs, nargs, 1);
45810        xmlResetLastError();
45811        if (mem_base != xmlMemBlocks()) {
45812            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
45813	           xmlMemBlocks() - mem_base);
45814	    test_ret++;
45815            printf(" %d", n_ctxt);
45816            printf(" %d", n_nargs);
45817            printf("\n");
45818        }
45819    }
45820    }
45821    function_tests++;
45822#endif
45823
45824    return(test_ret);
45825}
45826
45827
45828static int
45829test_xmlXPathCompareValues(void) {
45830    int test_ret = 0;
45831
45832#if defined(LIBXML_XPATH_ENABLED)
45833    int mem_base;
45834    int ret_val;
45835    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45836    int n_ctxt;
45837    int inf; /* less than (1) or greater than (0) */
45838    int n_inf;
45839    int strict; /* is the comparison strict */
45840    int n_strict;
45841
45842    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45843    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
45844    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
45845        mem_base = xmlMemBlocks();
45846        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45847        inf = gen_int(n_inf, 1);
45848        strict = gen_int(n_strict, 2);
45849
45850        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
45851        desret_int(ret_val);
45852        call_tests++;
45853        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45854        des_int(n_inf, inf, 1);
45855        des_int(n_strict, strict, 2);
45856        xmlResetLastError();
45857        if (mem_base != xmlMemBlocks()) {
45858            printf("Leak of %d blocks found in xmlXPathCompareValues",
45859	           xmlMemBlocks() - mem_base);
45860	    test_ret++;
45861            printf(" %d", n_ctxt);
45862            printf(" %d", n_inf);
45863            printf(" %d", n_strict);
45864            printf("\n");
45865        }
45866    }
45867    }
45868    }
45869    function_tests++;
45870#endif
45871
45872    return(test_ret);
45873}
45874
45875
45876static int
45877test_xmlXPathConcatFunction(void) {
45878    int test_ret = 0;
45879
45880#if defined(LIBXML_XPATH_ENABLED)
45881    int mem_base;
45882    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45883    int n_ctxt;
45884    int nargs; /* the number of arguments */
45885    int n_nargs;
45886
45887    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45888    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45889        mem_base = xmlMemBlocks();
45890        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45891        nargs = gen_int(n_nargs, 1);
45892
45893        xmlXPathConcatFunction(ctxt, nargs);
45894        call_tests++;
45895        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45896        des_int(n_nargs, nargs, 1);
45897        xmlResetLastError();
45898        if (mem_base != xmlMemBlocks()) {
45899            printf("Leak of %d blocks found in xmlXPathConcatFunction",
45900	           xmlMemBlocks() - mem_base);
45901	    test_ret++;
45902            printf(" %d", n_ctxt);
45903            printf(" %d", n_nargs);
45904            printf("\n");
45905        }
45906    }
45907    }
45908    function_tests++;
45909#endif
45910
45911    return(test_ret);
45912}
45913
45914
45915static int
45916test_xmlXPathContainsFunction(void) {
45917    int test_ret = 0;
45918
45919#if defined(LIBXML_XPATH_ENABLED)
45920    int mem_base;
45921    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45922    int n_ctxt;
45923    int nargs; /* the number of arguments */
45924    int n_nargs;
45925
45926    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45927    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45928        mem_base = xmlMemBlocks();
45929        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45930        nargs = gen_int(n_nargs, 1);
45931
45932        xmlXPathContainsFunction(ctxt, nargs);
45933        call_tests++;
45934        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45935        des_int(n_nargs, nargs, 1);
45936        xmlResetLastError();
45937        if (mem_base != xmlMemBlocks()) {
45938            printf("Leak of %d blocks found in xmlXPathContainsFunction",
45939	           xmlMemBlocks() - mem_base);
45940	    test_ret++;
45941            printf(" %d", n_ctxt);
45942            printf(" %d", n_nargs);
45943            printf("\n");
45944        }
45945    }
45946    }
45947    function_tests++;
45948#endif
45949
45950    return(test_ret);
45951}
45952
45953
45954static int
45955test_xmlXPathCountFunction(void) {
45956    int test_ret = 0;
45957
45958#if defined(LIBXML_XPATH_ENABLED)
45959    int mem_base;
45960    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45961    int n_ctxt;
45962    int nargs; /* the number of arguments */
45963    int n_nargs;
45964
45965    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45966    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45967        mem_base = xmlMemBlocks();
45968        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45969        nargs = gen_int(n_nargs, 1);
45970
45971        xmlXPathCountFunction(ctxt, nargs);
45972        call_tests++;
45973        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45974        des_int(n_nargs, nargs, 1);
45975        xmlResetLastError();
45976        if (mem_base != xmlMemBlocks()) {
45977            printf("Leak of %d blocks found in xmlXPathCountFunction",
45978	           xmlMemBlocks() - mem_base);
45979	    test_ret++;
45980            printf(" %d", n_ctxt);
45981            printf(" %d", n_nargs);
45982            printf("\n");
45983        }
45984    }
45985    }
45986    function_tests++;
45987#endif
45988
45989    return(test_ret);
45990}
45991
45992
45993static int
45994test_xmlXPathDebugDumpCompExpr(void) {
45995    int test_ret = 0;
45996
45997#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
45998    int mem_base;
45999    FILE * output; /* the FILE * for the output */
46000    int n_output;
46001    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46002    int n_comp;
46003    int depth; /* the indentation level. */
46004    int n_depth;
46005
46006    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46007    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46008    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46009        mem_base = xmlMemBlocks();
46010        output = gen_FILE_ptr(n_output, 0);
46011        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46012        depth = gen_int(n_depth, 2);
46013
46014        xmlXPathDebugDumpCompExpr(output, comp, depth);
46015        call_tests++;
46016        des_FILE_ptr(n_output, output, 0);
46017        des_xmlXPathCompExprPtr(n_comp, comp, 1);
46018        des_int(n_depth, depth, 2);
46019        xmlResetLastError();
46020        if (mem_base != xmlMemBlocks()) {
46021            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46022	           xmlMemBlocks() - mem_base);
46023	    test_ret++;
46024            printf(" %d", n_output);
46025            printf(" %d", n_comp);
46026            printf(" %d", n_depth);
46027            printf("\n");
46028        }
46029    }
46030    }
46031    }
46032    function_tests++;
46033#endif
46034
46035    return(test_ret);
46036}
46037
46038
46039static int
46040test_xmlXPathDebugDumpObject(void) {
46041    int test_ret = 0;
46042
46043#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46044    int mem_base;
46045    FILE * output; /* the FILE * to dump the output */
46046    int n_output;
46047    xmlXPathObjectPtr cur; /* the object to inspect */
46048    int n_cur;
46049    int depth; /* indentation level */
46050    int n_depth;
46051
46052    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46053    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46054    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46055        mem_base = xmlMemBlocks();
46056        output = gen_FILE_ptr(n_output, 0);
46057        cur = gen_xmlXPathObjectPtr(n_cur, 1);
46058        depth = gen_int(n_depth, 2);
46059
46060        xmlXPathDebugDumpObject(output, cur, depth);
46061        call_tests++;
46062        des_FILE_ptr(n_output, output, 0);
46063        des_xmlXPathObjectPtr(n_cur, cur, 1);
46064        des_int(n_depth, depth, 2);
46065        xmlResetLastError();
46066        if (mem_base != xmlMemBlocks()) {
46067            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46068	           xmlMemBlocks() - mem_base);
46069	    test_ret++;
46070            printf(" %d", n_output);
46071            printf(" %d", n_cur);
46072            printf(" %d", n_depth);
46073            printf("\n");
46074        }
46075    }
46076    }
46077    }
46078    function_tests++;
46079#endif
46080
46081    return(test_ret);
46082}
46083
46084
46085static int
46086test_xmlXPathDifference(void) {
46087    int test_ret = 0;
46088
46089#if defined(LIBXML_XPATH_ENABLED)
46090    int mem_base;
46091    xmlNodeSetPtr ret_val;
46092    xmlNodeSetPtr nodes1; /* a node-set */
46093    int n_nodes1;
46094    xmlNodeSetPtr nodes2; /* a node-set */
46095    int n_nodes2;
46096
46097    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46098    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46099        mem_base = xmlMemBlocks();
46100        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46101        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46102
46103        ret_val = xmlXPathDifference(nodes1, nodes2);
46104        desret_xmlNodeSetPtr(ret_val);
46105        call_tests++;
46106        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46107        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46108        xmlResetLastError();
46109        if (mem_base != xmlMemBlocks()) {
46110            printf("Leak of %d blocks found in xmlXPathDifference",
46111	           xmlMemBlocks() - mem_base);
46112	    test_ret++;
46113            printf(" %d", n_nodes1);
46114            printf(" %d", n_nodes2);
46115            printf("\n");
46116        }
46117    }
46118    }
46119    function_tests++;
46120#endif
46121
46122    return(test_ret);
46123}
46124
46125
46126static int
46127test_xmlXPathDistinct(void) {
46128    int test_ret = 0;
46129
46130#if defined(LIBXML_XPATH_ENABLED)
46131    int mem_base;
46132    xmlNodeSetPtr ret_val;
46133    xmlNodeSetPtr nodes; /* a node-set */
46134    int n_nodes;
46135
46136    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46137        mem_base = xmlMemBlocks();
46138        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46139
46140        ret_val = xmlXPathDistinct(nodes);
46141        desret_xmlNodeSetPtr(ret_val);
46142        call_tests++;
46143        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46144        xmlResetLastError();
46145        if (mem_base != xmlMemBlocks()) {
46146            printf("Leak of %d blocks found in xmlXPathDistinct",
46147	           xmlMemBlocks() - mem_base);
46148	    test_ret++;
46149            printf(" %d", n_nodes);
46150            printf("\n");
46151        }
46152    }
46153    function_tests++;
46154#endif
46155
46156    return(test_ret);
46157}
46158
46159
46160static int
46161test_xmlXPathDistinctSorted(void) {
46162    int test_ret = 0;
46163
46164#if defined(LIBXML_XPATH_ENABLED)
46165    int mem_base;
46166    xmlNodeSetPtr ret_val;
46167    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46168    int n_nodes;
46169
46170    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46171        mem_base = xmlMemBlocks();
46172        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46173
46174        ret_val = xmlXPathDistinctSorted(nodes);
46175        desret_xmlNodeSetPtr(ret_val);
46176        call_tests++;
46177        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46178        xmlResetLastError();
46179        if (mem_base != xmlMemBlocks()) {
46180            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46181	           xmlMemBlocks() - mem_base);
46182	    test_ret++;
46183            printf(" %d", n_nodes);
46184            printf("\n");
46185        }
46186    }
46187    function_tests++;
46188#endif
46189
46190    return(test_ret);
46191}
46192
46193
46194static int
46195test_xmlXPathDivValues(void) {
46196    int test_ret = 0;
46197
46198#if defined(LIBXML_XPATH_ENABLED)
46199    int mem_base;
46200    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46201    int n_ctxt;
46202
46203    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46204        mem_base = xmlMemBlocks();
46205        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46206
46207        xmlXPathDivValues(ctxt);
46208        call_tests++;
46209        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46210        xmlResetLastError();
46211        if (mem_base != xmlMemBlocks()) {
46212            printf("Leak of %d blocks found in xmlXPathDivValues",
46213	           xmlMemBlocks() - mem_base);
46214	    test_ret++;
46215            printf(" %d", n_ctxt);
46216            printf("\n");
46217        }
46218    }
46219    function_tests++;
46220#endif
46221
46222    return(test_ret);
46223}
46224
46225
46226static int
46227test_xmlXPathEqualValues(void) {
46228    int test_ret = 0;
46229
46230#if defined(LIBXML_XPATH_ENABLED)
46231    int mem_base;
46232    int ret_val;
46233    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46234    int n_ctxt;
46235
46236    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46237        mem_base = xmlMemBlocks();
46238        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46239
46240        ret_val = xmlXPathEqualValues(ctxt);
46241        desret_int(ret_val);
46242        call_tests++;
46243        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46244        xmlResetLastError();
46245        if (mem_base != xmlMemBlocks()) {
46246            printf("Leak of %d blocks found in xmlXPathEqualValues",
46247	           xmlMemBlocks() - mem_base);
46248	    test_ret++;
46249            printf(" %d", n_ctxt);
46250            printf("\n");
46251        }
46252    }
46253    function_tests++;
46254#endif
46255
46256    return(test_ret);
46257}
46258
46259
46260static int
46261test_xmlXPathErr(void) {
46262    int test_ret = 0;
46263
46264#if defined(LIBXML_XPATH_ENABLED)
46265    int mem_base;
46266    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
46267    int n_ctxt;
46268    int error; /* the error code */
46269    int n_error;
46270
46271    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46272    for (n_error = 0;n_error < gen_nb_int;n_error++) {
46273        mem_base = xmlMemBlocks();
46274        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46275        error = gen_int(n_error, 1);
46276
46277        xmlXPathErr(ctxt, error);
46278        call_tests++;
46279        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46280        des_int(n_error, error, 1);
46281        xmlResetLastError();
46282        if (mem_base != xmlMemBlocks()) {
46283            printf("Leak of %d blocks found in xmlXPathErr",
46284	           xmlMemBlocks() - mem_base);
46285	    test_ret++;
46286            printf(" %d", n_ctxt);
46287            printf(" %d", n_error);
46288            printf("\n");
46289        }
46290    }
46291    }
46292    function_tests++;
46293#endif
46294
46295    return(test_ret);
46296}
46297
46298
46299static int
46300test_xmlXPathEvalExpr(void) {
46301    int test_ret = 0;
46302
46303#if defined(LIBXML_XPATH_ENABLED)
46304    int mem_base;
46305    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46306    int n_ctxt;
46307
46308    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46309        mem_base = xmlMemBlocks();
46310        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46311
46312        xmlXPathEvalExpr(ctxt);
46313        call_tests++;
46314        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46315        xmlResetLastError();
46316        if (mem_base != xmlMemBlocks()) {
46317            printf("Leak of %d blocks found in xmlXPathEvalExpr",
46318	           xmlMemBlocks() - mem_base);
46319	    test_ret++;
46320            printf(" %d", n_ctxt);
46321            printf("\n");
46322        }
46323    }
46324    function_tests++;
46325#endif
46326
46327    return(test_ret);
46328}
46329
46330
46331static int
46332test_xmlXPathEvaluatePredicateResult(void) {
46333    int test_ret = 0;
46334
46335#if defined(LIBXML_XPATH_ENABLED)
46336    int mem_base;
46337    int ret_val;
46338    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46339    int n_ctxt;
46340    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46341    int n_res;
46342
46343    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46344    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46345        mem_base = xmlMemBlocks();
46346        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46347        res = gen_xmlXPathObjectPtr(n_res, 1);
46348
46349        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
46350        desret_int(ret_val);
46351        call_tests++;
46352        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46353        des_xmlXPathObjectPtr(n_res, res, 1);
46354        xmlResetLastError();
46355        if (mem_base != xmlMemBlocks()) {
46356            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
46357	           xmlMemBlocks() - mem_base);
46358	    test_ret++;
46359            printf(" %d", n_ctxt);
46360            printf(" %d", n_res);
46361            printf("\n");
46362        }
46363    }
46364    }
46365    function_tests++;
46366#endif
46367
46368    return(test_ret);
46369}
46370
46371
46372static int
46373test_xmlXPathFalseFunction(void) {
46374    int test_ret = 0;
46375
46376#if defined(LIBXML_XPATH_ENABLED)
46377    int mem_base;
46378    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46379    int n_ctxt;
46380    int nargs; /* the number of arguments */
46381    int n_nargs;
46382
46383    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46384    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46385        mem_base = xmlMemBlocks();
46386        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46387        nargs = gen_int(n_nargs, 1);
46388
46389        xmlXPathFalseFunction(ctxt, nargs);
46390        call_tests++;
46391        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46392        des_int(n_nargs, nargs, 1);
46393        xmlResetLastError();
46394        if (mem_base != xmlMemBlocks()) {
46395            printf("Leak of %d blocks found in xmlXPathFalseFunction",
46396	           xmlMemBlocks() - mem_base);
46397	    test_ret++;
46398            printf(" %d", n_ctxt);
46399            printf(" %d", n_nargs);
46400            printf("\n");
46401        }
46402    }
46403    }
46404    function_tests++;
46405#endif
46406
46407    return(test_ret);
46408}
46409
46410
46411static int
46412test_xmlXPathFloorFunction(void) {
46413    int test_ret = 0;
46414
46415#if defined(LIBXML_XPATH_ENABLED)
46416    int mem_base;
46417    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46418    int n_ctxt;
46419    int nargs; /* the number of arguments */
46420    int n_nargs;
46421
46422    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46423    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46424        mem_base = xmlMemBlocks();
46425        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46426        nargs = gen_int(n_nargs, 1);
46427
46428        xmlXPathFloorFunction(ctxt, nargs);
46429        call_tests++;
46430        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46431        des_int(n_nargs, nargs, 1);
46432        xmlResetLastError();
46433        if (mem_base != xmlMemBlocks()) {
46434            printf("Leak of %d blocks found in xmlXPathFloorFunction",
46435	           xmlMemBlocks() - mem_base);
46436	    test_ret++;
46437            printf(" %d", n_ctxt);
46438            printf(" %d", n_nargs);
46439            printf("\n");
46440        }
46441    }
46442    }
46443    function_tests++;
46444#endif
46445
46446    return(test_ret);
46447}
46448
46449
46450static int
46451test_xmlXPathFunctionLookup(void) {
46452    int test_ret = 0;
46453
46454
46455    /* missing type support */
46456    return(test_ret);
46457}
46458
46459
46460static int
46461test_xmlXPathFunctionLookupNS(void) {
46462    int test_ret = 0;
46463
46464
46465    /* missing type support */
46466    return(test_ret);
46467}
46468
46469
46470static int
46471test_xmlXPathHasSameNodes(void) {
46472    int test_ret = 0;
46473
46474#if defined(LIBXML_XPATH_ENABLED)
46475    int mem_base;
46476    int ret_val;
46477    xmlNodeSetPtr nodes1; /* a node-set */
46478    int n_nodes1;
46479    xmlNodeSetPtr nodes2; /* a node-set */
46480    int n_nodes2;
46481
46482    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46483    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46484        mem_base = xmlMemBlocks();
46485        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46486        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46487
46488        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
46489        desret_int(ret_val);
46490        call_tests++;
46491        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46492        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46493        xmlResetLastError();
46494        if (mem_base != xmlMemBlocks()) {
46495            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
46496	           xmlMemBlocks() - mem_base);
46497	    test_ret++;
46498            printf(" %d", n_nodes1);
46499            printf(" %d", n_nodes2);
46500            printf("\n");
46501        }
46502    }
46503    }
46504    function_tests++;
46505#endif
46506
46507    return(test_ret);
46508}
46509
46510
46511static int
46512test_xmlXPathIdFunction(void) {
46513    int test_ret = 0;
46514
46515#if defined(LIBXML_XPATH_ENABLED)
46516    int mem_base;
46517    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46518    int n_ctxt;
46519    int nargs; /* the number of arguments */
46520    int n_nargs;
46521
46522    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46523    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46524        mem_base = xmlMemBlocks();
46525        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46526        nargs = gen_int(n_nargs, 1);
46527
46528        xmlXPathIdFunction(ctxt, nargs);
46529        call_tests++;
46530        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46531        des_int(n_nargs, nargs, 1);
46532        xmlResetLastError();
46533        if (mem_base != xmlMemBlocks()) {
46534            printf("Leak of %d blocks found in xmlXPathIdFunction",
46535	           xmlMemBlocks() - mem_base);
46536	    test_ret++;
46537            printf(" %d", n_ctxt);
46538            printf(" %d", n_nargs);
46539            printf("\n");
46540        }
46541    }
46542    }
46543    function_tests++;
46544#endif
46545
46546    return(test_ret);
46547}
46548
46549
46550static int
46551test_xmlXPathIntersection(void) {
46552    int test_ret = 0;
46553
46554#if defined(LIBXML_XPATH_ENABLED)
46555    int mem_base;
46556    xmlNodeSetPtr ret_val;
46557    xmlNodeSetPtr nodes1; /* a node-set */
46558    int n_nodes1;
46559    xmlNodeSetPtr nodes2; /* a node-set */
46560    int n_nodes2;
46561
46562    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46563    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46564        mem_base = xmlMemBlocks();
46565        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46566        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46567
46568        ret_val = xmlXPathIntersection(nodes1, nodes2);
46569        desret_xmlNodeSetPtr(ret_val);
46570        call_tests++;
46571        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46572        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46573        xmlResetLastError();
46574        if (mem_base != xmlMemBlocks()) {
46575            printf("Leak of %d blocks found in xmlXPathIntersection",
46576	           xmlMemBlocks() - mem_base);
46577	    test_ret++;
46578            printf(" %d", n_nodes1);
46579            printf(" %d", n_nodes2);
46580            printf("\n");
46581        }
46582    }
46583    }
46584    function_tests++;
46585#endif
46586
46587    return(test_ret);
46588}
46589
46590
46591static int
46592test_xmlXPathIsNodeType(void) {
46593    int test_ret = 0;
46594
46595#if defined(LIBXML_XPATH_ENABLED)
46596    int mem_base;
46597    int ret_val;
46598    xmlChar * name; /* a name string */
46599    int n_name;
46600
46601    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46602        mem_base = xmlMemBlocks();
46603        name = gen_const_xmlChar_ptr(n_name, 0);
46604
46605        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
46606        desret_int(ret_val);
46607        call_tests++;
46608        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
46609        xmlResetLastError();
46610        if (mem_base != xmlMemBlocks()) {
46611            printf("Leak of %d blocks found in xmlXPathIsNodeType",
46612	           xmlMemBlocks() - mem_base);
46613	    test_ret++;
46614            printf(" %d", n_name);
46615            printf("\n");
46616        }
46617    }
46618    function_tests++;
46619#endif
46620
46621    return(test_ret);
46622}
46623
46624
46625static int
46626test_xmlXPathLangFunction(void) {
46627    int test_ret = 0;
46628
46629#if defined(LIBXML_XPATH_ENABLED)
46630    int mem_base;
46631    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46632    int n_ctxt;
46633    int nargs; /* the number of arguments */
46634    int n_nargs;
46635
46636    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46637    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46638        mem_base = xmlMemBlocks();
46639        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46640        nargs = gen_int(n_nargs, 1);
46641
46642        xmlXPathLangFunction(ctxt, nargs);
46643        call_tests++;
46644        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46645        des_int(n_nargs, nargs, 1);
46646        xmlResetLastError();
46647        if (mem_base != xmlMemBlocks()) {
46648            printf("Leak of %d blocks found in xmlXPathLangFunction",
46649	           xmlMemBlocks() - mem_base);
46650	    test_ret++;
46651            printf(" %d", n_ctxt);
46652            printf(" %d", n_nargs);
46653            printf("\n");
46654        }
46655    }
46656    }
46657    function_tests++;
46658#endif
46659
46660    return(test_ret);
46661}
46662
46663
46664static int
46665test_xmlXPathLastFunction(void) {
46666    int test_ret = 0;
46667
46668#if defined(LIBXML_XPATH_ENABLED)
46669    int mem_base;
46670    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46671    int n_ctxt;
46672    int nargs; /* the number of arguments */
46673    int n_nargs;
46674
46675    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46676    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46677        mem_base = xmlMemBlocks();
46678        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46679        nargs = gen_int(n_nargs, 1);
46680
46681        xmlXPathLastFunction(ctxt, nargs);
46682        call_tests++;
46683        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46684        des_int(n_nargs, nargs, 1);
46685        xmlResetLastError();
46686        if (mem_base != xmlMemBlocks()) {
46687            printf("Leak of %d blocks found in xmlXPathLastFunction",
46688	           xmlMemBlocks() - mem_base);
46689	    test_ret++;
46690            printf(" %d", n_ctxt);
46691            printf(" %d", n_nargs);
46692            printf("\n");
46693        }
46694    }
46695    }
46696    function_tests++;
46697#endif
46698
46699    return(test_ret);
46700}
46701
46702
46703static int
46704test_xmlXPathLeading(void) {
46705    int test_ret = 0;
46706
46707#if defined(LIBXML_XPATH_ENABLED)
46708    int mem_base;
46709    xmlNodeSetPtr ret_val;
46710    xmlNodeSetPtr nodes1; /* a node-set */
46711    int n_nodes1;
46712    xmlNodeSetPtr nodes2; /* a node-set */
46713    int n_nodes2;
46714
46715    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46716    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46717        mem_base = xmlMemBlocks();
46718        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46719        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46720
46721        ret_val = xmlXPathLeading(nodes1, nodes2);
46722        desret_xmlNodeSetPtr(ret_val);
46723        call_tests++;
46724        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46725        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46726        xmlResetLastError();
46727        if (mem_base != xmlMemBlocks()) {
46728            printf("Leak of %d blocks found in xmlXPathLeading",
46729	           xmlMemBlocks() - mem_base);
46730	    test_ret++;
46731            printf(" %d", n_nodes1);
46732            printf(" %d", n_nodes2);
46733            printf("\n");
46734        }
46735    }
46736    }
46737    function_tests++;
46738#endif
46739
46740    return(test_ret);
46741}
46742
46743
46744static int
46745test_xmlXPathLeadingSorted(void) {
46746    int test_ret = 0;
46747
46748#if defined(LIBXML_XPATH_ENABLED)
46749    int mem_base;
46750    xmlNodeSetPtr ret_val;
46751    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
46752    int n_nodes1;
46753    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
46754    int n_nodes2;
46755
46756    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46757    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46758        mem_base = xmlMemBlocks();
46759        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46760        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46761
46762        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
46763        desret_xmlNodeSetPtr(ret_val);
46764        call_tests++;
46765        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46766        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46767        xmlResetLastError();
46768        if (mem_base != xmlMemBlocks()) {
46769            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
46770	           xmlMemBlocks() - mem_base);
46771	    test_ret++;
46772            printf(" %d", n_nodes1);
46773            printf(" %d", n_nodes2);
46774            printf("\n");
46775        }
46776    }
46777    }
46778    function_tests++;
46779#endif
46780
46781    return(test_ret);
46782}
46783
46784
46785static int
46786test_xmlXPathLocalNameFunction(void) {
46787    int test_ret = 0;
46788
46789#if defined(LIBXML_XPATH_ENABLED)
46790    int mem_base;
46791    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46792    int n_ctxt;
46793    int nargs; /* the number of arguments */
46794    int n_nargs;
46795
46796    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46797    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46798        mem_base = xmlMemBlocks();
46799        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46800        nargs = gen_int(n_nargs, 1);
46801
46802        xmlXPathLocalNameFunction(ctxt, nargs);
46803        call_tests++;
46804        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46805        des_int(n_nargs, nargs, 1);
46806        xmlResetLastError();
46807        if (mem_base != xmlMemBlocks()) {
46808            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
46809	           xmlMemBlocks() - mem_base);
46810	    test_ret++;
46811            printf(" %d", n_ctxt);
46812            printf(" %d", n_nargs);
46813            printf("\n");
46814        }
46815    }
46816    }
46817    function_tests++;
46818#endif
46819
46820    return(test_ret);
46821}
46822
46823
46824static int
46825test_xmlXPathModValues(void) {
46826    int test_ret = 0;
46827
46828#if defined(LIBXML_XPATH_ENABLED)
46829    int mem_base;
46830    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46831    int n_ctxt;
46832
46833    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46834        mem_base = xmlMemBlocks();
46835        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46836
46837        xmlXPathModValues(ctxt);
46838        call_tests++;
46839        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46840        xmlResetLastError();
46841        if (mem_base != xmlMemBlocks()) {
46842            printf("Leak of %d blocks found in xmlXPathModValues",
46843	           xmlMemBlocks() - mem_base);
46844	    test_ret++;
46845            printf(" %d", n_ctxt);
46846            printf("\n");
46847        }
46848    }
46849    function_tests++;
46850#endif
46851
46852    return(test_ret);
46853}
46854
46855
46856static int
46857test_xmlXPathMultValues(void) {
46858    int test_ret = 0;
46859
46860#if defined(LIBXML_XPATH_ENABLED)
46861    int mem_base;
46862    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46863    int n_ctxt;
46864
46865    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46866        mem_base = xmlMemBlocks();
46867        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46868
46869        xmlXPathMultValues(ctxt);
46870        call_tests++;
46871        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46872        xmlResetLastError();
46873        if (mem_base != xmlMemBlocks()) {
46874            printf("Leak of %d blocks found in xmlXPathMultValues",
46875	           xmlMemBlocks() - mem_base);
46876	    test_ret++;
46877            printf(" %d", n_ctxt);
46878            printf("\n");
46879        }
46880    }
46881    function_tests++;
46882#endif
46883
46884    return(test_ret);
46885}
46886
46887
46888static int
46889test_xmlXPathNamespaceURIFunction(void) {
46890    int test_ret = 0;
46891
46892#if defined(LIBXML_XPATH_ENABLED)
46893    int mem_base;
46894    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46895    int n_ctxt;
46896    int nargs; /* the number of arguments */
46897    int n_nargs;
46898
46899    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46900    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46901        mem_base = xmlMemBlocks();
46902        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46903        nargs = gen_int(n_nargs, 1);
46904
46905        xmlXPathNamespaceURIFunction(ctxt, nargs);
46906        call_tests++;
46907        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46908        des_int(n_nargs, nargs, 1);
46909        xmlResetLastError();
46910        if (mem_base != xmlMemBlocks()) {
46911            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
46912	           xmlMemBlocks() - mem_base);
46913	    test_ret++;
46914            printf(" %d", n_ctxt);
46915            printf(" %d", n_nargs);
46916            printf("\n");
46917        }
46918    }
46919    }
46920    function_tests++;
46921#endif
46922
46923    return(test_ret);
46924}
46925
46926
46927static int
46928test_xmlXPathNewBoolean(void) {
46929    int test_ret = 0;
46930
46931#if defined(LIBXML_XPATH_ENABLED)
46932    int mem_base;
46933    xmlXPathObjectPtr ret_val;
46934    int val; /* the boolean value */
46935    int n_val;
46936
46937    for (n_val = 0;n_val < gen_nb_int;n_val++) {
46938        mem_base = xmlMemBlocks();
46939        val = gen_int(n_val, 0);
46940
46941        ret_val = xmlXPathNewBoolean(val);
46942        desret_xmlXPathObjectPtr(ret_val);
46943        call_tests++;
46944        des_int(n_val, val, 0);
46945        xmlResetLastError();
46946        if (mem_base != xmlMemBlocks()) {
46947            printf("Leak of %d blocks found in xmlXPathNewBoolean",
46948	           xmlMemBlocks() - mem_base);
46949	    test_ret++;
46950            printf(" %d", n_val);
46951            printf("\n");
46952        }
46953    }
46954    function_tests++;
46955#endif
46956
46957    return(test_ret);
46958}
46959
46960
46961static int
46962test_xmlXPathNewCString(void) {
46963    int test_ret = 0;
46964
46965#if defined(LIBXML_XPATH_ENABLED)
46966    int mem_base;
46967    xmlXPathObjectPtr ret_val;
46968    char * val; /* the char * value */
46969    int n_val;
46970
46971    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
46972        mem_base = xmlMemBlocks();
46973        val = gen_const_char_ptr(n_val, 0);
46974
46975        ret_val = xmlXPathNewCString((const char *)val);
46976        desret_xmlXPathObjectPtr(ret_val);
46977        call_tests++;
46978        des_const_char_ptr(n_val, (const char *)val, 0);
46979        xmlResetLastError();
46980        if (mem_base != xmlMemBlocks()) {
46981            printf("Leak of %d blocks found in xmlXPathNewCString",
46982	           xmlMemBlocks() - mem_base);
46983	    test_ret++;
46984            printf(" %d", n_val);
46985            printf("\n");
46986        }
46987    }
46988    function_tests++;
46989#endif
46990
46991    return(test_ret);
46992}
46993
46994
46995static int
46996test_xmlXPathNewFloat(void) {
46997    int test_ret = 0;
46998
46999#if defined(LIBXML_XPATH_ENABLED)
47000    int mem_base;
47001    xmlXPathObjectPtr ret_val;
47002    double val; /* the double value */
47003    int n_val;
47004
47005    for (n_val = 0;n_val < gen_nb_double;n_val++) {
47006        mem_base = xmlMemBlocks();
47007        val = gen_double(n_val, 0);
47008
47009        ret_val = xmlXPathNewFloat(val);
47010        desret_xmlXPathObjectPtr(ret_val);
47011        call_tests++;
47012        des_double(n_val, val, 0);
47013        xmlResetLastError();
47014        if (mem_base != xmlMemBlocks()) {
47015            printf("Leak of %d blocks found in xmlXPathNewFloat",
47016	           xmlMemBlocks() - mem_base);
47017	    test_ret++;
47018            printf(" %d", n_val);
47019            printf("\n");
47020        }
47021    }
47022    function_tests++;
47023#endif
47024
47025    return(test_ret);
47026}
47027
47028
47029static int
47030test_xmlXPathNewNodeSet(void) {
47031    int test_ret = 0;
47032
47033#if defined(LIBXML_XPATH_ENABLED)
47034    int mem_base;
47035    xmlXPathObjectPtr ret_val;
47036    xmlNodePtr val; /* the NodePtr value */
47037    int n_val;
47038
47039    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47040        mem_base = xmlMemBlocks();
47041        val = gen_xmlNodePtr(n_val, 0);
47042
47043        ret_val = xmlXPathNewNodeSet(val);
47044        desret_xmlXPathObjectPtr(ret_val);
47045        call_tests++;
47046        des_xmlNodePtr(n_val, val, 0);
47047        xmlResetLastError();
47048        if (mem_base != xmlMemBlocks()) {
47049            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47050	           xmlMemBlocks() - mem_base);
47051	    test_ret++;
47052            printf(" %d", n_val);
47053            printf("\n");
47054        }
47055    }
47056    function_tests++;
47057#endif
47058
47059    return(test_ret);
47060}
47061
47062
47063static int
47064test_xmlXPathNewNodeSetList(void) {
47065    int test_ret = 0;
47066
47067#if defined(LIBXML_XPATH_ENABLED)
47068    int mem_base;
47069    xmlXPathObjectPtr ret_val;
47070    xmlNodeSetPtr val; /* an existing NodeSet */
47071    int n_val;
47072
47073    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47074        mem_base = xmlMemBlocks();
47075        val = gen_xmlNodeSetPtr(n_val, 0);
47076
47077        ret_val = xmlXPathNewNodeSetList(val);
47078        desret_xmlXPathObjectPtr(ret_val);
47079        call_tests++;
47080        des_xmlNodeSetPtr(n_val, val, 0);
47081        xmlResetLastError();
47082        if (mem_base != xmlMemBlocks()) {
47083            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47084	           xmlMemBlocks() - mem_base);
47085	    test_ret++;
47086            printf(" %d", n_val);
47087            printf("\n");
47088        }
47089    }
47090    function_tests++;
47091#endif
47092
47093    return(test_ret);
47094}
47095
47096
47097static int
47098test_xmlXPathNewParserContext(void) {
47099    int test_ret = 0;
47100
47101
47102    /* missing type support */
47103    return(test_ret);
47104}
47105
47106
47107static int
47108test_xmlXPathNewString(void) {
47109    int test_ret = 0;
47110
47111#if defined(LIBXML_XPATH_ENABLED)
47112    int mem_base;
47113    xmlXPathObjectPtr ret_val;
47114    xmlChar * val; /* the xmlChar * value */
47115    int n_val;
47116
47117    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47118        mem_base = xmlMemBlocks();
47119        val = gen_const_xmlChar_ptr(n_val, 0);
47120
47121        ret_val = xmlXPathNewString((const xmlChar *)val);
47122        desret_xmlXPathObjectPtr(ret_val);
47123        call_tests++;
47124        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47125        xmlResetLastError();
47126        if (mem_base != xmlMemBlocks()) {
47127            printf("Leak of %d blocks found in xmlXPathNewString",
47128	           xmlMemBlocks() - mem_base);
47129	    test_ret++;
47130            printf(" %d", n_val);
47131            printf("\n");
47132        }
47133    }
47134    function_tests++;
47135#endif
47136
47137    return(test_ret);
47138}
47139
47140
47141static int
47142test_xmlXPathNextAncestor(void) {
47143    int test_ret = 0;
47144
47145#if defined(LIBXML_XPATH_ENABLED)
47146    int mem_base;
47147    xmlNodePtr ret_val;
47148    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47149    int n_ctxt;
47150    xmlNodePtr cur; /* the current node in the traversal */
47151    int n_cur;
47152
47153    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47154    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47155        mem_base = xmlMemBlocks();
47156        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47157        cur = gen_xmlNodePtr(n_cur, 1);
47158
47159        ret_val = xmlXPathNextAncestor(ctxt, cur);
47160        desret_xmlNodePtr(ret_val);
47161        call_tests++;
47162        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47163        des_xmlNodePtr(n_cur, cur, 1);
47164        xmlResetLastError();
47165        if (mem_base != xmlMemBlocks()) {
47166            printf("Leak of %d blocks found in xmlXPathNextAncestor",
47167	           xmlMemBlocks() - mem_base);
47168	    test_ret++;
47169            printf(" %d", n_ctxt);
47170            printf(" %d", n_cur);
47171            printf("\n");
47172        }
47173    }
47174    }
47175    function_tests++;
47176#endif
47177
47178    return(test_ret);
47179}
47180
47181
47182static int
47183test_xmlXPathNextAncestorOrSelf(void) {
47184    int test_ret = 0;
47185
47186#if defined(LIBXML_XPATH_ENABLED)
47187    int mem_base;
47188    xmlNodePtr ret_val;
47189    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47190    int n_ctxt;
47191    xmlNodePtr cur; /* the current node in the traversal */
47192    int n_cur;
47193
47194    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47195    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47196        mem_base = xmlMemBlocks();
47197        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47198        cur = gen_xmlNodePtr(n_cur, 1);
47199
47200        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47201        desret_xmlNodePtr(ret_val);
47202        call_tests++;
47203        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47204        des_xmlNodePtr(n_cur, cur, 1);
47205        xmlResetLastError();
47206        if (mem_base != xmlMemBlocks()) {
47207            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47208	           xmlMemBlocks() - mem_base);
47209	    test_ret++;
47210            printf(" %d", n_ctxt);
47211            printf(" %d", n_cur);
47212            printf("\n");
47213        }
47214    }
47215    }
47216    function_tests++;
47217#endif
47218
47219    return(test_ret);
47220}
47221
47222
47223static int
47224test_xmlXPathNextAttribute(void) {
47225    int test_ret = 0;
47226
47227#if defined(LIBXML_XPATH_ENABLED)
47228    int mem_base;
47229    xmlNodePtr ret_val;
47230    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47231    int n_ctxt;
47232    xmlNodePtr cur; /* the current attribute in the traversal */
47233    int n_cur;
47234
47235    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47236    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47237        mem_base = xmlMemBlocks();
47238        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47239        cur = gen_xmlNodePtr(n_cur, 1);
47240
47241        ret_val = xmlXPathNextAttribute(ctxt, cur);
47242        desret_xmlNodePtr(ret_val);
47243        call_tests++;
47244        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47245        des_xmlNodePtr(n_cur, cur, 1);
47246        xmlResetLastError();
47247        if (mem_base != xmlMemBlocks()) {
47248            printf("Leak of %d blocks found in xmlXPathNextAttribute",
47249	           xmlMemBlocks() - mem_base);
47250	    test_ret++;
47251            printf(" %d", n_ctxt);
47252            printf(" %d", n_cur);
47253            printf("\n");
47254        }
47255    }
47256    }
47257    function_tests++;
47258#endif
47259
47260    return(test_ret);
47261}
47262
47263
47264static int
47265test_xmlXPathNextChild(void) {
47266    int test_ret = 0;
47267
47268#if defined(LIBXML_XPATH_ENABLED)
47269    int mem_base;
47270    xmlNodePtr ret_val;
47271    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47272    int n_ctxt;
47273    xmlNodePtr cur; /* the current node in the traversal */
47274    int n_cur;
47275
47276    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47277    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47278        mem_base = xmlMemBlocks();
47279        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47280        cur = gen_xmlNodePtr(n_cur, 1);
47281
47282        ret_val = xmlXPathNextChild(ctxt, cur);
47283        desret_xmlNodePtr(ret_val);
47284        call_tests++;
47285        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47286        des_xmlNodePtr(n_cur, cur, 1);
47287        xmlResetLastError();
47288        if (mem_base != xmlMemBlocks()) {
47289            printf("Leak of %d blocks found in xmlXPathNextChild",
47290	           xmlMemBlocks() - mem_base);
47291	    test_ret++;
47292            printf(" %d", n_ctxt);
47293            printf(" %d", n_cur);
47294            printf("\n");
47295        }
47296    }
47297    }
47298    function_tests++;
47299#endif
47300
47301    return(test_ret);
47302}
47303
47304
47305static int
47306test_xmlXPathNextDescendant(void) {
47307    int test_ret = 0;
47308
47309#if defined(LIBXML_XPATH_ENABLED)
47310    int mem_base;
47311    xmlNodePtr ret_val;
47312    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47313    int n_ctxt;
47314    xmlNodePtr cur; /* the current node in the traversal */
47315    int n_cur;
47316
47317    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47318    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47319        mem_base = xmlMemBlocks();
47320        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47321        cur = gen_xmlNodePtr(n_cur, 1);
47322
47323        ret_val = xmlXPathNextDescendant(ctxt, cur);
47324        desret_xmlNodePtr(ret_val);
47325        call_tests++;
47326        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47327        des_xmlNodePtr(n_cur, cur, 1);
47328        xmlResetLastError();
47329        if (mem_base != xmlMemBlocks()) {
47330            printf("Leak of %d blocks found in xmlXPathNextDescendant",
47331	           xmlMemBlocks() - mem_base);
47332	    test_ret++;
47333            printf(" %d", n_ctxt);
47334            printf(" %d", n_cur);
47335            printf("\n");
47336        }
47337    }
47338    }
47339    function_tests++;
47340#endif
47341
47342    return(test_ret);
47343}
47344
47345
47346static int
47347test_xmlXPathNextDescendantOrSelf(void) {
47348    int test_ret = 0;
47349
47350#if defined(LIBXML_XPATH_ENABLED)
47351    int mem_base;
47352    xmlNodePtr ret_val;
47353    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47354    int n_ctxt;
47355    xmlNodePtr cur; /* the current node in the traversal */
47356    int n_cur;
47357
47358    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47359    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47360        mem_base = xmlMemBlocks();
47361        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47362        cur = gen_xmlNodePtr(n_cur, 1);
47363
47364        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
47365        desret_xmlNodePtr(ret_val);
47366        call_tests++;
47367        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47368        des_xmlNodePtr(n_cur, cur, 1);
47369        xmlResetLastError();
47370        if (mem_base != xmlMemBlocks()) {
47371            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
47372	           xmlMemBlocks() - mem_base);
47373	    test_ret++;
47374            printf(" %d", n_ctxt);
47375            printf(" %d", n_cur);
47376            printf("\n");
47377        }
47378    }
47379    }
47380    function_tests++;
47381#endif
47382
47383    return(test_ret);
47384}
47385
47386
47387static int
47388test_xmlXPathNextFollowing(void) {
47389    int test_ret = 0;
47390
47391#if defined(LIBXML_XPATH_ENABLED)
47392    int mem_base;
47393    xmlNodePtr ret_val;
47394    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47395    int n_ctxt;
47396    xmlNodePtr cur; /* the current node in the traversal */
47397    int n_cur;
47398
47399    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47400    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47401        mem_base = xmlMemBlocks();
47402        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47403        cur = gen_xmlNodePtr(n_cur, 1);
47404
47405        ret_val = xmlXPathNextFollowing(ctxt, cur);
47406        desret_xmlNodePtr(ret_val);
47407        call_tests++;
47408        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47409        des_xmlNodePtr(n_cur, cur, 1);
47410        xmlResetLastError();
47411        if (mem_base != xmlMemBlocks()) {
47412            printf("Leak of %d blocks found in xmlXPathNextFollowing",
47413	           xmlMemBlocks() - mem_base);
47414	    test_ret++;
47415            printf(" %d", n_ctxt);
47416            printf(" %d", n_cur);
47417            printf("\n");
47418        }
47419    }
47420    }
47421    function_tests++;
47422#endif
47423
47424    return(test_ret);
47425}
47426
47427
47428static int
47429test_xmlXPathNextFollowingSibling(void) {
47430    int test_ret = 0;
47431
47432#if defined(LIBXML_XPATH_ENABLED)
47433    int mem_base;
47434    xmlNodePtr ret_val;
47435    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47436    int n_ctxt;
47437    xmlNodePtr cur; /* the current node in the traversal */
47438    int n_cur;
47439
47440    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47441    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47442        mem_base = xmlMemBlocks();
47443        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47444        cur = gen_xmlNodePtr(n_cur, 1);
47445
47446        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
47447        desret_xmlNodePtr(ret_val);
47448        call_tests++;
47449        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47450        des_xmlNodePtr(n_cur, cur, 1);
47451        xmlResetLastError();
47452        if (mem_base != xmlMemBlocks()) {
47453            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
47454	           xmlMemBlocks() - mem_base);
47455	    test_ret++;
47456            printf(" %d", n_ctxt);
47457            printf(" %d", n_cur);
47458            printf("\n");
47459        }
47460    }
47461    }
47462    function_tests++;
47463#endif
47464
47465    return(test_ret);
47466}
47467
47468
47469static int
47470test_xmlXPathNextNamespace(void) {
47471    int test_ret = 0;
47472
47473#if defined(LIBXML_XPATH_ENABLED)
47474    int mem_base;
47475    xmlNodePtr ret_val;
47476    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47477    int n_ctxt;
47478    xmlNodePtr cur; /* the current attribute in the traversal */
47479    int n_cur;
47480
47481    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47482    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47483        mem_base = xmlMemBlocks();
47484        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47485        cur = gen_xmlNodePtr(n_cur, 1);
47486
47487        ret_val = xmlXPathNextNamespace(ctxt, cur);
47488        desret_xmlNodePtr(ret_val);
47489        call_tests++;
47490        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47491        des_xmlNodePtr(n_cur, cur, 1);
47492        xmlResetLastError();
47493        if (mem_base != xmlMemBlocks()) {
47494            printf("Leak of %d blocks found in xmlXPathNextNamespace",
47495	           xmlMemBlocks() - mem_base);
47496	    test_ret++;
47497            printf(" %d", n_ctxt);
47498            printf(" %d", n_cur);
47499            printf("\n");
47500        }
47501    }
47502    }
47503    function_tests++;
47504#endif
47505
47506    return(test_ret);
47507}
47508
47509
47510static int
47511test_xmlXPathNextParent(void) {
47512    int test_ret = 0;
47513
47514#if defined(LIBXML_XPATH_ENABLED)
47515    int mem_base;
47516    xmlNodePtr ret_val;
47517    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47518    int n_ctxt;
47519    xmlNodePtr cur; /* the current node in the traversal */
47520    int n_cur;
47521
47522    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47523    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47524        mem_base = xmlMemBlocks();
47525        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47526        cur = gen_xmlNodePtr(n_cur, 1);
47527
47528        ret_val = xmlXPathNextParent(ctxt, cur);
47529        desret_xmlNodePtr(ret_val);
47530        call_tests++;
47531        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47532        des_xmlNodePtr(n_cur, cur, 1);
47533        xmlResetLastError();
47534        if (mem_base != xmlMemBlocks()) {
47535            printf("Leak of %d blocks found in xmlXPathNextParent",
47536	           xmlMemBlocks() - mem_base);
47537	    test_ret++;
47538            printf(" %d", n_ctxt);
47539            printf(" %d", n_cur);
47540            printf("\n");
47541        }
47542    }
47543    }
47544    function_tests++;
47545#endif
47546
47547    return(test_ret);
47548}
47549
47550
47551static int
47552test_xmlXPathNextPreceding(void) {
47553    int test_ret = 0;
47554
47555#if defined(LIBXML_XPATH_ENABLED)
47556    int mem_base;
47557    xmlNodePtr ret_val;
47558    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47559    int n_ctxt;
47560    xmlNodePtr cur; /* the current node in the traversal */
47561    int n_cur;
47562
47563    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47564    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47565        mem_base = xmlMemBlocks();
47566        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47567        cur = gen_xmlNodePtr(n_cur, 1);
47568
47569        ret_val = xmlXPathNextPreceding(ctxt, cur);
47570        desret_xmlNodePtr(ret_val);
47571        call_tests++;
47572        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47573        des_xmlNodePtr(n_cur, cur, 1);
47574        xmlResetLastError();
47575        if (mem_base != xmlMemBlocks()) {
47576            printf("Leak of %d blocks found in xmlXPathNextPreceding",
47577	           xmlMemBlocks() - mem_base);
47578	    test_ret++;
47579            printf(" %d", n_ctxt);
47580            printf(" %d", n_cur);
47581            printf("\n");
47582        }
47583    }
47584    }
47585    function_tests++;
47586#endif
47587
47588    return(test_ret);
47589}
47590
47591
47592static int
47593test_xmlXPathNextPrecedingSibling(void) {
47594    int test_ret = 0;
47595
47596#if defined(LIBXML_XPATH_ENABLED)
47597    int mem_base;
47598    xmlNodePtr ret_val;
47599    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47600    int n_ctxt;
47601    xmlNodePtr cur; /* the current node in the traversal */
47602    int n_cur;
47603
47604    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47605    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47606        mem_base = xmlMemBlocks();
47607        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47608        cur = gen_xmlNodePtr(n_cur, 1);
47609
47610        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
47611        desret_xmlNodePtr(ret_val);
47612        call_tests++;
47613        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47614        des_xmlNodePtr(n_cur, cur, 1);
47615        xmlResetLastError();
47616        if (mem_base != xmlMemBlocks()) {
47617            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
47618	           xmlMemBlocks() - mem_base);
47619	    test_ret++;
47620            printf(" %d", n_ctxt);
47621            printf(" %d", n_cur);
47622            printf("\n");
47623        }
47624    }
47625    }
47626    function_tests++;
47627#endif
47628
47629    return(test_ret);
47630}
47631
47632
47633static int
47634test_xmlXPathNextSelf(void) {
47635    int test_ret = 0;
47636
47637#if defined(LIBXML_XPATH_ENABLED)
47638    int mem_base;
47639    xmlNodePtr ret_val;
47640    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47641    int n_ctxt;
47642    xmlNodePtr cur; /* the current node in the traversal */
47643    int n_cur;
47644
47645    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47646    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47647        mem_base = xmlMemBlocks();
47648        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47649        cur = gen_xmlNodePtr(n_cur, 1);
47650
47651        ret_val = xmlXPathNextSelf(ctxt, cur);
47652        desret_xmlNodePtr(ret_val);
47653        call_tests++;
47654        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47655        des_xmlNodePtr(n_cur, cur, 1);
47656        xmlResetLastError();
47657        if (mem_base != xmlMemBlocks()) {
47658            printf("Leak of %d blocks found in xmlXPathNextSelf",
47659	           xmlMemBlocks() - mem_base);
47660	    test_ret++;
47661            printf(" %d", n_ctxt);
47662            printf(" %d", n_cur);
47663            printf("\n");
47664        }
47665    }
47666    }
47667    function_tests++;
47668#endif
47669
47670    return(test_ret);
47671}
47672
47673
47674static int
47675test_xmlXPathNodeLeading(void) {
47676    int test_ret = 0;
47677
47678#if defined(LIBXML_XPATH_ENABLED)
47679    int mem_base;
47680    xmlNodeSetPtr ret_val;
47681    xmlNodeSetPtr nodes; /* a node-set */
47682    int n_nodes;
47683    xmlNodePtr node; /* a node */
47684    int n_node;
47685
47686    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47687    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47688        mem_base = xmlMemBlocks();
47689        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47690        node = gen_xmlNodePtr(n_node, 1);
47691
47692        ret_val = xmlXPathNodeLeading(nodes, node);
47693        desret_xmlNodeSetPtr(ret_val);
47694        call_tests++;
47695        des_xmlNodeSetPtr(n_nodes, nodes, 0);
47696        des_xmlNodePtr(n_node, node, 1);
47697        xmlResetLastError();
47698        if (mem_base != xmlMemBlocks()) {
47699            printf("Leak of %d blocks found in xmlXPathNodeLeading",
47700	           xmlMemBlocks() - mem_base);
47701	    test_ret++;
47702            printf(" %d", n_nodes);
47703            printf(" %d", n_node);
47704            printf("\n");
47705        }
47706    }
47707    }
47708    function_tests++;
47709#endif
47710
47711    return(test_ret);
47712}
47713
47714
47715static int
47716test_xmlXPathNodeLeadingSorted(void) {
47717    int test_ret = 0;
47718
47719#if defined(LIBXML_XPATH_ENABLED)
47720    int mem_base;
47721    xmlNodeSetPtr ret_val;
47722    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47723    int n_nodes;
47724    xmlNodePtr node; /* a node */
47725    int n_node;
47726
47727    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47728    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47729        mem_base = xmlMemBlocks();
47730        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47731        node = gen_xmlNodePtr(n_node, 1);
47732
47733        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
47734        desret_xmlNodeSetPtr(ret_val);
47735        call_tests++;
47736        des_xmlNodeSetPtr(n_nodes, nodes, 0);
47737        des_xmlNodePtr(n_node, node, 1);
47738        xmlResetLastError();
47739        if (mem_base != xmlMemBlocks()) {
47740            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
47741	           xmlMemBlocks() - mem_base);
47742	    test_ret++;
47743            printf(" %d", n_nodes);
47744            printf(" %d", n_node);
47745            printf("\n");
47746        }
47747    }
47748    }
47749    function_tests++;
47750#endif
47751
47752    return(test_ret);
47753}
47754
47755
47756static int
47757test_xmlXPathNodeSetAdd(void) {
47758    int test_ret = 0;
47759
47760#if defined(LIBXML_XPATH_ENABLED)
47761    int mem_base;
47762    xmlNodeSetPtr cur; /* the initial node set */
47763    int n_cur;
47764    xmlNodePtr val; /* a new xmlNodePtr */
47765    int n_val;
47766
47767    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47768    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47769        mem_base = xmlMemBlocks();
47770        cur = gen_xmlNodeSetPtr(n_cur, 0);
47771        val = gen_xmlNodePtr(n_val, 1);
47772
47773        xmlXPathNodeSetAdd(cur, val);
47774        call_tests++;
47775        des_xmlNodeSetPtr(n_cur, cur, 0);
47776        des_xmlNodePtr(n_val, val, 1);
47777        xmlResetLastError();
47778        if (mem_base != xmlMemBlocks()) {
47779            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
47780	           xmlMemBlocks() - mem_base);
47781	    test_ret++;
47782            printf(" %d", n_cur);
47783            printf(" %d", n_val);
47784            printf("\n");
47785        }
47786    }
47787    }
47788    function_tests++;
47789#endif
47790
47791    return(test_ret);
47792}
47793
47794
47795static int
47796test_xmlXPathNodeSetAddNs(void) {
47797    int test_ret = 0;
47798
47799#if defined(LIBXML_XPATH_ENABLED)
47800    int mem_base;
47801    xmlNodeSetPtr cur; /* the initial node set */
47802    int n_cur;
47803    xmlNodePtr node; /* the hosting node */
47804    int n_node;
47805    xmlNsPtr ns; /* a the namespace node */
47806    int n_ns;
47807
47808    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47809    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47810    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
47811        mem_base = xmlMemBlocks();
47812        cur = gen_xmlNodeSetPtr(n_cur, 0);
47813        node = gen_xmlNodePtr(n_node, 1);
47814        ns = gen_xmlNsPtr(n_ns, 2);
47815
47816        xmlXPathNodeSetAddNs(cur, node, ns);
47817        call_tests++;
47818        des_xmlNodeSetPtr(n_cur, cur, 0);
47819        des_xmlNodePtr(n_node, node, 1);
47820        des_xmlNsPtr(n_ns, ns, 2);
47821        xmlResetLastError();
47822        if (mem_base != xmlMemBlocks()) {
47823            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
47824	           xmlMemBlocks() - mem_base);
47825	    test_ret++;
47826            printf(" %d", n_cur);
47827            printf(" %d", n_node);
47828            printf(" %d", n_ns);
47829            printf("\n");
47830        }
47831    }
47832    }
47833    }
47834    function_tests++;
47835#endif
47836
47837    return(test_ret);
47838}
47839
47840
47841static int
47842test_xmlXPathNodeSetAddUnique(void) {
47843    int test_ret = 0;
47844
47845#if defined(LIBXML_XPATH_ENABLED)
47846    int mem_base;
47847    xmlNodeSetPtr cur; /* the initial node set */
47848    int n_cur;
47849    xmlNodePtr val; /* a new xmlNodePtr */
47850    int n_val;
47851
47852    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47853    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47854        mem_base = xmlMemBlocks();
47855        cur = gen_xmlNodeSetPtr(n_cur, 0);
47856        val = gen_xmlNodePtr(n_val, 1);
47857
47858        xmlXPathNodeSetAddUnique(cur, val);
47859        call_tests++;
47860        des_xmlNodeSetPtr(n_cur, cur, 0);
47861        des_xmlNodePtr(n_val, val, 1);
47862        xmlResetLastError();
47863        if (mem_base != xmlMemBlocks()) {
47864            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
47865	           xmlMemBlocks() - mem_base);
47866	    test_ret++;
47867            printf(" %d", n_cur);
47868            printf(" %d", n_val);
47869            printf("\n");
47870        }
47871    }
47872    }
47873    function_tests++;
47874#endif
47875
47876    return(test_ret);
47877}
47878
47879
47880static int
47881test_xmlXPathNodeSetContains(void) {
47882    int test_ret = 0;
47883
47884#if defined(LIBXML_XPATH_ENABLED)
47885    int mem_base;
47886    int ret_val;
47887    xmlNodeSetPtr cur; /* the node-set */
47888    int n_cur;
47889    xmlNodePtr val; /* the node */
47890    int n_val;
47891
47892    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47893    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47894        mem_base = xmlMemBlocks();
47895        cur = gen_xmlNodeSetPtr(n_cur, 0);
47896        val = gen_xmlNodePtr(n_val, 1);
47897
47898        ret_val = xmlXPathNodeSetContains(cur, val);
47899        desret_int(ret_val);
47900        call_tests++;
47901        des_xmlNodeSetPtr(n_cur, cur, 0);
47902        des_xmlNodePtr(n_val, val, 1);
47903        xmlResetLastError();
47904        if (mem_base != xmlMemBlocks()) {
47905            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
47906	           xmlMemBlocks() - mem_base);
47907	    test_ret++;
47908            printf(" %d", n_cur);
47909            printf(" %d", n_val);
47910            printf("\n");
47911        }
47912    }
47913    }
47914    function_tests++;
47915#endif
47916
47917    return(test_ret);
47918}
47919
47920
47921static int
47922test_xmlXPathNodeSetDel(void) {
47923    int test_ret = 0;
47924
47925#if defined(LIBXML_XPATH_ENABLED)
47926    int mem_base;
47927    xmlNodeSetPtr cur; /* the initial node set */
47928    int n_cur;
47929    xmlNodePtr val; /* an xmlNodePtr */
47930    int n_val;
47931
47932    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47933    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47934        mem_base = xmlMemBlocks();
47935        cur = gen_xmlNodeSetPtr(n_cur, 0);
47936        val = gen_xmlNodePtr(n_val, 1);
47937
47938        xmlXPathNodeSetDel(cur, val);
47939        call_tests++;
47940        des_xmlNodeSetPtr(n_cur, cur, 0);
47941        des_xmlNodePtr(n_val, val, 1);
47942        xmlResetLastError();
47943        if (mem_base != xmlMemBlocks()) {
47944            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
47945	           xmlMemBlocks() - mem_base);
47946	    test_ret++;
47947            printf(" %d", n_cur);
47948            printf(" %d", n_val);
47949            printf("\n");
47950        }
47951    }
47952    }
47953    function_tests++;
47954#endif
47955
47956    return(test_ret);
47957}
47958
47959
47960static int
47961test_xmlXPathNodeSetMerge(void) {
47962    int test_ret = 0;
47963
47964#if defined(LIBXML_XPATH_ENABLED)
47965    int mem_base;
47966    xmlNodeSetPtr ret_val;
47967    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
47968    int n_val1;
47969    xmlNodeSetPtr val2; /* the second NodeSet */
47970    int n_val2;
47971
47972    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
47973    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
47974        mem_base = xmlMemBlocks();
47975        val1 = gen_xmlNodeSetPtr(n_val1, 0);
47976        val2 = gen_xmlNodeSetPtr(n_val2, 1);
47977
47978        ret_val = xmlXPathNodeSetMerge(val1, val2);
47979        desret_xmlNodeSetPtr(ret_val);
47980        call_tests++;
47981        des_xmlNodeSetPtr(n_val1, val1, 0);
47982        des_xmlNodeSetPtr(n_val2, val2, 1);
47983        xmlResetLastError();
47984        if (mem_base != xmlMemBlocks()) {
47985            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
47986	           xmlMemBlocks() - mem_base);
47987	    test_ret++;
47988            printf(" %d", n_val1);
47989            printf(" %d", n_val2);
47990            printf("\n");
47991        }
47992    }
47993    }
47994    function_tests++;
47995#endif
47996
47997    return(test_ret);
47998}
47999
48000
48001static int
48002test_xmlXPathNodeSetRemove(void) {
48003    int test_ret = 0;
48004
48005#if defined(LIBXML_XPATH_ENABLED)
48006    int mem_base;
48007    xmlNodeSetPtr cur; /* the initial node set */
48008    int n_cur;
48009    int val; /* the index to remove */
48010    int n_val;
48011
48012    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48013    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48014        mem_base = xmlMemBlocks();
48015        cur = gen_xmlNodeSetPtr(n_cur, 0);
48016        val = gen_int(n_val, 1);
48017
48018        xmlXPathNodeSetRemove(cur, val);
48019        call_tests++;
48020        des_xmlNodeSetPtr(n_cur, cur, 0);
48021        des_int(n_val, val, 1);
48022        xmlResetLastError();
48023        if (mem_base != xmlMemBlocks()) {
48024            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48025	           xmlMemBlocks() - mem_base);
48026	    test_ret++;
48027            printf(" %d", n_cur);
48028            printf(" %d", n_val);
48029            printf("\n");
48030        }
48031    }
48032    }
48033    function_tests++;
48034#endif
48035
48036    return(test_ret);
48037}
48038
48039
48040static int
48041test_xmlXPathNodeSetSort(void) {
48042    int test_ret = 0;
48043
48044#if defined(LIBXML_XPATH_ENABLED)
48045    int mem_base;
48046    xmlNodeSetPtr set; /* the node set */
48047    int n_set;
48048
48049    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48050        mem_base = xmlMemBlocks();
48051        set = gen_xmlNodeSetPtr(n_set, 0);
48052
48053        xmlXPathNodeSetSort(set);
48054        call_tests++;
48055        des_xmlNodeSetPtr(n_set, set, 0);
48056        xmlResetLastError();
48057        if (mem_base != xmlMemBlocks()) {
48058            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48059	           xmlMemBlocks() - mem_base);
48060	    test_ret++;
48061            printf(" %d", n_set);
48062            printf("\n");
48063        }
48064    }
48065    function_tests++;
48066#endif
48067
48068    return(test_ret);
48069}
48070
48071
48072static int
48073test_xmlXPathNodeTrailing(void) {
48074    int test_ret = 0;
48075
48076#if defined(LIBXML_XPATH_ENABLED)
48077    int mem_base;
48078    xmlNodeSetPtr ret_val;
48079    xmlNodeSetPtr nodes; /* a node-set */
48080    int n_nodes;
48081    xmlNodePtr node; /* a node */
48082    int n_node;
48083
48084    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48085    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48086        mem_base = xmlMemBlocks();
48087        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48088        node = gen_xmlNodePtr(n_node, 1);
48089
48090        ret_val = xmlXPathNodeTrailing(nodes, node);
48091        desret_xmlNodeSetPtr(ret_val);
48092        call_tests++;
48093        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48094        des_xmlNodePtr(n_node, node, 1);
48095        xmlResetLastError();
48096        if (mem_base != xmlMemBlocks()) {
48097            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48098	           xmlMemBlocks() - mem_base);
48099	    test_ret++;
48100            printf(" %d", n_nodes);
48101            printf(" %d", n_node);
48102            printf("\n");
48103        }
48104    }
48105    }
48106    function_tests++;
48107#endif
48108
48109    return(test_ret);
48110}
48111
48112
48113static int
48114test_xmlXPathNodeTrailingSorted(void) {
48115    int test_ret = 0;
48116
48117#if defined(LIBXML_XPATH_ENABLED)
48118    int mem_base;
48119    xmlNodeSetPtr ret_val;
48120    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48121    int n_nodes;
48122    xmlNodePtr node; /* a node */
48123    int n_node;
48124
48125    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48126    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48127        mem_base = xmlMemBlocks();
48128        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48129        node = gen_xmlNodePtr(n_node, 1);
48130
48131        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48132        desret_xmlNodeSetPtr(ret_val);
48133        call_tests++;
48134        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48135        des_xmlNodePtr(n_node, node, 1);
48136        xmlResetLastError();
48137        if (mem_base != xmlMemBlocks()) {
48138            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48139	           xmlMemBlocks() - mem_base);
48140	    test_ret++;
48141            printf(" %d", n_nodes);
48142            printf(" %d", n_node);
48143            printf("\n");
48144        }
48145    }
48146    }
48147    function_tests++;
48148#endif
48149
48150    return(test_ret);
48151}
48152
48153
48154static int
48155test_xmlXPathNormalizeFunction(void) {
48156    int test_ret = 0;
48157
48158#if defined(LIBXML_XPATH_ENABLED)
48159    int mem_base;
48160    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48161    int n_ctxt;
48162    int nargs; /* the number of arguments */
48163    int n_nargs;
48164
48165    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48166    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48167        mem_base = xmlMemBlocks();
48168        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48169        nargs = gen_int(n_nargs, 1);
48170
48171        xmlXPathNormalizeFunction(ctxt, nargs);
48172        call_tests++;
48173        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48174        des_int(n_nargs, nargs, 1);
48175        xmlResetLastError();
48176        if (mem_base != xmlMemBlocks()) {
48177            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48178	           xmlMemBlocks() - mem_base);
48179	    test_ret++;
48180            printf(" %d", n_ctxt);
48181            printf(" %d", n_nargs);
48182            printf("\n");
48183        }
48184    }
48185    }
48186    function_tests++;
48187#endif
48188
48189    return(test_ret);
48190}
48191
48192
48193static int
48194test_xmlXPathNotEqualValues(void) {
48195    int test_ret = 0;
48196
48197#if defined(LIBXML_XPATH_ENABLED)
48198    int mem_base;
48199    int ret_val;
48200    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48201    int n_ctxt;
48202
48203    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48204        mem_base = xmlMemBlocks();
48205        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48206
48207        ret_val = xmlXPathNotEqualValues(ctxt);
48208        desret_int(ret_val);
48209        call_tests++;
48210        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48211        xmlResetLastError();
48212        if (mem_base != xmlMemBlocks()) {
48213            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48214	           xmlMemBlocks() - mem_base);
48215	    test_ret++;
48216            printf(" %d", n_ctxt);
48217            printf("\n");
48218        }
48219    }
48220    function_tests++;
48221#endif
48222
48223    return(test_ret);
48224}
48225
48226
48227static int
48228test_xmlXPathNotFunction(void) {
48229    int test_ret = 0;
48230
48231#if defined(LIBXML_XPATH_ENABLED)
48232    int mem_base;
48233    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48234    int n_ctxt;
48235    int nargs; /* the number of arguments */
48236    int n_nargs;
48237
48238    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48239    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48240        mem_base = xmlMemBlocks();
48241        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48242        nargs = gen_int(n_nargs, 1);
48243
48244        xmlXPathNotFunction(ctxt, nargs);
48245        call_tests++;
48246        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48247        des_int(n_nargs, nargs, 1);
48248        xmlResetLastError();
48249        if (mem_base != xmlMemBlocks()) {
48250            printf("Leak of %d blocks found in xmlXPathNotFunction",
48251	           xmlMemBlocks() - mem_base);
48252	    test_ret++;
48253            printf(" %d", n_ctxt);
48254            printf(" %d", n_nargs);
48255            printf("\n");
48256        }
48257    }
48258    }
48259    function_tests++;
48260#endif
48261
48262    return(test_ret);
48263}
48264
48265
48266static int
48267test_xmlXPathNsLookup(void) {
48268    int test_ret = 0;
48269
48270#if defined(LIBXML_XPATH_ENABLED)
48271    int mem_base;
48272    const xmlChar * ret_val;
48273    xmlXPathContextPtr ctxt; /* the XPath context */
48274    int n_ctxt;
48275    xmlChar * prefix; /* the namespace prefix value */
48276    int n_prefix;
48277
48278    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48279    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
48280        mem_base = xmlMemBlocks();
48281        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48282        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
48283
48284        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
48285        desret_const_xmlChar_ptr(ret_val);
48286        call_tests++;
48287        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48288        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
48289        xmlResetLastError();
48290        if (mem_base != xmlMemBlocks()) {
48291            printf("Leak of %d blocks found in xmlXPathNsLookup",
48292	           xmlMemBlocks() - mem_base);
48293	    test_ret++;
48294            printf(" %d", n_ctxt);
48295            printf(" %d", n_prefix);
48296            printf("\n");
48297        }
48298    }
48299    }
48300    function_tests++;
48301#endif
48302
48303    return(test_ret);
48304}
48305
48306
48307static int
48308test_xmlXPathNumberFunction(void) {
48309    int test_ret = 0;
48310
48311#if defined(LIBXML_XPATH_ENABLED)
48312    int mem_base;
48313    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48314    int n_ctxt;
48315    int nargs; /* the number of arguments */
48316    int n_nargs;
48317
48318    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48319    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48320        mem_base = xmlMemBlocks();
48321        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48322        nargs = gen_int(n_nargs, 1);
48323
48324        xmlXPathNumberFunction(ctxt, nargs);
48325        call_tests++;
48326        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48327        des_int(n_nargs, nargs, 1);
48328        xmlResetLastError();
48329        if (mem_base != xmlMemBlocks()) {
48330            printf("Leak of %d blocks found in xmlXPathNumberFunction",
48331	           xmlMemBlocks() - mem_base);
48332	    test_ret++;
48333            printf(" %d", n_ctxt);
48334            printf(" %d", n_nargs);
48335            printf("\n");
48336        }
48337    }
48338    }
48339    function_tests++;
48340#endif
48341
48342    return(test_ret);
48343}
48344
48345
48346static int
48347test_xmlXPathParseNCName(void) {
48348    int test_ret = 0;
48349
48350#if defined(LIBXML_XPATH_ENABLED)
48351    int mem_base;
48352    xmlChar * ret_val;
48353    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48354    int n_ctxt;
48355
48356    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48357        mem_base = xmlMemBlocks();
48358        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48359
48360        ret_val = xmlXPathParseNCName(ctxt);
48361        desret_xmlChar_ptr(ret_val);
48362        call_tests++;
48363        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48364        xmlResetLastError();
48365        if (mem_base != xmlMemBlocks()) {
48366            printf("Leak of %d blocks found in xmlXPathParseNCName",
48367	           xmlMemBlocks() - mem_base);
48368	    test_ret++;
48369            printf(" %d", n_ctxt);
48370            printf("\n");
48371        }
48372    }
48373    function_tests++;
48374#endif
48375
48376    return(test_ret);
48377}
48378
48379
48380static int
48381test_xmlXPathParseName(void) {
48382    int test_ret = 0;
48383
48384#if defined(LIBXML_XPATH_ENABLED)
48385    int mem_base;
48386    xmlChar * ret_val;
48387    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48388    int n_ctxt;
48389
48390    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48391        mem_base = xmlMemBlocks();
48392        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48393
48394        ret_val = xmlXPathParseName(ctxt);
48395        desret_xmlChar_ptr(ret_val);
48396        call_tests++;
48397        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48398        xmlResetLastError();
48399        if (mem_base != xmlMemBlocks()) {
48400            printf("Leak of %d blocks found in xmlXPathParseName",
48401	           xmlMemBlocks() - mem_base);
48402	    test_ret++;
48403            printf(" %d", n_ctxt);
48404            printf("\n");
48405        }
48406    }
48407    function_tests++;
48408#endif
48409
48410    return(test_ret);
48411}
48412
48413
48414static int
48415test_xmlXPathPopBoolean(void) {
48416    int test_ret = 0;
48417
48418#if defined(LIBXML_XPATH_ENABLED)
48419    int mem_base;
48420    int ret_val;
48421    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48422    int n_ctxt;
48423
48424    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48425        mem_base = xmlMemBlocks();
48426        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48427
48428        ret_val = xmlXPathPopBoolean(ctxt);
48429        desret_int(ret_val);
48430        call_tests++;
48431        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48432        xmlResetLastError();
48433        if (mem_base != xmlMemBlocks()) {
48434            printf("Leak of %d blocks found in xmlXPathPopBoolean",
48435	           xmlMemBlocks() - mem_base);
48436	    test_ret++;
48437            printf(" %d", n_ctxt);
48438            printf("\n");
48439        }
48440    }
48441    function_tests++;
48442#endif
48443
48444    return(test_ret);
48445}
48446
48447
48448static int
48449test_xmlXPathPopExternal(void) {
48450    int test_ret = 0;
48451
48452#if defined(LIBXML_XPATH_ENABLED)
48453    int mem_base;
48454    void * ret_val;
48455    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48456    int n_ctxt;
48457
48458    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48459        mem_base = xmlMemBlocks();
48460        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48461
48462        ret_val = xmlXPathPopExternal(ctxt);
48463        desret_void_ptr(ret_val);
48464        call_tests++;
48465        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48466        xmlResetLastError();
48467        if (mem_base != xmlMemBlocks()) {
48468            printf("Leak of %d blocks found in xmlXPathPopExternal",
48469	           xmlMemBlocks() - mem_base);
48470	    test_ret++;
48471            printf(" %d", n_ctxt);
48472            printf("\n");
48473        }
48474    }
48475    function_tests++;
48476#endif
48477
48478    return(test_ret);
48479}
48480
48481
48482static int
48483test_xmlXPathPopNodeSet(void) {
48484    int test_ret = 0;
48485
48486#if defined(LIBXML_XPATH_ENABLED)
48487    int mem_base;
48488    xmlNodeSetPtr ret_val;
48489    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48490    int n_ctxt;
48491
48492    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48493        mem_base = xmlMemBlocks();
48494        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48495
48496        ret_val = xmlXPathPopNodeSet(ctxt);
48497        desret_xmlNodeSetPtr(ret_val);
48498        call_tests++;
48499        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48500        xmlResetLastError();
48501        if (mem_base != xmlMemBlocks()) {
48502            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
48503	           xmlMemBlocks() - mem_base);
48504	    test_ret++;
48505            printf(" %d", n_ctxt);
48506            printf("\n");
48507        }
48508    }
48509    function_tests++;
48510#endif
48511
48512    return(test_ret);
48513}
48514
48515
48516static int
48517test_xmlXPathPopNumber(void) {
48518    int test_ret = 0;
48519
48520#if defined(LIBXML_XPATH_ENABLED)
48521    int mem_base;
48522    double ret_val;
48523    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48524    int n_ctxt;
48525
48526    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48527        mem_base = xmlMemBlocks();
48528        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48529
48530        ret_val = xmlXPathPopNumber(ctxt);
48531        desret_double(ret_val);
48532        call_tests++;
48533        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48534        xmlResetLastError();
48535        if (mem_base != xmlMemBlocks()) {
48536            printf("Leak of %d blocks found in xmlXPathPopNumber",
48537	           xmlMemBlocks() - mem_base);
48538	    test_ret++;
48539            printf(" %d", n_ctxt);
48540            printf("\n");
48541        }
48542    }
48543    function_tests++;
48544#endif
48545
48546    return(test_ret);
48547}
48548
48549
48550static int
48551test_xmlXPathPopString(void) {
48552    int test_ret = 0;
48553
48554#if defined(LIBXML_XPATH_ENABLED)
48555    int mem_base;
48556    xmlChar * ret_val;
48557    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48558    int n_ctxt;
48559
48560    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48561        mem_base = xmlMemBlocks();
48562        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48563
48564        ret_val = xmlXPathPopString(ctxt);
48565        desret_xmlChar_ptr(ret_val);
48566        call_tests++;
48567        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48568        xmlResetLastError();
48569        if (mem_base != xmlMemBlocks()) {
48570            printf("Leak of %d blocks found in xmlXPathPopString",
48571	           xmlMemBlocks() - mem_base);
48572	    test_ret++;
48573            printf(" %d", n_ctxt);
48574            printf("\n");
48575        }
48576    }
48577    function_tests++;
48578#endif
48579
48580    return(test_ret);
48581}
48582
48583
48584static int
48585test_xmlXPathPositionFunction(void) {
48586    int test_ret = 0;
48587
48588#if defined(LIBXML_XPATH_ENABLED)
48589    int mem_base;
48590    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48591    int n_ctxt;
48592    int nargs; /* the number of arguments */
48593    int n_nargs;
48594
48595    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48596    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48597        mem_base = xmlMemBlocks();
48598        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48599        nargs = gen_int(n_nargs, 1);
48600
48601        xmlXPathPositionFunction(ctxt, nargs);
48602        call_tests++;
48603        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48604        des_int(n_nargs, nargs, 1);
48605        xmlResetLastError();
48606        if (mem_base != xmlMemBlocks()) {
48607            printf("Leak of %d blocks found in xmlXPathPositionFunction",
48608	           xmlMemBlocks() - mem_base);
48609	    test_ret++;
48610            printf(" %d", n_ctxt);
48611            printf(" %d", n_nargs);
48612            printf("\n");
48613        }
48614    }
48615    }
48616    function_tests++;
48617#endif
48618
48619    return(test_ret);
48620}
48621
48622
48623static int
48624test_xmlXPathRegisterAllFunctions(void) {
48625    int test_ret = 0;
48626
48627#if defined(LIBXML_XPATH_ENABLED)
48628    int mem_base;
48629    xmlXPathContextPtr ctxt; /* the XPath context */
48630    int n_ctxt;
48631
48632    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48633        mem_base = xmlMemBlocks();
48634        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48635
48636        xmlXPathRegisterAllFunctions(ctxt);
48637        call_tests++;
48638        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48639        xmlResetLastError();
48640        if (mem_base != xmlMemBlocks()) {
48641            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
48642	           xmlMemBlocks() - mem_base);
48643	    test_ret++;
48644            printf(" %d", n_ctxt);
48645            printf("\n");
48646        }
48647    }
48648    function_tests++;
48649#endif
48650
48651    return(test_ret);
48652}
48653
48654
48655static int
48656test_xmlXPathRegisterFunc(void) {
48657    int test_ret = 0;
48658
48659
48660    /* missing type support */
48661    return(test_ret);
48662}
48663
48664
48665static int
48666test_xmlXPathRegisterFuncLookup(void) {
48667    int test_ret = 0;
48668
48669
48670    /* missing type support */
48671    return(test_ret);
48672}
48673
48674
48675static int
48676test_xmlXPathRegisterFuncNS(void) {
48677    int test_ret = 0;
48678
48679
48680    /* missing type support */
48681    return(test_ret);
48682}
48683
48684
48685static int
48686test_xmlXPathRegisterNs(void) {
48687    int test_ret = 0;
48688
48689#if defined(LIBXML_XPATH_ENABLED)
48690    int mem_base;
48691    int ret_val;
48692    xmlXPathContextPtr ctxt; /* the XPath context */
48693    int n_ctxt;
48694    xmlChar * prefix; /* the namespace prefix */
48695    int n_prefix;
48696    xmlChar * ns_uri; /* the namespace name */
48697    int n_ns_uri;
48698
48699    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48700    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
48701    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
48702        mem_base = xmlMemBlocks();
48703        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48704        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
48705        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
48706
48707        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
48708        desret_int(ret_val);
48709        call_tests++;
48710        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48711        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
48712        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
48713        xmlResetLastError();
48714        if (mem_base != xmlMemBlocks()) {
48715            printf("Leak of %d blocks found in xmlXPathRegisterNs",
48716	           xmlMemBlocks() - mem_base);
48717	    test_ret++;
48718            printf(" %d", n_ctxt);
48719            printf(" %d", n_prefix);
48720            printf(" %d", n_ns_uri);
48721            printf("\n");
48722        }
48723    }
48724    }
48725    }
48726    function_tests++;
48727#endif
48728
48729    return(test_ret);
48730}
48731
48732
48733static int
48734test_xmlXPathRegisterVariable(void) {
48735    int test_ret = 0;
48736
48737#if defined(LIBXML_XPATH_ENABLED)
48738    int mem_base;
48739    int ret_val;
48740    xmlXPathContextPtr ctxt; /* the XPath context */
48741    int n_ctxt;
48742    xmlChar * name; /* the variable name */
48743    int n_name;
48744    xmlXPathObjectPtr value; /* the variable value or NULL */
48745    int n_value;
48746
48747    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48748    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48749    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
48750        mem_base = xmlMemBlocks();
48751        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48752        name = gen_const_xmlChar_ptr(n_name, 1);
48753        value = gen_xmlXPathObjectPtr(n_value, 2);
48754
48755        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
48756        desret_int(ret_val);
48757        call_tests++;
48758        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48759        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48760        des_xmlXPathObjectPtr(n_value, value, 2);
48761        xmlResetLastError();
48762        if (mem_base != xmlMemBlocks()) {
48763            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
48764	           xmlMemBlocks() - mem_base);
48765	    test_ret++;
48766            printf(" %d", n_ctxt);
48767            printf(" %d", n_name);
48768            printf(" %d", n_value);
48769            printf("\n");
48770        }
48771    }
48772    }
48773    }
48774    function_tests++;
48775#endif
48776
48777    return(test_ret);
48778}
48779
48780
48781static int
48782test_xmlXPathRegisterVariableLookup(void) {
48783    int test_ret = 0;
48784
48785
48786    /* missing type support */
48787    return(test_ret);
48788}
48789
48790
48791static int
48792test_xmlXPathRegisterVariableNS(void) {
48793    int test_ret = 0;
48794
48795#if defined(LIBXML_XPATH_ENABLED)
48796    int mem_base;
48797    int ret_val;
48798    xmlXPathContextPtr ctxt; /* the XPath context */
48799    int n_ctxt;
48800    xmlChar * name; /* the variable name */
48801    int n_name;
48802    xmlChar * ns_uri; /* the variable namespace URI */
48803    int n_ns_uri;
48804    xmlXPathObjectPtr value; /* the variable value or NULL */
48805    int n_value;
48806
48807    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48808    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48809    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
48810    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
48811        mem_base = xmlMemBlocks();
48812        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48813        name = gen_const_xmlChar_ptr(n_name, 1);
48814        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
48815        value = gen_xmlXPathObjectPtr(n_value, 3);
48816
48817        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
48818        desret_int(ret_val);
48819        call_tests++;
48820        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48821        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48822        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
48823        des_xmlXPathObjectPtr(n_value, value, 3);
48824        xmlResetLastError();
48825        if (mem_base != xmlMemBlocks()) {
48826            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
48827	           xmlMemBlocks() - mem_base);
48828	    test_ret++;
48829            printf(" %d", n_ctxt);
48830            printf(" %d", n_name);
48831            printf(" %d", n_ns_uri);
48832            printf(" %d", n_value);
48833            printf("\n");
48834        }
48835    }
48836    }
48837    }
48838    }
48839    function_tests++;
48840#endif
48841
48842    return(test_ret);
48843}
48844
48845
48846static int
48847test_xmlXPathRegisteredFuncsCleanup(void) {
48848    int test_ret = 0;
48849
48850#if defined(LIBXML_XPATH_ENABLED)
48851    int mem_base;
48852    xmlXPathContextPtr ctxt; /* the XPath context */
48853    int n_ctxt;
48854
48855    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48856        mem_base = xmlMemBlocks();
48857        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48858
48859        xmlXPathRegisteredFuncsCleanup(ctxt);
48860        call_tests++;
48861        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48862        xmlResetLastError();
48863        if (mem_base != xmlMemBlocks()) {
48864            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
48865	           xmlMemBlocks() - mem_base);
48866	    test_ret++;
48867            printf(" %d", n_ctxt);
48868            printf("\n");
48869        }
48870    }
48871    function_tests++;
48872#endif
48873
48874    return(test_ret);
48875}
48876
48877
48878static int
48879test_xmlXPathRegisteredNsCleanup(void) {
48880    int test_ret = 0;
48881
48882#if defined(LIBXML_XPATH_ENABLED)
48883    int mem_base;
48884    xmlXPathContextPtr ctxt; /* the XPath context */
48885    int n_ctxt;
48886
48887    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48888        mem_base = xmlMemBlocks();
48889        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48890
48891        xmlXPathRegisteredNsCleanup(ctxt);
48892        call_tests++;
48893        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48894        xmlResetLastError();
48895        if (mem_base != xmlMemBlocks()) {
48896            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
48897	           xmlMemBlocks() - mem_base);
48898	    test_ret++;
48899            printf(" %d", n_ctxt);
48900            printf("\n");
48901        }
48902    }
48903    function_tests++;
48904#endif
48905
48906    return(test_ret);
48907}
48908
48909
48910static int
48911test_xmlXPathRegisteredVariablesCleanup(void) {
48912    int test_ret = 0;
48913
48914#if defined(LIBXML_XPATH_ENABLED)
48915    int mem_base;
48916    xmlXPathContextPtr ctxt; /* the XPath context */
48917    int n_ctxt;
48918
48919    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48920        mem_base = xmlMemBlocks();
48921        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48922
48923        xmlXPathRegisteredVariablesCleanup(ctxt);
48924        call_tests++;
48925        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48926        xmlResetLastError();
48927        if (mem_base != xmlMemBlocks()) {
48928            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
48929	           xmlMemBlocks() - mem_base);
48930	    test_ret++;
48931            printf(" %d", n_ctxt);
48932            printf("\n");
48933        }
48934    }
48935    function_tests++;
48936#endif
48937
48938    return(test_ret);
48939}
48940
48941
48942static int
48943test_xmlXPathRoot(void) {
48944    int test_ret = 0;
48945
48946#if defined(LIBXML_XPATH_ENABLED)
48947    int mem_base;
48948    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48949    int n_ctxt;
48950
48951    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48952        mem_base = xmlMemBlocks();
48953        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48954
48955        xmlXPathRoot(ctxt);
48956        call_tests++;
48957        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48958        xmlResetLastError();
48959        if (mem_base != xmlMemBlocks()) {
48960            printf("Leak of %d blocks found in xmlXPathRoot",
48961	           xmlMemBlocks() - mem_base);
48962	    test_ret++;
48963            printf(" %d", n_ctxt);
48964            printf("\n");
48965        }
48966    }
48967    function_tests++;
48968#endif
48969
48970    return(test_ret);
48971}
48972
48973
48974static int
48975test_xmlXPathRoundFunction(void) {
48976    int test_ret = 0;
48977
48978#if defined(LIBXML_XPATH_ENABLED)
48979    int mem_base;
48980    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48981    int n_ctxt;
48982    int nargs; /* the number of arguments */
48983    int n_nargs;
48984
48985    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48986    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48987        mem_base = xmlMemBlocks();
48988        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48989        nargs = gen_int(n_nargs, 1);
48990
48991        xmlXPathRoundFunction(ctxt, nargs);
48992        call_tests++;
48993        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48994        des_int(n_nargs, nargs, 1);
48995        xmlResetLastError();
48996        if (mem_base != xmlMemBlocks()) {
48997            printf("Leak of %d blocks found in xmlXPathRoundFunction",
48998	           xmlMemBlocks() - mem_base);
48999	    test_ret++;
49000            printf(" %d", n_ctxt);
49001            printf(" %d", n_nargs);
49002            printf("\n");
49003        }
49004    }
49005    }
49006    function_tests++;
49007#endif
49008
49009    return(test_ret);
49010}
49011
49012
49013static int
49014test_xmlXPathStartsWithFunction(void) {
49015    int test_ret = 0;
49016
49017#if defined(LIBXML_XPATH_ENABLED)
49018    int mem_base;
49019    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49020    int n_ctxt;
49021    int nargs; /* the number of arguments */
49022    int n_nargs;
49023
49024    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49025    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49026        mem_base = xmlMemBlocks();
49027        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49028        nargs = gen_int(n_nargs, 1);
49029
49030        xmlXPathStartsWithFunction(ctxt, nargs);
49031        call_tests++;
49032        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49033        des_int(n_nargs, nargs, 1);
49034        xmlResetLastError();
49035        if (mem_base != xmlMemBlocks()) {
49036            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49037	           xmlMemBlocks() - mem_base);
49038	    test_ret++;
49039            printf(" %d", n_ctxt);
49040            printf(" %d", n_nargs);
49041            printf("\n");
49042        }
49043    }
49044    }
49045    function_tests++;
49046#endif
49047
49048    return(test_ret);
49049}
49050
49051
49052static int
49053test_xmlXPathStringEvalNumber(void) {
49054    int test_ret = 0;
49055
49056#if defined(LIBXML_XPATH_ENABLED)
49057    int mem_base;
49058    double ret_val;
49059    xmlChar * str; /* A string to scan */
49060    int n_str;
49061
49062    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49063        mem_base = xmlMemBlocks();
49064        str = gen_const_xmlChar_ptr(n_str, 0);
49065
49066        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49067        desret_double(ret_val);
49068        call_tests++;
49069        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49070        xmlResetLastError();
49071        if (mem_base != xmlMemBlocks()) {
49072            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49073	           xmlMemBlocks() - mem_base);
49074	    test_ret++;
49075            printf(" %d", n_str);
49076            printf("\n");
49077        }
49078    }
49079    function_tests++;
49080#endif
49081
49082    return(test_ret);
49083}
49084
49085
49086static int
49087test_xmlXPathStringFunction(void) {
49088    int test_ret = 0;
49089
49090#if defined(LIBXML_XPATH_ENABLED)
49091    int mem_base;
49092    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49093    int n_ctxt;
49094    int nargs; /* the number of arguments */
49095    int n_nargs;
49096
49097    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49098    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49099        mem_base = xmlMemBlocks();
49100        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49101        nargs = gen_int(n_nargs, 1);
49102
49103        xmlXPathStringFunction(ctxt, nargs);
49104        call_tests++;
49105        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49106        des_int(n_nargs, nargs, 1);
49107        xmlResetLastError();
49108        if (mem_base != xmlMemBlocks()) {
49109            printf("Leak of %d blocks found in xmlXPathStringFunction",
49110	           xmlMemBlocks() - mem_base);
49111	    test_ret++;
49112            printf(" %d", n_ctxt);
49113            printf(" %d", n_nargs);
49114            printf("\n");
49115        }
49116    }
49117    }
49118    function_tests++;
49119#endif
49120
49121    return(test_ret);
49122}
49123
49124
49125static int
49126test_xmlXPathStringLengthFunction(void) {
49127    int test_ret = 0;
49128
49129#if defined(LIBXML_XPATH_ENABLED)
49130    int mem_base;
49131    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49132    int n_ctxt;
49133    int nargs; /* the number of arguments */
49134    int n_nargs;
49135
49136    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49137    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49138        mem_base = xmlMemBlocks();
49139        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49140        nargs = gen_int(n_nargs, 1);
49141
49142        xmlXPathStringLengthFunction(ctxt, nargs);
49143        call_tests++;
49144        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49145        des_int(n_nargs, nargs, 1);
49146        xmlResetLastError();
49147        if (mem_base != xmlMemBlocks()) {
49148            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49149	           xmlMemBlocks() - mem_base);
49150	    test_ret++;
49151            printf(" %d", n_ctxt);
49152            printf(" %d", n_nargs);
49153            printf("\n");
49154        }
49155    }
49156    }
49157    function_tests++;
49158#endif
49159
49160    return(test_ret);
49161}
49162
49163
49164static int
49165test_xmlXPathSubValues(void) {
49166    int test_ret = 0;
49167
49168#if defined(LIBXML_XPATH_ENABLED)
49169    int mem_base;
49170    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49171    int n_ctxt;
49172
49173    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49174        mem_base = xmlMemBlocks();
49175        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49176
49177        xmlXPathSubValues(ctxt);
49178        call_tests++;
49179        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49180        xmlResetLastError();
49181        if (mem_base != xmlMemBlocks()) {
49182            printf("Leak of %d blocks found in xmlXPathSubValues",
49183	           xmlMemBlocks() - mem_base);
49184	    test_ret++;
49185            printf(" %d", n_ctxt);
49186            printf("\n");
49187        }
49188    }
49189    function_tests++;
49190#endif
49191
49192    return(test_ret);
49193}
49194
49195
49196static int
49197test_xmlXPathSubstringAfterFunction(void) {
49198    int test_ret = 0;
49199
49200#if defined(LIBXML_XPATH_ENABLED)
49201    int mem_base;
49202    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49203    int n_ctxt;
49204    int nargs; /* the number of arguments */
49205    int n_nargs;
49206
49207    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49208    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49209        mem_base = xmlMemBlocks();
49210        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49211        nargs = gen_int(n_nargs, 1);
49212
49213        xmlXPathSubstringAfterFunction(ctxt, nargs);
49214        call_tests++;
49215        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49216        des_int(n_nargs, nargs, 1);
49217        xmlResetLastError();
49218        if (mem_base != xmlMemBlocks()) {
49219            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
49220	           xmlMemBlocks() - mem_base);
49221	    test_ret++;
49222            printf(" %d", n_ctxt);
49223            printf(" %d", n_nargs);
49224            printf("\n");
49225        }
49226    }
49227    }
49228    function_tests++;
49229#endif
49230
49231    return(test_ret);
49232}
49233
49234
49235static int
49236test_xmlXPathSubstringBeforeFunction(void) {
49237    int test_ret = 0;
49238
49239#if defined(LIBXML_XPATH_ENABLED)
49240    int mem_base;
49241    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49242    int n_ctxt;
49243    int nargs; /* the number of arguments */
49244    int n_nargs;
49245
49246    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49247    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49248        mem_base = xmlMemBlocks();
49249        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49250        nargs = gen_int(n_nargs, 1);
49251
49252        xmlXPathSubstringBeforeFunction(ctxt, nargs);
49253        call_tests++;
49254        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49255        des_int(n_nargs, nargs, 1);
49256        xmlResetLastError();
49257        if (mem_base != xmlMemBlocks()) {
49258            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
49259	           xmlMemBlocks() - mem_base);
49260	    test_ret++;
49261            printf(" %d", n_ctxt);
49262            printf(" %d", n_nargs);
49263            printf("\n");
49264        }
49265    }
49266    }
49267    function_tests++;
49268#endif
49269
49270    return(test_ret);
49271}
49272
49273
49274static int
49275test_xmlXPathSubstringFunction(void) {
49276    int test_ret = 0;
49277
49278#if defined(LIBXML_XPATH_ENABLED)
49279    int mem_base;
49280    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49281    int n_ctxt;
49282    int nargs; /* the number of arguments */
49283    int n_nargs;
49284
49285    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49286    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49287        mem_base = xmlMemBlocks();
49288        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49289        nargs = gen_int(n_nargs, 1);
49290
49291        xmlXPathSubstringFunction(ctxt, nargs);
49292        call_tests++;
49293        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49294        des_int(n_nargs, nargs, 1);
49295        xmlResetLastError();
49296        if (mem_base != xmlMemBlocks()) {
49297            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
49298	           xmlMemBlocks() - mem_base);
49299	    test_ret++;
49300            printf(" %d", n_ctxt);
49301            printf(" %d", n_nargs);
49302            printf("\n");
49303        }
49304    }
49305    }
49306    function_tests++;
49307#endif
49308
49309    return(test_ret);
49310}
49311
49312
49313static int
49314test_xmlXPathSumFunction(void) {
49315    int test_ret = 0;
49316
49317#if defined(LIBXML_XPATH_ENABLED)
49318    int mem_base;
49319    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49320    int n_ctxt;
49321    int nargs; /* the number of arguments */
49322    int n_nargs;
49323
49324    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49325    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49326        mem_base = xmlMemBlocks();
49327        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49328        nargs = gen_int(n_nargs, 1);
49329
49330        xmlXPathSumFunction(ctxt, nargs);
49331        call_tests++;
49332        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49333        des_int(n_nargs, nargs, 1);
49334        xmlResetLastError();
49335        if (mem_base != xmlMemBlocks()) {
49336            printf("Leak of %d blocks found in xmlXPathSumFunction",
49337	           xmlMemBlocks() - mem_base);
49338	    test_ret++;
49339            printf(" %d", n_ctxt);
49340            printf(" %d", n_nargs);
49341            printf("\n");
49342        }
49343    }
49344    }
49345    function_tests++;
49346#endif
49347
49348    return(test_ret);
49349}
49350
49351
49352static int
49353test_xmlXPathTrailing(void) {
49354    int test_ret = 0;
49355
49356#if defined(LIBXML_XPATH_ENABLED)
49357    int mem_base;
49358    xmlNodeSetPtr ret_val;
49359    xmlNodeSetPtr nodes1; /* a node-set */
49360    int n_nodes1;
49361    xmlNodeSetPtr nodes2; /* a node-set */
49362    int n_nodes2;
49363
49364    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49365    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49366        mem_base = xmlMemBlocks();
49367        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49368        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49369
49370        ret_val = xmlXPathTrailing(nodes1, nodes2);
49371        desret_xmlNodeSetPtr(ret_val);
49372        call_tests++;
49373        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49374        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49375        xmlResetLastError();
49376        if (mem_base != xmlMemBlocks()) {
49377            printf("Leak of %d blocks found in xmlXPathTrailing",
49378	           xmlMemBlocks() - mem_base);
49379	    test_ret++;
49380            printf(" %d", n_nodes1);
49381            printf(" %d", n_nodes2);
49382            printf("\n");
49383        }
49384    }
49385    }
49386    function_tests++;
49387#endif
49388
49389    return(test_ret);
49390}
49391
49392
49393static int
49394test_xmlXPathTrailingSorted(void) {
49395    int test_ret = 0;
49396
49397#if defined(LIBXML_XPATH_ENABLED)
49398    int mem_base;
49399    xmlNodeSetPtr ret_val;
49400    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
49401    int n_nodes1;
49402    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
49403    int n_nodes2;
49404
49405    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49406    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49407        mem_base = xmlMemBlocks();
49408        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49409        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49410
49411        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
49412        desret_xmlNodeSetPtr(ret_val);
49413        call_tests++;
49414        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49415        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49416        xmlResetLastError();
49417        if (mem_base != xmlMemBlocks()) {
49418            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
49419	           xmlMemBlocks() - mem_base);
49420	    test_ret++;
49421            printf(" %d", n_nodes1);
49422            printf(" %d", n_nodes2);
49423            printf("\n");
49424        }
49425    }
49426    }
49427    function_tests++;
49428#endif
49429
49430    return(test_ret);
49431}
49432
49433
49434static int
49435test_xmlXPathTranslateFunction(void) {
49436    int test_ret = 0;
49437
49438#if defined(LIBXML_XPATH_ENABLED)
49439    int mem_base;
49440    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49441    int n_ctxt;
49442    int nargs; /* the number of arguments */
49443    int n_nargs;
49444
49445    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49446    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49447        mem_base = xmlMemBlocks();
49448        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49449        nargs = gen_int(n_nargs, 1);
49450
49451        xmlXPathTranslateFunction(ctxt, nargs);
49452        call_tests++;
49453        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49454        des_int(n_nargs, nargs, 1);
49455        xmlResetLastError();
49456        if (mem_base != xmlMemBlocks()) {
49457            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
49458	           xmlMemBlocks() - mem_base);
49459	    test_ret++;
49460            printf(" %d", n_ctxt);
49461            printf(" %d", n_nargs);
49462            printf("\n");
49463        }
49464    }
49465    }
49466    function_tests++;
49467#endif
49468
49469    return(test_ret);
49470}
49471
49472
49473static int
49474test_xmlXPathTrueFunction(void) {
49475    int test_ret = 0;
49476
49477#if defined(LIBXML_XPATH_ENABLED)
49478    int mem_base;
49479    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49480    int n_ctxt;
49481    int nargs; /* the number of arguments */
49482    int n_nargs;
49483
49484    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49485    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49486        mem_base = xmlMemBlocks();
49487        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49488        nargs = gen_int(n_nargs, 1);
49489
49490        xmlXPathTrueFunction(ctxt, nargs);
49491        call_tests++;
49492        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49493        des_int(n_nargs, nargs, 1);
49494        xmlResetLastError();
49495        if (mem_base != xmlMemBlocks()) {
49496            printf("Leak of %d blocks found in xmlXPathTrueFunction",
49497	           xmlMemBlocks() - mem_base);
49498	    test_ret++;
49499            printf(" %d", n_ctxt);
49500            printf(" %d", n_nargs);
49501            printf("\n");
49502        }
49503    }
49504    }
49505    function_tests++;
49506#endif
49507
49508    return(test_ret);
49509}
49510
49511
49512static int
49513test_xmlXPathValueFlipSign(void) {
49514    int test_ret = 0;
49515
49516#if defined(LIBXML_XPATH_ENABLED)
49517    int mem_base;
49518    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49519    int n_ctxt;
49520
49521    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49522        mem_base = xmlMemBlocks();
49523        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49524
49525        xmlXPathValueFlipSign(ctxt);
49526        call_tests++;
49527        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49528        xmlResetLastError();
49529        if (mem_base != xmlMemBlocks()) {
49530            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
49531	           xmlMemBlocks() - mem_base);
49532	    test_ret++;
49533            printf(" %d", n_ctxt);
49534            printf("\n");
49535        }
49536    }
49537    function_tests++;
49538#endif
49539
49540    return(test_ret);
49541}
49542
49543
49544static int
49545test_xmlXPathVariableLookup(void) {
49546    int test_ret = 0;
49547
49548#if defined(LIBXML_XPATH_ENABLED)
49549    int mem_base;
49550    xmlXPathObjectPtr ret_val;
49551    xmlXPathContextPtr ctxt; /* the XPath context */
49552    int n_ctxt;
49553    xmlChar * name; /* the variable name */
49554    int n_name;
49555
49556    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49557    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49558        mem_base = xmlMemBlocks();
49559        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49560        name = gen_const_xmlChar_ptr(n_name, 1);
49561
49562        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
49563        desret_xmlXPathObjectPtr(ret_val);
49564        call_tests++;
49565        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49566        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49567        xmlResetLastError();
49568        if (mem_base != xmlMemBlocks()) {
49569            printf("Leak of %d blocks found in xmlXPathVariableLookup",
49570	           xmlMemBlocks() - mem_base);
49571	    test_ret++;
49572            printf(" %d", n_ctxt);
49573            printf(" %d", n_name);
49574            printf("\n");
49575        }
49576    }
49577    }
49578    function_tests++;
49579#endif
49580
49581    return(test_ret);
49582}
49583
49584
49585static int
49586test_xmlXPathVariableLookupNS(void) {
49587    int test_ret = 0;
49588
49589#if defined(LIBXML_XPATH_ENABLED)
49590    int mem_base;
49591    xmlXPathObjectPtr ret_val;
49592    xmlXPathContextPtr ctxt; /* the XPath context */
49593    int n_ctxt;
49594    xmlChar * name; /* the variable name */
49595    int n_name;
49596    xmlChar * ns_uri; /* the variable namespace URI */
49597    int n_ns_uri;
49598
49599    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49600    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49601    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49602        mem_base = xmlMemBlocks();
49603        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49604        name = gen_const_xmlChar_ptr(n_name, 1);
49605        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49606
49607        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
49608        desret_xmlXPathObjectPtr(ret_val);
49609        call_tests++;
49610        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49611        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49612        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49613        xmlResetLastError();
49614        if (mem_base != xmlMemBlocks()) {
49615            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
49616	           xmlMemBlocks() - mem_base);
49617	    test_ret++;
49618            printf(" %d", n_ctxt);
49619            printf(" %d", n_name);
49620            printf(" %d", n_ns_uri);
49621            printf("\n");
49622        }
49623    }
49624    }
49625    }
49626    function_tests++;
49627#endif
49628
49629    return(test_ret);
49630}
49631
49632
49633static int
49634test_xmlXPathWrapCString(void) {
49635    int test_ret = 0;
49636
49637#if defined(LIBXML_XPATH_ENABLED)
49638    int mem_base;
49639    xmlXPathObjectPtr ret_val;
49640    char * val; /* the char * value */
49641    int n_val;
49642
49643    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
49644        mem_base = xmlMemBlocks();
49645        val = gen_char_ptr(n_val, 0);
49646
49647        ret_val = xmlXPathWrapCString(val);
49648        desret_xmlXPathObjectPtr(ret_val);
49649        call_tests++;
49650        des_char_ptr(n_val, val, 0);
49651        xmlResetLastError();
49652        if (mem_base != xmlMemBlocks()) {
49653            printf("Leak of %d blocks found in xmlXPathWrapCString",
49654	           xmlMemBlocks() - mem_base);
49655	    test_ret++;
49656            printf(" %d", n_val);
49657            printf("\n");
49658        }
49659    }
49660    function_tests++;
49661#endif
49662
49663    return(test_ret);
49664}
49665
49666
49667static int
49668test_xmlXPathWrapExternal(void) {
49669    int test_ret = 0;
49670
49671#if defined(LIBXML_XPATH_ENABLED)
49672    int mem_base;
49673    xmlXPathObjectPtr ret_val;
49674    void * val; /* the user data */
49675    int n_val;
49676
49677    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
49678        mem_base = xmlMemBlocks();
49679        val = gen_void_ptr(n_val, 0);
49680
49681        ret_val = xmlXPathWrapExternal(val);
49682        desret_xmlXPathObjectPtr(ret_val);
49683        call_tests++;
49684        des_void_ptr(n_val, val, 0);
49685        xmlResetLastError();
49686        if (mem_base != xmlMemBlocks()) {
49687            printf("Leak of %d blocks found in xmlXPathWrapExternal",
49688	           xmlMemBlocks() - mem_base);
49689	    test_ret++;
49690            printf(" %d", n_val);
49691            printf("\n");
49692        }
49693    }
49694    function_tests++;
49695#endif
49696
49697    return(test_ret);
49698}
49699
49700
49701static int
49702test_xmlXPathWrapNodeSet(void) {
49703    int test_ret = 0;
49704
49705#if defined(LIBXML_XPATH_ENABLED)
49706    int mem_base;
49707    xmlXPathObjectPtr ret_val;
49708    xmlNodeSetPtr val; /* the NodePtr value */
49709    int n_val;
49710
49711    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
49712        mem_base = xmlMemBlocks();
49713        val = gen_xmlNodeSetPtr(n_val, 0);
49714
49715        ret_val = xmlXPathWrapNodeSet(val);
49716        desret_xmlXPathObjectPtr(ret_val);
49717        call_tests++;
49718        des_xmlNodeSetPtr(n_val, val, 0);
49719        xmlResetLastError();
49720        if (mem_base != xmlMemBlocks()) {
49721            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
49722	           xmlMemBlocks() - mem_base);
49723	    test_ret++;
49724            printf(" %d", n_val);
49725            printf("\n");
49726        }
49727    }
49728    function_tests++;
49729#endif
49730
49731    return(test_ret);
49732}
49733
49734
49735static int
49736test_xmlXPatherror(void) {
49737    int test_ret = 0;
49738
49739#if defined(LIBXML_XPATH_ENABLED)
49740    int mem_base;
49741    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49742    int n_ctxt;
49743    const char * file; /* the file name */
49744    int n_file;
49745    int line; /* the line number */
49746    int n_line;
49747    int no; /* the error number */
49748    int n_no;
49749
49750    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49751    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
49752    for (n_line = 0;n_line < gen_nb_int;n_line++) {
49753    for (n_no = 0;n_no < gen_nb_int;n_no++) {
49754        mem_base = xmlMemBlocks();
49755        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49756        file = gen_filepath(n_file, 1);
49757        line = gen_int(n_line, 2);
49758        no = gen_int(n_no, 3);
49759
49760        xmlXPatherror(ctxt, file, line, no);
49761        call_tests++;
49762        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49763        des_filepath(n_file, file, 1);
49764        des_int(n_line, line, 2);
49765        des_int(n_no, no, 3);
49766        xmlResetLastError();
49767        if (mem_base != xmlMemBlocks()) {
49768            printf("Leak of %d blocks found in xmlXPatherror",
49769	           xmlMemBlocks() - mem_base);
49770	    test_ret++;
49771            printf(" %d", n_ctxt);
49772            printf(" %d", n_file);
49773            printf(" %d", n_line);
49774            printf(" %d", n_no);
49775            printf("\n");
49776        }
49777    }
49778    }
49779    }
49780    }
49781    function_tests++;
49782#endif
49783
49784    return(test_ret);
49785}
49786
49787static int
49788test_xpathInternals(void) {
49789    int test_ret = 0;
49790
49791    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
49792    test_ret += test_valuePop();
49793    test_ret += test_valuePush();
49794    test_ret += test_xmlXPathAddValues();
49795    test_ret += test_xmlXPathBooleanFunction();
49796    test_ret += test_xmlXPathCeilingFunction();
49797    test_ret += test_xmlXPathCompareValues();
49798    test_ret += test_xmlXPathConcatFunction();
49799    test_ret += test_xmlXPathContainsFunction();
49800    test_ret += test_xmlXPathCountFunction();
49801    test_ret += test_xmlXPathDebugDumpCompExpr();
49802    test_ret += test_xmlXPathDebugDumpObject();
49803    test_ret += test_xmlXPathDifference();
49804    test_ret += test_xmlXPathDistinct();
49805    test_ret += test_xmlXPathDistinctSorted();
49806    test_ret += test_xmlXPathDivValues();
49807    test_ret += test_xmlXPathEqualValues();
49808    test_ret += test_xmlXPathErr();
49809    test_ret += test_xmlXPathEvalExpr();
49810    test_ret += test_xmlXPathEvaluatePredicateResult();
49811    test_ret += test_xmlXPathFalseFunction();
49812    test_ret += test_xmlXPathFloorFunction();
49813    test_ret += test_xmlXPathFunctionLookup();
49814    test_ret += test_xmlXPathFunctionLookupNS();
49815    test_ret += test_xmlXPathHasSameNodes();
49816    test_ret += test_xmlXPathIdFunction();
49817    test_ret += test_xmlXPathIntersection();
49818    test_ret += test_xmlXPathIsNodeType();
49819    test_ret += test_xmlXPathLangFunction();
49820    test_ret += test_xmlXPathLastFunction();
49821    test_ret += test_xmlXPathLeading();
49822    test_ret += test_xmlXPathLeadingSorted();
49823    test_ret += test_xmlXPathLocalNameFunction();
49824    test_ret += test_xmlXPathModValues();
49825    test_ret += test_xmlXPathMultValues();
49826    test_ret += test_xmlXPathNamespaceURIFunction();
49827    test_ret += test_xmlXPathNewBoolean();
49828    test_ret += test_xmlXPathNewCString();
49829    test_ret += test_xmlXPathNewFloat();
49830    test_ret += test_xmlXPathNewNodeSet();
49831    test_ret += test_xmlXPathNewNodeSetList();
49832    test_ret += test_xmlXPathNewParserContext();
49833    test_ret += test_xmlXPathNewString();
49834    test_ret += test_xmlXPathNextAncestor();
49835    test_ret += test_xmlXPathNextAncestorOrSelf();
49836    test_ret += test_xmlXPathNextAttribute();
49837    test_ret += test_xmlXPathNextChild();
49838    test_ret += test_xmlXPathNextDescendant();
49839    test_ret += test_xmlXPathNextDescendantOrSelf();
49840    test_ret += test_xmlXPathNextFollowing();
49841    test_ret += test_xmlXPathNextFollowingSibling();
49842    test_ret += test_xmlXPathNextNamespace();
49843    test_ret += test_xmlXPathNextParent();
49844    test_ret += test_xmlXPathNextPreceding();
49845    test_ret += test_xmlXPathNextPrecedingSibling();
49846    test_ret += test_xmlXPathNextSelf();
49847    test_ret += test_xmlXPathNodeLeading();
49848    test_ret += test_xmlXPathNodeLeadingSorted();
49849    test_ret += test_xmlXPathNodeSetAdd();
49850    test_ret += test_xmlXPathNodeSetAddNs();
49851    test_ret += test_xmlXPathNodeSetAddUnique();
49852    test_ret += test_xmlXPathNodeSetContains();
49853    test_ret += test_xmlXPathNodeSetDel();
49854    test_ret += test_xmlXPathNodeSetMerge();
49855    test_ret += test_xmlXPathNodeSetRemove();
49856    test_ret += test_xmlXPathNodeSetSort();
49857    test_ret += test_xmlXPathNodeTrailing();
49858    test_ret += test_xmlXPathNodeTrailingSorted();
49859    test_ret += test_xmlXPathNormalizeFunction();
49860    test_ret += test_xmlXPathNotEqualValues();
49861    test_ret += test_xmlXPathNotFunction();
49862    test_ret += test_xmlXPathNsLookup();
49863    test_ret += test_xmlXPathNumberFunction();
49864    test_ret += test_xmlXPathParseNCName();
49865    test_ret += test_xmlXPathParseName();
49866    test_ret += test_xmlXPathPopBoolean();
49867    test_ret += test_xmlXPathPopExternal();
49868    test_ret += test_xmlXPathPopNodeSet();
49869    test_ret += test_xmlXPathPopNumber();
49870    test_ret += test_xmlXPathPopString();
49871    test_ret += test_xmlXPathPositionFunction();
49872    test_ret += test_xmlXPathRegisterAllFunctions();
49873    test_ret += test_xmlXPathRegisterFunc();
49874    test_ret += test_xmlXPathRegisterFuncLookup();
49875    test_ret += test_xmlXPathRegisterFuncNS();
49876    test_ret += test_xmlXPathRegisterNs();
49877    test_ret += test_xmlXPathRegisterVariable();
49878    test_ret += test_xmlXPathRegisterVariableLookup();
49879    test_ret += test_xmlXPathRegisterVariableNS();
49880    test_ret += test_xmlXPathRegisteredFuncsCleanup();
49881    test_ret += test_xmlXPathRegisteredNsCleanup();
49882    test_ret += test_xmlXPathRegisteredVariablesCleanup();
49883    test_ret += test_xmlXPathRoot();
49884    test_ret += test_xmlXPathRoundFunction();
49885    test_ret += test_xmlXPathStartsWithFunction();
49886    test_ret += test_xmlXPathStringEvalNumber();
49887    test_ret += test_xmlXPathStringFunction();
49888    test_ret += test_xmlXPathStringLengthFunction();
49889    test_ret += test_xmlXPathSubValues();
49890    test_ret += test_xmlXPathSubstringAfterFunction();
49891    test_ret += test_xmlXPathSubstringBeforeFunction();
49892    test_ret += test_xmlXPathSubstringFunction();
49893    test_ret += test_xmlXPathSumFunction();
49894    test_ret += test_xmlXPathTrailing();
49895    test_ret += test_xmlXPathTrailingSorted();
49896    test_ret += test_xmlXPathTranslateFunction();
49897    test_ret += test_xmlXPathTrueFunction();
49898    test_ret += test_xmlXPathValueFlipSign();
49899    test_ret += test_xmlXPathVariableLookup();
49900    test_ret += test_xmlXPathVariableLookupNS();
49901    test_ret += test_xmlXPathWrapCString();
49902    test_ret += test_xmlXPathWrapExternal();
49903    test_ret += test_xmlXPathWrapNodeSet();
49904    test_ret += test_xmlXPatherror();
49905
49906    if (test_ret != 0)
49907	printf("Module xpathInternals: %d errors\n", test_ret);
49908    return(test_ret);
49909}
49910
49911static int
49912test_xmlXPtrBuildNodeList(void) {
49913    int test_ret = 0;
49914
49915#if defined(LIBXML_XPTR_ENABLED)
49916    int mem_base;
49917    xmlNodePtr ret_val;
49918    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
49919    int n_obj;
49920
49921    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
49922        mem_base = xmlMemBlocks();
49923        obj = gen_xmlXPathObjectPtr(n_obj, 0);
49924
49925        ret_val = xmlXPtrBuildNodeList(obj);
49926        desret_xmlNodePtr(ret_val);
49927        call_tests++;
49928        des_xmlXPathObjectPtr(n_obj, obj, 0);
49929        xmlResetLastError();
49930        if (mem_base != xmlMemBlocks()) {
49931            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
49932	           xmlMemBlocks() - mem_base);
49933	    test_ret++;
49934            printf(" %d", n_obj);
49935            printf("\n");
49936        }
49937    }
49938    function_tests++;
49939#endif
49940
49941    return(test_ret);
49942}
49943
49944
49945static int
49946test_xmlXPtrEval(void) {
49947    int test_ret = 0;
49948
49949#if defined(LIBXML_XPTR_ENABLED)
49950    int mem_base;
49951    xmlXPathObjectPtr ret_val;
49952    xmlChar * str; /* the XPointer expression */
49953    int n_str;
49954    xmlXPathContextPtr ctx; /* the XPointer context */
49955    int n_ctx;
49956
49957    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49958    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
49959        mem_base = xmlMemBlocks();
49960        str = gen_const_xmlChar_ptr(n_str, 0);
49961        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
49962
49963        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
49964        desret_xmlXPathObjectPtr(ret_val);
49965        call_tests++;
49966        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49967        des_xmlXPathContextPtr(n_ctx, ctx, 1);
49968        xmlResetLastError();
49969        if (mem_base != xmlMemBlocks()) {
49970            printf("Leak of %d blocks found in xmlXPtrEval",
49971	           xmlMemBlocks() - mem_base);
49972	    test_ret++;
49973            printf(" %d", n_str);
49974            printf(" %d", n_ctx);
49975            printf("\n");
49976        }
49977    }
49978    }
49979    function_tests++;
49980#endif
49981
49982    return(test_ret);
49983}
49984
49985
49986static int
49987test_xmlXPtrEvalRangePredicate(void) {
49988    int test_ret = 0;
49989
49990#if defined(LIBXML_XPTR_ENABLED)
49991    int mem_base;
49992    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
49993    int n_ctxt;
49994
49995    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49996        mem_base = xmlMemBlocks();
49997        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49998
49999        xmlXPtrEvalRangePredicate(ctxt);
50000        call_tests++;
50001        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50002        xmlResetLastError();
50003        if (mem_base != xmlMemBlocks()) {
50004            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50005	           xmlMemBlocks() - mem_base);
50006	    test_ret++;
50007            printf(" %d", n_ctxt);
50008            printf("\n");
50009        }
50010    }
50011    function_tests++;
50012#endif
50013
50014    return(test_ret);
50015}
50016
50017#ifdef LIBXML_XPTR_ENABLED
50018
50019#define gen_nb_xmlLocationSetPtr 1
50020static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50021    return(NULL);
50022}
50023static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50024}
50025#endif
50026
50027
50028static int
50029test_xmlXPtrLocationSetAdd(void) {
50030    int test_ret = 0;
50031
50032#if defined(LIBXML_XPTR_ENABLED)
50033    int mem_base;
50034    xmlLocationSetPtr cur; /* the initial range set */
50035    int n_cur;
50036    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50037    int n_val;
50038
50039    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50040    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50041        mem_base = xmlMemBlocks();
50042        cur = gen_xmlLocationSetPtr(n_cur, 0);
50043        val = gen_xmlXPathObjectPtr(n_val, 1);
50044
50045        xmlXPtrLocationSetAdd(cur, val);
50046        call_tests++;
50047        des_xmlLocationSetPtr(n_cur, cur, 0);
50048        des_xmlXPathObjectPtr(n_val, val, 1);
50049        xmlResetLastError();
50050        if (mem_base != xmlMemBlocks()) {
50051            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50052	           xmlMemBlocks() - mem_base);
50053	    test_ret++;
50054            printf(" %d", n_cur);
50055            printf(" %d", n_val);
50056            printf("\n");
50057        }
50058    }
50059    }
50060    function_tests++;
50061#endif
50062
50063    return(test_ret);
50064}
50065
50066
50067static int
50068test_xmlXPtrLocationSetCreate(void) {
50069    int test_ret = 0;
50070
50071
50072    /* missing type support */
50073    return(test_ret);
50074}
50075
50076
50077static int
50078test_xmlXPtrLocationSetDel(void) {
50079    int test_ret = 0;
50080
50081#if defined(LIBXML_XPTR_ENABLED)
50082    int mem_base;
50083    xmlLocationSetPtr cur; /* the initial range set */
50084    int n_cur;
50085    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50086    int n_val;
50087
50088    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50089    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50090        mem_base = xmlMemBlocks();
50091        cur = gen_xmlLocationSetPtr(n_cur, 0);
50092        val = gen_xmlXPathObjectPtr(n_val, 1);
50093
50094        xmlXPtrLocationSetDel(cur, val);
50095        call_tests++;
50096        des_xmlLocationSetPtr(n_cur, cur, 0);
50097        des_xmlXPathObjectPtr(n_val, val, 1);
50098        xmlResetLastError();
50099        if (mem_base != xmlMemBlocks()) {
50100            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50101	           xmlMemBlocks() - mem_base);
50102	    test_ret++;
50103            printf(" %d", n_cur);
50104            printf(" %d", n_val);
50105            printf("\n");
50106        }
50107    }
50108    }
50109    function_tests++;
50110#endif
50111
50112    return(test_ret);
50113}
50114
50115
50116static int
50117test_xmlXPtrLocationSetMerge(void) {
50118    int test_ret = 0;
50119
50120
50121    /* missing type support */
50122    return(test_ret);
50123}
50124
50125
50126static int
50127test_xmlXPtrLocationSetRemove(void) {
50128    int test_ret = 0;
50129
50130#if defined(LIBXML_XPTR_ENABLED)
50131    int mem_base;
50132    xmlLocationSetPtr cur; /* the initial range set */
50133    int n_cur;
50134    int val; /* the index to remove */
50135    int n_val;
50136
50137    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50138    for (n_val = 0;n_val < gen_nb_int;n_val++) {
50139        mem_base = xmlMemBlocks();
50140        cur = gen_xmlLocationSetPtr(n_cur, 0);
50141        val = gen_int(n_val, 1);
50142
50143        xmlXPtrLocationSetRemove(cur, val);
50144        call_tests++;
50145        des_xmlLocationSetPtr(n_cur, cur, 0);
50146        des_int(n_val, val, 1);
50147        xmlResetLastError();
50148        if (mem_base != xmlMemBlocks()) {
50149            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50150	           xmlMemBlocks() - mem_base);
50151	    test_ret++;
50152            printf(" %d", n_cur);
50153            printf(" %d", n_val);
50154            printf("\n");
50155        }
50156    }
50157    }
50158    function_tests++;
50159#endif
50160
50161    return(test_ret);
50162}
50163
50164
50165static int
50166test_xmlXPtrNewCollapsedRange(void) {
50167    int test_ret = 0;
50168
50169#if defined(LIBXML_XPTR_ENABLED)
50170    int mem_base;
50171    xmlXPathObjectPtr ret_val;
50172    xmlNodePtr start; /* the starting and ending node */
50173    int n_start;
50174
50175    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50176        mem_base = xmlMemBlocks();
50177        start = gen_xmlNodePtr(n_start, 0);
50178
50179        ret_val = xmlXPtrNewCollapsedRange(start);
50180        desret_xmlXPathObjectPtr(ret_val);
50181        call_tests++;
50182        des_xmlNodePtr(n_start, start, 0);
50183        xmlResetLastError();
50184        if (mem_base != xmlMemBlocks()) {
50185            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50186	           xmlMemBlocks() - mem_base);
50187	    test_ret++;
50188            printf(" %d", n_start);
50189            printf("\n");
50190        }
50191    }
50192    function_tests++;
50193#endif
50194
50195    return(test_ret);
50196}
50197
50198
50199static int
50200test_xmlXPtrNewContext(void) {
50201    int test_ret = 0;
50202
50203
50204    /* missing type support */
50205    return(test_ret);
50206}
50207
50208
50209static int
50210test_xmlXPtrNewLocationSetNodeSet(void) {
50211    int test_ret = 0;
50212
50213#if defined(LIBXML_XPTR_ENABLED)
50214    int mem_base;
50215    xmlXPathObjectPtr ret_val;
50216    xmlNodeSetPtr set; /* a node set */
50217    int n_set;
50218
50219    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50220        mem_base = xmlMemBlocks();
50221        set = gen_xmlNodeSetPtr(n_set, 0);
50222
50223        ret_val = xmlXPtrNewLocationSetNodeSet(set);
50224        desret_xmlXPathObjectPtr(ret_val);
50225        call_tests++;
50226        des_xmlNodeSetPtr(n_set, set, 0);
50227        xmlResetLastError();
50228        if (mem_base != xmlMemBlocks()) {
50229            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
50230	           xmlMemBlocks() - mem_base);
50231	    test_ret++;
50232            printf(" %d", n_set);
50233            printf("\n");
50234        }
50235    }
50236    function_tests++;
50237#endif
50238
50239    return(test_ret);
50240}
50241
50242
50243static int
50244test_xmlXPtrNewLocationSetNodes(void) {
50245    int test_ret = 0;
50246
50247#if defined(LIBXML_XPTR_ENABLED)
50248    int mem_base;
50249    xmlXPathObjectPtr ret_val;
50250    xmlNodePtr start; /* the start NodePtr value */
50251    int n_start;
50252    xmlNodePtr end; /* the end NodePtr value or NULL */
50253    int n_end;
50254
50255    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50256    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50257        mem_base = xmlMemBlocks();
50258        start = gen_xmlNodePtr(n_start, 0);
50259        end = gen_xmlNodePtr(n_end, 1);
50260
50261        ret_val = xmlXPtrNewLocationSetNodes(start, end);
50262        desret_xmlXPathObjectPtr(ret_val);
50263        call_tests++;
50264        des_xmlNodePtr(n_start, start, 0);
50265        des_xmlNodePtr(n_end, end, 1);
50266        xmlResetLastError();
50267        if (mem_base != xmlMemBlocks()) {
50268            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
50269	           xmlMemBlocks() - mem_base);
50270	    test_ret++;
50271            printf(" %d", n_start);
50272            printf(" %d", n_end);
50273            printf("\n");
50274        }
50275    }
50276    }
50277    function_tests++;
50278#endif
50279
50280    return(test_ret);
50281}
50282
50283
50284static int
50285test_xmlXPtrNewRange(void) {
50286    int test_ret = 0;
50287
50288#if defined(LIBXML_XPTR_ENABLED)
50289    int mem_base;
50290    xmlXPathObjectPtr ret_val;
50291    xmlNodePtr start; /* the starting node */
50292    int n_start;
50293    int startindex; /* the start index */
50294    int n_startindex;
50295    xmlNodePtr end; /* the ending point */
50296    int n_end;
50297    int endindex; /* the ending index */
50298    int n_endindex;
50299
50300    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50301    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
50302    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50303    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
50304        mem_base = xmlMemBlocks();
50305        start = gen_xmlNodePtr(n_start, 0);
50306        startindex = gen_int(n_startindex, 1);
50307        end = gen_xmlNodePtr(n_end, 2);
50308        endindex = gen_int(n_endindex, 3);
50309
50310        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
50311        desret_xmlXPathObjectPtr(ret_val);
50312        call_tests++;
50313        des_xmlNodePtr(n_start, start, 0);
50314        des_int(n_startindex, startindex, 1);
50315        des_xmlNodePtr(n_end, end, 2);
50316        des_int(n_endindex, endindex, 3);
50317        xmlResetLastError();
50318        if (mem_base != xmlMemBlocks()) {
50319            printf("Leak of %d blocks found in xmlXPtrNewRange",
50320	           xmlMemBlocks() - mem_base);
50321	    test_ret++;
50322            printf(" %d", n_start);
50323            printf(" %d", n_startindex);
50324            printf(" %d", n_end);
50325            printf(" %d", n_endindex);
50326            printf("\n");
50327        }
50328    }
50329    }
50330    }
50331    }
50332    function_tests++;
50333#endif
50334
50335    return(test_ret);
50336}
50337
50338
50339static int
50340test_xmlXPtrNewRangeNodeObject(void) {
50341    int test_ret = 0;
50342
50343#if defined(LIBXML_XPTR_ENABLED)
50344    int mem_base;
50345    xmlXPathObjectPtr ret_val;
50346    xmlNodePtr start; /* the starting node */
50347    int n_start;
50348    xmlXPathObjectPtr end; /* the ending object */
50349    int n_end;
50350
50351    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50352    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50353        mem_base = xmlMemBlocks();
50354        start = gen_xmlNodePtr(n_start, 0);
50355        end = gen_xmlXPathObjectPtr(n_end, 1);
50356
50357        ret_val = xmlXPtrNewRangeNodeObject(start, end);
50358        desret_xmlXPathObjectPtr(ret_val);
50359        call_tests++;
50360        des_xmlNodePtr(n_start, start, 0);
50361        des_xmlXPathObjectPtr(n_end, end, 1);
50362        xmlResetLastError();
50363        if (mem_base != xmlMemBlocks()) {
50364            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
50365	           xmlMemBlocks() - mem_base);
50366	    test_ret++;
50367            printf(" %d", n_start);
50368            printf(" %d", n_end);
50369            printf("\n");
50370        }
50371    }
50372    }
50373    function_tests++;
50374#endif
50375
50376    return(test_ret);
50377}
50378
50379
50380static int
50381test_xmlXPtrNewRangeNodePoint(void) {
50382    int test_ret = 0;
50383
50384#if defined(LIBXML_XPTR_ENABLED)
50385    int mem_base;
50386    xmlXPathObjectPtr ret_val;
50387    xmlNodePtr start; /* the starting node */
50388    int n_start;
50389    xmlXPathObjectPtr end; /* the ending point */
50390    int n_end;
50391
50392    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50393    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50394        mem_base = xmlMemBlocks();
50395        start = gen_xmlNodePtr(n_start, 0);
50396        end = gen_xmlXPathObjectPtr(n_end, 1);
50397
50398        ret_val = xmlXPtrNewRangeNodePoint(start, end);
50399        desret_xmlXPathObjectPtr(ret_val);
50400        call_tests++;
50401        des_xmlNodePtr(n_start, start, 0);
50402        des_xmlXPathObjectPtr(n_end, end, 1);
50403        xmlResetLastError();
50404        if (mem_base != xmlMemBlocks()) {
50405            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
50406	           xmlMemBlocks() - mem_base);
50407	    test_ret++;
50408            printf(" %d", n_start);
50409            printf(" %d", n_end);
50410            printf("\n");
50411        }
50412    }
50413    }
50414    function_tests++;
50415#endif
50416
50417    return(test_ret);
50418}
50419
50420
50421static int
50422test_xmlXPtrNewRangeNodes(void) {
50423    int test_ret = 0;
50424
50425#if defined(LIBXML_XPTR_ENABLED)
50426    int mem_base;
50427    xmlXPathObjectPtr ret_val;
50428    xmlNodePtr start; /* the starting node */
50429    int n_start;
50430    xmlNodePtr end; /* the ending node */
50431    int n_end;
50432
50433    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50434    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50435        mem_base = xmlMemBlocks();
50436        start = gen_xmlNodePtr(n_start, 0);
50437        end = gen_xmlNodePtr(n_end, 1);
50438
50439        ret_val = xmlXPtrNewRangeNodes(start, end);
50440        desret_xmlXPathObjectPtr(ret_val);
50441        call_tests++;
50442        des_xmlNodePtr(n_start, start, 0);
50443        des_xmlNodePtr(n_end, end, 1);
50444        xmlResetLastError();
50445        if (mem_base != xmlMemBlocks()) {
50446            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
50447	           xmlMemBlocks() - mem_base);
50448	    test_ret++;
50449            printf(" %d", n_start);
50450            printf(" %d", n_end);
50451            printf("\n");
50452        }
50453    }
50454    }
50455    function_tests++;
50456#endif
50457
50458    return(test_ret);
50459}
50460
50461
50462static int
50463test_xmlXPtrNewRangePointNode(void) {
50464    int test_ret = 0;
50465
50466#if defined(LIBXML_XPTR_ENABLED)
50467    int mem_base;
50468    xmlXPathObjectPtr ret_val;
50469    xmlXPathObjectPtr start; /* the starting point */
50470    int n_start;
50471    xmlNodePtr end; /* the ending node */
50472    int n_end;
50473
50474    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
50475    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50476        mem_base = xmlMemBlocks();
50477        start = gen_xmlXPathObjectPtr(n_start, 0);
50478        end = gen_xmlNodePtr(n_end, 1);
50479
50480        ret_val = xmlXPtrNewRangePointNode(start, end);
50481        desret_xmlXPathObjectPtr(ret_val);
50482        call_tests++;
50483        des_xmlXPathObjectPtr(n_start, start, 0);
50484        des_xmlNodePtr(n_end, end, 1);
50485        xmlResetLastError();
50486        if (mem_base != xmlMemBlocks()) {
50487            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
50488	           xmlMemBlocks() - mem_base);
50489	    test_ret++;
50490            printf(" %d", n_start);
50491            printf(" %d", n_end);
50492            printf("\n");
50493        }
50494    }
50495    }
50496    function_tests++;
50497#endif
50498
50499    return(test_ret);
50500}
50501
50502
50503static int
50504test_xmlXPtrNewRangePoints(void) {
50505    int test_ret = 0;
50506
50507#if defined(LIBXML_XPTR_ENABLED)
50508    int mem_base;
50509    xmlXPathObjectPtr ret_val;
50510    xmlXPathObjectPtr start; /* the starting point */
50511    int n_start;
50512    xmlXPathObjectPtr end; /* the ending point */
50513    int n_end;
50514
50515    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
50516    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50517        mem_base = xmlMemBlocks();
50518        start = gen_xmlXPathObjectPtr(n_start, 0);
50519        end = gen_xmlXPathObjectPtr(n_end, 1);
50520
50521        ret_val = xmlXPtrNewRangePoints(start, end);
50522        desret_xmlXPathObjectPtr(ret_val);
50523        call_tests++;
50524        des_xmlXPathObjectPtr(n_start, start, 0);
50525        des_xmlXPathObjectPtr(n_end, end, 1);
50526        xmlResetLastError();
50527        if (mem_base != xmlMemBlocks()) {
50528            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
50529	           xmlMemBlocks() - mem_base);
50530	    test_ret++;
50531            printf(" %d", n_start);
50532            printf(" %d", n_end);
50533            printf("\n");
50534        }
50535    }
50536    }
50537    function_tests++;
50538#endif
50539
50540    return(test_ret);
50541}
50542
50543
50544static int
50545test_xmlXPtrRangeToFunction(void) {
50546    int test_ret = 0;
50547
50548#if defined(LIBXML_XPTR_ENABLED)
50549    int mem_base;
50550    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50551    int n_ctxt;
50552    int nargs; /* the number of args */
50553    int n_nargs;
50554
50555    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50556    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50557        mem_base = xmlMemBlocks();
50558        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50559        nargs = gen_int(n_nargs, 1);
50560
50561        xmlXPtrRangeToFunction(ctxt, nargs);
50562        call_tests++;
50563        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50564        des_int(n_nargs, nargs, 1);
50565        xmlResetLastError();
50566        if (mem_base != xmlMemBlocks()) {
50567            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
50568	           xmlMemBlocks() - mem_base);
50569	    test_ret++;
50570            printf(" %d", n_ctxt);
50571            printf(" %d", n_nargs);
50572            printf("\n");
50573        }
50574    }
50575    }
50576    function_tests++;
50577#endif
50578
50579    return(test_ret);
50580}
50581
50582
50583static int
50584test_xmlXPtrWrapLocationSet(void) {
50585    int test_ret = 0;
50586
50587#if defined(LIBXML_XPTR_ENABLED)
50588    int mem_base;
50589    xmlXPathObjectPtr ret_val;
50590    xmlLocationSetPtr val; /* the LocationSet value */
50591    int n_val;
50592
50593    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
50594        mem_base = xmlMemBlocks();
50595        val = gen_xmlLocationSetPtr(n_val, 0);
50596
50597        ret_val = xmlXPtrWrapLocationSet(val);
50598        desret_xmlXPathObjectPtr(ret_val);
50599        call_tests++;
50600        des_xmlLocationSetPtr(n_val, val, 0);
50601        xmlResetLastError();
50602        if (mem_base != xmlMemBlocks()) {
50603            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
50604	           xmlMemBlocks() - mem_base);
50605	    test_ret++;
50606            printf(" %d", n_val);
50607            printf("\n");
50608        }
50609    }
50610    function_tests++;
50611#endif
50612
50613    return(test_ret);
50614}
50615
50616static int
50617test_xpointer(void) {
50618    int test_ret = 0;
50619
50620    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
50621    test_ret += test_xmlXPtrBuildNodeList();
50622    test_ret += test_xmlXPtrEval();
50623    test_ret += test_xmlXPtrEvalRangePredicate();
50624    test_ret += test_xmlXPtrLocationSetAdd();
50625    test_ret += test_xmlXPtrLocationSetCreate();
50626    test_ret += test_xmlXPtrLocationSetDel();
50627    test_ret += test_xmlXPtrLocationSetMerge();
50628    test_ret += test_xmlXPtrLocationSetRemove();
50629    test_ret += test_xmlXPtrNewCollapsedRange();
50630    test_ret += test_xmlXPtrNewContext();
50631    test_ret += test_xmlXPtrNewLocationSetNodeSet();
50632    test_ret += test_xmlXPtrNewLocationSetNodes();
50633    test_ret += test_xmlXPtrNewRange();
50634    test_ret += test_xmlXPtrNewRangeNodeObject();
50635    test_ret += test_xmlXPtrNewRangeNodePoint();
50636    test_ret += test_xmlXPtrNewRangeNodes();
50637    test_ret += test_xmlXPtrNewRangePointNode();
50638    test_ret += test_xmlXPtrNewRangePoints();
50639    test_ret += test_xmlXPtrRangeToFunction();
50640    test_ret += test_xmlXPtrWrapLocationSet();
50641
50642    if (test_ret != 0)
50643	printf("Module xpointer: %d errors\n", test_ret);
50644    return(test_ret);
50645}
50646static int
50647test_module(const char *module) {
50648    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
50649    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
50650    if (!strcmp(module, "SAX2")) return(test_SAX2());
50651    if (!strcmp(module, "c14n")) return(test_c14n());
50652    if (!strcmp(module, "catalog")) return(test_catalog());
50653    if (!strcmp(module, "chvalid")) return(test_chvalid());
50654    if (!strcmp(module, "debugXML")) return(test_debugXML());
50655    if (!strcmp(module, "dict")) return(test_dict());
50656    if (!strcmp(module, "encoding")) return(test_encoding());
50657    if (!strcmp(module, "entities")) return(test_entities());
50658    if (!strcmp(module, "hash")) return(test_hash());
50659    if (!strcmp(module, "list")) return(test_list());
50660    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
50661    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
50662    if (!strcmp(module, "parser")) return(test_parser());
50663    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
50664    if (!strcmp(module, "pattern")) return(test_pattern());
50665    if (!strcmp(module, "relaxng")) return(test_relaxng());
50666    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
50667    if (!strcmp(module, "schematron")) return(test_schematron());
50668    if (!strcmp(module, "tree")) return(test_tree());
50669    if (!strcmp(module, "uri")) return(test_uri());
50670    if (!strcmp(module, "valid")) return(test_valid());
50671    if (!strcmp(module, "xinclude")) return(test_xinclude());
50672    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
50673    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
50674    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
50675    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
50676    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
50677    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
50678    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
50679    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
50680    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
50681    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
50682    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
50683    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
50684    if (!strcmp(module, "xpath")) return(test_xpath());
50685    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
50686    if (!strcmp(module, "xpointer")) return(test_xpointer());
50687    return(0);
50688}
50689