testapi.c revision 6a0baa0cd89b402cdfbb63e9c40f291ebd191f1d
1/*
2 * testapi.c: libxml2 API tester program.
3 *
4 * Automatically generated by gentest.py from libxml2-api.xml
5 *
6 * See Copyright for the status of this software.
7 *
8 * daniel@veillard.com
9 */
10
11#ifdef HAVE_CONFIG_H
12#include "libxml.h"
13#else
14#include <stdio.h>
15#endif
16
17#include <string.h>
18#include <libxml/xmlerror.h>
19#include <libxml/relaxng.h>
20
21static int testlibxml2(void);
22static int test_module(const char *module);
23
24static int generic_errors = 0;
25static int call_tests = 0;
26static int function_tests = 0;
27
28static xmlChar chartab[1024];
29static int inttab[1024];
30static unsigned long longtab[1024];
31
32static xmlDocPtr api_doc = NULL;
33static xmlDtdPtr api_dtd = NULL;
34static xmlNodePtr api_root = NULL;
35static xmlAttrPtr api_attr = NULL;
36static xmlNsPtr api_ns = NULL;
37
38static void
39structured_errors(void *userData ATTRIBUTE_UNUSED,
40                  xmlErrorPtr error ATTRIBUTE_UNUSED) {
41    generic_errors++;
42}
43
44static void
45free_api_doc(void) {
46    xmlFreeDoc(api_doc);
47    api_doc = NULL;
48    api_dtd = NULL;
49    api_root = NULL;
50    api_attr = NULL;
51    api_ns = NULL;
52}
53
54static xmlDocPtr
55get_api_doc(void) {
56    if (api_doc == NULL) {
57        api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
58	api_root = NULL;
59	api_attr = NULL;
60    }
61    return(api_doc);
62}
63
64static xmlDtdPtr
65get_api_dtd(void) {
66    if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
67        get_api_doc();
68	if ((api_doc != NULL) && (api_doc->children != NULL) &&
69	    (api_doc->children->type == XML_DTD_NODE))
70	    api_dtd = (xmlDtdPtr) api_doc->children;
71    }
72    return(api_dtd);
73}
74
75static xmlNodePtr
76get_api_root(void) {
77    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
78        get_api_doc();
79	if ((api_doc != NULL) && (api_doc->children != NULL) &&
80	    (api_doc->children->next != NULL) &&
81	    (api_doc->children->next->type == XML_ELEMENT_NODE))
82	    api_root = api_doc->children->next;
83    }
84    return(api_root);
85}
86
87static xmlNsPtr
88get_api_ns(void) {
89    get_api_root();
90    if (api_root != NULL)
91        api_ns = api_root->nsDef;
92    return(api_ns);
93}
94
95static xmlAttrPtr
96get_api_attr(void) {
97#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
98    static int nr = 0;
99    xmlChar name[20];
100#endif
101
102    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
103        get_api_root();
104    }
105    if (api_root == NULL)
106        return(NULL);
107    if (api_root->properties != NULL) {
108        api_attr = api_root->properties;
109        return(api_root->properties);
110    }
111    api_attr = NULL;
112#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
113    snprintf((char *) name, 20, "foo%d", nr++);
114    api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
115#endif
116    return(api_attr);
117}
118
119static int quiet = 0;
120
121int main(int argc, char **argv) {
122    int ret;
123    int blocks, mem;
124
125    memset(chartab, 0, sizeof(chartab));
126    strncpy((char *) chartab, "  chartab\n", 20);
127    memset(inttab, 0, sizeof(inttab));
128    memset(longtab, 0, sizeof(longtab));
129
130    xmlInitParser();
131#ifdef LIBXML_SCHEMAS_ENABLED
132    xmlRelaxNGInitTypes();
133#endif
134
135    LIBXML_TEST_VERSION
136
137    xmlSetStructuredErrorFunc(NULL, structured_errors);
138
139    if (argc >= 2) {
140        if (!strcmp(argv[1], "-q")) {
141	    quiet = 1;
142	    if (argc >= 3)
143	        ret = test_module(argv[2]);
144	    else
145		ret = testlibxml2();
146        } else {
147	   ret = test_module(argv[1]);
148	}
149    } else
150	ret = testlibxml2();
151
152    xmlCleanupParser();
153    blocks = xmlMemBlocks();
154    mem = xmlMemUsed();
155    if ((blocks != 0) || (mem != 0)) {
156        printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
157    }
158    xmlMemoryDump();
159
160    return (ret != 0);
161}
162
163#include <libxml/HTMLparser.h>
164#include <libxml/HTMLtree.h>
165#include <libxml/catalog.h>
166#include <libxml/chvalid.h>
167#include <libxml/dict.h>
168#include <libxml/encoding.h>
169#include <libxml/entities.h>
170#include <libxml/hash.h>
171#include <libxml/list.h>
172#include <libxml/nanoftp.h>
173#include <libxml/nanohttp.h>
174#include <libxml/parser.h>
175#include <libxml/parserInternals.h>
176#include <libxml/pattern.h>
177#include <libxml/relaxng.h>
178#include <libxml/schemasInternals.h>
179#include <libxml/schematron.h>
180#include <libxml/tree.h>
181#include <libxml/uri.h>
182#include <libxml/valid.h>
183#include <libxml/xinclude.h>
184#include <libxml/xmlIO.h>
185#include <libxml/xmlerror.h>
186#include <libxml/xmlreader.h>
187#include <libxml/xmlsave.h>
188#include <libxml/xmlschemas.h>
189#include <libxml/xmlschemastypes.h>
190#include <libxml/xmlstring.h>
191#include <libxml/xmlwriter.h>
192#include <libxml/xpath.h>
193#include <libxml/xpointer.h>
194#include <libxml/debugXML.h>
195
196/*
197  We manually define xmlErrMemory because it's normal declaration
198  is "hidden" by #ifdef IN_LIBXML
199*/
200void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
201
202/*
203 We need some "remote" addresses, but want to avoid getting into
204 name resolution delays, so we use these
205*/
206#define	REMOTE1GOOD	"http://localhost/"
207#define	REMOTE1BAD	"http://missing. example.org/"
208#define	REMOTE2GOOD	"ftp://localhost/foo"
209
210#define gen_nb_void_ptr 2
211
212static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
213    return(NULL);
214}
215static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
216}
217
218#if 0
219#define gen_nb_const_void_ptr 2
220
221static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
222    if (no == 0) return((const void *) "immutable string");
223    return(NULL);
224}
225static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
226}
227#endif
228
229#define gen_nb_userdata 3
230
231static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
232    if (no == 0) return((void *) &call_tests);
233    if (no == 1) return((void *) -1);
234    return(NULL);
235}
236static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
237}
238
239
240#define gen_nb_int 4
241
242static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
243    if (no == 0) return(0);
244    if (no == 1) return(1);
245    if (no == 2) return(-1);
246    if (no == 3) return(122);
247    return(-1);
248}
249
250static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
251}
252
253#define gen_nb_parseroptions 5
254
255static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
256    if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
257    if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
258    if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
259    if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
260    return(XML_PARSE_SAX1);
261}
262
263static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
264}
265
266#if 0
267#define gen_nb_long 5
268
269static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
270    if (no == 0) return(0);
271    if (no == 1) return(1);
272    if (no == 2) return(-1);
273    if (no == 3) return(122);
274    return(-1);
275}
276
277static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
278}
279#endif
280
281#define gen_nb_xmlChar 4
282
283static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
284    if (no == 0) return('a');
285    if (no == 1) return(' ');
286    if (no == 2) return((xmlChar) '�');
287    return(0);
288}
289
290static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
291}
292
293#define gen_nb_unsigned_int 3
294
295static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
296    if (no == 0) return(0);
297    if (no == 1) return(1);
298    if (no == 2) return(122);
299    return((unsigned int) -1);
300}
301
302static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
303}
304
305#define gen_nb_unsigned_long 4
306
307static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
308    if (no == 0) return(0);
309    if (no == 1) return(1);
310    if (no == 2) return(122);
311    return((unsigned long) -1);
312}
313
314static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
315}
316
317#define gen_nb_double 4
318
319static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
320    if (no == 0) return(0);
321    if (no == 1) return(-1.1);
322#if defined(LIBXML_XPATH_ENABLED)
323    if (no == 2) return(xmlXPathNAN);
324#endif
325    return(-1);
326}
327
328static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
329}
330
331#define gen_nb_unsigned_long_ptr 2
332
333static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
334    if (no == 0) return(&longtab[nr]);
335    return(NULL);
336}
337
338static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
339}
340
341#define gen_nb_int_ptr 2
342
343static int *gen_int_ptr(int no, int nr) {
344    if (no == 0) return(&inttab[nr]);
345    return(NULL);
346}
347
348static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
349}
350
351#define gen_nb_const_char_ptr 4
352
353static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
354    if (no == 0) return((char *) "foo");
355    if (no == 1) return((char *) "<foo/>");
356    if (no == 2) return((char *) "test/ent2");
357    return(NULL);
358}
359static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
360}
361
362#define gen_nb_xmlChar_ptr 2
363
364static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
365    if (no == 0) return(&chartab[0]);
366    return(NULL);
367}
368static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
369}
370
371#define gen_nb_FILE_ptr 2
372
373static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
374    if (no == 0) return(fopen("test.out", "a+"));
375    return(NULL);
376}
377static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
378    if (val != NULL) fclose(val);
379}
380
381#define gen_nb_debug_FILE_ptr 2
382static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
383    return(fopen("test.out", "a+"));
384}
385static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
386    if (val != NULL) fclose(val);
387}
388
389#define gen_nb_const_xmlChar_ptr 5
390
391static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
392    if (no == 0) return((xmlChar *) "foo");
393    if (no == 1) return((xmlChar *) "<foo/>");
394    if (no == 2) return((xmlChar *) "n�ne");
395    if (no == 3) return((xmlChar *) " 2ab ");
396    return(NULL);
397}
398static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
399}
400
401#define gen_nb_filepath 8
402
403static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
404    if (no == 0) return("missing.xml");
405    if (no == 1) return("<foo/>");
406    if (no == 2) return("test/ent2");
407    if (no == 3) return("test/valid/REC-xml-19980210.xml");
408    if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
409    if (no == 5) return(REMOTE1GOOD);
410    if (no == 6) return(REMOTE1BAD);
411    return(NULL);
412}
413static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
414}
415
416#define gen_nb_eaten_name 2
417
418static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
419    if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
420    return(NULL);
421}
422static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
423}
424
425#define gen_nb_fileoutput 6
426
427static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
428    if (no == 0) return("/missing.xml");
429    if (no == 1) return("<foo/>");
430    if (no == 2) return(REMOTE2GOOD);
431    if (no == 3) return(REMOTE1GOOD);
432    if (no == 4) return(REMOTE1BAD);
433    return(NULL);
434}
435static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
436}
437
438#define gen_nb_xmlParserCtxtPtr 3
439static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
440    if (no == 0) return(xmlNewParserCtxt());
441    if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
442    return(NULL);
443}
444static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
445    if (val != NULL)
446        xmlFreeParserCtxt(val);
447}
448
449#define gen_nb_xmlSAXHandlerPtr 2
450static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
451#ifdef LIBXML_SAX1_ENABLED
452    if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
453#endif
454    return(NULL);
455}
456static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
457}
458
459#define gen_nb_xmlValidCtxtPtr 2
460static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
461#ifdef LIBXML_VALID_ENABLED
462    if (no == 0) return(xmlNewValidCtxt());
463#endif
464    return(NULL);
465}
466static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
467#ifdef LIBXML_VALID_ENABLED
468    if (val != NULL)
469        xmlFreeValidCtxt(val);
470#endif
471}
472
473#define gen_nb_xmlParserInputBufferPtr 8
474
475static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
476    if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
477    if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
478    if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
479    if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
480    if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
481    if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
482    if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
483    return(NULL);
484}
485static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
486    xmlFreeParserInputBuffer(val);
487}
488
489#define gen_nb_xmlDocPtr 3
490static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
491    if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
492    if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
493    return(NULL);
494}
495static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
496    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
497        xmlFreeDoc(val);
498}
499
500#define gen_nb_xmlAttrPtr 2
501static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
502    if (no == 0) return(get_api_attr());
503    return(NULL);
504}
505static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
506    if (no == 0) free_api_doc();
507}
508
509#define gen_nb_xmlDictPtr 2
510static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
511    if (no == 0) return(xmlDictCreate());
512    return(NULL);
513}
514static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
515    if (val != NULL)
516        xmlDictFree(val);
517}
518
519#define gen_nb_xmlNodePtr 3
520static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
521    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
522    if (no == 1) return(get_api_root());
523    return(NULL);
524/*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
525}
526static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
527    if (no == 1) {
528        free_api_doc();
529    } else if (val != NULL) {
530        xmlUnlinkNode(val);
531        xmlFreeNode(val);
532    }
533}
534
535#define gen_nb_xmlDtdPtr 3
536static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
537    if (no == 0)
538        return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
539    if (no == 1) return(get_api_dtd());
540    return(NULL);
541}
542static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
543    if (no == 1) free_api_doc();
544    else if (val != NULL) {
545        xmlUnlinkNode((xmlNodePtr) val);
546        xmlFreeNode((xmlNodePtr) val);
547    }
548}
549
550#define gen_nb_xmlNsPtr 2
551static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
552    if (no == 0) return(get_api_ns());
553    return(NULL);
554}
555static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
556    if (no == 0) free_api_doc();
557}
558
559#define gen_nb_xmlNodePtr_in 3
560static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
561    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
562    if (no == 0) return(xmlNewText(BAD_CAST "text"));
563    return(NULL);
564}
565static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
566}
567
568#ifdef LIBXML_WRITER_ENABLED
569#define gen_nb_xmlTextWriterPtr 2
570static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
571    if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
572    return(NULL);
573}
574static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
575    if (val != NULL) xmlFreeTextWriter(val);
576}
577#endif
578
579#ifdef LIBXML_READER_ENABLED
580#define gen_nb_xmlTextReaderPtr 4
581static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
582    if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
583    if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
584    if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
585    return(NULL);
586}
587static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
588    if (val != NULL) xmlFreeTextReader(val);
589}
590#endif
591
592#define gen_nb_xmlBufferPtr 3
593static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
594    if (no == 0) return(xmlBufferCreate());
595    if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
596    return(NULL);
597}
598static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
599    if (val != NULL) {
600        xmlBufferFree(val);
601    }
602}
603
604#define gen_nb_xmlListPtr 2
605static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
606    if (no == 0) return(xmlListCreate(NULL, NULL));
607    return(NULL);
608}
609static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
610    if (val != NULL) {
611        xmlListDelete(val);
612    }
613}
614
615#define gen_nb_xmlHashTablePtr 2
616static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
617    if (no == 0) return(xmlHashCreate(10));
618    return(NULL);
619}
620static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
621    if (val != NULL) {
622        xmlHashFree(val, NULL);
623    }
624}
625
626#include <libxml/xpathInternals.h>
627
628#ifdef LIBXML_XPATH_ENABLED
629#define gen_nb_xmlXPathObjectPtr 5
630static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
631    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
632    if (no == 1) return(xmlXPathNewFloat(1.1));
633    if (no == 2) return(xmlXPathNewBoolean(1));
634    if (no == 3) return(xmlXPathNewNodeSet(NULL));
635    return(NULL);
636}
637static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
638    if (val != NULL) {
639        xmlXPathFreeObject(val);
640    }
641}
642#endif
643
644#ifdef LIBXML_OUTPUT_ENABLED
645#define gen_nb_xmlOutputBufferPtr 2
646static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
647    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
648    return(NULL);
649}
650static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
651    if (val != NULL) {
652        xmlOutputBufferClose(val);
653    }
654}
655#endif
656
657#ifdef LIBXML_FTP_ENABLED
658#define gen_nb_xmlNanoFTPCtxtPtr 4
659static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
660    if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
661    if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
662    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
663    return(NULL);
664}
665static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
666    if (val != NULL) {
667        xmlNanoFTPFreeCtxt(val);
668    }
669}
670#endif
671
672#ifdef LIBXML_HTTP_ENABLED
673#define gen_nb_xmlNanoHTTPCtxtPtr 1
674static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
675    if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
676    if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
677    if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
678    return(NULL);
679}
680static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
681    if (val != NULL) {
682	xmlNanoHTTPClose(val);
683    }
684}
685#endif
686
687#define gen_nb_xmlCharEncoding 4
688static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
689    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
690    if (no == 1) return(XML_CHAR_ENCODING_NONE);
691    if (no == 2) return(XML_CHAR_ENCODING_8859_1);
692    return(XML_CHAR_ENCODING_ERROR);
693}
694static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
695}
696
697#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
698
699#define gen_nb_xmlExpCtxtPtr 1
700static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
701    return(NULL);
702}
703static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
704}
705
706#define gen_nb_xmlExpNodePtr 1
707static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
708    return(NULL);
709}
710static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
711}
712
713#endif
714
715#define gen_nb_xmlHashDeallocator 2
716static void
717test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
718}
719
720static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
721    if (no == 0) return(test_xmlHashDeallocator);
722    return(NULL);
723}
724static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
725}
726
727
728static void desret_int(int val ATTRIBUTE_UNUSED) {
729}
730static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
731}
732static void desret_long(long val ATTRIBUTE_UNUSED) {
733}
734static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
735}
736static void desret_double(double val ATTRIBUTE_UNUSED) {
737}
738static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
739}
740#if 0
741static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
742}
743#endif
744static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
745}
746static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
747}
748static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
749}
750static void desret_xmlChar_ptr(xmlChar *val) {
751    if (val != NULL)
752	xmlFree(val);
753}
754static void desret_xmlDocPtr(xmlDocPtr val) {
755    if (val != api_doc)
756	xmlFreeDoc(val);
757}
758static void desret_xmlDictPtr(xmlDictPtr val) {
759    xmlDictFree(val);
760}
761#ifdef LIBXML_OUTPUT_ENABLED
762static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
763    xmlOutputBufferClose(val);
764}
765#endif
766#ifdef LIBXML_READER_ENABLED
767static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
768    xmlFreeTextReader(val);
769}
770#endif
771static void desret_xmlNodePtr(xmlNodePtr val) {
772    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
773	xmlUnlinkNode(val);
774	xmlFreeNode(val);
775    }
776}
777static void desret_xmlAttrPtr(xmlAttrPtr val) {
778    if (val != NULL) {
779	xmlUnlinkNode((xmlNodePtr) val);
780	xmlFreeNode((xmlNodePtr) val);
781    }
782}
783static void desret_xmlEntityPtr(xmlEntityPtr val) {
784    if (val != NULL) {
785	xmlUnlinkNode((xmlNodePtr) val);
786	xmlFreeNode((xmlNodePtr) val);
787    }
788}
789static void desret_xmlElementPtr(xmlElementPtr val) {
790    if (val != NULL) {
791	xmlUnlinkNode((xmlNodePtr) val);
792    }
793}
794static void desret_xmlAttributePtr(xmlAttributePtr val) {
795    if (val != NULL) {
796	xmlUnlinkNode((xmlNodePtr) val);
797    }
798}
799static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
800}
801static void desret_xmlDtdPtr(xmlDtdPtr val) {
802    desret_xmlNodePtr((xmlNodePtr)val);
803}
804#ifdef LIBXML_XPATH_ENABLED
805static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
806    xmlXPathFreeObject(val);
807}
808static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
809    xmlXPathFreeNodeSet(val);
810}
811#endif
812static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
813    xmlFreeParserCtxt(val);
814}
815static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
816    xmlFreeParserInputBuffer(val);
817}
818static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
819    xmlFreeInputStream(val);
820}
821#ifdef LIBXML_WRITER_ENABLED
822static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
823    xmlFreeTextWriter(val);
824}
825#endif
826static void desret_xmlBufferPtr(xmlBufferPtr val) {
827    xmlBufferFree(val);
828}
829#ifdef LIBXML_SCHEMAS_ENABLED
830static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
831    xmlSchemaFreeParserCtxt(val);
832}
833static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
834}
835static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
836    xmlRelaxNGFreeParserCtxt(val);
837}
838#endif
839#ifdef LIBXML_HTML_ENABLED
840static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
841}
842#endif
843#ifdef LIBXML_HTTP_ENABLED
844static void desret_xmlNanoHTTPCtxtPtr(void *val) {
845    xmlNanoHTTPClose(val);
846}
847#endif
848#ifdef LIBXML_FTP_ENABLED
849static void desret_xmlNanoFTPCtxtPtr(void *val) {
850    xmlNanoFTPClose(val);
851}
852#endif
853/* cut and pasted from autogenerated to avoid troubles */
854#define gen_nb_const_xmlChar_ptr_ptr 1
855static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
856    return(NULL);
857}
858static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
859}
860
861#define gen_nb_unsigned_char_ptr 1
862static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
863    return(NULL);
864}
865static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
866}
867
868#define gen_nb_const_unsigned_char_ptr 1
869static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
870    return(NULL);
871}
872static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
873}
874
875#ifdef LIBXML_HTML_ENABLED
876#define gen_nb_const_htmlNodePtr 1
877static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
878    return(NULL);
879}
880static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
881}
882#endif
883
884#ifdef LIBXML_HTML_ENABLED
885#define gen_nb_htmlDocPtr 3
886static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
887    if (no == 0) return(htmlNewDoc(NULL, NULL));
888    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
889    return(NULL);
890}
891static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
892    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
893        xmlFreeDoc(val);
894}
895static void desret_htmlDocPtr(htmlDocPtr val) {
896    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
897        xmlFreeDoc(val);
898}
899#define gen_nb_htmlParserCtxtPtr 3
900static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
901    if (no == 0) return(xmlNewParserCtxt());
902    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
903    return(NULL);
904}
905static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
906    if (val != NULL)
907        htmlFreeParserCtxt(val);
908}
909static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
910    if (val != NULL)
911        htmlFreeParserCtxt(val);
912}
913#endif
914
915#ifdef LIBXML_XPATH_ENABLED
916#define gen_nb_xmlNodeSetPtr 1
917static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
918    return(NULL);
919}
920static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
921}
922#endif
923
924#ifdef LIBXML_DEBUG_ENABLED
925#ifdef LIBXML_XPATH_ENABLED
926#define gen_nb_xmlShellCtxtPtr 1
927static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
928    return(NULL);
929}
930static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
931}
932#endif
933#endif
934
935#ifdef LIBXML_PATTERN_ENABLED
936#define gen_nb_xmlPatternPtr 1
937static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
938    return(NULL);
939}
940static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
941}
942#endif
943
944#define gen_nb_xmlElementContentPtr 1
945static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
946    return(NULL);
947}
948static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
949    if (val != NULL)
950        xmlFreeElementContent(val);
951}
952static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
953    if (val != NULL)
954        xmlFreeElementContent(val);
955}
956
957#define gen_nb_xmlParserNodeInfoSeqPtr 1
958static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
959    return(NULL);
960}
961static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
962}
963
964static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
965}
966
967/************************************************************************
968 *									*
969 *   WARNING: end of the manually maintained part of the test code	*
970 *            do not remove or alter the CUT HERE line			*
971 *									*
972 ************************************************************************/
973
974/* CUT HERE: everything below that line is generated */
975#ifdef LIBXML_HTML_ENABLED
976static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
977}
978
979#endif
980
981#define gen_nb_xmlAttributeDefault 4
982static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
983    if (no == 1) return(XML_ATTRIBUTE_FIXED);
984    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
985    if (no == 3) return(XML_ATTRIBUTE_NONE);
986    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
987    return(0);
988}
989
990static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
991}
992
993#define gen_nb_xmlAttributeType 4
994static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
995    if (no == 1) return(XML_ATTRIBUTE_CDATA);
996    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
997    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
998    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
999    return(0);
1000}
1001
1002static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1003}
1004
1005#define gen_nb_xmlBufferAllocationScheme 3
1006static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1007    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1008    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1009    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1010    return(0);
1011}
1012
1013static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1014}
1015
1016static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1017}
1018
1019#ifdef LIBXML_CATALOG_ENABLED
1020#define gen_nb_xmlCatalogAllow 4
1021static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1022    if (no == 1) return(XML_CATA_ALLOW_ALL);
1023    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1024    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1025    if (no == 4) return(XML_CATA_ALLOW_NONE);
1026    return(0);
1027}
1028
1029static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1030}
1031
1032static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1033}
1034
1035#endif
1036
1037#ifdef LIBXML_CATALOG_ENABLED
1038#define gen_nb_xmlCatalogPrefer 3
1039static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1040    if (no == 1) return(XML_CATA_PREFER_NONE);
1041    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1042    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1043    return(0);
1044}
1045
1046static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1047}
1048
1049static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1050}
1051
1052#endif
1053
1054#define gen_nb_xmlElementContentType 4
1055static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1056    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1057    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1058    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1059    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1060    return(0);
1061}
1062
1063static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1064}
1065
1066#define gen_nb_xmlElementTypeVal 4
1067static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1068    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1069    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1070    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1071    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1072    return(0);
1073}
1074
1075static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1076}
1077
1078#define gen_nb_xmlFeature 4
1079static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1080    if (no == 1) return(XML_WITH_AUTOMATA);
1081    if (no == 2) return(XML_WITH_C14N);
1082    if (no == 3) return(XML_WITH_CATALOG);
1083    if (no == 4) return(XML_WITH_DEBUG);
1084    return(0);
1085}
1086
1087static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1088}
1089
1090static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1091}
1092
1093#ifdef LIBXML_SCHEMAS_ENABLED
1094#define gen_nb_xmlSchemaValType 4
1095static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1096    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1097    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1098    if (no == 3) return(XML_SCHEMAS_ANYURI);
1099    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1100    return(0);
1101}
1102
1103static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1104}
1105
1106static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1107}
1108
1109#endif
1110
1111#ifdef LIBXML_SCHEMAS_ENABLED
1112#define gen_nb_xmlSchemaWhitespaceValueType 4
1113static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1114    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1115    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1116    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1117    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1118    return(0);
1119}
1120
1121static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1122}
1123
1124#endif
1125
1126#include <libxml/HTMLparser.h>
1127#include <libxml/HTMLtree.h>
1128#include <libxml/SAX2.h>
1129#include <libxml/c14n.h>
1130#include <libxml/catalog.h>
1131#include <libxml/chvalid.h>
1132#include <libxml/debugXML.h>
1133#include <libxml/dict.h>
1134#include <libxml/encoding.h>
1135#include <libxml/entities.h>
1136#include <libxml/hash.h>
1137#include <libxml/list.h>
1138#include <libxml/nanoftp.h>
1139#include <libxml/nanohttp.h>
1140#include <libxml/parser.h>
1141#include <libxml/parserInternals.h>
1142#include <libxml/pattern.h>
1143#include <libxml/relaxng.h>
1144#include <libxml/schemasInternals.h>
1145#include <libxml/schematron.h>
1146#include <libxml/tree.h>
1147#include <libxml/uri.h>
1148#include <libxml/valid.h>
1149#include <libxml/xinclude.h>
1150#include <libxml/xmlIO.h>
1151#include <libxml/xmlautomata.h>
1152#include <libxml/xmlerror.h>
1153#include <libxml/xmlmodule.h>
1154#include <libxml/xmlreader.h>
1155#include <libxml/xmlregexp.h>
1156#include <libxml/xmlsave.h>
1157#include <libxml/xmlschemas.h>
1158#include <libxml/xmlschemastypes.h>
1159#include <libxml/xmlstring.h>
1160#include <libxml/xmlunicode.h>
1161#include <libxml/xmlwriter.h>
1162#include <libxml/xpath.h>
1163#include <libxml/xpathInternals.h>
1164#include <libxml/xpointer.h>
1165static int test_HTMLparser(void);
1166static int test_HTMLtree(void);
1167static int test_SAX2(void);
1168static int test_c14n(void);
1169static int test_catalog(void);
1170static int test_chvalid(void);
1171static int test_debugXML(void);
1172static int test_dict(void);
1173static int test_encoding(void);
1174static int test_entities(void);
1175static int test_hash(void);
1176static int test_list(void);
1177static int test_nanoftp(void);
1178static int test_nanohttp(void);
1179static int test_parser(void);
1180static int test_parserInternals(void);
1181static int test_pattern(void);
1182static int test_relaxng(void);
1183static int test_schemasInternals(void);
1184static int test_schematron(void);
1185static int test_tree(void);
1186static int test_uri(void);
1187static int test_valid(void);
1188static int test_xinclude(void);
1189static int test_xmlIO(void);
1190static int test_xmlautomata(void);
1191static int test_xmlerror(void);
1192static int test_xmlmodule(void);
1193static int test_xmlreader(void);
1194static int test_xmlregexp(void);
1195static int test_xmlsave(void);
1196static int test_xmlschemas(void);
1197static int test_xmlschemastypes(void);
1198static int test_xmlstring(void);
1199static int test_xmlunicode(void);
1200static int test_xmlwriter(void);
1201static int test_xpath(void);
1202static int test_xpathInternals(void);
1203static int test_xpointer(void);
1204
1205/**
1206 * testlibxml2:
1207 *
1208 * Main entry point of the tester for the full libxml2 module,
1209 * it calls all the tester entry point for each module.
1210 *
1211 * Returns the number of error found
1212 */
1213static int
1214testlibxml2(void)
1215{
1216    int test_ret = 0;
1217
1218    test_ret += test_HTMLparser();
1219    test_ret += test_HTMLtree();
1220    test_ret += test_SAX2();
1221    test_ret += test_c14n();
1222    test_ret += test_catalog();
1223    test_ret += test_chvalid();
1224    test_ret += test_debugXML();
1225    test_ret += test_dict();
1226    test_ret += test_encoding();
1227    test_ret += test_entities();
1228    test_ret += test_hash();
1229    test_ret += test_list();
1230    test_ret += test_nanoftp();
1231    test_ret += test_nanohttp();
1232    test_ret += test_parser();
1233    test_ret += test_parserInternals();
1234    test_ret += test_pattern();
1235    test_ret += test_relaxng();
1236    test_ret += test_schemasInternals();
1237    test_ret += test_schematron();
1238    test_ret += test_tree();
1239    test_ret += test_uri();
1240    test_ret += test_valid();
1241    test_ret += test_xinclude();
1242    test_ret += test_xmlIO();
1243    test_ret += test_xmlautomata();
1244    test_ret += test_xmlerror();
1245    test_ret += test_xmlmodule();
1246    test_ret += test_xmlreader();
1247    test_ret += test_xmlregexp();
1248    test_ret += test_xmlsave();
1249    test_ret += test_xmlschemas();
1250    test_ret += test_xmlschemastypes();
1251    test_ret += test_xmlstring();
1252    test_ret += test_xmlunicode();
1253    test_ret += test_xmlwriter();
1254    test_ret += test_xpath();
1255    test_ret += test_xpathInternals();
1256    test_ret += test_xpointer();
1257
1258    printf("Total: %d functions, %d tests, %d errors\n",
1259           function_tests, call_tests, test_ret);
1260    return(test_ret);
1261}
1262
1263
1264static int
1265test_UTF8ToHtml(void) {
1266    int test_ret = 0;
1267
1268#if defined(LIBXML_HTML_ENABLED)
1269    int mem_base;
1270    int ret_val;
1271    unsigned char * out; /* a pointer to an array of bytes to store the result */
1272    int n_out;
1273    int * outlen; /* the length of @out */
1274    int n_outlen;
1275    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1276    int n_in;
1277    int * inlen; /* the length of @in */
1278    int n_inlen;
1279
1280    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1281    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1282    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1283    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1284        mem_base = xmlMemBlocks();
1285        out = gen_unsigned_char_ptr(n_out, 0);
1286        outlen = gen_int_ptr(n_outlen, 1);
1287        in = gen_const_unsigned_char_ptr(n_in, 2);
1288        inlen = gen_int_ptr(n_inlen, 3);
1289
1290        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1291        desret_int(ret_val);
1292        call_tests++;
1293        des_unsigned_char_ptr(n_out, out, 0);
1294        des_int_ptr(n_outlen, outlen, 1);
1295        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1296        des_int_ptr(n_inlen, inlen, 3);
1297        xmlResetLastError();
1298        if (mem_base != xmlMemBlocks()) {
1299            printf("Leak of %d blocks found in UTF8ToHtml",
1300	           xmlMemBlocks() - mem_base);
1301	    test_ret++;
1302            printf(" %d", n_out);
1303            printf(" %d", n_outlen);
1304            printf(" %d", n_in);
1305            printf(" %d", n_inlen);
1306            printf("\n");
1307        }
1308    }
1309    }
1310    }
1311    }
1312    function_tests++;
1313#endif
1314
1315    return(test_ret);
1316}
1317
1318#ifdef LIBXML_HTML_ENABLED
1319
1320#define gen_nb_const_htmlElemDesc_ptr 1
1321static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1322    return(NULL);
1323}
1324static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1325}
1326#endif
1327
1328
1329static int
1330test_htmlAttrAllowed(void) {
1331    int test_ret = 0;
1332
1333#if defined(LIBXML_HTML_ENABLED)
1334    int mem_base;
1335    htmlStatus ret_val;
1336    htmlElemDesc * elt; /* HTML element */
1337    int n_elt;
1338    xmlChar * attr; /* HTML attribute */
1339    int n_attr;
1340    int legacy; /* whether to allow deprecated attributes */
1341    int n_legacy;
1342
1343    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1344    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1345    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1346        mem_base = xmlMemBlocks();
1347        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1348        attr = gen_const_xmlChar_ptr(n_attr, 1);
1349        legacy = gen_int(n_legacy, 2);
1350
1351        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1352        desret_htmlStatus(ret_val);
1353        call_tests++;
1354        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1355        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1356        des_int(n_legacy, legacy, 2);
1357        xmlResetLastError();
1358        if (mem_base != xmlMemBlocks()) {
1359            printf("Leak of %d blocks found in htmlAttrAllowed",
1360	           xmlMemBlocks() - mem_base);
1361	    test_ret++;
1362            printf(" %d", n_elt);
1363            printf(" %d", n_attr);
1364            printf(" %d", n_legacy);
1365            printf("\n");
1366        }
1367    }
1368    }
1369    }
1370    function_tests++;
1371#endif
1372
1373    return(test_ret);
1374}
1375
1376#ifdef LIBXML_HTML_ENABLED
1377
1378#define gen_nb_htmlNodePtr 1
1379static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1380    return(NULL);
1381}
1382static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1383}
1384#endif
1385
1386
1387static int
1388test_htmlAutoCloseTag(void) {
1389    int test_ret = 0;
1390
1391#if defined(LIBXML_HTML_ENABLED)
1392    int mem_base;
1393    int ret_val;
1394    htmlDocPtr doc; /* the HTML document */
1395    int n_doc;
1396    xmlChar * name; /* The tag name */
1397    int n_name;
1398    htmlNodePtr elem; /* the HTML element */
1399    int n_elem;
1400
1401    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1402    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1403    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1404        mem_base = xmlMemBlocks();
1405        doc = gen_htmlDocPtr(n_doc, 0);
1406        name = gen_const_xmlChar_ptr(n_name, 1);
1407        elem = gen_htmlNodePtr(n_elem, 2);
1408
1409        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1410        desret_int(ret_val);
1411        call_tests++;
1412        des_htmlDocPtr(n_doc, doc, 0);
1413        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1414        des_htmlNodePtr(n_elem, elem, 2);
1415        xmlResetLastError();
1416        if (mem_base != xmlMemBlocks()) {
1417            printf("Leak of %d blocks found in htmlAutoCloseTag",
1418	           xmlMemBlocks() - mem_base);
1419	    test_ret++;
1420            printf(" %d", n_doc);
1421            printf(" %d", n_name);
1422            printf(" %d", n_elem);
1423            printf("\n");
1424        }
1425    }
1426    }
1427    }
1428    function_tests++;
1429#endif
1430
1431    return(test_ret);
1432}
1433
1434
1435static int
1436test_htmlCreateMemoryParserCtxt(void) {
1437    int test_ret = 0;
1438
1439#if defined(LIBXML_HTML_ENABLED)
1440    int mem_base;
1441    htmlParserCtxtPtr ret_val;
1442    char * buffer; /* a pointer to a char array */
1443    int n_buffer;
1444    int size; /* the size of the array */
1445    int n_size;
1446
1447    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1448    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1449        mem_base = xmlMemBlocks();
1450        buffer = gen_const_char_ptr(n_buffer, 0);
1451        size = gen_int(n_size, 1);
1452
1453        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1454        desret_htmlParserCtxtPtr(ret_val);
1455        call_tests++;
1456        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1457        des_int(n_size, size, 1);
1458        xmlResetLastError();
1459        if (mem_base != xmlMemBlocks()) {
1460            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1461	           xmlMemBlocks() - mem_base);
1462	    test_ret++;
1463            printf(" %d", n_buffer);
1464            printf(" %d", n_size);
1465            printf("\n");
1466        }
1467    }
1468    }
1469    function_tests++;
1470#endif
1471
1472    return(test_ret);
1473}
1474
1475#ifdef LIBXML_HTML_ENABLED
1476
1477#define gen_nb_htmlSAXHandlerPtr 1
1478static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1479    return(NULL);
1480}
1481static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1482}
1483#endif
1484
1485
1486static int
1487test_htmlCreatePushParserCtxt(void) {
1488    int test_ret = 0;
1489
1490#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1491    int mem_base;
1492    htmlParserCtxtPtr ret_val;
1493    htmlSAXHandlerPtr sax; /* a SAX handler */
1494    int n_sax;
1495    void * user_data; /* The user data returned on SAX callbacks */
1496    int n_user_data;
1497    char * chunk; /* a pointer to an array of chars */
1498    int n_chunk;
1499    int size; /* number of chars in the array */
1500    int n_size;
1501    const char * filename; /* an optional file name or URI */
1502    int n_filename;
1503    xmlCharEncoding enc; /* an optional encoding */
1504    int n_enc;
1505
1506    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1507    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1508    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1509    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1510    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1511    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1512        mem_base = xmlMemBlocks();
1513        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1514        user_data = gen_userdata(n_user_data, 1);
1515        chunk = gen_const_char_ptr(n_chunk, 2);
1516        size = gen_int(n_size, 3);
1517        filename = gen_fileoutput(n_filename, 4);
1518        enc = gen_xmlCharEncoding(n_enc, 5);
1519
1520        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1521        desret_htmlParserCtxtPtr(ret_val);
1522        call_tests++;
1523        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1524        des_userdata(n_user_data, user_data, 1);
1525        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1526        des_int(n_size, size, 3);
1527        des_fileoutput(n_filename, filename, 4);
1528        des_xmlCharEncoding(n_enc, enc, 5);
1529        xmlResetLastError();
1530        if (mem_base != xmlMemBlocks()) {
1531            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1532	           xmlMemBlocks() - mem_base);
1533	    test_ret++;
1534            printf(" %d", n_sax);
1535            printf(" %d", n_user_data);
1536            printf(" %d", n_chunk);
1537            printf(" %d", n_size);
1538            printf(" %d", n_filename);
1539            printf(" %d", n_enc);
1540            printf("\n");
1541        }
1542    }
1543    }
1544    }
1545    }
1546    }
1547    }
1548    function_tests++;
1549#endif
1550
1551    return(test_ret);
1552}
1553
1554
1555static int
1556test_htmlCtxtReadDoc(void) {
1557    int test_ret = 0;
1558
1559#if defined(LIBXML_HTML_ENABLED)
1560    int mem_base;
1561    htmlDocPtr ret_val;
1562    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1563    int n_ctxt;
1564    xmlChar * cur; /* a pointer to a zero terminated string */
1565    int n_cur;
1566    const char * URL; /* the base URL to use for the document */
1567    int n_URL;
1568    char * encoding; /* the document encoding, or NULL */
1569    int n_encoding;
1570    int options; /* a combination of htmlParserOption(s) */
1571    int n_options;
1572
1573    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1574    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1575    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1576    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1577    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1578        mem_base = xmlMemBlocks();
1579        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1580        cur = gen_const_xmlChar_ptr(n_cur, 1);
1581        URL = gen_filepath(n_URL, 2);
1582        encoding = gen_const_char_ptr(n_encoding, 3);
1583        options = gen_int(n_options, 4);
1584
1585        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1586        desret_htmlDocPtr(ret_val);
1587        call_tests++;
1588        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1589        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1590        des_filepath(n_URL, URL, 2);
1591        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1592        des_int(n_options, options, 4);
1593        xmlResetLastError();
1594        if (mem_base != xmlMemBlocks()) {
1595            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1596	           xmlMemBlocks() - mem_base);
1597	    test_ret++;
1598            printf(" %d", n_ctxt);
1599            printf(" %d", n_cur);
1600            printf(" %d", n_URL);
1601            printf(" %d", n_encoding);
1602            printf(" %d", n_options);
1603            printf("\n");
1604        }
1605    }
1606    }
1607    }
1608    }
1609    }
1610    function_tests++;
1611#endif
1612
1613    return(test_ret);
1614}
1615
1616
1617static int
1618test_htmlCtxtReadFile(void) {
1619    int test_ret = 0;
1620
1621#if defined(LIBXML_HTML_ENABLED)
1622    htmlDocPtr ret_val;
1623    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1624    int n_ctxt;
1625    const char * filename; /* a file or URL */
1626    int n_filename;
1627    char * encoding; /* the document encoding, or NULL */
1628    int n_encoding;
1629    int options; /* a combination of htmlParserOption(s) */
1630    int n_options;
1631
1632    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1633    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1634    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1635    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1636        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1637        filename = gen_filepath(n_filename, 1);
1638        encoding = gen_const_char_ptr(n_encoding, 2);
1639        options = gen_int(n_options, 3);
1640
1641        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1642        desret_htmlDocPtr(ret_val);
1643        call_tests++;
1644        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1645        des_filepath(n_filename, filename, 1);
1646        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1647        des_int(n_options, options, 3);
1648        xmlResetLastError();
1649    }
1650    }
1651    }
1652    }
1653    function_tests++;
1654#endif
1655
1656    return(test_ret);
1657}
1658
1659
1660static int
1661test_htmlCtxtReadMemory(void) {
1662    int test_ret = 0;
1663
1664#if defined(LIBXML_HTML_ENABLED)
1665    int mem_base;
1666    htmlDocPtr ret_val;
1667    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1668    int n_ctxt;
1669    char * buffer; /* a pointer to a char array */
1670    int n_buffer;
1671    int size; /* the size of the array */
1672    int n_size;
1673    const char * URL; /* the base URL to use for the document */
1674    int n_URL;
1675    char * encoding; /* the document encoding, or NULL */
1676    int n_encoding;
1677    int options; /* a combination of htmlParserOption(s) */
1678    int n_options;
1679
1680    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1681    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1682    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1683    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1684    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1685    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1686        mem_base = xmlMemBlocks();
1687        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1688        buffer = gen_const_char_ptr(n_buffer, 1);
1689        size = gen_int(n_size, 2);
1690        URL = gen_filepath(n_URL, 3);
1691        encoding = gen_const_char_ptr(n_encoding, 4);
1692        options = gen_int(n_options, 5);
1693
1694        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1695        desret_htmlDocPtr(ret_val);
1696        call_tests++;
1697        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1698        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1699        des_int(n_size, size, 2);
1700        des_filepath(n_URL, URL, 3);
1701        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1702        des_int(n_options, options, 5);
1703        xmlResetLastError();
1704        if (mem_base != xmlMemBlocks()) {
1705            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1706	           xmlMemBlocks() - mem_base);
1707	    test_ret++;
1708            printf(" %d", n_ctxt);
1709            printf(" %d", n_buffer);
1710            printf(" %d", n_size);
1711            printf(" %d", n_URL);
1712            printf(" %d", n_encoding);
1713            printf(" %d", n_options);
1714            printf("\n");
1715        }
1716    }
1717    }
1718    }
1719    }
1720    }
1721    }
1722    function_tests++;
1723#endif
1724
1725    return(test_ret);
1726}
1727
1728
1729static int
1730test_htmlCtxtReset(void) {
1731    int test_ret = 0;
1732
1733#if defined(LIBXML_HTML_ENABLED)
1734    int mem_base;
1735    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1736    int n_ctxt;
1737
1738    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1739        mem_base = xmlMemBlocks();
1740        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1741
1742        htmlCtxtReset(ctxt);
1743        call_tests++;
1744        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1745        xmlResetLastError();
1746        if (mem_base != xmlMemBlocks()) {
1747            printf("Leak of %d blocks found in htmlCtxtReset",
1748	           xmlMemBlocks() - mem_base);
1749	    test_ret++;
1750            printf(" %d", n_ctxt);
1751            printf("\n");
1752        }
1753    }
1754    function_tests++;
1755#endif
1756
1757    return(test_ret);
1758}
1759
1760
1761static int
1762test_htmlCtxtUseOptions(void) {
1763    int test_ret = 0;
1764
1765#if defined(LIBXML_HTML_ENABLED)
1766    int mem_base;
1767    int ret_val;
1768    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1769    int n_ctxt;
1770    int options; /* a combination of htmlParserOption(s) */
1771    int n_options;
1772
1773    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1774    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1775        mem_base = xmlMemBlocks();
1776        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1777        options = gen_int(n_options, 1);
1778
1779        ret_val = htmlCtxtUseOptions(ctxt, options);
1780        desret_int(ret_val);
1781        call_tests++;
1782        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1783        des_int(n_options, options, 1);
1784        xmlResetLastError();
1785        if (mem_base != xmlMemBlocks()) {
1786            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1787	           xmlMemBlocks() - mem_base);
1788	    test_ret++;
1789            printf(" %d", n_ctxt);
1790            printf(" %d", n_options);
1791            printf("\n");
1792        }
1793    }
1794    }
1795    function_tests++;
1796#endif
1797
1798    return(test_ret);
1799}
1800
1801
1802static int
1803test_htmlElementAllowedHere(void) {
1804    int test_ret = 0;
1805
1806#if defined(LIBXML_HTML_ENABLED)
1807    int mem_base;
1808    int ret_val;
1809    htmlElemDesc * parent; /* HTML parent element */
1810    int n_parent;
1811    xmlChar * elt; /* HTML element */
1812    int n_elt;
1813
1814    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1815    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1816        mem_base = xmlMemBlocks();
1817        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1818        elt = gen_const_xmlChar_ptr(n_elt, 1);
1819
1820        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1821        desret_int(ret_val);
1822        call_tests++;
1823        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1824        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1825        xmlResetLastError();
1826        if (mem_base != xmlMemBlocks()) {
1827            printf("Leak of %d blocks found in htmlElementAllowedHere",
1828	           xmlMemBlocks() - mem_base);
1829	    test_ret++;
1830            printf(" %d", n_parent);
1831            printf(" %d", n_elt);
1832            printf("\n");
1833        }
1834    }
1835    }
1836    function_tests++;
1837#endif
1838
1839    return(test_ret);
1840}
1841
1842
1843static int
1844test_htmlElementStatusHere(void) {
1845    int test_ret = 0;
1846
1847#if defined(LIBXML_HTML_ENABLED)
1848    int mem_base;
1849    htmlStatus ret_val;
1850    htmlElemDesc * parent; /* HTML parent element */
1851    int n_parent;
1852    htmlElemDesc * elt; /* HTML element */
1853    int n_elt;
1854
1855    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1856    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1857        mem_base = xmlMemBlocks();
1858        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1859        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1860
1861        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1862        desret_htmlStatus(ret_val);
1863        call_tests++;
1864        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1865        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1866        xmlResetLastError();
1867        if (mem_base != xmlMemBlocks()) {
1868            printf("Leak of %d blocks found in htmlElementStatusHere",
1869	           xmlMemBlocks() - mem_base);
1870	    test_ret++;
1871            printf(" %d", n_parent);
1872            printf(" %d", n_elt);
1873            printf("\n");
1874        }
1875    }
1876    }
1877    function_tests++;
1878#endif
1879
1880    return(test_ret);
1881}
1882
1883
1884static int
1885test_htmlEncodeEntities(void) {
1886    int test_ret = 0;
1887
1888#if defined(LIBXML_HTML_ENABLED)
1889    int mem_base;
1890    int ret_val;
1891    unsigned char * out; /* a pointer to an array of bytes to store the result */
1892    int n_out;
1893    int * outlen; /* the length of @out */
1894    int n_outlen;
1895    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1896    int n_in;
1897    int * inlen; /* the length of @in */
1898    int n_inlen;
1899    int quoteChar; /* the quote character to escape (' or ") or zero. */
1900    int n_quoteChar;
1901
1902    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1903    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1904    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1905    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1906    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1907        mem_base = xmlMemBlocks();
1908        out = gen_unsigned_char_ptr(n_out, 0);
1909        outlen = gen_int_ptr(n_outlen, 1);
1910        in = gen_const_unsigned_char_ptr(n_in, 2);
1911        inlen = gen_int_ptr(n_inlen, 3);
1912        quoteChar = gen_int(n_quoteChar, 4);
1913
1914        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1915        desret_int(ret_val);
1916        call_tests++;
1917        des_unsigned_char_ptr(n_out, out, 0);
1918        des_int_ptr(n_outlen, outlen, 1);
1919        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1920        des_int_ptr(n_inlen, inlen, 3);
1921        des_int(n_quoteChar, quoteChar, 4);
1922        xmlResetLastError();
1923        if (mem_base != xmlMemBlocks()) {
1924            printf("Leak of %d blocks found in htmlEncodeEntities",
1925	           xmlMemBlocks() - mem_base);
1926	    test_ret++;
1927            printf(" %d", n_out);
1928            printf(" %d", n_outlen);
1929            printf(" %d", n_in);
1930            printf(" %d", n_inlen);
1931            printf(" %d", n_quoteChar);
1932            printf("\n");
1933        }
1934    }
1935    }
1936    }
1937    }
1938    }
1939    function_tests++;
1940#endif
1941
1942    return(test_ret);
1943}
1944
1945
1946static int
1947test_htmlEntityLookup(void) {
1948    int test_ret = 0;
1949
1950#if defined(LIBXML_HTML_ENABLED)
1951    int mem_base;
1952    const htmlEntityDesc * ret_val;
1953    xmlChar * name; /* the entity name */
1954    int n_name;
1955
1956    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1957        mem_base = xmlMemBlocks();
1958        name = gen_const_xmlChar_ptr(n_name, 0);
1959
1960        ret_val = htmlEntityLookup((const xmlChar *)name);
1961        desret_const_htmlEntityDesc_ptr(ret_val);
1962        call_tests++;
1963        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1964        xmlResetLastError();
1965        if (mem_base != xmlMemBlocks()) {
1966            printf("Leak of %d blocks found in htmlEntityLookup",
1967	           xmlMemBlocks() - mem_base);
1968	    test_ret++;
1969            printf(" %d", n_name);
1970            printf("\n");
1971        }
1972    }
1973    function_tests++;
1974#endif
1975
1976    return(test_ret);
1977}
1978
1979
1980static int
1981test_htmlEntityValueLookup(void) {
1982    int test_ret = 0;
1983
1984#if defined(LIBXML_HTML_ENABLED)
1985    int mem_base;
1986    const htmlEntityDesc * ret_val;
1987    unsigned int value; /* the entity's unicode value */
1988    int n_value;
1989
1990    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
1991        mem_base = xmlMemBlocks();
1992        value = gen_unsigned_int(n_value, 0);
1993
1994        ret_val = htmlEntityValueLookup(value);
1995        desret_const_htmlEntityDesc_ptr(ret_val);
1996        call_tests++;
1997        des_unsigned_int(n_value, value, 0);
1998        xmlResetLastError();
1999        if (mem_base != xmlMemBlocks()) {
2000            printf("Leak of %d blocks found in htmlEntityValueLookup",
2001	           xmlMemBlocks() - mem_base);
2002	    test_ret++;
2003            printf(" %d", n_value);
2004            printf("\n");
2005        }
2006    }
2007    function_tests++;
2008#endif
2009
2010    return(test_ret);
2011}
2012
2013
2014static int
2015test_htmlHandleOmittedElem(void) {
2016    int test_ret = 0;
2017
2018#if defined(LIBXML_HTML_ENABLED)
2019    int mem_base;
2020    int ret_val;
2021    int val; /* int 0 or 1 */
2022    int n_val;
2023
2024    for (n_val = 0;n_val < gen_nb_int;n_val++) {
2025        mem_base = xmlMemBlocks();
2026        val = gen_int(n_val, 0);
2027
2028        ret_val = htmlHandleOmittedElem(val);
2029        desret_int(ret_val);
2030        call_tests++;
2031        des_int(n_val, val, 0);
2032        xmlResetLastError();
2033        if (mem_base != xmlMemBlocks()) {
2034            printf("Leak of %d blocks found in htmlHandleOmittedElem",
2035	           xmlMemBlocks() - mem_base);
2036	    test_ret++;
2037            printf(" %d", n_val);
2038            printf("\n");
2039        }
2040    }
2041    function_tests++;
2042#endif
2043
2044    return(test_ret);
2045}
2046
2047
2048static int
2049test_htmlIsAutoClosed(void) {
2050    int test_ret = 0;
2051
2052#if defined(LIBXML_HTML_ENABLED)
2053    int mem_base;
2054    int ret_val;
2055    htmlDocPtr doc; /* the HTML document */
2056    int n_doc;
2057    htmlNodePtr elem; /* the HTML element */
2058    int n_elem;
2059
2060    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2061    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2062        mem_base = xmlMemBlocks();
2063        doc = gen_htmlDocPtr(n_doc, 0);
2064        elem = gen_htmlNodePtr(n_elem, 1);
2065
2066        ret_val = htmlIsAutoClosed(doc, elem);
2067        desret_int(ret_val);
2068        call_tests++;
2069        des_htmlDocPtr(n_doc, doc, 0);
2070        des_htmlNodePtr(n_elem, elem, 1);
2071        xmlResetLastError();
2072        if (mem_base != xmlMemBlocks()) {
2073            printf("Leak of %d blocks found in htmlIsAutoClosed",
2074	           xmlMemBlocks() - mem_base);
2075	    test_ret++;
2076            printf(" %d", n_doc);
2077            printf(" %d", n_elem);
2078            printf("\n");
2079        }
2080    }
2081    }
2082    function_tests++;
2083#endif
2084
2085    return(test_ret);
2086}
2087
2088
2089static int
2090test_htmlIsScriptAttribute(void) {
2091    int test_ret = 0;
2092
2093#if defined(LIBXML_HTML_ENABLED)
2094    int mem_base;
2095    int ret_val;
2096    xmlChar * name; /* an attribute name */
2097    int n_name;
2098
2099    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2100        mem_base = xmlMemBlocks();
2101        name = gen_const_xmlChar_ptr(n_name, 0);
2102
2103        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2104        desret_int(ret_val);
2105        call_tests++;
2106        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2107        xmlResetLastError();
2108        if (mem_base != xmlMemBlocks()) {
2109            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2110	           xmlMemBlocks() - mem_base);
2111	    test_ret++;
2112            printf(" %d", n_name);
2113            printf("\n");
2114        }
2115    }
2116    function_tests++;
2117#endif
2118
2119    return(test_ret);
2120}
2121
2122
2123static int
2124test_htmlNodeStatus(void) {
2125    int test_ret = 0;
2126
2127#if defined(LIBXML_HTML_ENABLED)
2128    int mem_base;
2129    htmlStatus ret_val;
2130    htmlNodePtr node; /* an htmlNodePtr in a tree */
2131    int n_node;
2132    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2133    int n_legacy;
2134
2135    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2136    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2137        mem_base = xmlMemBlocks();
2138        node = gen_const_htmlNodePtr(n_node, 0);
2139        legacy = gen_int(n_legacy, 1);
2140
2141        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2142        desret_htmlStatus(ret_val);
2143        call_tests++;
2144        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2145        des_int(n_legacy, legacy, 1);
2146        xmlResetLastError();
2147        if (mem_base != xmlMemBlocks()) {
2148            printf("Leak of %d blocks found in htmlNodeStatus",
2149	           xmlMemBlocks() - mem_base);
2150	    test_ret++;
2151            printf(" %d", n_node);
2152            printf(" %d", n_legacy);
2153            printf("\n");
2154        }
2155    }
2156    }
2157    function_tests++;
2158#endif
2159
2160    return(test_ret);
2161}
2162
2163
2164static int
2165test_htmlParseCharRef(void) {
2166    int test_ret = 0;
2167
2168#if defined(LIBXML_HTML_ENABLED)
2169    int mem_base;
2170    int ret_val;
2171    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2172    int n_ctxt;
2173
2174    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2175        mem_base = xmlMemBlocks();
2176        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2177
2178        ret_val = htmlParseCharRef(ctxt);
2179        desret_int(ret_val);
2180        call_tests++;
2181        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2182        xmlResetLastError();
2183        if (mem_base != xmlMemBlocks()) {
2184            printf("Leak of %d blocks found in htmlParseCharRef",
2185	           xmlMemBlocks() - mem_base);
2186	    test_ret++;
2187            printf(" %d", n_ctxt);
2188            printf("\n");
2189        }
2190    }
2191    function_tests++;
2192#endif
2193
2194    return(test_ret);
2195}
2196
2197
2198static int
2199test_htmlParseChunk(void) {
2200    int test_ret = 0;
2201
2202#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2203    int mem_base;
2204    int ret_val;
2205    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2206    int n_ctxt;
2207    char * chunk; /* an char array */
2208    int n_chunk;
2209    int size; /* the size in byte of the chunk */
2210    int n_size;
2211    int terminate; /* last chunk indicator */
2212    int n_terminate;
2213
2214    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2215    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2216    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2217    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2218        mem_base = xmlMemBlocks();
2219        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2220        chunk = gen_const_char_ptr(n_chunk, 1);
2221        size = gen_int(n_size, 2);
2222        terminate = gen_int(n_terminate, 3);
2223
2224        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2225        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2226        desret_int(ret_val);
2227        call_tests++;
2228        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2229        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2230        des_int(n_size, size, 2);
2231        des_int(n_terminate, terminate, 3);
2232        xmlResetLastError();
2233        if (mem_base != xmlMemBlocks()) {
2234            printf("Leak of %d blocks found in htmlParseChunk",
2235	           xmlMemBlocks() - mem_base);
2236	    test_ret++;
2237            printf(" %d", n_ctxt);
2238            printf(" %d", n_chunk);
2239            printf(" %d", n_size);
2240            printf(" %d", n_terminate);
2241            printf("\n");
2242        }
2243    }
2244    }
2245    }
2246    }
2247    function_tests++;
2248#endif
2249
2250    return(test_ret);
2251}
2252
2253
2254static int
2255test_htmlParseDoc(void) {
2256    int test_ret = 0;
2257
2258#if defined(LIBXML_HTML_ENABLED)
2259    int mem_base;
2260    htmlDocPtr ret_val;
2261    xmlChar * cur; /* a pointer to an array of xmlChar */
2262    int n_cur;
2263    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2264    int n_encoding;
2265
2266    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2267    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2268        mem_base = xmlMemBlocks();
2269        cur = gen_xmlChar_ptr(n_cur, 0);
2270        encoding = gen_const_char_ptr(n_encoding, 1);
2271
2272        ret_val = htmlParseDoc(cur, (const char *)encoding);
2273        desret_htmlDocPtr(ret_val);
2274        call_tests++;
2275        des_xmlChar_ptr(n_cur, cur, 0);
2276        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2277        xmlResetLastError();
2278        if (mem_base != xmlMemBlocks()) {
2279            printf("Leak of %d blocks found in htmlParseDoc",
2280	           xmlMemBlocks() - mem_base);
2281	    test_ret++;
2282            printf(" %d", n_cur);
2283            printf(" %d", n_encoding);
2284            printf("\n");
2285        }
2286    }
2287    }
2288    function_tests++;
2289#endif
2290
2291    return(test_ret);
2292}
2293
2294
2295static int
2296test_htmlParseDocument(void) {
2297    int test_ret = 0;
2298
2299#if defined(LIBXML_HTML_ENABLED)
2300    int mem_base;
2301    int ret_val;
2302    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2303    int n_ctxt;
2304
2305    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2306        mem_base = xmlMemBlocks();
2307        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2308
2309        ret_val = htmlParseDocument(ctxt);
2310        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2311        desret_int(ret_val);
2312        call_tests++;
2313        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2314        xmlResetLastError();
2315        if (mem_base != xmlMemBlocks()) {
2316            printf("Leak of %d blocks found in htmlParseDocument",
2317	           xmlMemBlocks() - mem_base);
2318	    test_ret++;
2319            printf(" %d", n_ctxt);
2320            printf("\n");
2321        }
2322    }
2323    function_tests++;
2324#endif
2325
2326    return(test_ret);
2327}
2328
2329
2330static int
2331test_htmlParseElement(void) {
2332    int test_ret = 0;
2333
2334#if defined(LIBXML_HTML_ENABLED)
2335    int mem_base;
2336    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2337    int n_ctxt;
2338
2339    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2340        mem_base = xmlMemBlocks();
2341        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2342
2343        htmlParseElement(ctxt);
2344        call_tests++;
2345        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2346        xmlResetLastError();
2347        if (mem_base != xmlMemBlocks()) {
2348            printf("Leak of %d blocks found in htmlParseElement",
2349	           xmlMemBlocks() - mem_base);
2350	    test_ret++;
2351            printf(" %d", n_ctxt);
2352            printf("\n");
2353        }
2354    }
2355    function_tests++;
2356#endif
2357
2358    return(test_ret);
2359}
2360
2361
2362static int
2363test_htmlParseEntityRef(void) {
2364    int test_ret = 0;
2365
2366#if defined(LIBXML_HTML_ENABLED)
2367    int mem_base;
2368    const htmlEntityDesc * ret_val;
2369    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2370    int n_ctxt;
2371    xmlChar ** str; /* location to store the entity name */
2372    int n_str;
2373
2374    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2375    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2376        mem_base = xmlMemBlocks();
2377        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2378        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2379
2380        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2381        desret_const_htmlEntityDesc_ptr(ret_val);
2382        call_tests++;
2383        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2384        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2385        xmlResetLastError();
2386        if (mem_base != xmlMemBlocks()) {
2387            printf("Leak of %d blocks found in htmlParseEntityRef",
2388	           xmlMemBlocks() - mem_base);
2389	    test_ret++;
2390            printf(" %d", n_ctxt);
2391            printf(" %d", n_str);
2392            printf("\n");
2393        }
2394    }
2395    }
2396    function_tests++;
2397#endif
2398
2399    return(test_ret);
2400}
2401
2402
2403static int
2404test_htmlParseFile(void) {
2405    int test_ret = 0;
2406
2407#if defined(LIBXML_HTML_ENABLED)
2408    htmlDocPtr ret_val;
2409    const char * filename; /* the filename */
2410    int n_filename;
2411    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2412    int n_encoding;
2413
2414    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2415    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2416        filename = gen_filepath(n_filename, 0);
2417        encoding = gen_const_char_ptr(n_encoding, 1);
2418
2419        ret_val = htmlParseFile(filename, (const char *)encoding);
2420        desret_htmlDocPtr(ret_val);
2421        call_tests++;
2422        des_filepath(n_filename, filename, 0);
2423        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2424        xmlResetLastError();
2425    }
2426    }
2427    function_tests++;
2428#endif
2429
2430    return(test_ret);
2431}
2432
2433
2434static int
2435test_htmlReadDoc(void) {
2436    int test_ret = 0;
2437
2438#if defined(LIBXML_HTML_ENABLED)
2439    int mem_base;
2440    htmlDocPtr ret_val;
2441    xmlChar * cur; /* a pointer to a zero terminated string */
2442    int n_cur;
2443    const char * URL; /* the base URL to use for the document */
2444    int n_URL;
2445    char * encoding; /* the document encoding, or NULL */
2446    int n_encoding;
2447    int options; /* a combination of htmlParserOption(s) */
2448    int n_options;
2449
2450    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2451    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2452    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2453    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2454        mem_base = xmlMemBlocks();
2455        cur = gen_const_xmlChar_ptr(n_cur, 0);
2456        URL = gen_filepath(n_URL, 1);
2457        encoding = gen_const_char_ptr(n_encoding, 2);
2458        options = gen_int(n_options, 3);
2459
2460        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2461        desret_htmlDocPtr(ret_val);
2462        call_tests++;
2463        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2464        des_filepath(n_URL, URL, 1);
2465        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2466        des_int(n_options, options, 3);
2467        xmlResetLastError();
2468        if (mem_base != xmlMemBlocks()) {
2469            printf("Leak of %d blocks found in htmlReadDoc",
2470	           xmlMemBlocks() - mem_base);
2471	    test_ret++;
2472            printf(" %d", n_cur);
2473            printf(" %d", n_URL);
2474            printf(" %d", n_encoding);
2475            printf(" %d", n_options);
2476            printf("\n");
2477        }
2478    }
2479    }
2480    }
2481    }
2482    function_tests++;
2483#endif
2484
2485    return(test_ret);
2486}
2487
2488
2489static int
2490test_htmlReadFile(void) {
2491    int test_ret = 0;
2492
2493#if defined(LIBXML_HTML_ENABLED)
2494    int mem_base;
2495    htmlDocPtr ret_val;
2496    const char * filename; /* a file or URL */
2497    int n_filename;
2498    char * encoding; /* the document encoding, or NULL */
2499    int n_encoding;
2500    int options; /* a combination of htmlParserOption(s) */
2501    int n_options;
2502
2503    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2504    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2505    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2506        mem_base = xmlMemBlocks();
2507        filename = gen_filepath(n_filename, 0);
2508        encoding = gen_const_char_ptr(n_encoding, 1);
2509        options = gen_int(n_options, 2);
2510
2511        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2512        desret_htmlDocPtr(ret_val);
2513        call_tests++;
2514        des_filepath(n_filename, filename, 0);
2515        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2516        des_int(n_options, options, 2);
2517        xmlResetLastError();
2518        if (mem_base != xmlMemBlocks()) {
2519            printf("Leak of %d blocks found in htmlReadFile",
2520	           xmlMemBlocks() - mem_base);
2521	    test_ret++;
2522            printf(" %d", n_filename);
2523            printf(" %d", n_encoding);
2524            printf(" %d", n_options);
2525            printf("\n");
2526        }
2527    }
2528    }
2529    }
2530    function_tests++;
2531#endif
2532
2533    return(test_ret);
2534}
2535
2536
2537static int
2538test_htmlReadMemory(void) {
2539    int test_ret = 0;
2540
2541#if defined(LIBXML_HTML_ENABLED)
2542    int mem_base;
2543    htmlDocPtr ret_val;
2544    char * buffer; /* a pointer to a char array */
2545    int n_buffer;
2546    int size; /* the size of the array */
2547    int n_size;
2548    const char * URL; /* the base URL to use for the document */
2549    int n_URL;
2550    char * encoding; /* the document encoding, or NULL */
2551    int n_encoding;
2552    int options; /* a combination of htmlParserOption(s) */
2553    int n_options;
2554
2555    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2556    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2557    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2558    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2559    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2560        mem_base = xmlMemBlocks();
2561        buffer = gen_const_char_ptr(n_buffer, 0);
2562        size = gen_int(n_size, 1);
2563        URL = gen_filepath(n_URL, 2);
2564        encoding = gen_const_char_ptr(n_encoding, 3);
2565        options = gen_int(n_options, 4);
2566
2567        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2568        desret_htmlDocPtr(ret_val);
2569        call_tests++;
2570        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2571        des_int(n_size, size, 1);
2572        des_filepath(n_URL, URL, 2);
2573        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2574        des_int(n_options, options, 4);
2575        xmlResetLastError();
2576        if (mem_base != xmlMemBlocks()) {
2577            printf("Leak of %d blocks found in htmlReadMemory",
2578	           xmlMemBlocks() - mem_base);
2579	    test_ret++;
2580            printf(" %d", n_buffer);
2581            printf(" %d", n_size);
2582            printf(" %d", n_URL);
2583            printf(" %d", n_encoding);
2584            printf(" %d", n_options);
2585            printf("\n");
2586        }
2587    }
2588    }
2589    }
2590    }
2591    }
2592    function_tests++;
2593#endif
2594
2595    return(test_ret);
2596}
2597
2598
2599static int
2600test_htmlSAXParseDoc(void) {
2601    int test_ret = 0;
2602
2603#if defined(LIBXML_HTML_ENABLED)
2604    int mem_base;
2605    htmlDocPtr ret_val;
2606    xmlChar * cur; /* a pointer to an array of xmlChar */
2607    int n_cur;
2608    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2609    int n_encoding;
2610    htmlSAXHandlerPtr sax; /* the SAX handler block */
2611    int n_sax;
2612    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2613    int n_userData;
2614
2615    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2616    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2617    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2618    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2619        mem_base = xmlMemBlocks();
2620        cur = gen_xmlChar_ptr(n_cur, 0);
2621        encoding = gen_const_char_ptr(n_encoding, 1);
2622        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2623        userData = gen_userdata(n_userData, 3);
2624
2625        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2626        desret_htmlDocPtr(ret_val);
2627        call_tests++;
2628        des_xmlChar_ptr(n_cur, cur, 0);
2629        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2630        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2631        des_userdata(n_userData, userData, 3);
2632        xmlResetLastError();
2633        if (mem_base != xmlMemBlocks()) {
2634            printf("Leak of %d blocks found in htmlSAXParseDoc",
2635	           xmlMemBlocks() - mem_base);
2636	    test_ret++;
2637            printf(" %d", n_cur);
2638            printf(" %d", n_encoding);
2639            printf(" %d", n_sax);
2640            printf(" %d", n_userData);
2641            printf("\n");
2642        }
2643    }
2644    }
2645    }
2646    }
2647    function_tests++;
2648#endif
2649
2650    return(test_ret);
2651}
2652
2653
2654static int
2655test_htmlSAXParseFile(void) {
2656    int test_ret = 0;
2657
2658#if defined(LIBXML_HTML_ENABLED)
2659    int mem_base;
2660    htmlDocPtr ret_val;
2661    const char * filename; /* the filename */
2662    int n_filename;
2663    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2664    int n_encoding;
2665    htmlSAXHandlerPtr sax; /* the SAX handler block */
2666    int n_sax;
2667    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2668    int n_userData;
2669
2670    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2671    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2672    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2673    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2674        mem_base = xmlMemBlocks();
2675        filename = gen_filepath(n_filename, 0);
2676        encoding = gen_const_char_ptr(n_encoding, 1);
2677        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2678        userData = gen_userdata(n_userData, 3);
2679
2680        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2681        desret_htmlDocPtr(ret_val);
2682        call_tests++;
2683        des_filepath(n_filename, filename, 0);
2684        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2685        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2686        des_userdata(n_userData, userData, 3);
2687        xmlResetLastError();
2688        if (mem_base != xmlMemBlocks()) {
2689            printf("Leak of %d blocks found in htmlSAXParseFile",
2690	           xmlMemBlocks() - mem_base);
2691	    test_ret++;
2692            printf(" %d", n_filename);
2693            printf(" %d", n_encoding);
2694            printf(" %d", n_sax);
2695            printf(" %d", n_userData);
2696            printf("\n");
2697        }
2698    }
2699    }
2700    }
2701    }
2702    function_tests++;
2703#endif
2704
2705    return(test_ret);
2706}
2707
2708
2709static int
2710test_htmlTagLookup(void) {
2711    int test_ret = 0;
2712
2713
2714    /* missing type support */
2715    return(test_ret);
2716}
2717
2718static int
2719test_HTMLparser(void) {
2720    int test_ret = 0;
2721
2722    if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n");
2723    test_ret += test_UTF8ToHtml();
2724    test_ret += test_htmlAttrAllowed();
2725    test_ret += test_htmlAutoCloseTag();
2726    test_ret += test_htmlCreateMemoryParserCtxt();
2727    test_ret += test_htmlCreatePushParserCtxt();
2728    test_ret += test_htmlCtxtReadDoc();
2729    test_ret += test_htmlCtxtReadFile();
2730    test_ret += test_htmlCtxtReadMemory();
2731    test_ret += test_htmlCtxtReset();
2732    test_ret += test_htmlCtxtUseOptions();
2733    test_ret += test_htmlElementAllowedHere();
2734    test_ret += test_htmlElementStatusHere();
2735    test_ret += test_htmlEncodeEntities();
2736    test_ret += test_htmlEntityLookup();
2737    test_ret += test_htmlEntityValueLookup();
2738    test_ret += test_htmlHandleOmittedElem();
2739    test_ret += test_htmlIsAutoClosed();
2740    test_ret += test_htmlIsScriptAttribute();
2741    test_ret += test_htmlNodeStatus();
2742    test_ret += test_htmlParseCharRef();
2743    test_ret += test_htmlParseChunk();
2744    test_ret += test_htmlParseDoc();
2745    test_ret += test_htmlParseDocument();
2746    test_ret += test_htmlParseElement();
2747    test_ret += test_htmlParseEntityRef();
2748    test_ret += test_htmlParseFile();
2749    test_ret += test_htmlReadDoc();
2750    test_ret += test_htmlReadFile();
2751    test_ret += test_htmlReadMemory();
2752    test_ret += test_htmlSAXParseDoc();
2753    test_ret += test_htmlSAXParseFile();
2754    test_ret += test_htmlTagLookup();
2755
2756    if (test_ret != 0)
2757	printf("Module HTMLparser: %d errors\n", test_ret);
2758    return(test_ret);
2759}
2760
2761static int
2762test_htmlDocContentDumpFormatOutput(void) {
2763    int test_ret = 0;
2764
2765#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2766    int mem_base;
2767    xmlOutputBufferPtr buf; /* the HTML buffer output */
2768    int n_buf;
2769    xmlDocPtr cur; /* the document */
2770    int n_cur;
2771    char * encoding; /* the encoding string */
2772    int n_encoding;
2773    int format; /* should formatting spaces been added */
2774    int n_format;
2775
2776    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2777    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2778    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2779    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2780        mem_base = xmlMemBlocks();
2781        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2782        cur = gen_xmlDocPtr(n_cur, 1);
2783        encoding = gen_const_char_ptr(n_encoding, 2);
2784        format = gen_int(n_format, 3);
2785
2786        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2787        call_tests++;
2788        des_xmlOutputBufferPtr(n_buf, buf, 0);
2789        des_xmlDocPtr(n_cur, cur, 1);
2790        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2791        des_int(n_format, format, 3);
2792        xmlResetLastError();
2793        if (mem_base != xmlMemBlocks()) {
2794            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2795	           xmlMemBlocks() - mem_base);
2796	    test_ret++;
2797            printf(" %d", n_buf);
2798            printf(" %d", n_cur);
2799            printf(" %d", n_encoding);
2800            printf(" %d", n_format);
2801            printf("\n");
2802        }
2803    }
2804    }
2805    }
2806    }
2807    function_tests++;
2808#endif
2809
2810    return(test_ret);
2811}
2812
2813
2814static int
2815test_htmlDocContentDumpOutput(void) {
2816    int test_ret = 0;
2817
2818#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2819    int mem_base;
2820    xmlOutputBufferPtr buf; /* the HTML buffer output */
2821    int n_buf;
2822    xmlDocPtr cur; /* the document */
2823    int n_cur;
2824    char * encoding; /* the encoding string */
2825    int n_encoding;
2826
2827    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2828    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2829    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2830        mem_base = xmlMemBlocks();
2831        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2832        cur = gen_xmlDocPtr(n_cur, 1);
2833        encoding = gen_const_char_ptr(n_encoding, 2);
2834
2835        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2836        call_tests++;
2837        des_xmlOutputBufferPtr(n_buf, buf, 0);
2838        des_xmlDocPtr(n_cur, cur, 1);
2839        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2840        xmlResetLastError();
2841        if (mem_base != xmlMemBlocks()) {
2842            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2843	           xmlMemBlocks() - mem_base);
2844	    test_ret++;
2845            printf(" %d", n_buf);
2846            printf(" %d", n_cur);
2847            printf(" %d", n_encoding);
2848            printf("\n");
2849        }
2850    }
2851    }
2852    }
2853    function_tests++;
2854#endif
2855
2856    return(test_ret);
2857}
2858
2859
2860static int
2861test_htmlDocDump(void) {
2862    int test_ret = 0;
2863
2864#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2865    int mem_base;
2866    int ret_val;
2867    FILE * f; /* the FILE* */
2868    int n_f;
2869    xmlDocPtr cur; /* the document */
2870    int n_cur;
2871
2872    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2873    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2874        mem_base = xmlMemBlocks();
2875        f = gen_FILE_ptr(n_f, 0);
2876        cur = gen_xmlDocPtr(n_cur, 1);
2877
2878        ret_val = htmlDocDump(f, cur);
2879        desret_int(ret_val);
2880        call_tests++;
2881        des_FILE_ptr(n_f, f, 0);
2882        des_xmlDocPtr(n_cur, cur, 1);
2883        xmlResetLastError();
2884        if (mem_base != xmlMemBlocks()) {
2885            printf("Leak of %d blocks found in htmlDocDump",
2886	           xmlMemBlocks() - mem_base);
2887	    test_ret++;
2888            printf(" %d", n_f);
2889            printf(" %d", n_cur);
2890            printf("\n");
2891        }
2892    }
2893    }
2894    function_tests++;
2895#endif
2896
2897    return(test_ret);
2898}
2899
2900
2901#define gen_nb_xmlChar_ptr_ptr 1
2902static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2903    return(NULL);
2904}
2905static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2906}
2907
2908static int
2909test_htmlDocDumpMemory(void) {
2910    int test_ret = 0;
2911
2912#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2913    int mem_base;
2914    xmlDocPtr cur; /* the document */
2915    int n_cur;
2916    xmlChar ** mem; /* OUT: the memory pointer */
2917    int n_mem;
2918    int * size; /* OUT: the memory length */
2919    int n_size;
2920
2921    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2922    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2923    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2924        mem_base = xmlMemBlocks();
2925        cur = gen_xmlDocPtr(n_cur, 0);
2926        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2927        size = gen_int_ptr(n_size, 2);
2928
2929        htmlDocDumpMemory(cur, mem, size);
2930        call_tests++;
2931        des_xmlDocPtr(n_cur, cur, 0);
2932        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2933        des_int_ptr(n_size, size, 2);
2934        xmlResetLastError();
2935        if (mem_base != xmlMemBlocks()) {
2936            printf("Leak of %d blocks found in htmlDocDumpMemory",
2937	           xmlMemBlocks() - mem_base);
2938	    test_ret++;
2939            printf(" %d", n_cur);
2940            printf(" %d", n_mem);
2941            printf(" %d", n_size);
2942            printf("\n");
2943        }
2944    }
2945    }
2946    }
2947    function_tests++;
2948#endif
2949
2950    return(test_ret);
2951}
2952
2953
2954static int
2955test_htmlGetMetaEncoding(void) {
2956    int test_ret = 0;
2957
2958#if defined(LIBXML_HTML_ENABLED)
2959    int mem_base;
2960    const xmlChar * ret_val;
2961    htmlDocPtr doc; /* the document */
2962    int n_doc;
2963
2964    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2965        mem_base = xmlMemBlocks();
2966        doc = gen_htmlDocPtr(n_doc, 0);
2967
2968        ret_val = htmlGetMetaEncoding(doc);
2969        desret_const_xmlChar_ptr(ret_val);
2970        call_tests++;
2971        des_htmlDocPtr(n_doc, doc, 0);
2972        xmlResetLastError();
2973        if (mem_base != xmlMemBlocks()) {
2974            printf("Leak of %d blocks found in htmlGetMetaEncoding",
2975	           xmlMemBlocks() - mem_base);
2976	    test_ret++;
2977            printf(" %d", n_doc);
2978            printf("\n");
2979        }
2980    }
2981    function_tests++;
2982#endif
2983
2984    return(test_ret);
2985}
2986
2987
2988static int
2989test_htmlIsBooleanAttr(void) {
2990    int test_ret = 0;
2991
2992#if defined(LIBXML_HTML_ENABLED)
2993    int mem_base;
2994    int ret_val;
2995    xmlChar * name; /* the name of the attribute to check */
2996    int n_name;
2997
2998    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2999        mem_base = xmlMemBlocks();
3000        name = gen_const_xmlChar_ptr(n_name, 0);
3001
3002        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3003        desret_int(ret_val);
3004        call_tests++;
3005        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3006        xmlResetLastError();
3007        if (mem_base != xmlMemBlocks()) {
3008            printf("Leak of %d blocks found in htmlIsBooleanAttr",
3009	           xmlMemBlocks() - mem_base);
3010	    test_ret++;
3011            printf(" %d", n_name);
3012            printf("\n");
3013        }
3014    }
3015    function_tests++;
3016#endif
3017
3018    return(test_ret);
3019}
3020
3021
3022static int
3023test_htmlNewDoc(void) {
3024    int test_ret = 0;
3025
3026#if defined(LIBXML_HTML_ENABLED)
3027    int mem_base;
3028    htmlDocPtr ret_val;
3029    xmlChar * URI; /* URI for the dtd, or NULL */
3030    int n_URI;
3031    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3032    int n_ExternalID;
3033
3034    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3035    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3036        mem_base = xmlMemBlocks();
3037        URI = gen_const_xmlChar_ptr(n_URI, 0);
3038        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3039
3040        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3041        desret_htmlDocPtr(ret_val);
3042        call_tests++;
3043        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3044        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3045        xmlResetLastError();
3046        if (mem_base != xmlMemBlocks()) {
3047            printf("Leak of %d blocks found in htmlNewDoc",
3048	           xmlMemBlocks() - mem_base);
3049	    test_ret++;
3050            printf(" %d", n_URI);
3051            printf(" %d", n_ExternalID);
3052            printf("\n");
3053        }
3054    }
3055    }
3056    function_tests++;
3057#endif
3058
3059    return(test_ret);
3060}
3061
3062
3063static int
3064test_htmlNewDocNoDtD(void) {
3065    int test_ret = 0;
3066
3067#if defined(LIBXML_HTML_ENABLED)
3068    int mem_base;
3069    htmlDocPtr ret_val;
3070    xmlChar * URI; /* URI for the dtd, or NULL */
3071    int n_URI;
3072    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3073    int n_ExternalID;
3074
3075    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3076    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3077        mem_base = xmlMemBlocks();
3078        URI = gen_const_xmlChar_ptr(n_URI, 0);
3079        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3080
3081        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3082        desret_htmlDocPtr(ret_val);
3083        call_tests++;
3084        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3085        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3086        xmlResetLastError();
3087        if (mem_base != xmlMemBlocks()) {
3088            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3089	           xmlMemBlocks() - mem_base);
3090	    test_ret++;
3091            printf(" %d", n_URI);
3092            printf(" %d", n_ExternalID);
3093            printf("\n");
3094        }
3095    }
3096    }
3097    function_tests++;
3098#endif
3099
3100    return(test_ret);
3101}
3102
3103
3104static int
3105test_htmlNodeDump(void) {
3106    int test_ret = 0;
3107
3108#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3109    int mem_base;
3110    int ret_val;
3111    xmlBufferPtr buf; /* the HTML buffer output */
3112    int n_buf;
3113    xmlDocPtr doc; /* the document */
3114    int n_doc;
3115    xmlNodePtr cur; /* the current node */
3116    int n_cur;
3117
3118    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3119    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3120    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3121        mem_base = xmlMemBlocks();
3122        buf = gen_xmlBufferPtr(n_buf, 0);
3123        doc = gen_xmlDocPtr(n_doc, 1);
3124        cur = gen_xmlNodePtr(n_cur, 2);
3125
3126        ret_val = htmlNodeDump(buf, doc, cur);
3127        desret_int(ret_val);
3128        call_tests++;
3129        des_xmlBufferPtr(n_buf, buf, 0);
3130        des_xmlDocPtr(n_doc, doc, 1);
3131        des_xmlNodePtr(n_cur, cur, 2);
3132        xmlResetLastError();
3133        if (mem_base != xmlMemBlocks()) {
3134            printf("Leak of %d blocks found in htmlNodeDump",
3135	           xmlMemBlocks() - mem_base);
3136	    test_ret++;
3137            printf(" %d", n_buf);
3138            printf(" %d", n_doc);
3139            printf(" %d", n_cur);
3140            printf("\n");
3141        }
3142    }
3143    }
3144    }
3145    function_tests++;
3146#endif
3147
3148    return(test_ret);
3149}
3150
3151
3152static int
3153test_htmlNodeDumpFile(void) {
3154    int test_ret = 0;
3155
3156#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3157    int mem_base;
3158    FILE * out; /* the FILE pointer */
3159    int n_out;
3160    xmlDocPtr doc; /* the document */
3161    int n_doc;
3162    xmlNodePtr cur; /* the current node */
3163    int n_cur;
3164
3165    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3166    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3167    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3168        mem_base = xmlMemBlocks();
3169        out = gen_FILE_ptr(n_out, 0);
3170        doc = gen_xmlDocPtr(n_doc, 1);
3171        cur = gen_xmlNodePtr(n_cur, 2);
3172
3173        htmlNodeDumpFile(out, doc, cur);
3174        call_tests++;
3175        des_FILE_ptr(n_out, out, 0);
3176        des_xmlDocPtr(n_doc, doc, 1);
3177        des_xmlNodePtr(n_cur, cur, 2);
3178        xmlResetLastError();
3179        if (mem_base != xmlMemBlocks()) {
3180            printf("Leak of %d blocks found in htmlNodeDumpFile",
3181	           xmlMemBlocks() - mem_base);
3182	    test_ret++;
3183            printf(" %d", n_out);
3184            printf(" %d", n_doc);
3185            printf(" %d", n_cur);
3186            printf("\n");
3187        }
3188    }
3189    }
3190    }
3191    function_tests++;
3192#endif
3193
3194    return(test_ret);
3195}
3196
3197
3198static int
3199test_htmlNodeDumpFileFormat(void) {
3200    int test_ret = 0;
3201
3202#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3203    int mem_base;
3204    int ret_val;
3205    FILE * out; /* the FILE pointer */
3206    int n_out;
3207    xmlDocPtr doc; /* the document */
3208    int n_doc;
3209    xmlNodePtr cur; /* the current node */
3210    int n_cur;
3211    char * encoding; /* the document encoding */
3212    int n_encoding;
3213    int format; /* should formatting spaces been added */
3214    int n_format;
3215
3216    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3217    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3218    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3219    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3220    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3221        mem_base = xmlMemBlocks();
3222        out = gen_FILE_ptr(n_out, 0);
3223        doc = gen_xmlDocPtr(n_doc, 1);
3224        cur = gen_xmlNodePtr(n_cur, 2);
3225        encoding = gen_const_char_ptr(n_encoding, 3);
3226        format = gen_int(n_format, 4);
3227
3228        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3229        desret_int(ret_val);
3230        call_tests++;
3231        des_FILE_ptr(n_out, out, 0);
3232        des_xmlDocPtr(n_doc, doc, 1);
3233        des_xmlNodePtr(n_cur, cur, 2);
3234        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3235        des_int(n_format, format, 4);
3236        xmlResetLastError();
3237        if (mem_base != xmlMemBlocks()) {
3238            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3239	           xmlMemBlocks() - mem_base);
3240	    test_ret++;
3241            printf(" %d", n_out);
3242            printf(" %d", n_doc);
3243            printf(" %d", n_cur);
3244            printf(" %d", n_encoding);
3245            printf(" %d", n_format);
3246            printf("\n");
3247        }
3248    }
3249    }
3250    }
3251    }
3252    }
3253    function_tests++;
3254#endif
3255
3256    return(test_ret);
3257}
3258
3259
3260static int
3261test_htmlNodeDumpFormatOutput(void) {
3262    int test_ret = 0;
3263
3264#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3265    int mem_base;
3266    xmlOutputBufferPtr buf; /* the HTML buffer output */
3267    int n_buf;
3268    xmlDocPtr doc; /* the document */
3269    int n_doc;
3270    xmlNodePtr cur; /* the current node */
3271    int n_cur;
3272    char * encoding; /* the encoding string */
3273    int n_encoding;
3274    int format; /* should formatting spaces been added */
3275    int n_format;
3276
3277    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3278    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3279    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3280    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3281    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3282        mem_base = xmlMemBlocks();
3283        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3284        doc = gen_xmlDocPtr(n_doc, 1);
3285        cur = gen_xmlNodePtr(n_cur, 2);
3286        encoding = gen_const_char_ptr(n_encoding, 3);
3287        format = gen_int(n_format, 4);
3288
3289        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3290        call_tests++;
3291        des_xmlOutputBufferPtr(n_buf, buf, 0);
3292        des_xmlDocPtr(n_doc, doc, 1);
3293        des_xmlNodePtr(n_cur, cur, 2);
3294        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3295        des_int(n_format, format, 4);
3296        xmlResetLastError();
3297        if (mem_base != xmlMemBlocks()) {
3298            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3299	           xmlMemBlocks() - mem_base);
3300	    test_ret++;
3301            printf(" %d", n_buf);
3302            printf(" %d", n_doc);
3303            printf(" %d", n_cur);
3304            printf(" %d", n_encoding);
3305            printf(" %d", n_format);
3306            printf("\n");
3307        }
3308    }
3309    }
3310    }
3311    }
3312    }
3313    function_tests++;
3314#endif
3315
3316    return(test_ret);
3317}
3318
3319
3320static int
3321test_htmlNodeDumpOutput(void) {
3322    int test_ret = 0;
3323
3324#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3325    int mem_base;
3326    xmlOutputBufferPtr buf; /* the HTML buffer output */
3327    int n_buf;
3328    xmlDocPtr doc; /* the document */
3329    int n_doc;
3330    xmlNodePtr cur; /* the current node */
3331    int n_cur;
3332    char * encoding; /* the encoding string */
3333    int n_encoding;
3334
3335    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3336    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3337    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3338    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3339        mem_base = xmlMemBlocks();
3340        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3341        doc = gen_xmlDocPtr(n_doc, 1);
3342        cur = gen_xmlNodePtr(n_cur, 2);
3343        encoding = gen_const_char_ptr(n_encoding, 3);
3344
3345        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3346        call_tests++;
3347        des_xmlOutputBufferPtr(n_buf, buf, 0);
3348        des_xmlDocPtr(n_doc, doc, 1);
3349        des_xmlNodePtr(n_cur, cur, 2);
3350        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3351        xmlResetLastError();
3352        if (mem_base != xmlMemBlocks()) {
3353            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3354	           xmlMemBlocks() - mem_base);
3355	    test_ret++;
3356            printf(" %d", n_buf);
3357            printf(" %d", n_doc);
3358            printf(" %d", n_cur);
3359            printf(" %d", n_encoding);
3360            printf("\n");
3361        }
3362    }
3363    }
3364    }
3365    }
3366    function_tests++;
3367#endif
3368
3369    return(test_ret);
3370}
3371
3372
3373static int
3374test_htmlSaveFile(void) {
3375    int test_ret = 0;
3376
3377#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3378    int mem_base;
3379    int ret_val;
3380    const char * filename; /* the filename (or URL) */
3381    int n_filename;
3382    xmlDocPtr cur; /* the document */
3383    int n_cur;
3384
3385    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3386    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3387        mem_base = xmlMemBlocks();
3388        filename = gen_fileoutput(n_filename, 0);
3389        cur = gen_xmlDocPtr(n_cur, 1);
3390
3391        ret_val = htmlSaveFile(filename, cur);
3392        desret_int(ret_val);
3393        call_tests++;
3394        des_fileoutput(n_filename, filename, 0);
3395        des_xmlDocPtr(n_cur, cur, 1);
3396        xmlResetLastError();
3397        if (mem_base != xmlMemBlocks()) {
3398            printf("Leak of %d blocks found in htmlSaveFile",
3399	           xmlMemBlocks() - mem_base);
3400	    test_ret++;
3401            printf(" %d", n_filename);
3402            printf(" %d", n_cur);
3403            printf("\n");
3404        }
3405    }
3406    }
3407    function_tests++;
3408#endif
3409
3410    return(test_ret);
3411}
3412
3413
3414static int
3415test_htmlSaveFileEnc(void) {
3416    int test_ret = 0;
3417
3418#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3419    int mem_base;
3420    int ret_val;
3421    const char * filename; /* the filename */
3422    int n_filename;
3423    xmlDocPtr cur; /* the document */
3424    int n_cur;
3425    char * encoding; /* the document encoding */
3426    int n_encoding;
3427
3428    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3429    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3430    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3431        mem_base = xmlMemBlocks();
3432        filename = gen_fileoutput(n_filename, 0);
3433        cur = gen_xmlDocPtr(n_cur, 1);
3434        encoding = gen_const_char_ptr(n_encoding, 2);
3435
3436        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3437        desret_int(ret_val);
3438        call_tests++;
3439        des_fileoutput(n_filename, filename, 0);
3440        des_xmlDocPtr(n_cur, cur, 1);
3441        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3442        xmlResetLastError();
3443        if (mem_base != xmlMemBlocks()) {
3444            printf("Leak of %d blocks found in htmlSaveFileEnc",
3445	           xmlMemBlocks() - mem_base);
3446	    test_ret++;
3447            printf(" %d", n_filename);
3448            printf(" %d", n_cur);
3449            printf(" %d", n_encoding);
3450            printf("\n");
3451        }
3452    }
3453    }
3454    }
3455    function_tests++;
3456#endif
3457
3458    return(test_ret);
3459}
3460
3461
3462static int
3463test_htmlSaveFileFormat(void) {
3464    int test_ret = 0;
3465
3466#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3467    int mem_base;
3468    int ret_val;
3469    const char * filename; /* the filename */
3470    int n_filename;
3471    xmlDocPtr cur; /* the document */
3472    int n_cur;
3473    char * encoding; /* the document encoding */
3474    int n_encoding;
3475    int format; /* should formatting spaces been added */
3476    int n_format;
3477
3478    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3479    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3480    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3481    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3482        mem_base = xmlMemBlocks();
3483        filename = gen_fileoutput(n_filename, 0);
3484        cur = gen_xmlDocPtr(n_cur, 1);
3485        encoding = gen_const_char_ptr(n_encoding, 2);
3486        format = gen_int(n_format, 3);
3487
3488        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3489        desret_int(ret_val);
3490        call_tests++;
3491        des_fileoutput(n_filename, filename, 0);
3492        des_xmlDocPtr(n_cur, cur, 1);
3493        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3494        des_int(n_format, format, 3);
3495        xmlResetLastError();
3496        if (mem_base != xmlMemBlocks()) {
3497            printf("Leak of %d blocks found in htmlSaveFileFormat",
3498	           xmlMemBlocks() - mem_base);
3499	    test_ret++;
3500            printf(" %d", n_filename);
3501            printf(" %d", n_cur);
3502            printf(" %d", n_encoding);
3503            printf(" %d", n_format);
3504            printf("\n");
3505        }
3506    }
3507    }
3508    }
3509    }
3510    function_tests++;
3511#endif
3512
3513    return(test_ret);
3514}
3515
3516
3517static int
3518test_htmlSetMetaEncoding(void) {
3519    int test_ret = 0;
3520
3521#if defined(LIBXML_HTML_ENABLED)
3522    int mem_base;
3523    int ret_val;
3524    htmlDocPtr doc; /* the document */
3525    int n_doc;
3526    xmlChar * encoding; /* the encoding string */
3527    int n_encoding;
3528
3529    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3530    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3531        mem_base = xmlMemBlocks();
3532        doc = gen_htmlDocPtr(n_doc, 0);
3533        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3534
3535        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3536        desret_int(ret_val);
3537        call_tests++;
3538        des_htmlDocPtr(n_doc, doc, 0);
3539        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3540        xmlResetLastError();
3541        if (mem_base != xmlMemBlocks()) {
3542            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3543	           xmlMemBlocks() - mem_base);
3544	    test_ret++;
3545            printf(" %d", n_doc);
3546            printf(" %d", n_encoding);
3547            printf("\n");
3548        }
3549    }
3550    }
3551    function_tests++;
3552#endif
3553
3554    return(test_ret);
3555}
3556
3557static int
3558test_HTMLtree(void) {
3559    int test_ret = 0;
3560
3561    if (quiet == 0) printf("Testing HTMLtree : 17 of 17 functions ...\n");
3562    test_ret += test_htmlDocContentDumpFormatOutput();
3563    test_ret += test_htmlDocContentDumpOutput();
3564    test_ret += test_htmlDocDump();
3565    test_ret += test_htmlDocDumpMemory();
3566    test_ret += test_htmlGetMetaEncoding();
3567    test_ret += test_htmlIsBooleanAttr();
3568    test_ret += test_htmlNewDoc();
3569    test_ret += test_htmlNewDocNoDtD();
3570    test_ret += test_htmlNodeDump();
3571    test_ret += test_htmlNodeDumpFile();
3572    test_ret += test_htmlNodeDumpFileFormat();
3573    test_ret += test_htmlNodeDumpFormatOutput();
3574    test_ret += test_htmlNodeDumpOutput();
3575    test_ret += test_htmlSaveFile();
3576    test_ret += test_htmlSaveFileEnc();
3577    test_ret += test_htmlSaveFileFormat();
3578    test_ret += test_htmlSetMetaEncoding();
3579
3580    if (test_ret != 0)
3581	printf("Module HTMLtree: %d errors\n", test_ret);
3582    return(test_ret);
3583}
3584
3585static int
3586test_docbDefaultSAXHandlerInit(void) {
3587    int test_ret = 0;
3588
3589#if defined(LIBXML_DOCB_ENABLED)
3590#ifdef LIBXML_DOCB_ENABLED
3591    int mem_base;
3592
3593        mem_base = xmlMemBlocks();
3594
3595        docbDefaultSAXHandlerInit();
3596        call_tests++;
3597        xmlResetLastError();
3598        if (mem_base != xmlMemBlocks()) {
3599            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3600	           xmlMemBlocks() - mem_base);
3601	    test_ret++;
3602            printf("\n");
3603        }
3604    function_tests++;
3605#endif
3606#endif
3607
3608    return(test_ret);
3609}
3610
3611
3612static int
3613test_htmlDefaultSAXHandlerInit(void) {
3614    int test_ret = 0;
3615
3616#if defined(LIBXML_HTML_ENABLED)
3617#ifdef LIBXML_HTML_ENABLED
3618    int mem_base;
3619
3620        mem_base = xmlMemBlocks();
3621
3622        htmlDefaultSAXHandlerInit();
3623        call_tests++;
3624        xmlResetLastError();
3625        if (mem_base != xmlMemBlocks()) {
3626            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3627	           xmlMemBlocks() - mem_base);
3628	    test_ret++;
3629            printf("\n");
3630        }
3631    function_tests++;
3632#endif
3633#endif
3634
3635    return(test_ret);
3636}
3637
3638
3639static int
3640test_xmlDefaultSAXHandlerInit(void) {
3641    int test_ret = 0;
3642
3643    int mem_base;
3644
3645        mem_base = xmlMemBlocks();
3646
3647        xmlDefaultSAXHandlerInit();
3648        call_tests++;
3649        xmlResetLastError();
3650        if (mem_base != xmlMemBlocks()) {
3651            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3652	           xmlMemBlocks() - mem_base);
3653	    test_ret++;
3654            printf("\n");
3655        }
3656    function_tests++;
3657
3658    return(test_ret);
3659}
3660
3661
3662#define gen_nb_xmlEnumerationPtr 1
3663static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3664    return(NULL);
3665}
3666static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3667}
3668
3669static int
3670test_xmlSAX2AttributeDecl(void) {
3671    int test_ret = 0;
3672
3673    int mem_base;
3674    void * ctx; /* the user data (XML parser context) */
3675    int n_ctx;
3676    xmlChar * elem; /* the name of the element */
3677    int n_elem;
3678    xmlChar * fullname; /* the attribute name */
3679    int n_fullname;
3680    int type; /* the attribute type */
3681    int n_type;
3682    int def; /* the type of default value */
3683    int n_def;
3684    xmlChar * defaultValue; /* the attribute default value */
3685    int n_defaultValue;
3686    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3687    int n_tree;
3688
3689    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3690    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3691    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3692    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3693    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3694    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3695    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3696        mem_base = xmlMemBlocks();
3697        ctx = gen_void_ptr(n_ctx, 0);
3698        elem = gen_const_xmlChar_ptr(n_elem, 1);
3699        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3700        type = gen_int(n_type, 3);
3701        def = gen_int(n_def, 4);
3702        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3703        tree = gen_xmlEnumerationPtr(n_tree, 6);
3704
3705        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3706        call_tests++;
3707        des_void_ptr(n_ctx, ctx, 0);
3708        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3709        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3710        des_int(n_type, type, 3);
3711        des_int(n_def, def, 4);
3712        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3713        des_xmlEnumerationPtr(n_tree, tree, 6);
3714        xmlResetLastError();
3715        if (mem_base != xmlMemBlocks()) {
3716            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3717	           xmlMemBlocks() - mem_base);
3718	    test_ret++;
3719            printf(" %d", n_ctx);
3720            printf(" %d", n_elem);
3721            printf(" %d", n_fullname);
3722            printf(" %d", n_type);
3723            printf(" %d", n_def);
3724            printf(" %d", n_defaultValue);
3725            printf(" %d", n_tree);
3726            printf("\n");
3727        }
3728    }
3729    }
3730    }
3731    }
3732    }
3733    }
3734    }
3735    function_tests++;
3736
3737    return(test_ret);
3738}
3739
3740
3741static int
3742test_xmlSAX2CDataBlock(void) {
3743    int test_ret = 0;
3744
3745    int mem_base;
3746    void * ctx; /* the user data (XML parser context) */
3747    int n_ctx;
3748    xmlChar * value; /* The pcdata content */
3749    int n_value;
3750    int len; /* the block length */
3751    int n_len;
3752
3753    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3754    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3755    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3756        mem_base = xmlMemBlocks();
3757        ctx = gen_void_ptr(n_ctx, 0);
3758        value = gen_const_xmlChar_ptr(n_value, 1);
3759        len = gen_int(n_len, 2);
3760
3761        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3762        call_tests++;
3763        des_void_ptr(n_ctx, ctx, 0);
3764        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3765        des_int(n_len, len, 2);
3766        xmlResetLastError();
3767        if (mem_base != xmlMemBlocks()) {
3768            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3769	           xmlMemBlocks() - mem_base);
3770	    test_ret++;
3771            printf(" %d", n_ctx);
3772            printf(" %d", n_value);
3773            printf(" %d", n_len);
3774            printf("\n");
3775        }
3776    }
3777    }
3778    }
3779    function_tests++;
3780
3781    return(test_ret);
3782}
3783
3784
3785static int
3786test_xmlSAX2Characters(void) {
3787    int test_ret = 0;
3788
3789    int mem_base;
3790    void * ctx; /* the user data (XML parser context) */
3791    int n_ctx;
3792    xmlChar * ch; /* a xmlChar string */
3793    int n_ch;
3794    int len; /* the number of xmlChar */
3795    int n_len;
3796
3797    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3798    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3799    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3800        mem_base = xmlMemBlocks();
3801        ctx = gen_void_ptr(n_ctx, 0);
3802        ch = gen_const_xmlChar_ptr(n_ch, 1);
3803        len = gen_int(n_len, 2);
3804
3805        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3806        call_tests++;
3807        des_void_ptr(n_ctx, ctx, 0);
3808        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3809        des_int(n_len, len, 2);
3810        xmlResetLastError();
3811        if (mem_base != xmlMemBlocks()) {
3812            printf("Leak of %d blocks found in xmlSAX2Characters",
3813	           xmlMemBlocks() - mem_base);
3814	    test_ret++;
3815            printf(" %d", n_ctx);
3816            printf(" %d", n_ch);
3817            printf(" %d", n_len);
3818            printf("\n");
3819        }
3820    }
3821    }
3822    }
3823    function_tests++;
3824
3825    return(test_ret);
3826}
3827
3828
3829static int
3830test_xmlSAX2Comment(void) {
3831    int test_ret = 0;
3832
3833    int mem_base;
3834    void * ctx; /* the user data (XML parser context) */
3835    int n_ctx;
3836    xmlChar * value; /* the xmlSAX2Comment content */
3837    int n_value;
3838
3839    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3840    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3841        mem_base = xmlMemBlocks();
3842        ctx = gen_void_ptr(n_ctx, 0);
3843        value = gen_const_xmlChar_ptr(n_value, 1);
3844
3845        xmlSAX2Comment(ctx, (const xmlChar *)value);
3846        call_tests++;
3847        des_void_ptr(n_ctx, ctx, 0);
3848        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3849        xmlResetLastError();
3850        if (mem_base != xmlMemBlocks()) {
3851            printf("Leak of %d blocks found in xmlSAX2Comment",
3852	           xmlMemBlocks() - mem_base);
3853	    test_ret++;
3854            printf(" %d", n_ctx);
3855            printf(" %d", n_value);
3856            printf("\n");
3857        }
3858    }
3859    }
3860    function_tests++;
3861
3862    return(test_ret);
3863}
3864
3865
3866static int
3867test_xmlSAX2ElementDecl(void) {
3868    int test_ret = 0;
3869
3870    int mem_base;
3871    void * ctx; /* the user data (XML parser context) */
3872    int n_ctx;
3873    xmlChar * name; /* the element name */
3874    int n_name;
3875    int type; /* the element type */
3876    int n_type;
3877    xmlElementContentPtr content; /* the element value tree */
3878    int n_content;
3879
3880    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3881    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3882    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3883    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3884        mem_base = xmlMemBlocks();
3885        ctx = gen_void_ptr(n_ctx, 0);
3886        name = gen_const_xmlChar_ptr(n_name, 1);
3887        type = gen_int(n_type, 2);
3888        content = gen_xmlElementContentPtr(n_content, 3);
3889
3890        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3891        call_tests++;
3892        des_void_ptr(n_ctx, ctx, 0);
3893        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3894        des_int(n_type, type, 2);
3895        des_xmlElementContentPtr(n_content, content, 3);
3896        xmlResetLastError();
3897        if (mem_base != xmlMemBlocks()) {
3898            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
3899	           xmlMemBlocks() - mem_base);
3900	    test_ret++;
3901            printf(" %d", n_ctx);
3902            printf(" %d", n_name);
3903            printf(" %d", n_type);
3904            printf(" %d", n_content);
3905            printf("\n");
3906        }
3907    }
3908    }
3909    }
3910    }
3911    function_tests++;
3912
3913    return(test_ret);
3914}
3915
3916
3917static int
3918test_xmlSAX2EndDocument(void) {
3919    int test_ret = 0;
3920
3921    int mem_base;
3922    void * ctx; /* the user data (XML parser context) */
3923    int n_ctx;
3924
3925    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3926        mem_base = xmlMemBlocks();
3927        ctx = gen_void_ptr(n_ctx, 0);
3928
3929        xmlSAX2EndDocument(ctx);
3930        call_tests++;
3931        des_void_ptr(n_ctx, ctx, 0);
3932        xmlResetLastError();
3933        if (mem_base != xmlMemBlocks()) {
3934            printf("Leak of %d blocks found in xmlSAX2EndDocument",
3935	           xmlMemBlocks() - mem_base);
3936	    test_ret++;
3937            printf(" %d", n_ctx);
3938            printf("\n");
3939        }
3940    }
3941    function_tests++;
3942
3943    return(test_ret);
3944}
3945
3946
3947static int
3948test_xmlSAX2EndElement(void) {
3949    int test_ret = 0;
3950
3951#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
3952#ifdef LIBXML_SAX1_ENABLED
3953    int mem_base;
3954    void * ctx; /* the user data (XML parser context) */
3955    int n_ctx;
3956    xmlChar * name; /* The element name */
3957    int n_name;
3958
3959    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3960    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3961        mem_base = xmlMemBlocks();
3962        ctx = gen_void_ptr(n_ctx, 0);
3963        name = gen_const_xmlChar_ptr(n_name, 1);
3964
3965        xmlSAX2EndElement(ctx, (const xmlChar *)name);
3966        call_tests++;
3967        des_void_ptr(n_ctx, ctx, 0);
3968        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3969        xmlResetLastError();
3970        if (mem_base != xmlMemBlocks()) {
3971            printf("Leak of %d blocks found in xmlSAX2EndElement",
3972	           xmlMemBlocks() - mem_base);
3973	    test_ret++;
3974            printf(" %d", n_ctx);
3975            printf(" %d", n_name);
3976            printf("\n");
3977        }
3978    }
3979    }
3980    function_tests++;
3981#endif
3982#endif
3983
3984    return(test_ret);
3985}
3986
3987
3988static int
3989test_xmlSAX2EndElementNs(void) {
3990    int test_ret = 0;
3991
3992    int mem_base;
3993    void * ctx; /* the user data (XML parser context) */
3994    int n_ctx;
3995    xmlChar * localname; /* the local name of the element */
3996    int n_localname;
3997    xmlChar * prefix; /* the element namespace prefix if available */
3998    int n_prefix;
3999    xmlChar * URI; /* the element namespace name if available */
4000    int n_URI;
4001
4002    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4003    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4004    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4005    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4006        mem_base = xmlMemBlocks();
4007        ctx = gen_void_ptr(n_ctx, 0);
4008        localname = gen_const_xmlChar_ptr(n_localname, 1);
4009        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4010        URI = gen_const_xmlChar_ptr(n_URI, 3);
4011
4012        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4013        call_tests++;
4014        des_void_ptr(n_ctx, ctx, 0);
4015        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4016        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4017        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4018        xmlResetLastError();
4019        if (mem_base != xmlMemBlocks()) {
4020            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4021	           xmlMemBlocks() - mem_base);
4022	    test_ret++;
4023            printf(" %d", n_ctx);
4024            printf(" %d", n_localname);
4025            printf(" %d", n_prefix);
4026            printf(" %d", n_URI);
4027            printf("\n");
4028        }
4029    }
4030    }
4031    }
4032    }
4033    function_tests++;
4034
4035    return(test_ret);
4036}
4037
4038
4039static int
4040test_xmlSAX2EntityDecl(void) {
4041    int test_ret = 0;
4042
4043    int mem_base;
4044    void * ctx; /* the user data (XML parser context) */
4045    int n_ctx;
4046    xmlChar * name; /* the entity name */
4047    int n_name;
4048    int type; /* the entity type */
4049    int n_type;
4050    xmlChar * publicId; /* The public ID of the entity */
4051    int n_publicId;
4052    xmlChar * systemId; /* The system ID of the entity */
4053    int n_systemId;
4054    xmlChar * content; /* the entity value (without processing). */
4055    int n_content;
4056
4057    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4058    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4059    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4060    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4061    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4062    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4063        mem_base = xmlMemBlocks();
4064        ctx = gen_void_ptr(n_ctx, 0);
4065        name = gen_const_xmlChar_ptr(n_name, 1);
4066        type = gen_int(n_type, 2);
4067        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4068        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4069        content = gen_xmlChar_ptr(n_content, 5);
4070
4071        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4072        call_tests++;
4073        des_void_ptr(n_ctx, ctx, 0);
4074        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4075        des_int(n_type, type, 2);
4076        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4077        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4078        des_xmlChar_ptr(n_content, content, 5);
4079        xmlResetLastError();
4080        if (mem_base != xmlMemBlocks()) {
4081            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4082	           xmlMemBlocks() - mem_base);
4083	    test_ret++;
4084            printf(" %d", n_ctx);
4085            printf(" %d", n_name);
4086            printf(" %d", n_type);
4087            printf(" %d", n_publicId);
4088            printf(" %d", n_systemId);
4089            printf(" %d", n_content);
4090            printf("\n");
4091        }
4092    }
4093    }
4094    }
4095    }
4096    }
4097    }
4098    function_tests++;
4099
4100    return(test_ret);
4101}
4102
4103
4104static int
4105test_xmlSAX2ExternalSubset(void) {
4106    int test_ret = 0;
4107
4108    int mem_base;
4109    void * ctx; /* the user data (XML parser context) */
4110    int n_ctx;
4111    xmlChar * name; /* the root element name */
4112    int n_name;
4113    xmlChar * ExternalID; /* the external ID */
4114    int n_ExternalID;
4115    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4116    int n_SystemID;
4117
4118    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4119    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4120    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4121    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4122        mem_base = xmlMemBlocks();
4123        ctx = gen_void_ptr(n_ctx, 0);
4124        name = gen_const_xmlChar_ptr(n_name, 1);
4125        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4126        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4127
4128        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4129        call_tests++;
4130        des_void_ptr(n_ctx, ctx, 0);
4131        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4132        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4133        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4134        xmlResetLastError();
4135        if (mem_base != xmlMemBlocks()) {
4136            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4137	           xmlMemBlocks() - mem_base);
4138	    test_ret++;
4139            printf(" %d", n_ctx);
4140            printf(" %d", n_name);
4141            printf(" %d", n_ExternalID);
4142            printf(" %d", n_SystemID);
4143            printf("\n");
4144        }
4145    }
4146    }
4147    }
4148    }
4149    function_tests++;
4150
4151    return(test_ret);
4152}
4153
4154
4155static int
4156test_xmlSAX2GetColumnNumber(void) {
4157    int test_ret = 0;
4158
4159    int mem_base;
4160    int ret_val;
4161    void * ctx; /* the user data (XML parser context) */
4162    int n_ctx;
4163
4164    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4165        mem_base = xmlMemBlocks();
4166        ctx = gen_void_ptr(n_ctx, 0);
4167
4168        ret_val = xmlSAX2GetColumnNumber(ctx);
4169        desret_int(ret_val);
4170        call_tests++;
4171        des_void_ptr(n_ctx, ctx, 0);
4172        xmlResetLastError();
4173        if (mem_base != xmlMemBlocks()) {
4174            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4175	           xmlMemBlocks() - mem_base);
4176	    test_ret++;
4177            printf(" %d", n_ctx);
4178            printf("\n");
4179        }
4180    }
4181    function_tests++;
4182
4183    return(test_ret);
4184}
4185
4186
4187static int
4188test_xmlSAX2GetEntity(void) {
4189    int test_ret = 0;
4190
4191    int mem_base;
4192    xmlEntityPtr ret_val;
4193    void * ctx; /* the user data (XML parser context) */
4194    int n_ctx;
4195    xmlChar * name; /* The entity name */
4196    int n_name;
4197
4198    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4199    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4200        mem_base = xmlMemBlocks();
4201        ctx = gen_void_ptr(n_ctx, 0);
4202        name = gen_const_xmlChar_ptr(n_name, 1);
4203
4204        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4205        desret_xmlEntityPtr(ret_val);
4206        call_tests++;
4207        des_void_ptr(n_ctx, ctx, 0);
4208        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4209        xmlResetLastError();
4210        if (mem_base != xmlMemBlocks()) {
4211            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4212	           xmlMemBlocks() - mem_base);
4213	    test_ret++;
4214            printf(" %d", n_ctx);
4215            printf(" %d", n_name);
4216            printf("\n");
4217        }
4218    }
4219    }
4220    function_tests++;
4221
4222    return(test_ret);
4223}
4224
4225
4226static int
4227test_xmlSAX2GetLineNumber(void) {
4228    int test_ret = 0;
4229
4230    int mem_base;
4231    int ret_val;
4232    void * ctx; /* the user data (XML parser context) */
4233    int n_ctx;
4234
4235    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4236        mem_base = xmlMemBlocks();
4237        ctx = gen_void_ptr(n_ctx, 0);
4238
4239        ret_val = xmlSAX2GetLineNumber(ctx);
4240        desret_int(ret_val);
4241        call_tests++;
4242        des_void_ptr(n_ctx, ctx, 0);
4243        xmlResetLastError();
4244        if (mem_base != xmlMemBlocks()) {
4245            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4246	           xmlMemBlocks() - mem_base);
4247	    test_ret++;
4248            printf(" %d", n_ctx);
4249            printf("\n");
4250        }
4251    }
4252    function_tests++;
4253
4254    return(test_ret);
4255}
4256
4257
4258static int
4259test_xmlSAX2GetParameterEntity(void) {
4260    int test_ret = 0;
4261
4262    int mem_base;
4263    xmlEntityPtr ret_val;
4264    void * ctx; /* the user data (XML parser context) */
4265    int n_ctx;
4266    xmlChar * name; /* The entity name */
4267    int n_name;
4268
4269    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4270    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4271        mem_base = xmlMemBlocks();
4272        ctx = gen_void_ptr(n_ctx, 0);
4273        name = gen_const_xmlChar_ptr(n_name, 1);
4274
4275        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4276        desret_xmlEntityPtr(ret_val);
4277        call_tests++;
4278        des_void_ptr(n_ctx, ctx, 0);
4279        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4280        xmlResetLastError();
4281        if (mem_base != xmlMemBlocks()) {
4282            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4283	           xmlMemBlocks() - mem_base);
4284	    test_ret++;
4285            printf(" %d", n_ctx);
4286            printf(" %d", n_name);
4287            printf("\n");
4288        }
4289    }
4290    }
4291    function_tests++;
4292
4293    return(test_ret);
4294}
4295
4296
4297static int
4298test_xmlSAX2GetPublicId(void) {
4299    int test_ret = 0;
4300
4301    int mem_base;
4302    const xmlChar * ret_val;
4303    void * ctx; /* the user data (XML parser context) */
4304    int n_ctx;
4305
4306    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4307        mem_base = xmlMemBlocks();
4308        ctx = gen_void_ptr(n_ctx, 0);
4309
4310        ret_val = xmlSAX2GetPublicId(ctx);
4311        desret_const_xmlChar_ptr(ret_val);
4312        call_tests++;
4313        des_void_ptr(n_ctx, ctx, 0);
4314        xmlResetLastError();
4315        if (mem_base != xmlMemBlocks()) {
4316            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4317	           xmlMemBlocks() - mem_base);
4318	    test_ret++;
4319            printf(" %d", n_ctx);
4320            printf("\n");
4321        }
4322    }
4323    function_tests++;
4324
4325    return(test_ret);
4326}
4327
4328
4329static int
4330test_xmlSAX2GetSystemId(void) {
4331    int test_ret = 0;
4332
4333    int mem_base;
4334    const xmlChar * ret_val;
4335    void * ctx; /* the user data (XML parser context) */
4336    int n_ctx;
4337
4338    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4339        mem_base = xmlMemBlocks();
4340        ctx = gen_void_ptr(n_ctx, 0);
4341
4342        ret_val = xmlSAX2GetSystemId(ctx);
4343        desret_const_xmlChar_ptr(ret_val);
4344        call_tests++;
4345        des_void_ptr(n_ctx, ctx, 0);
4346        xmlResetLastError();
4347        if (mem_base != xmlMemBlocks()) {
4348            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4349	           xmlMemBlocks() - mem_base);
4350	    test_ret++;
4351            printf(" %d", n_ctx);
4352            printf("\n");
4353        }
4354    }
4355    function_tests++;
4356
4357    return(test_ret);
4358}
4359
4360
4361static int
4362test_xmlSAX2HasExternalSubset(void) {
4363    int test_ret = 0;
4364
4365    int mem_base;
4366    int ret_val;
4367    void * ctx; /* the user data (XML parser context) */
4368    int n_ctx;
4369
4370    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4371        mem_base = xmlMemBlocks();
4372        ctx = gen_void_ptr(n_ctx, 0);
4373
4374        ret_val = xmlSAX2HasExternalSubset(ctx);
4375        desret_int(ret_val);
4376        call_tests++;
4377        des_void_ptr(n_ctx, ctx, 0);
4378        xmlResetLastError();
4379        if (mem_base != xmlMemBlocks()) {
4380            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4381	           xmlMemBlocks() - mem_base);
4382	    test_ret++;
4383            printf(" %d", n_ctx);
4384            printf("\n");
4385        }
4386    }
4387    function_tests++;
4388
4389    return(test_ret);
4390}
4391
4392
4393static int
4394test_xmlSAX2HasInternalSubset(void) {
4395    int test_ret = 0;
4396
4397    int mem_base;
4398    int ret_val;
4399    void * ctx; /* the user data (XML parser context) */
4400    int n_ctx;
4401
4402    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4403        mem_base = xmlMemBlocks();
4404        ctx = gen_void_ptr(n_ctx, 0);
4405
4406        ret_val = xmlSAX2HasInternalSubset(ctx);
4407        desret_int(ret_val);
4408        call_tests++;
4409        des_void_ptr(n_ctx, ctx, 0);
4410        xmlResetLastError();
4411        if (mem_base != xmlMemBlocks()) {
4412            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4413	           xmlMemBlocks() - mem_base);
4414	    test_ret++;
4415            printf(" %d", n_ctx);
4416            printf("\n");
4417        }
4418    }
4419    function_tests++;
4420
4421    return(test_ret);
4422}
4423
4424
4425static int
4426test_xmlSAX2IgnorableWhitespace(void) {
4427    int test_ret = 0;
4428
4429    int mem_base;
4430    void * ctx; /* the user data (XML parser context) */
4431    int n_ctx;
4432    xmlChar * ch; /* a xmlChar string */
4433    int n_ch;
4434    int len; /* the number of xmlChar */
4435    int n_len;
4436
4437    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4438    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4439    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4440        mem_base = xmlMemBlocks();
4441        ctx = gen_void_ptr(n_ctx, 0);
4442        ch = gen_const_xmlChar_ptr(n_ch, 1);
4443        len = gen_int(n_len, 2);
4444
4445        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4446        call_tests++;
4447        des_void_ptr(n_ctx, ctx, 0);
4448        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4449        des_int(n_len, len, 2);
4450        xmlResetLastError();
4451        if (mem_base != xmlMemBlocks()) {
4452            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4453	           xmlMemBlocks() - mem_base);
4454	    test_ret++;
4455            printf(" %d", n_ctx);
4456            printf(" %d", n_ch);
4457            printf(" %d", n_len);
4458            printf("\n");
4459        }
4460    }
4461    }
4462    }
4463    function_tests++;
4464
4465    return(test_ret);
4466}
4467
4468
4469#define gen_nb_xmlSAXHandler_ptr 1
4470static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4471    return(NULL);
4472}
4473static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4474}
4475
4476static int
4477test_xmlSAX2InitDefaultSAXHandler(void) {
4478    int test_ret = 0;
4479
4480    int mem_base;
4481    xmlSAXHandler * hdlr; /* the SAX handler */
4482    int n_hdlr;
4483    int warning; /* flag if non-zero sets the handler warning procedure */
4484    int n_warning;
4485
4486    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4487    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4488        mem_base = xmlMemBlocks();
4489        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4490        warning = gen_int(n_warning, 1);
4491
4492        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4493        call_tests++;
4494        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4495        des_int(n_warning, warning, 1);
4496        xmlResetLastError();
4497        if (mem_base != xmlMemBlocks()) {
4498            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4499	           xmlMemBlocks() - mem_base);
4500	    test_ret++;
4501            printf(" %d", n_hdlr);
4502            printf(" %d", n_warning);
4503            printf("\n");
4504        }
4505    }
4506    }
4507    function_tests++;
4508
4509    return(test_ret);
4510}
4511
4512
4513static int
4514test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4515    int test_ret = 0;
4516
4517#if defined(LIBXML_DOCB_ENABLED)
4518    int mem_base;
4519    xmlSAXHandler * hdlr; /* the SAX handler */
4520    int n_hdlr;
4521
4522    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4523        mem_base = xmlMemBlocks();
4524        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4525
4526        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4527        call_tests++;
4528        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4529        xmlResetLastError();
4530        if (mem_base != xmlMemBlocks()) {
4531            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4532	           xmlMemBlocks() - mem_base);
4533	    test_ret++;
4534            printf(" %d", n_hdlr);
4535            printf("\n");
4536        }
4537    }
4538    function_tests++;
4539#endif
4540
4541    return(test_ret);
4542}
4543
4544
4545static int
4546test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4547    int test_ret = 0;
4548
4549#if defined(LIBXML_HTML_ENABLED)
4550    int mem_base;
4551    xmlSAXHandler * hdlr; /* the SAX handler */
4552    int n_hdlr;
4553
4554    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4555        mem_base = xmlMemBlocks();
4556        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4557
4558        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4559        call_tests++;
4560        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4561        xmlResetLastError();
4562        if (mem_base != xmlMemBlocks()) {
4563            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4564	           xmlMemBlocks() - mem_base);
4565	    test_ret++;
4566            printf(" %d", n_hdlr);
4567            printf("\n");
4568        }
4569    }
4570    function_tests++;
4571#endif
4572
4573    return(test_ret);
4574}
4575
4576
4577static int
4578test_xmlSAX2InternalSubset(void) {
4579    int test_ret = 0;
4580
4581    int mem_base;
4582    void * ctx; /* the user data (XML parser context) */
4583    int n_ctx;
4584    xmlChar * name; /* the root element name */
4585    int n_name;
4586    xmlChar * ExternalID; /* the external ID */
4587    int n_ExternalID;
4588    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4589    int n_SystemID;
4590
4591    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4592    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4593    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4594    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4595        mem_base = xmlMemBlocks();
4596        ctx = gen_void_ptr(n_ctx, 0);
4597        name = gen_const_xmlChar_ptr(n_name, 1);
4598        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4599        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4600
4601        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4602        call_tests++;
4603        des_void_ptr(n_ctx, ctx, 0);
4604        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4605        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4606        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4607        xmlResetLastError();
4608        if (mem_base != xmlMemBlocks()) {
4609            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4610	           xmlMemBlocks() - mem_base);
4611	    test_ret++;
4612            printf(" %d", n_ctx);
4613            printf(" %d", n_name);
4614            printf(" %d", n_ExternalID);
4615            printf(" %d", n_SystemID);
4616            printf("\n");
4617        }
4618    }
4619    }
4620    }
4621    }
4622    function_tests++;
4623
4624    return(test_ret);
4625}
4626
4627
4628static int
4629test_xmlSAX2IsStandalone(void) {
4630    int test_ret = 0;
4631
4632    int mem_base;
4633    int ret_val;
4634    void * ctx; /* the user data (XML parser context) */
4635    int n_ctx;
4636
4637    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4638        mem_base = xmlMemBlocks();
4639        ctx = gen_void_ptr(n_ctx, 0);
4640
4641        ret_val = xmlSAX2IsStandalone(ctx);
4642        desret_int(ret_val);
4643        call_tests++;
4644        des_void_ptr(n_ctx, ctx, 0);
4645        xmlResetLastError();
4646        if (mem_base != xmlMemBlocks()) {
4647            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4648	           xmlMemBlocks() - mem_base);
4649	    test_ret++;
4650            printf(" %d", n_ctx);
4651            printf("\n");
4652        }
4653    }
4654    function_tests++;
4655
4656    return(test_ret);
4657}
4658
4659
4660static int
4661test_xmlSAX2NotationDecl(void) {
4662    int test_ret = 0;
4663
4664    int mem_base;
4665    void * ctx; /* the user data (XML parser context) */
4666    int n_ctx;
4667    xmlChar * name; /* The name of the notation */
4668    int n_name;
4669    xmlChar * publicId; /* The public ID of the entity */
4670    int n_publicId;
4671    xmlChar * systemId; /* The system ID of the entity */
4672    int n_systemId;
4673
4674    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4675    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4676    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4677    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4678        mem_base = xmlMemBlocks();
4679        ctx = gen_void_ptr(n_ctx, 0);
4680        name = gen_const_xmlChar_ptr(n_name, 1);
4681        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4682        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4683
4684        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4685        call_tests++;
4686        des_void_ptr(n_ctx, ctx, 0);
4687        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4688        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4689        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4690        xmlResetLastError();
4691        if (mem_base != xmlMemBlocks()) {
4692            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4693	           xmlMemBlocks() - mem_base);
4694	    test_ret++;
4695            printf(" %d", n_ctx);
4696            printf(" %d", n_name);
4697            printf(" %d", n_publicId);
4698            printf(" %d", n_systemId);
4699            printf("\n");
4700        }
4701    }
4702    }
4703    }
4704    }
4705    function_tests++;
4706
4707    return(test_ret);
4708}
4709
4710
4711static int
4712test_xmlSAX2ProcessingInstruction(void) {
4713    int test_ret = 0;
4714
4715    int mem_base;
4716    void * ctx; /* the user data (XML parser context) */
4717    int n_ctx;
4718    xmlChar * target; /* the target name */
4719    int n_target;
4720    xmlChar * data; /* the PI data's */
4721    int n_data;
4722
4723    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4724    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4725    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4726        mem_base = xmlMemBlocks();
4727        ctx = gen_void_ptr(n_ctx, 0);
4728        target = gen_const_xmlChar_ptr(n_target, 1);
4729        data = gen_const_xmlChar_ptr(n_data, 2);
4730
4731        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4732        call_tests++;
4733        des_void_ptr(n_ctx, ctx, 0);
4734        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4735        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4736        xmlResetLastError();
4737        if (mem_base != xmlMemBlocks()) {
4738            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4739	           xmlMemBlocks() - mem_base);
4740	    test_ret++;
4741            printf(" %d", n_ctx);
4742            printf(" %d", n_target);
4743            printf(" %d", n_data);
4744            printf("\n");
4745        }
4746    }
4747    }
4748    }
4749    function_tests++;
4750
4751    return(test_ret);
4752}
4753
4754
4755static int
4756test_xmlSAX2Reference(void) {
4757    int test_ret = 0;
4758
4759    int mem_base;
4760    void * ctx; /* the user data (XML parser context) */
4761    int n_ctx;
4762    xmlChar * name; /* The entity name */
4763    int n_name;
4764
4765    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4766    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4767        mem_base = xmlMemBlocks();
4768        ctx = gen_void_ptr(n_ctx, 0);
4769        name = gen_const_xmlChar_ptr(n_name, 1);
4770
4771        xmlSAX2Reference(ctx, (const xmlChar *)name);
4772        call_tests++;
4773        des_void_ptr(n_ctx, ctx, 0);
4774        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4775        xmlResetLastError();
4776        if (mem_base != xmlMemBlocks()) {
4777            printf("Leak of %d blocks found in xmlSAX2Reference",
4778	           xmlMemBlocks() - mem_base);
4779	    test_ret++;
4780            printf(" %d", n_ctx);
4781            printf(" %d", n_name);
4782            printf("\n");
4783        }
4784    }
4785    }
4786    function_tests++;
4787
4788    return(test_ret);
4789}
4790
4791
4792static int
4793test_xmlSAX2ResolveEntity(void) {
4794    int test_ret = 0;
4795
4796    int mem_base;
4797    xmlParserInputPtr ret_val;
4798    void * ctx; /* the user data (XML parser context) */
4799    int n_ctx;
4800    xmlChar * publicId; /* The public ID of the entity */
4801    int n_publicId;
4802    xmlChar * systemId; /* The system ID of the entity */
4803    int n_systemId;
4804
4805    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4806    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4807    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4808        mem_base = xmlMemBlocks();
4809        ctx = gen_void_ptr(n_ctx, 0);
4810        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4811        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4812
4813        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4814        desret_xmlParserInputPtr(ret_val);
4815        call_tests++;
4816        des_void_ptr(n_ctx, ctx, 0);
4817        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4818        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4819        xmlResetLastError();
4820        if (mem_base != xmlMemBlocks()) {
4821            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4822	           xmlMemBlocks() - mem_base);
4823	    test_ret++;
4824            printf(" %d", n_ctx);
4825            printf(" %d", n_publicId);
4826            printf(" %d", n_systemId);
4827            printf("\n");
4828        }
4829    }
4830    }
4831    }
4832    function_tests++;
4833
4834    return(test_ret);
4835}
4836
4837
4838#define gen_nb_xmlSAXLocatorPtr 1
4839static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4840    return(NULL);
4841}
4842static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4843}
4844
4845static int
4846test_xmlSAX2SetDocumentLocator(void) {
4847    int test_ret = 0;
4848
4849    int mem_base;
4850    void * ctx; /* the user data (XML parser context) */
4851    int n_ctx;
4852    xmlSAXLocatorPtr loc; /* A SAX Locator */
4853    int n_loc;
4854
4855    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4856    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4857        mem_base = xmlMemBlocks();
4858        ctx = gen_void_ptr(n_ctx, 0);
4859        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4860
4861        xmlSAX2SetDocumentLocator(ctx, loc);
4862        call_tests++;
4863        des_void_ptr(n_ctx, ctx, 0);
4864        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4865        xmlResetLastError();
4866        if (mem_base != xmlMemBlocks()) {
4867            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4868	           xmlMemBlocks() - mem_base);
4869	    test_ret++;
4870            printf(" %d", n_ctx);
4871            printf(" %d", n_loc);
4872            printf("\n");
4873        }
4874    }
4875    }
4876    function_tests++;
4877
4878    return(test_ret);
4879}
4880
4881
4882static int
4883test_xmlSAX2StartDocument(void) {
4884    int test_ret = 0;
4885
4886    int mem_base;
4887    void * ctx; /* the user data (XML parser context) */
4888    int n_ctx;
4889
4890    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4891        mem_base = xmlMemBlocks();
4892        ctx = gen_void_ptr(n_ctx, 0);
4893
4894        xmlSAX2StartDocument(ctx);
4895        call_tests++;
4896        des_void_ptr(n_ctx, ctx, 0);
4897        xmlResetLastError();
4898        if (mem_base != xmlMemBlocks()) {
4899            printf("Leak of %d blocks found in xmlSAX2StartDocument",
4900	           xmlMemBlocks() - mem_base);
4901	    test_ret++;
4902            printf(" %d", n_ctx);
4903            printf("\n");
4904        }
4905    }
4906    function_tests++;
4907
4908    return(test_ret);
4909}
4910
4911
4912static int
4913test_xmlSAX2StartElement(void) {
4914    int test_ret = 0;
4915
4916#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4917#ifdef LIBXML_SAX1_ENABLED
4918    int mem_base;
4919    void * ctx; /* the user data (XML parser context) */
4920    int n_ctx;
4921    xmlChar * fullname; /* The element name, including namespace prefix */
4922    int n_fullname;
4923    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
4924    int n_atts;
4925
4926    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4927    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
4928    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
4929        mem_base = xmlMemBlocks();
4930        ctx = gen_void_ptr(n_ctx, 0);
4931        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
4932        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
4933
4934        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
4935        call_tests++;
4936        des_void_ptr(n_ctx, ctx, 0);
4937        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
4938        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
4939        xmlResetLastError();
4940        if (mem_base != xmlMemBlocks()) {
4941            printf("Leak of %d blocks found in xmlSAX2StartElement",
4942	           xmlMemBlocks() - mem_base);
4943	    test_ret++;
4944            printf(" %d", n_ctx);
4945            printf(" %d", n_fullname);
4946            printf(" %d", n_atts);
4947            printf("\n");
4948        }
4949    }
4950    }
4951    }
4952    function_tests++;
4953#endif
4954#endif
4955
4956    return(test_ret);
4957}
4958
4959
4960static int
4961test_xmlSAX2StartElementNs(void) {
4962    int test_ret = 0;
4963
4964    int mem_base;
4965    void * ctx; /* the user data (XML parser context) */
4966    int n_ctx;
4967    xmlChar * localname; /* the local name of the element */
4968    int n_localname;
4969    xmlChar * prefix; /* the element namespace prefix if available */
4970    int n_prefix;
4971    xmlChar * URI; /* the element namespace name if available */
4972    int n_URI;
4973    int nb_namespaces; /* number of namespace definitions on that node */
4974    int n_nb_namespaces;
4975    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
4976    int n_namespaces;
4977    int nb_attributes; /* the number of attributes on that node */
4978    int n_nb_attributes;
4979    int nb_defaulted; /* the number of defaulted attributes. */
4980    int n_nb_defaulted;
4981    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
4982    int n_attributes;
4983
4984    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4985    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4986    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4987    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4988    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
4989    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
4990    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
4991    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
4992    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
4993        mem_base = xmlMemBlocks();
4994        ctx = gen_void_ptr(n_ctx, 0);
4995        localname = gen_const_xmlChar_ptr(n_localname, 1);
4996        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4997        URI = gen_const_xmlChar_ptr(n_URI, 3);
4998        nb_namespaces = gen_int(n_nb_namespaces, 4);
4999        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5000        nb_attributes = gen_int(n_nb_attributes, 6);
5001        nb_defaulted = gen_int(n_nb_defaulted, 7);
5002        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5003
5004        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5005        call_tests++;
5006        des_void_ptr(n_ctx, ctx, 0);
5007        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5008        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5009        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5010        des_int(n_nb_namespaces, nb_namespaces, 4);
5011        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5012        des_int(n_nb_attributes, nb_attributes, 6);
5013        des_int(n_nb_defaulted, nb_defaulted, 7);
5014        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5015        xmlResetLastError();
5016        if (mem_base != xmlMemBlocks()) {
5017            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5018	           xmlMemBlocks() - mem_base);
5019	    test_ret++;
5020            printf(" %d", n_ctx);
5021            printf(" %d", n_localname);
5022            printf(" %d", n_prefix);
5023            printf(" %d", n_URI);
5024            printf(" %d", n_nb_namespaces);
5025            printf(" %d", n_namespaces);
5026            printf(" %d", n_nb_attributes);
5027            printf(" %d", n_nb_defaulted);
5028            printf(" %d", n_attributes);
5029            printf("\n");
5030        }
5031    }
5032    }
5033    }
5034    }
5035    }
5036    }
5037    }
5038    }
5039    }
5040    function_tests++;
5041
5042    return(test_ret);
5043}
5044
5045
5046static int
5047test_xmlSAX2UnparsedEntityDecl(void) {
5048    int test_ret = 0;
5049
5050    int mem_base;
5051    void * ctx; /* the user data (XML parser context) */
5052    int n_ctx;
5053    xmlChar * name; /* The name of the entity */
5054    int n_name;
5055    xmlChar * publicId; /* The public ID of the entity */
5056    int n_publicId;
5057    xmlChar * systemId; /* The system ID of the entity */
5058    int n_systemId;
5059    xmlChar * notationName; /* the name of the notation */
5060    int n_notationName;
5061
5062    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5063    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5064    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5065    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5066    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5067        mem_base = xmlMemBlocks();
5068        ctx = gen_void_ptr(n_ctx, 0);
5069        name = gen_const_xmlChar_ptr(n_name, 1);
5070        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5071        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5072        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5073
5074        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5075        call_tests++;
5076        des_void_ptr(n_ctx, ctx, 0);
5077        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5078        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5079        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5080        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5081        xmlResetLastError();
5082        if (mem_base != xmlMemBlocks()) {
5083            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5084	           xmlMemBlocks() - mem_base);
5085	    test_ret++;
5086            printf(" %d", n_ctx);
5087            printf(" %d", n_name);
5088            printf(" %d", n_publicId);
5089            printf(" %d", n_systemId);
5090            printf(" %d", n_notationName);
5091            printf("\n");
5092        }
5093    }
5094    }
5095    }
5096    }
5097    }
5098    function_tests++;
5099
5100    return(test_ret);
5101}
5102
5103
5104static int
5105test_xmlSAXDefaultVersion(void) {
5106    int test_ret = 0;
5107
5108#if defined(LIBXML_SAX1_ENABLED)
5109#ifdef LIBXML_SAX1_ENABLED
5110    int mem_base;
5111    int ret_val;
5112    int version; /* the version, 1 or 2 */
5113    int n_version;
5114
5115    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5116        mem_base = xmlMemBlocks();
5117        version = gen_int(n_version, 0);
5118
5119        ret_val = xmlSAXDefaultVersion(version);
5120        desret_int(ret_val);
5121        call_tests++;
5122        des_int(n_version, version, 0);
5123        xmlResetLastError();
5124        if (mem_base != xmlMemBlocks()) {
5125            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5126	           xmlMemBlocks() - mem_base);
5127	    test_ret++;
5128            printf(" %d", n_version);
5129            printf("\n");
5130        }
5131    }
5132    function_tests++;
5133#endif
5134#endif
5135
5136    return(test_ret);
5137}
5138
5139
5140static int
5141test_xmlSAXVersion(void) {
5142    int test_ret = 0;
5143
5144    int mem_base;
5145    int ret_val;
5146    xmlSAXHandler * hdlr; /* the SAX handler */
5147    int n_hdlr;
5148    int version; /* the version, 1 or 2 */
5149    int n_version;
5150
5151    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5152    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5153        mem_base = xmlMemBlocks();
5154        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5155        version = gen_int(n_version, 1);
5156
5157        ret_val = xmlSAXVersion(hdlr, version);
5158        desret_int(ret_val);
5159        call_tests++;
5160        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5161        des_int(n_version, version, 1);
5162        xmlResetLastError();
5163        if (mem_base != xmlMemBlocks()) {
5164            printf("Leak of %d blocks found in xmlSAXVersion",
5165	           xmlMemBlocks() - mem_base);
5166	    test_ret++;
5167            printf(" %d", n_hdlr);
5168            printf(" %d", n_version);
5169            printf("\n");
5170        }
5171    }
5172    }
5173    function_tests++;
5174
5175    return(test_ret);
5176}
5177
5178static int
5179test_SAX2(void) {
5180    int test_ret = 0;
5181
5182    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5183    test_ret += test_docbDefaultSAXHandlerInit();
5184    test_ret += test_htmlDefaultSAXHandlerInit();
5185    test_ret += test_xmlDefaultSAXHandlerInit();
5186    test_ret += test_xmlSAX2AttributeDecl();
5187    test_ret += test_xmlSAX2CDataBlock();
5188    test_ret += test_xmlSAX2Characters();
5189    test_ret += test_xmlSAX2Comment();
5190    test_ret += test_xmlSAX2ElementDecl();
5191    test_ret += test_xmlSAX2EndDocument();
5192    test_ret += test_xmlSAX2EndElement();
5193    test_ret += test_xmlSAX2EndElementNs();
5194    test_ret += test_xmlSAX2EntityDecl();
5195    test_ret += test_xmlSAX2ExternalSubset();
5196    test_ret += test_xmlSAX2GetColumnNumber();
5197    test_ret += test_xmlSAX2GetEntity();
5198    test_ret += test_xmlSAX2GetLineNumber();
5199    test_ret += test_xmlSAX2GetParameterEntity();
5200    test_ret += test_xmlSAX2GetPublicId();
5201    test_ret += test_xmlSAX2GetSystemId();
5202    test_ret += test_xmlSAX2HasExternalSubset();
5203    test_ret += test_xmlSAX2HasInternalSubset();
5204    test_ret += test_xmlSAX2IgnorableWhitespace();
5205    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5206    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5207    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5208    test_ret += test_xmlSAX2InternalSubset();
5209    test_ret += test_xmlSAX2IsStandalone();
5210    test_ret += test_xmlSAX2NotationDecl();
5211    test_ret += test_xmlSAX2ProcessingInstruction();
5212    test_ret += test_xmlSAX2Reference();
5213    test_ret += test_xmlSAX2ResolveEntity();
5214    test_ret += test_xmlSAX2SetDocumentLocator();
5215    test_ret += test_xmlSAX2StartDocument();
5216    test_ret += test_xmlSAX2StartElement();
5217    test_ret += test_xmlSAX2StartElementNs();
5218    test_ret += test_xmlSAX2UnparsedEntityDecl();
5219    test_ret += test_xmlSAXDefaultVersion();
5220    test_ret += test_xmlSAXVersion();
5221
5222    if (test_ret != 0)
5223	printf("Module SAX2: %d errors\n", test_ret);
5224    return(test_ret);
5225}
5226
5227static int
5228test_xmlC14NDocDumpMemory(void) {
5229    int test_ret = 0;
5230
5231#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5232    int mem_base;
5233    int ret_val;
5234    xmlDocPtr doc; /* the XML document for canonization */
5235    int n_doc;
5236    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5237    int n_nodes;
5238    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5239    int n_exclusive;
5240    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) */
5241    int n_inclusive_ns_prefixes;
5242    int with_comments; /* include comments in the result (!=0) or not (==0) */
5243    int n_with_comments;
5244    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 */
5245    int n_doc_txt_ptr;
5246
5247    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5248    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5249    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5250    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5251    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5252    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5253        mem_base = xmlMemBlocks();
5254        doc = gen_xmlDocPtr(n_doc, 0);
5255        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5256        exclusive = gen_int(n_exclusive, 2);
5257        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5258        with_comments = gen_int(n_with_comments, 4);
5259        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5260
5261        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5262        desret_int(ret_val);
5263        call_tests++;
5264        des_xmlDocPtr(n_doc, doc, 0);
5265        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5266        des_int(n_exclusive, exclusive, 2);
5267        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5268        des_int(n_with_comments, with_comments, 4);
5269        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5270        xmlResetLastError();
5271        if (mem_base != xmlMemBlocks()) {
5272            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5273	           xmlMemBlocks() - mem_base);
5274	    test_ret++;
5275            printf(" %d", n_doc);
5276            printf(" %d", n_nodes);
5277            printf(" %d", n_exclusive);
5278            printf(" %d", n_inclusive_ns_prefixes);
5279            printf(" %d", n_with_comments);
5280            printf(" %d", n_doc_txt_ptr);
5281            printf("\n");
5282        }
5283    }
5284    }
5285    }
5286    }
5287    }
5288    }
5289    function_tests++;
5290#endif
5291
5292    return(test_ret);
5293}
5294
5295
5296static int
5297test_xmlC14NDocSave(void) {
5298    int test_ret = 0;
5299
5300#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5301    int mem_base;
5302    int ret_val;
5303    xmlDocPtr doc; /* the XML document for canonization */
5304    int n_doc;
5305    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5306    int n_nodes;
5307    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5308    int n_exclusive;
5309    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) */
5310    int n_inclusive_ns_prefixes;
5311    int with_comments; /* include comments in the result (!=0) or not (==0) */
5312    int n_with_comments;
5313    const char * filename; /* the filename to store canonical XML image */
5314    int n_filename;
5315    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5316    int n_compression;
5317
5318    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5319    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5320    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5321    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5322    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5323    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5324    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5325        mem_base = xmlMemBlocks();
5326        doc = gen_xmlDocPtr(n_doc, 0);
5327        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5328        exclusive = gen_int(n_exclusive, 2);
5329        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5330        with_comments = gen_int(n_with_comments, 4);
5331        filename = gen_fileoutput(n_filename, 5);
5332        compression = gen_int(n_compression, 6);
5333
5334        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5335        desret_int(ret_val);
5336        call_tests++;
5337        des_xmlDocPtr(n_doc, doc, 0);
5338        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5339        des_int(n_exclusive, exclusive, 2);
5340        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5341        des_int(n_with_comments, with_comments, 4);
5342        des_fileoutput(n_filename, filename, 5);
5343        des_int(n_compression, compression, 6);
5344        xmlResetLastError();
5345        if (mem_base != xmlMemBlocks()) {
5346            printf("Leak of %d blocks found in xmlC14NDocSave",
5347	           xmlMemBlocks() - mem_base);
5348	    test_ret++;
5349            printf(" %d", n_doc);
5350            printf(" %d", n_nodes);
5351            printf(" %d", n_exclusive);
5352            printf(" %d", n_inclusive_ns_prefixes);
5353            printf(" %d", n_with_comments);
5354            printf(" %d", n_filename);
5355            printf(" %d", n_compression);
5356            printf("\n");
5357        }
5358    }
5359    }
5360    }
5361    }
5362    }
5363    }
5364    }
5365    function_tests++;
5366#endif
5367
5368    return(test_ret);
5369}
5370
5371
5372static int
5373test_xmlC14NDocSaveTo(void) {
5374    int test_ret = 0;
5375
5376#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5377    int mem_base;
5378    int ret_val;
5379    xmlDocPtr doc; /* the XML document for canonization */
5380    int n_doc;
5381    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5382    int n_nodes;
5383    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5384    int n_exclusive;
5385    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) */
5386    int n_inclusive_ns_prefixes;
5387    int with_comments; /* include comments in the result (!=0) or not (==0) */
5388    int n_with_comments;
5389    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5390    int n_buf;
5391
5392    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5393    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5394    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5395    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5396    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5397    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5398        mem_base = xmlMemBlocks();
5399        doc = gen_xmlDocPtr(n_doc, 0);
5400        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5401        exclusive = gen_int(n_exclusive, 2);
5402        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5403        with_comments = gen_int(n_with_comments, 4);
5404        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5405
5406        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5407        desret_int(ret_val);
5408        call_tests++;
5409        des_xmlDocPtr(n_doc, doc, 0);
5410        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5411        des_int(n_exclusive, exclusive, 2);
5412        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5413        des_int(n_with_comments, with_comments, 4);
5414        des_xmlOutputBufferPtr(n_buf, buf, 5);
5415        xmlResetLastError();
5416        if (mem_base != xmlMemBlocks()) {
5417            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5418	           xmlMemBlocks() - mem_base);
5419	    test_ret++;
5420            printf(" %d", n_doc);
5421            printf(" %d", n_nodes);
5422            printf(" %d", n_exclusive);
5423            printf(" %d", n_inclusive_ns_prefixes);
5424            printf(" %d", n_with_comments);
5425            printf(" %d", n_buf);
5426            printf("\n");
5427        }
5428    }
5429    }
5430    }
5431    }
5432    }
5433    }
5434    function_tests++;
5435#endif
5436
5437    return(test_ret);
5438}
5439
5440
5441static int
5442test_xmlC14NExecute(void) {
5443    int test_ret = 0;
5444
5445
5446    /* missing type support */
5447    return(test_ret);
5448}
5449
5450static int
5451test_c14n(void) {
5452    int test_ret = 0;
5453
5454    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5455    test_ret += test_xmlC14NDocDumpMemory();
5456    test_ret += test_xmlC14NDocSave();
5457    test_ret += test_xmlC14NDocSaveTo();
5458    test_ret += test_xmlC14NExecute();
5459
5460    if (test_ret != 0)
5461	printf("Module c14n: %d errors\n", test_ret);
5462    return(test_ret);
5463}
5464#ifdef LIBXML_CATALOG_ENABLED
5465
5466#define gen_nb_xmlCatalogPtr 1
5467static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5468    return(NULL);
5469}
5470static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5471}
5472#endif
5473
5474
5475static int
5476test_xmlACatalogAdd(void) {
5477    int test_ret = 0;
5478
5479#if defined(LIBXML_CATALOG_ENABLED)
5480    int mem_base;
5481    int ret_val;
5482    xmlCatalogPtr catal; /* a Catalog */
5483    int n_catal;
5484    xmlChar * type; /* the type of record to add to the catalog */
5485    int n_type;
5486    xmlChar * orig; /* the system, public or prefix to match */
5487    int n_orig;
5488    xmlChar * replace; /* the replacement value for the match */
5489    int n_replace;
5490
5491    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5492    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5493    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5494    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5495        mem_base = xmlMemBlocks();
5496        catal = gen_xmlCatalogPtr(n_catal, 0);
5497        type = gen_const_xmlChar_ptr(n_type, 1);
5498        orig = gen_const_xmlChar_ptr(n_orig, 2);
5499        replace = gen_const_xmlChar_ptr(n_replace, 3);
5500
5501        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5502        desret_int(ret_val);
5503        call_tests++;
5504        des_xmlCatalogPtr(n_catal, catal, 0);
5505        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5506        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5507        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5508        xmlResetLastError();
5509        if (mem_base != xmlMemBlocks()) {
5510            printf("Leak of %d blocks found in xmlACatalogAdd",
5511	           xmlMemBlocks() - mem_base);
5512	    test_ret++;
5513            printf(" %d", n_catal);
5514            printf(" %d", n_type);
5515            printf(" %d", n_orig);
5516            printf(" %d", n_replace);
5517            printf("\n");
5518        }
5519    }
5520    }
5521    }
5522    }
5523    function_tests++;
5524#endif
5525
5526    return(test_ret);
5527}
5528
5529
5530static int
5531test_xmlACatalogDump(void) {
5532    int test_ret = 0;
5533
5534#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5535    int mem_base;
5536    xmlCatalogPtr catal; /* a Catalog */
5537    int n_catal;
5538    FILE * out; /* the file. */
5539    int n_out;
5540
5541    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5542    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5543        mem_base = xmlMemBlocks();
5544        catal = gen_xmlCatalogPtr(n_catal, 0);
5545        out = gen_FILE_ptr(n_out, 1);
5546
5547        xmlACatalogDump(catal, out);
5548        call_tests++;
5549        des_xmlCatalogPtr(n_catal, catal, 0);
5550        des_FILE_ptr(n_out, out, 1);
5551        xmlResetLastError();
5552        if (mem_base != xmlMemBlocks()) {
5553            printf("Leak of %d blocks found in xmlACatalogDump",
5554	           xmlMemBlocks() - mem_base);
5555	    test_ret++;
5556            printf(" %d", n_catal);
5557            printf(" %d", n_out);
5558            printf("\n");
5559        }
5560    }
5561    }
5562    function_tests++;
5563#endif
5564
5565    return(test_ret);
5566}
5567
5568
5569static int
5570test_xmlACatalogRemove(void) {
5571    int test_ret = 0;
5572
5573#if defined(LIBXML_CATALOG_ENABLED)
5574    int mem_base;
5575    int ret_val;
5576    xmlCatalogPtr catal; /* a Catalog */
5577    int n_catal;
5578    xmlChar * value; /* the value to remove */
5579    int n_value;
5580
5581    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5582    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5583        mem_base = xmlMemBlocks();
5584        catal = gen_xmlCatalogPtr(n_catal, 0);
5585        value = gen_const_xmlChar_ptr(n_value, 1);
5586
5587        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5588        desret_int(ret_val);
5589        call_tests++;
5590        des_xmlCatalogPtr(n_catal, catal, 0);
5591        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5592        xmlResetLastError();
5593        if (mem_base != xmlMemBlocks()) {
5594            printf("Leak of %d blocks found in xmlACatalogRemove",
5595	           xmlMemBlocks() - mem_base);
5596	    test_ret++;
5597            printf(" %d", n_catal);
5598            printf(" %d", n_value);
5599            printf("\n");
5600        }
5601    }
5602    }
5603    function_tests++;
5604#endif
5605
5606    return(test_ret);
5607}
5608
5609
5610static int
5611test_xmlACatalogResolve(void) {
5612    int test_ret = 0;
5613
5614#if defined(LIBXML_CATALOG_ENABLED)
5615    int mem_base;
5616    xmlChar * ret_val;
5617    xmlCatalogPtr catal; /* a Catalog */
5618    int n_catal;
5619    xmlChar * pubID; /* the public ID string */
5620    int n_pubID;
5621    xmlChar * sysID; /* the system ID string */
5622    int n_sysID;
5623
5624    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5625    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5626    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5627        mem_base = xmlMemBlocks();
5628        catal = gen_xmlCatalogPtr(n_catal, 0);
5629        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5630        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5631
5632        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5633        desret_xmlChar_ptr(ret_val);
5634        call_tests++;
5635        des_xmlCatalogPtr(n_catal, catal, 0);
5636        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5637        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5638        xmlResetLastError();
5639        if (mem_base != xmlMemBlocks()) {
5640            printf("Leak of %d blocks found in xmlACatalogResolve",
5641	           xmlMemBlocks() - mem_base);
5642	    test_ret++;
5643            printf(" %d", n_catal);
5644            printf(" %d", n_pubID);
5645            printf(" %d", n_sysID);
5646            printf("\n");
5647        }
5648    }
5649    }
5650    }
5651    function_tests++;
5652#endif
5653
5654    return(test_ret);
5655}
5656
5657
5658static int
5659test_xmlACatalogResolvePublic(void) {
5660    int test_ret = 0;
5661
5662#if defined(LIBXML_CATALOG_ENABLED)
5663    int mem_base;
5664    xmlChar * ret_val;
5665    xmlCatalogPtr catal; /* a Catalog */
5666    int n_catal;
5667    xmlChar * pubID; /* the public ID string */
5668    int n_pubID;
5669
5670    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5671    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5672        mem_base = xmlMemBlocks();
5673        catal = gen_xmlCatalogPtr(n_catal, 0);
5674        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5675
5676        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5677        desret_xmlChar_ptr(ret_val);
5678        call_tests++;
5679        des_xmlCatalogPtr(n_catal, catal, 0);
5680        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5681        xmlResetLastError();
5682        if (mem_base != xmlMemBlocks()) {
5683            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5684	           xmlMemBlocks() - mem_base);
5685	    test_ret++;
5686            printf(" %d", n_catal);
5687            printf(" %d", n_pubID);
5688            printf("\n");
5689        }
5690    }
5691    }
5692    function_tests++;
5693#endif
5694
5695    return(test_ret);
5696}
5697
5698
5699static int
5700test_xmlACatalogResolveSystem(void) {
5701    int test_ret = 0;
5702
5703#if defined(LIBXML_CATALOG_ENABLED)
5704    int mem_base;
5705    xmlChar * ret_val;
5706    xmlCatalogPtr catal; /* a Catalog */
5707    int n_catal;
5708    xmlChar * sysID; /* the system ID string */
5709    int n_sysID;
5710
5711    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5712    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5713        mem_base = xmlMemBlocks();
5714        catal = gen_xmlCatalogPtr(n_catal, 0);
5715        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5716
5717        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5718        desret_xmlChar_ptr(ret_val);
5719        call_tests++;
5720        des_xmlCatalogPtr(n_catal, catal, 0);
5721        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5722        xmlResetLastError();
5723        if (mem_base != xmlMemBlocks()) {
5724            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5725	           xmlMemBlocks() - mem_base);
5726	    test_ret++;
5727            printf(" %d", n_catal);
5728            printf(" %d", n_sysID);
5729            printf("\n");
5730        }
5731    }
5732    }
5733    function_tests++;
5734#endif
5735
5736    return(test_ret);
5737}
5738
5739
5740static int
5741test_xmlACatalogResolveURI(void) {
5742    int test_ret = 0;
5743
5744#if defined(LIBXML_CATALOG_ENABLED)
5745    int mem_base;
5746    xmlChar * ret_val;
5747    xmlCatalogPtr catal; /* a Catalog */
5748    int n_catal;
5749    xmlChar * URI; /* the URI */
5750    int n_URI;
5751
5752    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5753    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5754        mem_base = xmlMemBlocks();
5755        catal = gen_xmlCatalogPtr(n_catal, 0);
5756        URI = gen_const_xmlChar_ptr(n_URI, 1);
5757
5758        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5759        desret_xmlChar_ptr(ret_val);
5760        call_tests++;
5761        des_xmlCatalogPtr(n_catal, catal, 0);
5762        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5763        xmlResetLastError();
5764        if (mem_base != xmlMemBlocks()) {
5765            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5766	           xmlMemBlocks() - mem_base);
5767	    test_ret++;
5768            printf(" %d", n_catal);
5769            printf(" %d", n_URI);
5770            printf("\n");
5771        }
5772    }
5773    }
5774    function_tests++;
5775#endif
5776
5777    return(test_ret);
5778}
5779
5780
5781static int
5782test_xmlCatalogAdd(void) {
5783    int test_ret = 0;
5784
5785#if defined(LIBXML_CATALOG_ENABLED)
5786    int mem_base;
5787    int ret_val;
5788    xmlChar * type; /* the type of record to add to the catalog */
5789    int n_type;
5790    xmlChar * orig; /* the system, public or prefix to match */
5791    int n_orig;
5792    xmlChar * replace; /* the replacement value for the match */
5793    int n_replace;
5794
5795    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5796    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5797    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5798        mem_base = xmlMemBlocks();
5799        type = gen_const_xmlChar_ptr(n_type, 0);
5800        orig = gen_const_xmlChar_ptr(n_orig, 1);
5801        replace = gen_const_xmlChar_ptr(n_replace, 2);
5802
5803        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5804        desret_int(ret_val);
5805        call_tests++;
5806        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5807        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5808        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5809        xmlResetLastError();
5810        if (mem_base != xmlMemBlocks()) {
5811            printf("Leak of %d blocks found in xmlCatalogAdd",
5812	           xmlMemBlocks() - mem_base);
5813	    test_ret++;
5814            printf(" %d", n_type);
5815            printf(" %d", n_orig);
5816            printf(" %d", n_replace);
5817            printf("\n");
5818        }
5819    }
5820    }
5821    }
5822    function_tests++;
5823#endif
5824
5825    return(test_ret);
5826}
5827
5828
5829static int
5830test_xmlCatalogCleanup(void) {
5831    int test_ret = 0;
5832
5833#if defined(LIBXML_CATALOG_ENABLED)
5834
5835
5836        xmlCatalogCleanup();
5837        call_tests++;
5838        xmlResetLastError();
5839    function_tests++;
5840#endif
5841
5842    return(test_ret);
5843}
5844
5845
5846static int
5847test_xmlCatalogConvert(void) {
5848    int test_ret = 0;
5849
5850#if defined(LIBXML_CATALOG_ENABLED)
5851    int ret_val;
5852
5853
5854        ret_val = xmlCatalogConvert();
5855        desret_int(ret_val);
5856        call_tests++;
5857        xmlResetLastError();
5858    function_tests++;
5859#endif
5860
5861    return(test_ret);
5862}
5863
5864
5865static int
5866test_xmlCatalogDump(void) {
5867    int test_ret = 0;
5868
5869#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5870    int mem_base;
5871    FILE * out; /* the file. */
5872    int n_out;
5873
5874    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5875        mem_base = xmlMemBlocks();
5876        out = gen_FILE_ptr(n_out, 0);
5877
5878        xmlCatalogDump(out);
5879        call_tests++;
5880        des_FILE_ptr(n_out, out, 0);
5881        xmlResetLastError();
5882        if (mem_base != xmlMemBlocks()) {
5883            printf("Leak of %d blocks found in xmlCatalogDump",
5884	           xmlMemBlocks() - mem_base);
5885	    test_ret++;
5886            printf(" %d", n_out);
5887            printf("\n");
5888        }
5889    }
5890    function_tests++;
5891#endif
5892
5893    return(test_ret);
5894}
5895
5896
5897static int
5898test_xmlCatalogGetDefaults(void) {
5899    int test_ret = 0;
5900
5901#if defined(LIBXML_CATALOG_ENABLED)
5902    int mem_base;
5903    xmlCatalogAllow ret_val;
5904
5905        mem_base = xmlMemBlocks();
5906
5907        ret_val = xmlCatalogGetDefaults();
5908        desret_xmlCatalogAllow(ret_val);
5909        call_tests++;
5910        xmlResetLastError();
5911        if (mem_base != xmlMemBlocks()) {
5912            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
5913	           xmlMemBlocks() - mem_base);
5914	    test_ret++;
5915            printf("\n");
5916        }
5917    function_tests++;
5918#endif
5919
5920    return(test_ret);
5921}
5922
5923
5924static int
5925test_xmlCatalogIsEmpty(void) {
5926    int test_ret = 0;
5927
5928#if defined(LIBXML_CATALOG_ENABLED)
5929    int mem_base;
5930    int ret_val;
5931    xmlCatalogPtr catal; /* should this create an SGML catalog */
5932    int n_catal;
5933
5934    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5935        mem_base = xmlMemBlocks();
5936        catal = gen_xmlCatalogPtr(n_catal, 0);
5937
5938        ret_val = xmlCatalogIsEmpty(catal);
5939        desret_int(ret_val);
5940        call_tests++;
5941        des_xmlCatalogPtr(n_catal, catal, 0);
5942        xmlResetLastError();
5943        if (mem_base != xmlMemBlocks()) {
5944            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
5945	           xmlMemBlocks() - mem_base);
5946	    test_ret++;
5947            printf(" %d", n_catal);
5948            printf("\n");
5949        }
5950    }
5951    function_tests++;
5952#endif
5953
5954    return(test_ret);
5955}
5956
5957
5958static int
5959test_xmlCatalogLocalResolve(void) {
5960    int test_ret = 0;
5961
5962#if defined(LIBXML_CATALOG_ENABLED)
5963    int mem_base;
5964    xmlChar * ret_val;
5965    void * catalogs; /* a document's list of catalogs */
5966    int n_catalogs;
5967    xmlChar * pubID; /* the public ID string */
5968    int n_pubID;
5969    xmlChar * sysID; /* the system ID string */
5970    int n_sysID;
5971
5972    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5973    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5974    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5975        mem_base = xmlMemBlocks();
5976        catalogs = gen_void_ptr(n_catalogs, 0);
5977        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5978        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5979
5980        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
5981        desret_xmlChar_ptr(ret_val);
5982        call_tests++;
5983        des_void_ptr(n_catalogs, catalogs, 0);
5984        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5985        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5986        xmlResetLastError();
5987        if (mem_base != xmlMemBlocks()) {
5988            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
5989	           xmlMemBlocks() - mem_base);
5990	    test_ret++;
5991            printf(" %d", n_catalogs);
5992            printf(" %d", n_pubID);
5993            printf(" %d", n_sysID);
5994            printf("\n");
5995        }
5996    }
5997    }
5998    }
5999    function_tests++;
6000#endif
6001
6002    return(test_ret);
6003}
6004
6005
6006static int
6007test_xmlCatalogLocalResolveURI(void) {
6008    int test_ret = 0;
6009
6010#if defined(LIBXML_CATALOG_ENABLED)
6011    int mem_base;
6012    xmlChar * ret_val;
6013    void * catalogs; /* a document's list of catalogs */
6014    int n_catalogs;
6015    xmlChar * URI; /* the URI */
6016    int n_URI;
6017
6018    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6019    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6020        mem_base = xmlMemBlocks();
6021        catalogs = gen_void_ptr(n_catalogs, 0);
6022        URI = gen_const_xmlChar_ptr(n_URI, 1);
6023
6024        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6025        desret_xmlChar_ptr(ret_val);
6026        call_tests++;
6027        des_void_ptr(n_catalogs, catalogs, 0);
6028        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6029        xmlResetLastError();
6030        if (mem_base != xmlMemBlocks()) {
6031            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6032	           xmlMemBlocks() - mem_base);
6033	    test_ret++;
6034            printf(" %d", n_catalogs);
6035            printf(" %d", n_URI);
6036            printf("\n");
6037        }
6038    }
6039    }
6040    function_tests++;
6041#endif
6042
6043    return(test_ret);
6044}
6045
6046
6047static int
6048test_xmlCatalogRemove(void) {
6049    int test_ret = 0;
6050
6051#if defined(LIBXML_CATALOG_ENABLED)
6052    int ret_val;
6053    xmlChar * value; /* the value to remove */
6054    int n_value;
6055
6056    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6057        value = gen_const_xmlChar_ptr(n_value, 0);
6058
6059        ret_val = xmlCatalogRemove((const xmlChar *)value);
6060        desret_int(ret_val);
6061        call_tests++;
6062        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6063        xmlResetLastError();
6064    }
6065    function_tests++;
6066#endif
6067
6068    return(test_ret);
6069}
6070
6071
6072static int
6073test_xmlCatalogResolve(void) {
6074    int test_ret = 0;
6075
6076#if defined(LIBXML_CATALOG_ENABLED)
6077    int mem_base;
6078    xmlChar * ret_val;
6079    xmlChar * pubID; /* the public ID string */
6080    int n_pubID;
6081    xmlChar * sysID; /* the system ID string */
6082    int n_sysID;
6083
6084    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6085    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6086        mem_base = xmlMemBlocks();
6087        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6088        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6089
6090        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6091        desret_xmlChar_ptr(ret_val);
6092        call_tests++;
6093        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6094        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6095        xmlResetLastError();
6096        if (mem_base != xmlMemBlocks()) {
6097            printf("Leak of %d blocks found in xmlCatalogResolve",
6098	           xmlMemBlocks() - mem_base);
6099	    test_ret++;
6100            printf(" %d", n_pubID);
6101            printf(" %d", n_sysID);
6102            printf("\n");
6103        }
6104    }
6105    }
6106    function_tests++;
6107#endif
6108
6109    return(test_ret);
6110}
6111
6112
6113static int
6114test_xmlCatalogResolvePublic(void) {
6115    int test_ret = 0;
6116
6117#if defined(LIBXML_CATALOG_ENABLED)
6118    int mem_base;
6119    xmlChar * ret_val;
6120    xmlChar * pubID; /* the public ID string */
6121    int n_pubID;
6122
6123    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6124        mem_base = xmlMemBlocks();
6125        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6126
6127        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6128        desret_xmlChar_ptr(ret_val);
6129        call_tests++;
6130        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6131        xmlResetLastError();
6132        if (mem_base != xmlMemBlocks()) {
6133            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6134	           xmlMemBlocks() - mem_base);
6135	    test_ret++;
6136            printf(" %d", n_pubID);
6137            printf("\n");
6138        }
6139    }
6140    function_tests++;
6141#endif
6142
6143    return(test_ret);
6144}
6145
6146
6147static int
6148test_xmlCatalogResolveSystem(void) {
6149    int test_ret = 0;
6150
6151#if defined(LIBXML_CATALOG_ENABLED)
6152    int mem_base;
6153    xmlChar * ret_val;
6154    xmlChar * sysID; /* the system ID string */
6155    int n_sysID;
6156
6157    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6158        mem_base = xmlMemBlocks();
6159        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6160
6161        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6162        desret_xmlChar_ptr(ret_val);
6163        call_tests++;
6164        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6165        xmlResetLastError();
6166        if (mem_base != xmlMemBlocks()) {
6167            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6168	           xmlMemBlocks() - mem_base);
6169	    test_ret++;
6170            printf(" %d", n_sysID);
6171            printf("\n");
6172        }
6173    }
6174    function_tests++;
6175#endif
6176
6177    return(test_ret);
6178}
6179
6180
6181static int
6182test_xmlCatalogResolveURI(void) {
6183    int test_ret = 0;
6184
6185#if defined(LIBXML_CATALOG_ENABLED)
6186    int mem_base;
6187    xmlChar * ret_val;
6188    xmlChar * URI; /* the URI */
6189    int n_URI;
6190
6191    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6192        mem_base = xmlMemBlocks();
6193        URI = gen_const_xmlChar_ptr(n_URI, 0);
6194
6195        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6196        desret_xmlChar_ptr(ret_val);
6197        call_tests++;
6198        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6199        xmlResetLastError();
6200        if (mem_base != xmlMemBlocks()) {
6201            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6202	           xmlMemBlocks() - mem_base);
6203	    test_ret++;
6204            printf(" %d", n_URI);
6205            printf("\n");
6206        }
6207    }
6208    function_tests++;
6209#endif
6210
6211    return(test_ret);
6212}
6213
6214
6215static int
6216test_xmlCatalogSetDefaultPrefer(void) {
6217    int test_ret = 0;
6218
6219#if defined(LIBXML_CATALOG_ENABLED)
6220    int mem_base;
6221    xmlCatalogPrefer ret_val;
6222    xmlCatalogPrefer prefer; /* the default preference for delegation */
6223    int n_prefer;
6224
6225    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6226        mem_base = xmlMemBlocks();
6227        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6228
6229        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6230        desret_xmlCatalogPrefer(ret_val);
6231        call_tests++;
6232        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6233        xmlResetLastError();
6234        if (mem_base != xmlMemBlocks()) {
6235            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6236	           xmlMemBlocks() - mem_base);
6237	    test_ret++;
6238            printf(" %d", n_prefer);
6239            printf("\n");
6240        }
6241    }
6242    function_tests++;
6243#endif
6244
6245    return(test_ret);
6246}
6247
6248
6249static int
6250test_xmlCatalogSetDefaults(void) {
6251    int test_ret = 0;
6252
6253#if defined(LIBXML_CATALOG_ENABLED)
6254    int mem_base;
6255    xmlCatalogAllow allow; /* what catalogs should be accepted */
6256    int n_allow;
6257
6258    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6259        mem_base = xmlMemBlocks();
6260        allow = gen_xmlCatalogAllow(n_allow, 0);
6261
6262        xmlCatalogSetDefaults(allow);
6263        call_tests++;
6264        des_xmlCatalogAllow(n_allow, allow, 0);
6265        xmlResetLastError();
6266        if (mem_base != xmlMemBlocks()) {
6267            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6268	           xmlMemBlocks() - mem_base);
6269	    test_ret++;
6270            printf(" %d", n_allow);
6271            printf("\n");
6272        }
6273    }
6274    function_tests++;
6275#endif
6276
6277    return(test_ret);
6278}
6279
6280
6281static int
6282test_xmlConvertSGMLCatalog(void) {
6283    int test_ret = 0;
6284
6285#if defined(LIBXML_CATALOG_ENABLED)
6286    int mem_base;
6287    int ret_val;
6288    xmlCatalogPtr catal; /* the catalog */
6289    int n_catal;
6290
6291    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6292        mem_base = xmlMemBlocks();
6293        catal = gen_xmlCatalogPtr(n_catal, 0);
6294
6295        ret_val = xmlConvertSGMLCatalog(catal);
6296        desret_int(ret_val);
6297        call_tests++;
6298        des_xmlCatalogPtr(n_catal, catal, 0);
6299        xmlResetLastError();
6300        if (mem_base != xmlMemBlocks()) {
6301            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6302	           xmlMemBlocks() - mem_base);
6303	    test_ret++;
6304            printf(" %d", n_catal);
6305            printf("\n");
6306        }
6307    }
6308    function_tests++;
6309#endif
6310
6311    return(test_ret);
6312}
6313
6314
6315static int
6316test_xmlInitializeCatalog(void) {
6317    int test_ret = 0;
6318
6319#if defined(LIBXML_CATALOG_ENABLED)
6320    int mem_base;
6321
6322        mem_base = xmlMemBlocks();
6323
6324        xmlInitializeCatalog();
6325        call_tests++;
6326        xmlResetLastError();
6327        if (mem_base != xmlMemBlocks()) {
6328            printf("Leak of %d blocks found in xmlInitializeCatalog",
6329	           xmlMemBlocks() - mem_base);
6330	    test_ret++;
6331            printf("\n");
6332        }
6333    function_tests++;
6334#endif
6335
6336    return(test_ret);
6337}
6338
6339
6340static int
6341test_xmlLoadACatalog(void) {
6342    int test_ret = 0;
6343
6344
6345    /* missing type support */
6346    return(test_ret);
6347}
6348
6349
6350static int
6351test_xmlLoadCatalog(void) {
6352    int test_ret = 0;
6353
6354#if defined(LIBXML_CATALOG_ENABLED)
6355    int ret_val;
6356    const char * filename; /* a file path */
6357    int n_filename;
6358
6359    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6360        filename = gen_filepath(n_filename, 0);
6361
6362        ret_val = xmlLoadCatalog(filename);
6363        desret_int(ret_val);
6364        call_tests++;
6365        des_filepath(n_filename, filename, 0);
6366        xmlResetLastError();
6367    }
6368    function_tests++;
6369#endif
6370
6371    return(test_ret);
6372}
6373
6374
6375static int
6376test_xmlLoadCatalogs(void) {
6377    int test_ret = 0;
6378
6379#if defined(LIBXML_CATALOG_ENABLED)
6380    char * pathss; /* a list of directories separated by a colon or a space. */
6381    int n_pathss;
6382
6383    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6384        pathss = gen_const_char_ptr(n_pathss, 0);
6385
6386        xmlLoadCatalogs((const char *)pathss);
6387        call_tests++;
6388        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6389        xmlResetLastError();
6390    }
6391    function_tests++;
6392#endif
6393
6394    return(test_ret);
6395}
6396
6397
6398static int
6399test_xmlLoadSGMLSuperCatalog(void) {
6400    int test_ret = 0;
6401
6402
6403    /* missing type support */
6404    return(test_ret);
6405}
6406
6407
6408static int
6409test_xmlNewCatalog(void) {
6410    int test_ret = 0;
6411
6412
6413    /* missing type support */
6414    return(test_ret);
6415}
6416
6417
6418static int
6419test_xmlParseCatalogFile(void) {
6420    int test_ret = 0;
6421
6422#if defined(LIBXML_CATALOG_ENABLED)
6423    int mem_base;
6424    xmlDocPtr ret_val;
6425    const char * filename; /* the filename */
6426    int n_filename;
6427
6428    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6429        mem_base = xmlMemBlocks();
6430        filename = gen_filepath(n_filename, 0);
6431
6432        ret_val = xmlParseCatalogFile(filename);
6433        desret_xmlDocPtr(ret_val);
6434        call_tests++;
6435        des_filepath(n_filename, filename, 0);
6436        xmlResetLastError();
6437        if (mem_base != xmlMemBlocks()) {
6438            printf("Leak of %d blocks found in xmlParseCatalogFile",
6439	           xmlMemBlocks() - mem_base);
6440	    test_ret++;
6441            printf(" %d", n_filename);
6442            printf("\n");
6443        }
6444    }
6445    function_tests++;
6446#endif
6447
6448    return(test_ret);
6449}
6450
6451static int
6452test_catalog(void) {
6453    int test_ret = 0;
6454
6455    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6456    test_ret += test_xmlACatalogAdd();
6457    test_ret += test_xmlACatalogDump();
6458    test_ret += test_xmlACatalogRemove();
6459    test_ret += test_xmlACatalogResolve();
6460    test_ret += test_xmlACatalogResolvePublic();
6461    test_ret += test_xmlACatalogResolveSystem();
6462    test_ret += test_xmlACatalogResolveURI();
6463    test_ret += test_xmlCatalogAdd();
6464    test_ret += test_xmlCatalogCleanup();
6465    test_ret += test_xmlCatalogConvert();
6466    test_ret += test_xmlCatalogDump();
6467    test_ret += test_xmlCatalogGetDefaults();
6468    test_ret += test_xmlCatalogIsEmpty();
6469    test_ret += test_xmlCatalogLocalResolve();
6470    test_ret += test_xmlCatalogLocalResolveURI();
6471    test_ret += test_xmlCatalogRemove();
6472    test_ret += test_xmlCatalogResolve();
6473    test_ret += test_xmlCatalogResolvePublic();
6474    test_ret += test_xmlCatalogResolveSystem();
6475    test_ret += test_xmlCatalogResolveURI();
6476    test_ret += test_xmlCatalogSetDefaultPrefer();
6477    test_ret += test_xmlCatalogSetDefaults();
6478    test_ret += test_xmlConvertSGMLCatalog();
6479    test_ret += test_xmlInitializeCatalog();
6480    test_ret += test_xmlLoadACatalog();
6481    test_ret += test_xmlLoadCatalog();
6482    test_ret += test_xmlLoadCatalogs();
6483    test_ret += test_xmlLoadSGMLSuperCatalog();
6484    test_ret += test_xmlNewCatalog();
6485    test_ret += test_xmlParseCatalogFile();
6486
6487    if (test_ret != 0)
6488	printf("Module catalog: %d errors\n", test_ret);
6489    return(test_ret);
6490}
6491
6492#define gen_nb_const_xmlChRangeGroupPtr 1
6493static xmlChRangeGroupPtr gen_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6494    return(NULL);
6495}
6496static void des_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroupPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6497}
6498
6499static int
6500test_xmlCharInRange(void) {
6501    int test_ret = 0;
6502
6503    int mem_base;
6504    int ret_val;
6505    unsigned int val; /* character to be validated */
6506    int n_val;
6507    xmlChRangeGroupPtr rptr; /* pointer to range to be used to validate */
6508    int n_rptr;
6509
6510    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6511    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroupPtr;n_rptr++) {
6512        mem_base = xmlMemBlocks();
6513        val = gen_unsigned_int(n_val, 0);
6514        rptr = gen_const_xmlChRangeGroupPtr(n_rptr, 1);
6515
6516        ret_val = xmlCharInRange(val, (const xmlChRangeGroupPtr)rptr);
6517        desret_int(ret_val);
6518        call_tests++;
6519        des_unsigned_int(n_val, val, 0);
6520        des_const_xmlChRangeGroupPtr(n_rptr, (const xmlChRangeGroupPtr)rptr, 1);
6521        xmlResetLastError();
6522        if (mem_base != xmlMemBlocks()) {
6523            printf("Leak of %d blocks found in xmlCharInRange",
6524	           xmlMemBlocks() - mem_base);
6525	    test_ret++;
6526            printf(" %d", n_val);
6527            printf(" %d", n_rptr);
6528            printf("\n");
6529        }
6530    }
6531    }
6532    function_tests++;
6533
6534    return(test_ret);
6535}
6536
6537
6538static int
6539test_xmlIsBaseChar(void) {
6540    int test_ret = 0;
6541
6542    int mem_base;
6543    int ret_val;
6544    unsigned int ch; /* character to validate */
6545    int n_ch;
6546
6547    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6548        mem_base = xmlMemBlocks();
6549        ch = gen_unsigned_int(n_ch, 0);
6550
6551        ret_val = xmlIsBaseChar(ch);
6552        desret_int(ret_val);
6553        call_tests++;
6554        des_unsigned_int(n_ch, ch, 0);
6555        xmlResetLastError();
6556        if (mem_base != xmlMemBlocks()) {
6557            printf("Leak of %d blocks found in xmlIsBaseChar",
6558	           xmlMemBlocks() - mem_base);
6559	    test_ret++;
6560            printf(" %d", n_ch);
6561            printf("\n");
6562        }
6563    }
6564    function_tests++;
6565
6566    return(test_ret);
6567}
6568
6569
6570static int
6571test_xmlIsBlank(void) {
6572    int test_ret = 0;
6573
6574    int mem_base;
6575    int ret_val;
6576    unsigned int ch; /* character to validate */
6577    int n_ch;
6578
6579    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6580        mem_base = xmlMemBlocks();
6581        ch = gen_unsigned_int(n_ch, 0);
6582
6583        ret_val = xmlIsBlank(ch);
6584        desret_int(ret_val);
6585        call_tests++;
6586        des_unsigned_int(n_ch, ch, 0);
6587        xmlResetLastError();
6588        if (mem_base != xmlMemBlocks()) {
6589            printf("Leak of %d blocks found in xmlIsBlank",
6590	           xmlMemBlocks() - mem_base);
6591	    test_ret++;
6592            printf(" %d", n_ch);
6593            printf("\n");
6594        }
6595    }
6596    function_tests++;
6597
6598    return(test_ret);
6599}
6600
6601
6602static int
6603test_xmlIsChar(void) {
6604    int test_ret = 0;
6605
6606    int mem_base;
6607    int ret_val;
6608    unsigned int ch; /* character to validate */
6609    int n_ch;
6610
6611    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6612        mem_base = xmlMemBlocks();
6613        ch = gen_unsigned_int(n_ch, 0);
6614
6615        ret_val = xmlIsChar(ch);
6616        desret_int(ret_val);
6617        call_tests++;
6618        des_unsigned_int(n_ch, ch, 0);
6619        xmlResetLastError();
6620        if (mem_base != xmlMemBlocks()) {
6621            printf("Leak of %d blocks found in xmlIsChar",
6622	           xmlMemBlocks() - mem_base);
6623	    test_ret++;
6624            printf(" %d", n_ch);
6625            printf("\n");
6626        }
6627    }
6628    function_tests++;
6629
6630    return(test_ret);
6631}
6632
6633
6634static int
6635test_xmlIsCombining(void) {
6636    int test_ret = 0;
6637
6638    int mem_base;
6639    int ret_val;
6640    unsigned int ch; /* character to validate */
6641    int n_ch;
6642
6643    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6644        mem_base = xmlMemBlocks();
6645        ch = gen_unsigned_int(n_ch, 0);
6646
6647        ret_val = xmlIsCombining(ch);
6648        desret_int(ret_val);
6649        call_tests++;
6650        des_unsigned_int(n_ch, ch, 0);
6651        xmlResetLastError();
6652        if (mem_base != xmlMemBlocks()) {
6653            printf("Leak of %d blocks found in xmlIsCombining",
6654	           xmlMemBlocks() - mem_base);
6655	    test_ret++;
6656            printf(" %d", n_ch);
6657            printf("\n");
6658        }
6659    }
6660    function_tests++;
6661
6662    return(test_ret);
6663}
6664
6665
6666static int
6667test_xmlIsDigit(void) {
6668    int test_ret = 0;
6669
6670    int mem_base;
6671    int ret_val;
6672    unsigned int ch; /* character to validate */
6673    int n_ch;
6674
6675    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6676        mem_base = xmlMemBlocks();
6677        ch = gen_unsigned_int(n_ch, 0);
6678
6679        ret_val = xmlIsDigit(ch);
6680        desret_int(ret_val);
6681        call_tests++;
6682        des_unsigned_int(n_ch, ch, 0);
6683        xmlResetLastError();
6684        if (mem_base != xmlMemBlocks()) {
6685            printf("Leak of %d blocks found in xmlIsDigit",
6686	           xmlMemBlocks() - mem_base);
6687	    test_ret++;
6688            printf(" %d", n_ch);
6689            printf("\n");
6690        }
6691    }
6692    function_tests++;
6693
6694    return(test_ret);
6695}
6696
6697
6698static int
6699test_xmlIsExtender(void) {
6700    int test_ret = 0;
6701
6702    int mem_base;
6703    int ret_val;
6704    unsigned int ch; /* character to validate */
6705    int n_ch;
6706
6707    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6708        mem_base = xmlMemBlocks();
6709        ch = gen_unsigned_int(n_ch, 0);
6710
6711        ret_val = xmlIsExtender(ch);
6712        desret_int(ret_val);
6713        call_tests++;
6714        des_unsigned_int(n_ch, ch, 0);
6715        xmlResetLastError();
6716        if (mem_base != xmlMemBlocks()) {
6717            printf("Leak of %d blocks found in xmlIsExtender",
6718	           xmlMemBlocks() - mem_base);
6719	    test_ret++;
6720            printf(" %d", n_ch);
6721            printf("\n");
6722        }
6723    }
6724    function_tests++;
6725
6726    return(test_ret);
6727}
6728
6729
6730static int
6731test_xmlIsIdeographic(void) {
6732    int test_ret = 0;
6733
6734    int mem_base;
6735    int ret_val;
6736    unsigned int ch; /* character to validate */
6737    int n_ch;
6738
6739    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6740        mem_base = xmlMemBlocks();
6741        ch = gen_unsigned_int(n_ch, 0);
6742
6743        ret_val = xmlIsIdeographic(ch);
6744        desret_int(ret_val);
6745        call_tests++;
6746        des_unsigned_int(n_ch, ch, 0);
6747        xmlResetLastError();
6748        if (mem_base != xmlMemBlocks()) {
6749            printf("Leak of %d blocks found in xmlIsIdeographic",
6750	           xmlMemBlocks() - mem_base);
6751	    test_ret++;
6752            printf(" %d", n_ch);
6753            printf("\n");
6754        }
6755    }
6756    function_tests++;
6757
6758    return(test_ret);
6759}
6760
6761
6762static int
6763test_xmlIsPubidChar(void) {
6764    int test_ret = 0;
6765
6766    int mem_base;
6767    int ret_val;
6768    unsigned int ch; /* character to validate */
6769    int n_ch;
6770
6771    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6772        mem_base = xmlMemBlocks();
6773        ch = gen_unsigned_int(n_ch, 0);
6774
6775        ret_val = xmlIsPubidChar(ch);
6776        desret_int(ret_val);
6777        call_tests++;
6778        des_unsigned_int(n_ch, ch, 0);
6779        xmlResetLastError();
6780        if (mem_base != xmlMemBlocks()) {
6781            printf("Leak of %d blocks found in xmlIsPubidChar",
6782	           xmlMemBlocks() - mem_base);
6783	    test_ret++;
6784            printf(" %d", n_ch);
6785            printf("\n");
6786        }
6787    }
6788    function_tests++;
6789
6790    return(test_ret);
6791}
6792
6793static int
6794test_chvalid(void) {
6795    int test_ret = 0;
6796
6797    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6798    test_ret += test_xmlCharInRange();
6799    test_ret += test_xmlIsBaseChar();
6800    test_ret += test_xmlIsBlank();
6801    test_ret += test_xmlIsChar();
6802    test_ret += test_xmlIsCombining();
6803    test_ret += test_xmlIsDigit();
6804    test_ret += test_xmlIsExtender();
6805    test_ret += test_xmlIsIdeographic();
6806    test_ret += test_xmlIsPubidChar();
6807
6808    if (test_ret != 0)
6809	printf("Module chvalid: %d errors\n", test_ret);
6810    return(test_ret);
6811}
6812
6813static int
6814test_xmlBoolToText(void) {
6815    int test_ret = 0;
6816
6817#if defined(LIBXML_DEBUG_ENABLED)
6818    int mem_base;
6819    const char * ret_val;
6820    int boolval; /* a bool to turn into text */
6821    int n_boolval;
6822
6823    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6824        mem_base = xmlMemBlocks();
6825        boolval = gen_int(n_boolval, 0);
6826
6827        ret_val = xmlBoolToText(boolval);
6828        desret_const_char_ptr(ret_val);
6829        call_tests++;
6830        des_int(n_boolval, boolval, 0);
6831        xmlResetLastError();
6832        if (mem_base != xmlMemBlocks()) {
6833            printf("Leak of %d blocks found in xmlBoolToText",
6834	           xmlMemBlocks() - mem_base);
6835	    test_ret++;
6836            printf(" %d", n_boolval);
6837            printf("\n");
6838        }
6839    }
6840    function_tests++;
6841#endif
6842
6843    return(test_ret);
6844}
6845
6846
6847static int
6848test_xmlDebugCheckDocument(void) {
6849    int test_ret = 0;
6850
6851#if defined(LIBXML_DEBUG_ENABLED)
6852    int mem_base;
6853    int ret_val;
6854    FILE * output; /* the FILE * for the output */
6855    int n_output;
6856    xmlDocPtr doc; /* the document */
6857    int n_doc;
6858
6859    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6860    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6861        mem_base = xmlMemBlocks();
6862        output = gen_debug_FILE_ptr(n_output, 0);
6863        doc = gen_xmlDocPtr(n_doc, 1);
6864
6865        ret_val = xmlDebugCheckDocument(output, doc);
6866        desret_int(ret_val);
6867        call_tests++;
6868        des_debug_FILE_ptr(n_output, output, 0);
6869        des_xmlDocPtr(n_doc, doc, 1);
6870        xmlResetLastError();
6871        if (mem_base != xmlMemBlocks()) {
6872            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6873	           xmlMemBlocks() - mem_base);
6874	    test_ret++;
6875            printf(" %d", n_output);
6876            printf(" %d", n_doc);
6877            printf("\n");
6878        }
6879    }
6880    }
6881    function_tests++;
6882#endif
6883
6884    return(test_ret);
6885}
6886
6887
6888static int
6889test_xmlDebugDumpAttr(void) {
6890    int test_ret = 0;
6891
6892#if defined(LIBXML_DEBUG_ENABLED)
6893    int mem_base;
6894    FILE * output; /* the FILE * for the output */
6895    int n_output;
6896    xmlAttrPtr attr; /* the attribute */
6897    int n_attr;
6898    int depth; /* the indentation level. */
6899    int n_depth;
6900
6901    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6902    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6903    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6904        mem_base = xmlMemBlocks();
6905        output = gen_debug_FILE_ptr(n_output, 0);
6906        attr = gen_xmlAttrPtr(n_attr, 1);
6907        depth = gen_int(n_depth, 2);
6908
6909        xmlDebugDumpAttr(output, attr, depth);
6910        call_tests++;
6911        des_debug_FILE_ptr(n_output, output, 0);
6912        des_xmlAttrPtr(n_attr, attr, 1);
6913        des_int(n_depth, depth, 2);
6914        xmlResetLastError();
6915        if (mem_base != xmlMemBlocks()) {
6916            printf("Leak of %d blocks found in xmlDebugDumpAttr",
6917	           xmlMemBlocks() - mem_base);
6918	    test_ret++;
6919            printf(" %d", n_output);
6920            printf(" %d", n_attr);
6921            printf(" %d", n_depth);
6922            printf("\n");
6923        }
6924    }
6925    }
6926    }
6927    function_tests++;
6928#endif
6929
6930    return(test_ret);
6931}
6932
6933
6934static int
6935test_xmlDebugDumpAttrList(void) {
6936    int test_ret = 0;
6937
6938#if defined(LIBXML_DEBUG_ENABLED)
6939    int mem_base;
6940    FILE * output; /* the FILE * for the output */
6941    int n_output;
6942    xmlAttrPtr attr; /* the attribute list */
6943    int n_attr;
6944    int depth; /* the indentation level. */
6945    int n_depth;
6946
6947    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6948    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6949    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6950        mem_base = xmlMemBlocks();
6951        output = gen_debug_FILE_ptr(n_output, 0);
6952        attr = gen_xmlAttrPtr(n_attr, 1);
6953        depth = gen_int(n_depth, 2);
6954
6955        xmlDebugDumpAttrList(output, attr, depth);
6956        call_tests++;
6957        des_debug_FILE_ptr(n_output, output, 0);
6958        des_xmlAttrPtr(n_attr, attr, 1);
6959        des_int(n_depth, depth, 2);
6960        xmlResetLastError();
6961        if (mem_base != xmlMemBlocks()) {
6962            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
6963	           xmlMemBlocks() - mem_base);
6964	    test_ret++;
6965            printf(" %d", n_output);
6966            printf(" %d", n_attr);
6967            printf(" %d", n_depth);
6968            printf("\n");
6969        }
6970    }
6971    }
6972    }
6973    function_tests++;
6974#endif
6975
6976    return(test_ret);
6977}
6978
6979
6980static int
6981test_xmlDebugDumpDTD(void) {
6982    int test_ret = 0;
6983
6984#if defined(LIBXML_DEBUG_ENABLED)
6985    int mem_base;
6986    FILE * output; /* the FILE * for the output */
6987    int n_output;
6988    xmlDtdPtr dtd; /* the DTD */
6989    int n_dtd;
6990
6991    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6992    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
6993        mem_base = xmlMemBlocks();
6994        output = gen_debug_FILE_ptr(n_output, 0);
6995        dtd = gen_xmlDtdPtr(n_dtd, 1);
6996
6997        xmlDebugDumpDTD(output, dtd);
6998        call_tests++;
6999        des_debug_FILE_ptr(n_output, output, 0);
7000        des_xmlDtdPtr(n_dtd, dtd, 1);
7001        xmlResetLastError();
7002        if (mem_base != xmlMemBlocks()) {
7003            printf("Leak of %d blocks found in xmlDebugDumpDTD",
7004	           xmlMemBlocks() - mem_base);
7005	    test_ret++;
7006            printf(" %d", n_output);
7007            printf(" %d", n_dtd);
7008            printf("\n");
7009        }
7010    }
7011    }
7012    function_tests++;
7013#endif
7014
7015    return(test_ret);
7016}
7017
7018
7019static int
7020test_xmlDebugDumpDocument(void) {
7021    int test_ret = 0;
7022
7023#if defined(LIBXML_DEBUG_ENABLED)
7024    int mem_base;
7025    FILE * output; /* the FILE * for the output */
7026    int n_output;
7027    xmlDocPtr doc; /* the document */
7028    int n_doc;
7029
7030    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7031    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7032        mem_base = xmlMemBlocks();
7033        output = gen_debug_FILE_ptr(n_output, 0);
7034        doc = gen_xmlDocPtr(n_doc, 1);
7035
7036        xmlDebugDumpDocument(output, doc);
7037        call_tests++;
7038        des_debug_FILE_ptr(n_output, output, 0);
7039        des_xmlDocPtr(n_doc, doc, 1);
7040        xmlResetLastError();
7041        if (mem_base != xmlMemBlocks()) {
7042            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7043	           xmlMemBlocks() - mem_base);
7044	    test_ret++;
7045            printf(" %d", n_output);
7046            printf(" %d", n_doc);
7047            printf("\n");
7048        }
7049    }
7050    }
7051    function_tests++;
7052#endif
7053
7054    return(test_ret);
7055}
7056
7057
7058static int
7059test_xmlDebugDumpDocumentHead(void) {
7060    int test_ret = 0;
7061
7062#if defined(LIBXML_DEBUG_ENABLED)
7063    int mem_base;
7064    FILE * output; /* the FILE * for the output */
7065    int n_output;
7066    xmlDocPtr doc; /* the document */
7067    int n_doc;
7068
7069    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7070    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7071        mem_base = xmlMemBlocks();
7072        output = gen_debug_FILE_ptr(n_output, 0);
7073        doc = gen_xmlDocPtr(n_doc, 1);
7074
7075        xmlDebugDumpDocumentHead(output, doc);
7076        call_tests++;
7077        des_debug_FILE_ptr(n_output, output, 0);
7078        des_xmlDocPtr(n_doc, doc, 1);
7079        xmlResetLastError();
7080        if (mem_base != xmlMemBlocks()) {
7081            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7082	           xmlMemBlocks() - mem_base);
7083	    test_ret++;
7084            printf(" %d", n_output);
7085            printf(" %d", n_doc);
7086            printf("\n");
7087        }
7088    }
7089    }
7090    function_tests++;
7091#endif
7092
7093    return(test_ret);
7094}
7095
7096
7097static int
7098test_xmlDebugDumpEntities(void) {
7099    int test_ret = 0;
7100
7101#if defined(LIBXML_DEBUG_ENABLED)
7102    int mem_base;
7103    FILE * output; /* the FILE * for the output */
7104    int n_output;
7105    xmlDocPtr doc; /* the document */
7106    int n_doc;
7107
7108    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7109    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7110        mem_base = xmlMemBlocks();
7111        output = gen_debug_FILE_ptr(n_output, 0);
7112        doc = gen_xmlDocPtr(n_doc, 1);
7113
7114        xmlDebugDumpEntities(output, doc);
7115        call_tests++;
7116        des_debug_FILE_ptr(n_output, output, 0);
7117        des_xmlDocPtr(n_doc, doc, 1);
7118        xmlResetLastError();
7119        if (mem_base != xmlMemBlocks()) {
7120            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7121	           xmlMemBlocks() - mem_base);
7122	    test_ret++;
7123            printf(" %d", n_output);
7124            printf(" %d", n_doc);
7125            printf("\n");
7126        }
7127    }
7128    }
7129    function_tests++;
7130#endif
7131
7132    return(test_ret);
7133}
7134
7135
7136static int
7137test_xmlDebugDumpNode(void) {
7138    int test_ret = 0;
7139
7140#if defined(LIBXML_DEBUG_ENABLED)
7141    int mem_base;
7142    FILE * output; /* the FILE * for the output */
7143    int n_output;
7144    xmlNodePtr node; /* the node */
7145    int n_node;
7146    int depth; /* the indentation level. */
7147    int n_depth;
7148
7149    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7150    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7151    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7152        mem_base = xmlMemBlocks();
7153        output = gen_debug_FILE_ptr(n_output, 0);
7154        node = gen_xmlNodePtr(n_node, 1);
7155        depth = gen_int(n_depth, 2);
7156
7157        xmlDebugDumpNode(output, node, depth);
7158        call_tests++;
7159        des_debug_FILE_ptr(n_output, output, 0);
7160        des_xmlNodePtr(n_node, node, 1);
7161        des_int(n_depth, depth, 2);
7162        xmlResetLastError();
7163        if (mem_base != xmlMemBlocks()) {
7164            printf("Leak of %d blocks found in xmlDebugDumpNode",
7165	           xmlMemBlocks() - mem_base);
7166	    test_ret++;
7167            printf(" %d", n_output);
7168            printf(" %d", n_node);
7169            printf(" %d", n_depth);
7170            printf("\n");
7171        }
7172    }
7173    }
7174    }
7175    function_tests++;
7176#endif
7177
7178    return(test_ret);
7179}
7180
7181
7182static int
7183test_xmlDebugDumpNodeList(void) {
7184    int test_ret = 0;
7185
7186#if defined(LIBXML_DEBUG_ENABLED)
7187    int mem_base;
7188    FILE * output; /* the FILE * for the output */
7189    int n_output;
7190    xmlNodePtr node; /* the node list */
7191    int n_node;
7192    int depth; /* the indentation level. */
7193    int n_depth;
7194
7195    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7196    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7197    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7198        mem_base = xmlMemBlocks();
7199        output = gen_debug_FILE_ptr(n_output, 0);
7200        node = gen_xmlNodePtr(n_node, 1);
7201        depth = gen_int(n_depth, 2);
7202
7203        xmlDebugDumpNodeList(output, node, depth);
7204        call_tests++;
7205        des_debug_FILE_ptr(n_output, output, 0);
7206        des_xmlNodePtr(n_node, node, 1);
7207        des_int(n_depth, depth, 2);
7208        xmlResetLastError();
7209        if (mem_base != xmlMemBlocks()) {
7210            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7211	           xmlMemBlocks() - mem_base);
7212	    test_ret++;
7213            printf(" %d", n_output);
7214            printf(" %d", n_node);
7215            printf(" %d", n_depth);
7216            printf("\n");
7217        }
7218    }
7219    }
7220    }
7221    function_tests++;
7222#endif
7223
7224    return(test_ret);
7225}
7226
7227
7228static int
7229test_xmlDebugDumpOneNode(void) {
7230    int test_ret = 0;
7231
7232#if defined(LIBXML_DEBUG_ENABLED)
7233    int mem_base;
7234    FILE * output; /* the FILE * for the output */
7235    int n_output;
7236    xmlNodePtr node; /* the node */
7237    int n_node;
7238    int depth; /* the indentation level. */
7239    int n_depth;
7240
7241    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7242    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7243    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7244        mem_base = xmlMemBlocks();
7245        output = gen_debug_FILE_ptr(n_output, 0);
7246        node = gen_xmlNodePtr(n_node, 1);
7247        depth = gen_int(n_depth, 2);
7248
7249        xmlDebugDumpOneNode(output, node, depth);
7250        call_tests++;
7251        des_debug_FILE_ptr(n_output, output, 0);
7252        des_xmlNodePtr(n_node, node, 1);
7253        des_int(n_depth, depth, 2);
7254        xmlResetLastError();
7255        if (mem_base != xmlMemBlocks()) {
7256            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7257	           xmlMemBlocks() - mem_base);
7258	    test_ret++;
7259            printf(" %d", n_output);
7260            printf(" %d", n_node);
7261            printf(" %d", n_depth);
7262            printf("\n");
7263        }
7264    }
7265    }
7266    }
7267    function_tests++;
7268#endif
7269
7270    return(test_ret);
7271}
7272
7273
7274static int
7275test_xmlDebugDumpString(void) {
7276    int test_ret = 0;
7277
7278#if defined(LIBXML_DEBUG_ENABLED)
7279    int mem_base;
7280    FILE * output; /* the FILE * for the output */
7281    int n_output;
7282    xmlChar * str; /* the string */
7283    int n_str;
7284
7285    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7286    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7287        mem_base = xmlMemBlocks();
7288        output = gen_debug_FILE_ptr(n_output, 0);
7289        str = gen_const_xmlChar_ptr(n_str, 1);
7290
7291        xmlDebugDumpString(output, (const xmlChar *)str);
7292        call_tests++;
7293        des_debug_FILE_ptr(n_output, output, 0);
7294        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7295        xmlResetLastError();
7296        if (mem_base != xmlMemBlocks()) {
7297            printf("Leak of %d blocks found in xmlDebugDumpString",
7298	           xmlMemBlocks() - mem_base);
7299	    test_ret++;
7300            printf(" %d", n_output);
7301            printf(" %d", n_str);
7302            printf("\n");
7303        }
7304    }
7305    }
7306    function_tests++;
7307#endif
7308
7309    return(test_ret);
7310}
7311
7312
7313static int
7314test_xmlLsCountNode(void) {
7315    int test_ret = 0;
7316
7317#if defined(LIBXML_DEBUG_ENABLED)
7318    int mem_base;
7319    int ret_val;
7320    xmlNodePtr node; /* the node to count */
7321    int n_node;
7322
7323    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7324        mem_base = xmlMemBlocks();
7325        node = gen_xmlNodePtr(n_node, 0);
7326
7327        ret_val = xmlLsCountNode(node);
7328        desret_int(ret_val);
7329        call_tests++;
7330        des_xmlNodePtr(n_node, node, 0);
7331        xmlResetLastError();
7332        if (mem_base != xmlMemBlocks()) {
7333            printf("Leak of %d blocks found in xmlLsCountNode",
7334	           xmlMemBlocks() - mem_base);
7335	    test_ret++;
7336            printf(" %d", n_node);
7337            printf("\n");
7338        }
7339    }
7340    function_tests++;
7341#endif
7342
7343    return(test_ret);
7344}
7345
7346
7347static int
7348test_xmlLsOneNode(void) {
7349    int test_ret = 0;
7350
7351#if defined(LIBXML_DEBUG_ENABLED)
7352    int mem_base;
7353    FILE * output; /* the FILE * for the output */
7354    int n_output;
7355    xmlNodePtr node; /* the node to dump */
7356    int n_node;
7357
7358    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7359    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7360        mem_base = xmlMemBlocks();
7361        output = gen_debug_FILE_ptr(n_output, 0);
7362        node = gen_xmlNodePtr(n_node, 1);
7363
7364        xmlLsOneNode(output, node);
7365        call_tests++;
7366        des_debug_FILE_ptr(n_output, output, 0);
7367        des_xmlNodePtr(n_node, node, 1);
7368        xmlResetLastError();
7369        if (mem_base != xmlMemBlocks()) {
7370            printf("Leak of %d blocks found in xmlLsOneNode",
7371	           xmlMemBlocks() - mem_base);
7372	    test_ret++;
7373            printf(" %d", n_output);
7374            printf(" %d", n_node);
7375            printf("\n");
7376        }
7377    }
7378    }
7379    function_tests++;
7380#endif
7381
7382    return(test_ret);
7383}
7384
7385
7386#define gen_nb_char_ptr 1
7387static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7388    return(NULL);
7389}
7390static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7391}
7392
7393static int
7394test_xmlShell(void) {
7395    int test_ret = 0;
7396
7397
7398    /* missing type support */
7399    return(test_ret);
7400}
7401
7402
7403static int
7404test_xmlShellBase(void) {
7405    int test_ret = 0;
7406
7407#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7408    int mem_base;
7409    int ret_val;
7410    xmlShellCtxtPtr ctxt; /* the shell context */
7411    int n_ctxt;
7412    char * arg; /* unused */
7413    int n_arg;
7414    xmlNodePtr node; /* a node */
7415    int n_node;
7416    xmlNodePtr node2; /* unused */
7417    int n_node2;
7418
7419    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7420    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7421    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7422    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7423        mem_base = xmlMemBlocks();
7424        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7425        arg = gen_char_ptr(n_arg, 1);
7426        node = gen_xmlNodePtr(n_node, 2);
7427        node2 = gen_xmlNodePtr(n_node2, 3);
7428
7429        ret_val = xmlShellBase(ctxt, arg, node, node2);
7430        desret_int(ret_val);
7431        call_tests++;
7432        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7433        des_char_ptr(n_arg, arg, 1);
7434        des_xmlNodePtr(n_node, node, 2);
7435        des_xmlNodePtr(n_node2, node2, 3);
7436        xmlResetLastError();
7437        if (mem_base != xmlMemBlocks()) {
7438            printf("Leak of %d blocks found in xmlShellBase",
7439	           xmlMemBlocks() - mem_base);
7440	    test_ret++;
7441            printf(" %d", n_ctxt);
7442            printf(" %d", n_arg);
7443            printf(" %d", n_node);
7444            printf(" %d", n_node2);
7445            printf("\n");
7446        }
7447    }
7448    }
7449    }
7450    }
7451    function_tests++;
7452#endif
7453
7454    return(test_ret);
7455}
7456
7457
7458static int
7459test_xmlShellCat(void) {
7460    int test_ret = 0;
7461
7462#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7463    int mem_base;
7464    int ret_val;
7465    xmlShellCtxtPtr ctxt; /* the shell context */
7466    int n_ctxt;
7467    char * arg; /* unused */
7468    int n_arg;
7469    xmlNodePtr node; /* a node */
7470    int n_node;
7471    xmlNodePtr node2; /* unused */
7472    int n_node2;
7473
7474    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7475    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7476    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7477    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7478        mem_base = xmlMemBlocks();
7479        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7480        arg = gen_char_ptr(n_arg, 1);
7481        node = gen_xmlNodePtr(n_node, 2);
7482        node2 = gen_xmlNodePtr(n_node2, 3);
7483
7484        ret_val = xmlShellCat(ctxt, arg, node, node2);
7485        desret_int(ret_val);
7486        call_tests++;
7487        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7488        des_char_ptr(n_arg, arg, 1);
7489        des_xmlNodePtr(n_node, node, 2);
7490        des_xmlNodePtr(n_node2, node2, 3);
7491        xmlResetLastError();
7492        if (mem_base != xmlMemBlocks()) {
7493            printf("Leak of %d blocks found in xmlShellCat",
7494	           xmlMemBlocks() - mem_base);
7495	    test_ret++;
7496            printf(" %d", n_ctxt);
7497            printf(" %d", n_arg);
7498            printf(" %d", n_node);
7499            printf(" %d", n_node2);
7500            printf("\n");
7501        }
7502    }
7503    }
7504    }
7505    }
7506    function_tests++;
7507#endif
7508
7509    return(test_ret);
7510}
7511
7512
7513static int
7514test_xmlShellDir(void) {
7515    int test_ret = 0;
7516
7517#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7518    int mem_base;
7519    int ret_val;
7520    xmlShellCtxtPtr ctxt; /* the shell context */
7521    int n_ctxt;
7522    char * arg; /* unused */
7523    int n_arg;
7524    xmlNodePtr node; /* a node */
7525    int n_node;
7526    xmlNodePtr node2; /* unused */
7527    int n_node2;
7528
7529    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7530    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7531    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7532    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7533        mem_base = xmlMemBlocks();
7534        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7535        arg = gen_char_ptr(n_arg, 1);
7536        node = gen_xmlNodePtr(n_node, 2);
7537        node2 = gen_xmlNodePtr(n_node2, 3);
7538
7539        ret_val = xmlShellDir(ctxt, arg, node, node2);
7540        desret_int(ret_val);
7541        call_tests++;
7542        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7543        des_char_ptr(n_arg, arg, 1);
7544        des_xmlNodePtr(n_node, node, 2);
7545        des_xmlNodePtr(n_node2, node2, 3);
7546        xmlResetLastError();
7547        if (mem_base != xmlMemBlocks()) {
7548            printf("Leak of %d blocks found in xmlShellDir",
7549	           xmlMemBlocks() - mem_base);
7550	    test_ret++;
7551            printf(" %d", n_ctxt);
7552            printf(" %d", n_arg);
7553            printf(" %d", n_node);
7554            printf(" %d", n_node2);
7555            printf("\n");
7556        }
7557    }
7558    }
7559    }
7560    }
7561    function_tests++;
7562#endif
7563
7564    return(test_ret);
7565}
7566
7567
7568static int
7569test_xmlShellDu(void) {
7570    int test_ret = 0;
7571
7572#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7573    int mem_base;
7574    int ret_val;
7575    xmlShellCtxtPtr ctxt; /* the shell context */
7576    int n_ctxt;
7577    char * arg; /* unused */
7578    int n_arg;
7579    xmlNodePtr tree; /* a node defining a subtree */
7580    int n_tree;
7581    xmlNodePtr node2; /* unused */
7582    int n_node2;
7583
7584    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7585    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7586    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7587    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7588        mem_base = xmlMemBlocks();
7589        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7590        arg = gen_char_ptr(n_arg, 1);
7591        tree = gen_xmlNodePtr(n_tree, 2);
7592        node2 = gen_xmlNodePtr(n_node2, 3);
7593
7594        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7595        desret_int(ret_val);
7596        call_tests++;
7597        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7598        des_char_ptr(n_arg, arg, 1);
7599        des_xmlNodePtr(n_tree, tree, 2);
7600        des_xmlNodePtr(n_node2, node2, 3);
7601        xmlResetLastError();
7602        if (mem_base != xmlMemBlocks()) {
7603            printf("Leak of %d blocks found in xmlShellDu",
7604	           xmlMemBlocks() - mem_base);
7605	    test_ret++;
7606            printf(" %d", n_ctxt);
7607            printf(" %d", n_arg);
7608            printf(" %d", n_tree);
7609            printf(" %d", n_node2);
7610            printf("\n");
7611        }
7612    }
7613    }
7614    }
7615    }
7616    function_tests++;
7617#endif
7618
7619    return(test_ret);
7620}
7621
7622
7623static int
7624test_xmlShellList(void) {
7625    int test_ret = 0;
7626
7627#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7628    int mem_base;
7629    int ret_val;
7630    xmlShellCtxtPtr ctxt; /* the shell context */
7631    int n_ctxt;
7632    char * arg; /* unused */
7633    int n_arg;
7634    xmlNodePtr node; /* a node */
7635    int n_node;
7636    xmlNodePtr node2; /* unused */
7637    int n_node2;
7638
7639    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7640    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7641    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7642    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7643        mem_base = xmlMemBlocks();
7644        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7645        arg = gen_char_ptr(n_arg, 1);
7646        node = gen_xmlNodePtr(n_node, 2);
7647        node2 = gen_xmlNodePtr(n_node2, 3);
7648
7649        ret_val = xmlShellList(ctxt, arg, node, node2);
7650        desret_int(ret_val);
7651        call_tests++;
7652        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7653        des_char_ptr(n_arg, arg, 1);
7654        des_xmlNodePtr(n_node, node, 2);
7655        des_xmlNodePtr(n_node2, node2, 3);
7656        xmlResetLastError();
7657        if (mem_base != xmlMemBlocks()) {
7658            printf("Leak of %d blocks found in xmlShellList",
7659	           xmlMemBlocks() - mem_base);
7660	    test_ret++;
7661            printf(" %d", n_ctxt);
7662            printf(" %d", n_arg);
7663            printf(" %d", n_node);
7664            printf(" %d", n_node2);
7665            printf("\n");
7666        }
7667    }
7668    }
7669    }
7670    }
7671    function_tests++;
7672#endif
7673
7674    return(test_ret);
7675}
7676
7677
7678static int
7679test_xmlShellLoad(void) {
7680    int test_ret = 0;
7681
7682#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7683    int mem_base;
7684    int ret_val;
7685    xmlShellCtxtPtr ctxt; /* the shell context */
7686    int n_ctxt;
7687    char * filename; /* the file name */
7688    int n_filename;
7689    xmlNodePtr node; /* unused */
7690    int n_node;
7691    xmlNodePtr node2; /* unused */
7692    int n_node2;
7693
7694    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7695    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7696    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7697    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7698        mem_base = xmlMemBlocks();
7699        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7700        filename = gen_char_ptr(n_filename, 1);
7701        node = gen_xmlNodePtr(n_node, 2);
7702        node2 = gen_xmlNodePtr(n_node2, 3);
7703
7704        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7705        desret_int(ret_val);
7706        call_tests++;
7707        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7708        des_char_ptr(n_filename, filename, 1);
7709        des_xmlNodePtr(n_node, node, 2);
7710        des_xmlNodePtr(n_node2, node2, 3);
7711        xmlResetLastError();
7712        if (mem_base != xmlMemBlocks()) {
7713            printf("Leak of %d blocks found in xmlShellLoad",
7714	           xmlMemBlocks() - mem_base);
7715	    test_ret++;
7716            printf(" %d", n_ctxt);
7717            printf(" %d", n_filename);
7718            printf(" %d", n_node);
7719            printf(" %d", n_node2);
7720            printf("\n");
7721        }
7722    }
7723    }
7724    }
7725    }
7726    function_tests++;
7727#endif
7728
7729    return(test_ret);
7730}
7731
7732
7733static int
7734test_xmlShellPrintXPathResult(void) {
7735    int test_ret = 0;
7736
7737#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7738    int mem_base;
7739    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7740    int n_list;
7741
7742    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7743        mem_base = xmlMemBlocks();
7744        list = gen_xmlXPathObjectPtr(n_list, 0);
7745
7746        xmlShellPrintXPathResult(list);
7747        call_tests++;
7748        des_xmlXPathObjectPtr(n_list, list, 0);
7749        xmlResetLastError();
7750        if (mem_base != xmlMemBlocks()) {
7751            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7752	           xmlMemBlocks() - mem_base);
7753	    test_ret++;
7754            printf(" %d", n_list);
7755            printf("\n");
7756        }
7757    }
7758    function_tests++;
7759#endif
7760
7761    return(test_ret);
7762}
7763
7764
7765static int
7766test_xmlShellPwd(void) {
7767    int test_ret = 0;
7768
7769#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7770    int mem_base;
7771    int ret_val;
7772    xmlShellCtxtPtr ctxt; /* the shell context */
7773    int n_ctxt;
7774    char * buffer; /* the output buffer */
7775    int n_buffer;
7776    xmlNodePtr node; /* a node */
7777    int n_node;
7778    xmlNodePtr node2; /* unused */
7779    int n_node2;
7780
7781    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7782    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7783    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7784    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7785        mem_base = xmlMemBlocks();
7786        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7787        buffer = gen_char_ptr(n_buffer, 1);
7788        node = gen_xmlNodePtr(n_node, 2);
7789        node2 = gen_xmlNodePtr(n_node2, 3);
7790
7791        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7792        desret_int(ret_val);
7793        call_tests++;
7794        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7795        des_char_ptr(n_buffer, buffer, 1);
7796        des_xmlNodePtr(n_node, node, 2);
7797        des_xmlNodePtr(n_node2, node2, 3);
7798        xmlResetLastError();
7799        if (mem_base != xmlMemBlocks()) {
7800            printf("Leak of %d blocks found in xmlShellPwd",
7801	           xmlMemBlocks() - mem_base);
7802	    test_ret++;
7803            printf(" %d", n_ctxt);
7804            printf(" %d", n_buffer);
7805            printf(" %d", n_node);
7806            printf(" %d", n_node2);
7807            printf("\n");
7808        }
7809    }
7810    }
7811    }
7812    }
7813    function_tests++;
7814#endif
7815
7816    return(test_ret);
7817}
7818
7819
7820static int
7821test_xmlShellSave(void) {
7822    int test_ret = 0;
7823
7824#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7825    int mem_base;
7826    int ret_val;
7827    xmlShellCtxtPtr ctxt; /* the shell context */
7828    int n_ctxt;
7829    char * filename; /* the file name (optional) */
7830    int n_filename;
7831    xmlNodePtr node; /* unused */
7832    int n_node;
7833    xmlNodePtr node2; /* unused */
7834    int n_node2;
7835
7836    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7837    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7838    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7839    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7840        mem_base = xmlMemBlocks();
7841        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7842        filename = gen_char_ptr(n_filename, 1);
7843        node = gen_xmlNodePtr(n_node, 2);
7844        node2 = gen_xmlNodePtr(n_node2, 3);
7845
7846        ret_val = xmlShellSave(ctxt, filename, node, node2);
7847        desret_int(ret_val);
7848        call_tests++;
7849        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7850        des_char_ptr(n_filename, filename, 1);
7851        des_xmlNodePtr(n_node, node, 2);
7852        des_xmlNodePtr(n_node2, node2, 3);
7853        xmlResetLastError();
7854        if (mem_base != xmlMemBlocks()) {
7855            printf("Leak of %d blocks found in xmlShellSave",
7856	           xmlMemBlocks() - mem_base);
7857	    test_ret++;
7858            printf(" %d", n_ctxt);
7859            printf(" %d", n_filename);
7860            printf(" %d", n_node);
7861            printf(" %d", n_node2);
7862            printf("\n");
7863        }
7864    }
7865    }
7866    }
7867    }
7868    function_tests++;
7869#endif
7870
7871    return(test_ret);
7872}
7873
7874
7875static int
7876test_xmlShellValidate(void) {
7877    int test_ret = 0;
7878
7879#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7880    int mem_base;
7881    int ret_val;
7882    xmlShellCtxtPtr ctxt; /* the shell context */
7883    int n_ctxt;
7884    char * dtd; /* the DTD URI (optional) */
7885    int n_dtd;
7886    xmlNodePtr node; /* unused */
7887    int n_node;
7888    xmlNodePtr node2; /* unused */
7889    int n_node2;
7890
7891    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7892    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7893    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7894    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7895        mem_base = xmlMemBlocks();
7896        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7897        dtd = gen_char_ptr(n_dtd, 1);
7898        node = gen_xmlNodePtr(n_node, 2);
7899        node2 = gen_xmlNodePtr(n_node2, 3);
7900
7901        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
7902        desret_int(ret_val);
7903        call_tests++;
7904        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7905        des_char_ptr(n_dtd, dtd, 1);
7906        des_xmlNodePtr(n_node, node, 2);
7907        des_xmlNodePtr(n_node2, node2, 3);
7908        xmlResetLastError();
7909        if (mem_base != xmlMemBlocks()) {
7910            printf("Leak of %d blocks found in xmlShellValidate",
7911	           xmlMemBlocks() - mem_base);
7912	    test_ret++;
7913            printf(" %d", n_ctxt);
7914            printf(" %d", n_dtd);
7915            printf(" %d", n_node);
7916            printf(" %d", n_node2);
7917            printf("\n");
7918        }
7919    }
7920    }
7921    }
7922    }
7923    function_tests++;
7924#endif
7925
7926    return(test_ret);
7927}
7928
7929
7930static int
7931test_xmlShellWrite(void) {
7932    int test_ret = 0;
7933
7934#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7935    int mem_base;
7936    int ret_val;
7937    xmlShellCtxtPtr ctxt; /* the shell context */
7938    int n_ctxt;
7939    char * filename; /* the file name */
7940    int n_filename;
7941    xmlNodePtr node; /* a node in the tree */
7942    int n_node;
7943    xmlNodePtr node2; /* unused */
7944    int n_node2;
7945
7946    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7947    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7948    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7949    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7950        mem_base = xmlMemBlocks();
7951        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7952        filename = gen_char_ptr(n_filename, 1);
7953        node = gen_xmlNodePtr(n_node, 2);
7954        node2 = gen_xmlNodePtr(n_node2, 3);
7955
7956        ret_val = xmlShellWrite(ctxt, filename, node, node2);
7957        desret_int(ret_val);
7958        call_tests++;
7959        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7960        des_char_ptr(n_filename, filename, 1);
7961        des_xmlNodePtr(n_node, node, 2);
7962        des_xmlNodePtr(n_node2, node2, 3);
7963        xmlResetLastError();
7964        if (mem_base != xmlMemBlocks()) {
7965            printf("Leak of %d blocks found in xmlShellWrite",
7966	           xmlMemBlocks() - mem_base);
7967	    test_ret++;
7968            printf(" %d", n_ctxt);
7969            printf(" %d", n_filename);
7970            printf(" %d", n_node);
7971            printf(" %d", n_node2);
7972            printf("\n");
7973        }
7974    }
7975    }
7976    }
7977    }
7978    function_tests++;
7979#endif
7980
7981    return(test_ret);
7982}
7983
7984static int
7985test_debugXML(void) {
7986    int test_ret = 0;
7987
7988    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
7989    test_ret += test_xmlBoolToText();
7990    test_ret += test_xmlDebugCheckDocument();
7991    test_ret += test_xmlDebugDumpAttr();
7992    test_ret += test_xmlDebugDumpAttrList();
7993    test_ret += test_xmlDebugDumpDTD();
7994    test_ret += test_xmlDebugDumpDocument();
7995    test_ret += test_xmlDebugDumpDocumentHead();
7996    test_ret += test_xmlDebugDumpEntities();
7997    test_ret += test_xmlDebugDumpNode();
7998    test_ret += test_xmlDebugDumpNodeList();
7999    test_ret += test_xmlDebugDumpOneNode();
8000    test_ret += test_xmlDebugDumpString();
8001    test_ret += test_xmlLsCountNode();
8002    test_ret += test_xmlLsOneNode();
8003    test_ret += test_xmlShell();
8004    test_ret += test_xmlShellBase();
8005    test_ret += test_xmlShellCat();
8006    test_ret += test_xmlShellDir();
8007    test_ret += test_xmlShellDu();
8008    test_ret += test_xmlShellList();
8009    test_ret += test_xmlShellLoad();
8010    test_ret += test_xmlShellPrintXPathResult();
8011    test_ret += test_xmlShellPwd();
8012    test_ret += test_xmlShellSave();
8013    test_ret += test_xmlShellValidate();
8014    test_ret += test_xmlShellWrite();
8015
8016    if (test_ret != 0)
8017	printf("Module debugXML: %d errors\n", test_ret);
8018    return(test_ret);
8019}
8020
8021static int
8022test_xmlDictCleanup(void) {
8023    int test_ret = 0;
8024
8025    int mem_base;
8026
8027        mem_base = xmlMemBlocks();
8028
8029        xmlDictCleanup();
8030        call_tests++;
8031        xmlResetLastError();
8032        if (mem_base != xmlMemBlocks()) {
8033            printf("Leak of %d blocks found in xmlDictCleanup",
8034	           xmlMemBlocks() - mem_base);
8035	    test_ret++;
8036            printf("\n");
8037        }
8038    function_tests++;
8039
8040    return(test_ret);
8041}
8042
8043
8044static int
8045test_xmlDictCreate(void) {
8046    int test_ret = 0;
8047
8048    int mem_base;
8049    xmlDictPtr ret_val;
8050
8051        mem_base = xmlMemBlocks();
8052
8053        ret_val = xmlDictCreate();
8054        desret_xmlDictPtr(ret_val);
8055        call_tests++;
8056        xmlResetLastError();
8057        if (mem_base != xmlMemBlocks()) {
8058            printf("Leak of %d blocks found in xmlDictCreate",
8059	           xmlMemBlocks() - mem_base);
8060	    test_ret++;
8061            printf("\n");
8062        }
8063    function_tests++;
8064
8065    return(test_ret);
8066}
8067
8068
8069static int
8070test_xmlDictCreateSub(void) {
8071    int test_ret = 0;
8072
8073    int mem_base;
8074    xmlDictPtr ret_val;
8075    xmlDictPtr sub; /* an existing dictionnary */
8076    int n_sub;
8077
8078    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8079        mem_base = xmlMemBlocks();
8080        sub = gen_xmlDictPtr(n_sub, 0);
8081
8082        ret_val = xmlDictCreateSub(sub);
8083        desret_xmlDictPtr(ret_val);
8084        call_tests++;
8085        des_xmlDictPtr(n_sub, sub, 0);
8086        xmlResetLastError();
8087        if (mem_base != xmlMemBlocks()) {
8088            printf("Leak of %d blocks found in xmlDictCreateSub",
8089	           xmlMemBlocks() - mem_base);
8090	    test_ret++;
8091            printf(" %d", n_sub);
8092            printf("\n");
8093        }
8094    }
8095    function_tests++;
8096
8097    return(test_ret);
8098}
8099
8100
8101static int
8102test_xmlDictExists(void) {
8103    int test_ret = 0;
8104
8105    int mem_base;
8106    const xmlChar * ret_val;
8107    xmlDictPtr dict; /* the dictionnary */
8108    int n_dict;
8109    xmlChar * name; /* the name of the userdata */
8110    int n_name;
8111    int len; /* the length of the name, if -1 it is recomputed */
8112    int n_len;
8113
8114    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8115    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8116    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8117        mem_base = xmlMemBlocks();
8118        dict = gen_xmlDictPtr(n_dict, 0);
8119        name = gen_const_xmlChar_ptr(n_name, 1);
8120        len = gen_int(n_len, 2);
8121
8122        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8123        desret_const_xmlChar_ptr(ret_val);
8124        call_tests++;
8125        des_xmlDictPtr(n_dict, dict, 0);
8126        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8127        des_int(n_len, len, 2);
8128        xmlResetLastError();
8129        if (mem_base != xmlMemBlocks()) {
8130            printf("Leak of %d blocks found in xmlDictExists",
8131	           xmlMemBlocks() - mem_base);
8132	    test_ret++;
8133            printf(" %d", n_dict);
8134            printf(" %d", n_name);
8135            printf(" %d", n_len);
8136            printf("\n");
8137        }
8138    }
8139    }
8140    }
8141    function_tests++;
8142
8143    return(test_ret);
8144}
8145
8146
8147static int
8148test_xmlDictLookup(void) {
8149    int test_ret = 0;
8150
8151    int mem_base;
8152    const xmlChar * ret_val;
8153    xmlDictPtr dict; /* the dictionnary */
8154    int n_dict;
8155    xmlChar * name; /* the name of the userdata */
8156    int n_name;
8157    int len; /* the length of the name, if -1 it is recomputed */
8158    int n_len;
8159
8160    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8161    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8162    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8163        mem_base = xmlMemBlocks();
8164        dict = gen_xmlDictPtr(n_dict, 0);
8165        name = gen_const_xmlChar_ptr(n_name, 1);
8166        len = gen_int(n_len, 2);
8167
8168        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8169        desret_const_xmlChar_ptr(ret_val);
8170        call_tests++;
8171        des_xmlDictPtr(n_dict, dict, 0);
8172        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8173        des_int(n_len, len, 2);
8174        xmlResetLastError();
8175        if (mem_base != xmlMemBlocks()) {
8176            printf("Leak of %d blocks found in xmlDictLookup",
8177	           xmlMemBlocks() - mem_base);
8178	    test_ret++;
8179            printf(" %d", n_dict);
8180            printf(" %d", n_name);
8181            printf(" %d", n_len);
8182            printf("\n");
8183        }
8184    }
8185    }
8186    }
8187    function_tests++;
8188
8189    return(test_ret);
8190}
8191
8192
8193static int
8194test_xmlDictOwns(void) {
8195    int test_ret = 0;
8196
8197    int mem_base;
8198    int ret_val;
8199    xmlDictPtr dict; /* the dictionnary */
8200    int n_dict;
8201    xmlChar * str; /* the string */
8202    int n_str;
8203
8204    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8205    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8206        mem_base = xmlMemBlocks();
8207        dict = gen_xmlDictPtr(n_dict, 0);
8208        str = gen_const_xmlChar_ptr(n_str, 1);
8209
8210        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8211        desret_int(ret_val);
8212        call_tests++;
8213        des_xmlDictPtr(n_dict, dict, 0);
8214        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8215        xmlResetLastError();
8216        if (mem_base != xmlMemBlocks()) {
8217            printf("Leak of %d blocks found in xmlDictOwns",
8218	           xmlMemBlocks() - mem_base);
8219	    test_ret++;
8220            printf(" %d", n_dict);
8221            printf(" %d", n_str);
8222            printf("\n");
8223        }
8224    }
8225    }
8226    function_tests++;
8227
8228    return(test_ret);
8229}
8230
8231
8232static int
8233test_xmlDictQLookup(void) {
8234    int test_ret = 0;
8235
8236    int mem_base;
8237    const xmlChar * ret_val;
8238    xmlDictPtr dict; /* the dictionnary */
8239    int n_dict;
8240    xmlChar * prefix; /* the prefix */
8241    int n_prefix;
8242    xmlChar * name; /* the name */
8243    int n_name;
8244
8245    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8246    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8247    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8248        mem_base = xmlMemBlocks();
8249        dict = gen_xmlDictPtr(n_dict, 0);
8250        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8251        name = gen_const_xmlChar_ptr(n_name, 2);
8252
8253        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8254        desret_const_xmlChar_ptr(ret_val);
8255        call_tests++;
8256        des_xmlDictPtr(n_dict, dict, 0);
8257        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8258        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8259        xmlResetLastError();
8260        if (mem_base != xmlMemBlocks()) {
8261            printf("Leak of %d blocks found in xmlDictQLookup",
8262	           xmlMemBlocks() - mem_base);
8263	    test_ret++;
8264            printf(" %d", n_dict);
8265            printf(" %d", n_prefix);
8266            printf(" %d", n_name);
8267            printf("\n");
8268        }
8269    }
8270    }
8271    }
8272    function_tests++;
8273
8274    return(test_ret);
8275}
8276
8277
8278static int
8279test_xmlDictReference(void) {
8280    int test_ret = 0;
8281
8282    int mem_base;
8283    int ret_val;
8284    xmlDictPtr dict; /* the dictionnary */
8285    int n_dict;
8286
8287    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8288        mem_base = xmlMemBlocks();
8289        dict = gen_xmlDictPtr(n_dict, 0);
8290
8291        ret_val = xmlDictReference(dict);
8292        xmlDictFree(dict);
8293        desret_int(ret_val);
8294        call_tests++;
8295        des_xmlDictPtr(n_dict, dict, 0);
8296        xmlResetLastError();
8297        if (mem_base != xmlMemBlocks()) {
8298            printf("Leak of %d blocks found in xmlDictReference",
8299	           xmlMemBlocks() - mem_base);
8300	    test_ret++;
8301            printf(" %d", n_dict);
8302            printf("\n");
8303        }
8304    }
8305    function_tests++;
8306
8307    return(test_ret);
8308}
8309
8310
8311static int
8312test_xmlDictSize(void) {
8313    int test_ret = 0;
8314
8315    int mem_base;
8316    int ret_val;
8317    xmlDictPtr dict; /* the dictionnary */
8318    int n_dict;
8319
8320    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8321        mem_base = xmlMemBlocks();
8322        dict = gen_xmlDictPtr(n_dict, 0);
8323
8324        ret_val = xmlDictSize(dict);
8325        desret_int(ret_val);
8326        call_tests++;
8327        des_xmlDictPtr(n_dict, dict, 0);
8328        xmlResetLastError();
8329        if (mem_base != xmlMemBlocks()) {
8330            printf("Leak of %d blocks found in xmlDictSize",
8331	           xmlMemBlocks() - mem_base);
8332	    test_ret++;
8333            printf(" %d", n_dict);
8334            printf("\n");
8335        }
8336    }
8337    function_tests++;
8338
8339    return(test_ret);
8340}
8341
8342static int
8343test_dict(void) {
8344    int test_ret = 0;
8345
8346    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8347    test_ret += test_xmlDictCleanup();
8348    test_ret += test_xmlDictCreate();
8349    test_ret += test_xmlDictCreateSub();
8350    test_ret += test_xmlDictExists();
8351    test_ret += test_xmlDictLookup();
8352    test_ret += test_xmlDictOwns();
8353    test_ret += test_xmlDictQLookup();
8354    test_ret += test_xmlDictReference();
8355    test_ret += test_xmlDictSize();
8356
8357    if (test_ret != 0)
8358	printf("Module dict: %d errors\n", test_ret);
8359    return(test_ret);
8360}
8361
8362static int
8363test_UTF8Toisolat1(void) {
8364    int test_ret = 0;
8365
8366#if defined(LIBXML_OUTPUT_ENABLED)
8367#ifdef LIBXML_OUTPUT_ENABLED
8368    int mem_base;
8369    int ret_val;
8370    unsigned char * out; /* a pointer to an array of bytes to store the result */
8371    int n_out;
8372    int * outlen; /* the length of @out */
8373    int n_outlen;
8374    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8375    int n_in;
8376    int * inlen; /* the length of @in */
8377    int n_inlen;
8378
8379    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8380    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8381    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8382    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8383        mem_base = xmlMemBlocks();
8384        out = gen_unsigned_char_ptr(n_out, 0);
8385        outlen = gen_int_ptr(n_outlen, 1);
8386        in = gen_const_unsigned_char_ptr(n_in, 2);
8387        inlen = gen_int_ptr(n_inlen, 3);
8388
8389        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8390        desret_int(ret_val);
8391        call_tests++;
8392        des_unsigned_char_ptr(n_out, out, 0);
8393        des_int_ptr(n_outlen, outlen, 1);
8394        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8395        des_int_ptr(n_inlen, inlen, 3);
8396        xmlResetLastError();
8397        if (mem_base != xmlMemBlocks()) {
8398            printf("Leak of %d blocks found in UTF8Toisolat1",
8399	           xmlMemBlocks() - mem_base);
8400	    test_ret++;
8401            printf(" %d", n_out);
8402            printf(" %d", n_outlen);
8403            printf(" %d", n_in);
8404            printf(" %d", n_inlen);
8405            printf("\n");
8406        }
8407    }
8408    }
8409    }
8410    }
8411    function_tests++;
8412#endif
8413#endif
8414
8415    return(test_ret);
8416}
8417
8418
8419static int
8420test_isolat1ToUTF8(void) {
8421    int test_ret = 0;
8422
8423    int mem_base;
8424    int ret_val;
8425    unsigned char * out; /* a pointer to an array of bytes to store the result */
8426    int n_out;
8427    int * outlen; /* the length of @out */
8428    int n_outlen;
8429    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8430    int n_in;
8431    int * inlen; /* the length of @in */
8432    int n_inlen;
8433
8434    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8435    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8436    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8437    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8438        mem_base = xmlMemBlocks();
8439        out = gen_unsigned_char_ptr(n_out, 0);
8440        outlen = gen_int_ptr(n_outlen, 1);
8441        in = gen_const_unsigned_char_ptr(n_in, 2);
8442        inlen = gen_int_ptr(n_inlen, 3);
8443
8444        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8445        desret_int(ret_val);
8446        call_tests++;
8447        des_unsigned_char_ptr(n_out, out, 0);
8448        des_int_ptr(n_outlen, outlen, 1);
8449        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8450        des_int_ptr(n_inlen, inlen, 3);
8451        xmlResetLastError();
8452        if (mem_base != xmlMemBlocks()) {
8453            printf("Leak of %d blocks found in isolat1ToUTF8",
8454	           xmlMemBlocks() - mem_base);
8455	    test_ret++;
8456            printf(" %d", n_out);
8457            printf(" %d", n_outlen);
8458            printf(" %d", n_in);
8459            printf(" %d", n_inlen);
8460            printf("\n");
8461        }
8462    }
8463    }
8464    }
8465    }
8466    function_tests++;
8467
8468    return(test_ret);
8469}
8470
8471
8472static int
8473test_xmlAddEncodingAlias(void) {
8474    int test_ret = 0;
8475
8476    int ret_val;
8477    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8478    int n_name;
8479    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8480    int n_alias;
8481
8482    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8483    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8484        name = gen_const_char_ptr(n_name, 0);
8485        alias = gen_const_char_ptr(n_alias, 1);
8486
8487        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8488        desret_int(ret_val);
8489        call_tests++;
8490        des_const_char_ptr(n_name, (const char *)name, 0);
8491        des_const_char_ptr(n_alias, (const char *)alias, 1);
8492        xmlResetLastError();
8493    }
8494    }
8495    function_tests++;
8496
8497    return(test_ret);
8498}
8499
8500
8501#define gen_nb_xmlCharEncodingHandler_ptr 1
8502static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8503    return(NULL);
8504}
8505static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8506}
8507
8508static int
8509test_xmlCharEncCloseFunc(void) {
8510    int test_ret = 0;
8511
8512    int mem_base;
8513    int ret_val;
8514    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8515    int n_handler;
8516
8517    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8518        mem_base = xmlMemBlocks();
8519        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8520
8521        ret_val = xmlCharEncCloseFunc(handler);
8522        desret_int(ret_val);
8523        call_tests++;
8524        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8525        xmlResetLastError();
8526        if (mem_base != xmlMemBlocks()) {
8527            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8528	           xmlMemBlocks() - mem_base);
8529	    test_ret++;
8530            printf(" %d", n_handler);
8531            printf("\n");
8532        }
8533    }
8534    function_tests++;
8535
8536    return(test_ret);
8537}
8538
8539
8540static int
8541test_xmlCharEncFirstLine(void) {
8542    int test_ret = 0;
8543
8544    int mem_base;
8545    int ret_val;
8546    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8547    int n_handler;
8548    xmlBufferPtr out; /* an xmlBuffer for the output. */
8549    int n_out;
8550    xmlBufferPtr in; /* an xmlBuffer for the input */
8551    int n_in;
8552
8553    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8554    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8555    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8556        mem_base = xmlMemBlocks();
8557        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8558        out = gen_xmlBufferPtr(n_out, 1);
8559        in = gen_xmlBufferPtr(n_in, 2);
8560
8561        ret_val = xmlCharEncFirstLine(handler, out, in);
8562        desret_int(ret_val);
8563        call_tests++;
8564        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8565        des_xmlBufferPtr(n_out, out, 1);
8566        des_xmlBufferPtr(n_in, in, 2);
8567        xmlResetLastError();
8568        if (mem_base != xmlMemBlocks()) {
8569            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8570	           xmlMemBlocks() - mem_base);
8571	    test_ret++;
8572            printf(" %d", n_handler);
8573            printf(" %d", n_out);
8574            printf(" %d", n_in);
8575            printf("\n");
8576        }
8577    }
8578    }
8579    }
8580    function_tests++;
8581
8582    return(test_ret);
8583}
8584
8585
8586static int
8587test_xmlCharEncInFunc(void) {
8588    int test_ret = 0;
8589
8590    int mem_base;
8591    int ret_val;
8592    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8593    int n_handler;
8594    xmlBufferPtr out; /* an xmlBuffer for the output. */
8595    int n_out;
8596    xmlBufferPtr in; /* an xmlBuffer for the input */
8597    int n_in;
8598
8599    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8600    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8601    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8602        mem_base = xmlMemBlocks();
8603        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8604        out = gen_xmlBufferPtr(n_out, 1);
8605        in = gen_xmlBufferPtr(n_in, 2);
8606
8607        ret_val = xmlCharEncInFunc(handler, out, in);
8608        desret_int(ret_val);
8609        call_tests++;
8610        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8611        des_xmlBufferPtr(n_out, out, 1);
8612        des_xmlBufferPtr(n_in, in, 2);
8613        xmlResetLastError();
8614        if (mem_base != xmlMemBlocks()) {
8615            printf("Leak of %d blocks found in xmlCharEncInFunc",
8616	           xmlMemBlocks() - mem_base);
8617	    test_ret++;
8618            printf(" %d", n_handler);
8619            printf(" %d", n_out);
8620            printf(" %d", n_in);
8621            printf("\n");
8622        }
8623    }
8624    }
8625    }
8626    function_tests++;
8627
8628    return(test_ret);
8629}
8630
8631
8632static int
8633test_xmlCharEncOutFunc(void) {
8634    int test_ret = 0;
8635
8636    int mem_base;
8637    int ret_val;
8638    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8639    int n_handler;
8640    xmlBufferPtr out; /* an xmlBuffer for the output. */
8641    int n_out;
8642    xmlBufferPtr in; /* an xmlBuffer for the input */
8643    int n_in;
8644
8645    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8646    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8647    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8648        mem_base = xmlMemBlocks();
8649        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8650        out = gen_xmlBufferPtr(n_out, 1);
8651        in = gen_xmlBufferPtr(n_in, 2);
8652
8653        ret_val = xmlCharEncOutFunc(handler, out, in);
8654        desret_int(ret_val);
8655        call_tests++;
8656        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8657        des_xmlBufferPtr(n_out, out, 1);
8658        des_xmlBufferPtr(n_in, in, 2);
8659        xmlResetLastError();
8660        if (mem_base != xmlMemBlocks()) {
8661            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8662	           xmlMemBlocks() - mem_base);
8663	    test_ret++;
8664            printf(" %d", n_handler);
8665            printf(" %d", n_out);
8666            printf(" %d", n_in);
8667            printf("\n");
8668        }
8669    }
8670    }
8671    }
8672    function_tests++;
8673
8674    return(test_ret);
8675}
8676
8677
8678static int
8679test_xmlCleanupCharEncodingHandlers(void) {
8680    int test_ret = 0;
8681
8682
8683
8684        xmlCleanupCharEncodingHandlers();
8685        call_tests++;
8686        xmlResetLastError();
8687    function_tests++;
8688
8689    return(test_ret);
8690}
8691
8692
8693static int
8694test_xmlCleanupEncodingAliases(void) {
8695    int test_ret = 0;
8696
8697    int mem_base;
8698
8699        mem_base = xmlMemBlocks();
8700
8701        xmlCleanupEncodingAliases();
8702        call_tests++;
8703        xmlResetLastError();
8704        if (mem_base != xmlMemBlocks()) {
8705            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8706	           xmlMemBlocks() - mem_base);
8707	    test_ret++;
8708            printf("\n");
8709        }
8710    function_tests++;
8711
8712    return(test_ret);
8713}
8714
8715
8716static int
8717test_xmlDelEncodingAlias(void) {
8718    int test_ret = 0;
8719
8720    int mem_base;
8721    int ret_val;
8722    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8723    int n_alias;
8724
8725    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8726        mem_base = xmlMemBlocks();
8727        alias = gen_const_char_ptr(n_alias, 0);
8728
8729        ret_val = xmlDelEncodingAlias((const char *)alias);
8730        desret_int(ret_val);
8731        call_tests++;
8732        des_const_char_ptr(n_alias, (const char *)alias, 0);
8733        xmlResetLastError();
8734        if (mem_base != xmlMemBlocks()) {
8735            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8736	           xmlMemBlocks() - mem_base);
8737	    test_ret++;
8738            printf(" %d", n_alias);
8739            printf("\n");
8740        }
8741    }
8742    function_tests++;
8743
8744    return(test_ret);
8745}
8746
8747
8748static int
8749test_xmlDetectCharEncoding(void) {
8750    int test_ret = 0;
8751
8752    int mem_base;
8753    xmlCharEncoding ret_val;
8754    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). */
8755    int n_in;
8756    int len; /* pointer to the length of the buffer */
8757    int n_len;
8758
8759    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8760    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8761        mem_base = xmlMemBlocks();
8762        in = gen_const_unsigned_char_ptr(n_in, 0);
8763        len = gen_int(n_len, 1);
8764
8765        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8766        desret_xmlCharEncoding(ret_val);
8767        call_tests++;
8768        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8769        des_int(n_len, len, 1);
8770        xmlResetLastError();
8771        if (mem_base != xmlMemBlocks()) {
8772            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8773	           xmlMemBlocks() - mem_base);
8774	    test_ret++;
8775            printf(" %d", n_in);
8776            printf(" %d", n_len);
8777            printf("\n");
8778        }
8779    }
8780    }
8781    function_tests++;
8782
8783    return(test_ret);
8784}
8785
8786
8787static int
8788test_xmlFindCharEncodingHandler(void) {
8789    int test_ret = 0;
8790
8791
8792    /* missing type support */
8793    return(test_ret);
8794}
8795
8796
8797static int
8798test_xmlGetCharEncodingHandler(void) {
8799    int test_ret = 0;
8800
8801
8802    /* missing type support */
8803    return(test_ret);
8804}
8805
8806
8807static int
8808test_xmlGetCharEncodingName(void) {
8809    int test_ret = 0;
8810
8811    int mem_base;
8812    const char * ret_val;
8813    xmlCharEncoding enc; /* the encoding */
8814    int n_enc;
8815
8816    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8817        mem_base = xmlMemBlocks();
8818        enc = gen_xmlCharEncoding(n_enc, 0);
8819
8820        ret_val = xmlGetCharEncodingName(enc);
8821        desret_const_char_ptr(ret_val);
8822        call_tests++;
8823        des_xmlCharEncoding(n_enc, enc, 0);
8824        xmlResetLastError();
8825        if (mem_base != xmlMemBlocks()) {
8826            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8827	           xmlMemBlocks() - mem_base);
8828	    test_ret++;
8829            printf(" %d", n_enc);
8830            printf("\n");
8831        }
8832    }
8833    function_tests++;
8834
8835    return(test_ret);
8836}
8837
8838
8839static int
8840test_xmlGetEncodingAlias(void) {
8841    int test_ret = 0;
8842
8843    int mem_base;
8844    const char * ret_val;
8845    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8846    int n_alias;
8847
8848    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8849        mem_base = xmlMemBlocks();
8850        alias = gen_const_char_ptr(n_alias, 0);
8851
8852        ret_val = xmlGetEncodingAlias((const char *)alias);
8853        desret_const_char_ptr(ret_val);
8854        call_tests++;
8855        des_const_char_ptr(n_alias, (const char *)alias, 0);
8856        xmlResetLastError();
8857        if (mem_base != xmlMemBlocks()) {
8858            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8859	           xmlMemBlocks() - mem_base);
8860	    test_ret++;
8861            printf(" %d", n_alias);
8862            printf("\n");
8863        }
8864    }
8865    function_tests++;
8866
8867    return(test_ret);
8868}
8869
8870
8871static int
8872test_xmlInitCharEncodingHandlers(void) {
8873    int test_ret = 0;
8874
8875
8876
8877        xmlInitCharEncodingHandlers();
8878        call_tests++;
8879        xmlResetLastError();
8880    function_tests++;
8881
8882    return(test_ret);
8883}
8884
8885
8886static int
8887test_xmlNewCharEncodingHandler(void) {
8888    int test_ret = 0;
8889
8890
8891    /* missing type support */
8892    return(test_ret);
8893}
8894
8895
8896static int
8897test_xmlParseCharEncoding(void) {
8898    int test_ret = 0;
8899
8900    int mem_base;
8901    xmlCharEncoding ret_val;
8902    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8903    int n_name;
8904
8905    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8906        mem_base = xmlMemBlocks();
8907        name = gen_const_char_ptr(n_name, 0);
8908
8909        ret_val = xmlParseCharEncoding((const char *)name);
8910        desret_xmlCharEncoding(ret_val);
8911        call_tests++;
8912        des_const_char_ptr(n_name, (const char *)name, 0);
8913        xmlResetLastError();
8914        if (mem_base != xmlMemBlocks()) {
8915            printf("Leak of %d blocks found in xmlParseCharEncoding",
8916	           xmlMemBlocks() - mem_base);
8917	    test_ret++;
8918            printf(" %d", n_name);
8919            printf("\n");
8920        }
8921    }
8922    function_tests++;
8923
8924    return(test_ret);
8925}
8926
8927
8928#define gen_nb_xmlCharEncodingHandlerPtr 1
8929static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8930    return(NULL);
8931}
8932static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8933}
8934
8935static int
8936test_xmlRegisterCharEncodingHandler(void) {
8937    int test_ret = 0;
8938
8939    int mem_base;
8940    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
8941    int n_handler;
8942
8943    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
8944        mem_base = xmlMemBlocks();
8945        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
8946
8947        xmlRegisterCharEncodingHandler(handler);
8948        call_tests++;
8949        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
8950        xmlResetLastError();
8951        if (mem_base != xmlMemBlocks()) {
8952            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
8953	           xmlMemBlocks() - mem_base);
8954	    test_ret++;
8955            printf(" %d", n_handler);
8956            printf("\n");
8957        }
8958    }
8959    function_tests++;
8960
8961    return(test_ret);
8962}
8963
8964static int
8965test_encoding(void) {
8966    int test_ret = 0;
8967
8968    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
8969    test_ret += test_UTF8Toisolat1();
8970    test_ret += test_isolat1ToUTF8();
8971    test_ret += test_xmlAddEncodingAlias();
8972    test_ret += test_xmlCharEncCloseFunc();
8973    test_ret += test_xmlCharEncFirstLine();
8974    test_ret += test_xmlCharEncInFunc();
8975    test_ret += test_xmlCharEncOutFunc();
8976    test_ret += test_xmlCleanupCharEncodingHandlers();
8977    test_ret += test_xmlCleanupEncodingAliases();
8978    test_ret += test_xmlDelEncodingAlias();
8979    test_ret += test_xmlDetectCharEncoding();
8980    test_ret += test_xmlFindCharEncodingHandler();
8981    test_ret += test_xmlGetCharEncodingHandler();
8982    test_ret += test_xmlGetCharEncodingName();
8983    test_ret += test_xmlGetEncodingAlias();
8984    test_ret += test_xmlInitCharEncodingHandlers();
8985    test_ret += test_xmlNewCharEncodingHandler();
8986    test_ret += test_xmlParseCharEncoding();
8987    test_ret += test_xmlRegisterCharEncodingHandler();
8988
8989    if (test_ret != 0)
8990	printf("Module encoding: %d errors\n", test_ret);
8991    return(test_ret);
8992}
8993
8994static int
8995test_xmlAddDocEntity(void) {
8996    int test_ret = 0;
8997
8998    int mem_base;
8999    xmlEntityPtr ret_val;
9000    xmlDocPtr doc; /* the document */
9001    int n_doc;
9002    xmlChar * name; /* the entity name */
9003    int n_name;
9004    int type; /* the entity type XML_xxx_yyy_ENTITY */
9005    int n_type;
9006    xmlChar * ExternalID; /* the entity external ID if available */
9007    int n_ExternalID;
9008    xmlChar * SystemID; /* the entity system ID if available */
9009    int n_SystemID;
9010    xmlChar * content; /* the entity content */
9011    int n_content;
9012
9013    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9014    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9015    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9016    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9017    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9018    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9019        mem_base = xmlMemBlocks();
9020        doc = gen_xmlDocPtr(n_doc, 0);
9021        name = gen_const_xmlChar_ptr(n_name, 1);
9022        type = gen_int(n_type, 2);
9023        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9024        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9025        content = gen_const_xmlChar_ptr(n_content, 5);
9026
9027        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9028        desret_xmlEntityPtr(ret_val);
9029        call_tests++;
9030        des_xmlDocPtr(n_doc, doc, 0);
9031        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9032        des_int(n_type, type, 2);
9033        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9034        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9035        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9036        xmlResetLastError();
9037        if (mem_base != xmlMemBlocks()) {
9038            printf("Leak of %d blocks found in xmlAddDocEntity",
9039	           xmlMemBlocks() - mem_base);
9040	    test_ret++;
9041            printf(" %d", n_doc);
9042            printf(" %d", n_name);
9043            printf(" %d", n_type);
9044            printf(" %d", n_ExternalID);
9045            printf(" %d", n_SystemID);
9046            printf(" %d", n_content);
9047            printf("\n");
9048        }
9049    }
9050    }
9051    }
9052    }
9053    }
9054    }
9055    function_tests++;
9056
9057    return(test_ret);
9058}
9059
9060
9061static int
9062test_xmlAddDtdEntity(void) {
9063    int test_ret = 0;
9064
9065    int mem_base;
9066    xmlEntityPtr ret_val;
9067    xmlDocPtr doc; /* the document */
9068    int n_doc;
9069    xmlChar * name; /* the entity name */
9070    int n_name;
9071    int type; /* the entity type XML_xxx_yyy_ENTITY */
9072    int n_type;
9073    xmlChar * ExternalID; /* the entity external ID if available */
9074    int n_ExternalID;
9075    xmlChar * SystemID; /* the entity system ID if available */
9076    int n_SystemID;
9077    xmlChar * content; /* the entity content */
9078    int n_content;
9079
9080    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9081    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9082    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9083    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9084    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9085    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9086        mem_base = xmlMemBlocks();
9087        doc = gen_xmlDocPtr(n_doc, 0);
9088        name = gen_const_xmlChar_ptr(n_name, 1);
9089        type = gen_int(n_type, 2);
9090        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9091        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9092        content = gen_const_xmlChar_ptr(n_content, 5);
9093
9094        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9095        desret_xmlEntityPtr(ret_val);
9096        call_tests++;
9097        des_xmlDocPtr(n_doc, doc, 0);
9098        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9099        des_int(n_type, type, 2);
9100        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9101        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9102        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9103        xmlResetLastError();
9104        if (mem_base != xmlMemBlocks()) {
9105            printf("Leak of %d blocks found in xmlAddDtdEntity",
9106	           xmlMemBlocks() - mem_base);
9107	    test_ret++;
9108            printf(" %d", n_doc);
9109            printf(" %d", n_name);
9110            printf(" %d", n_type);
9111            printf(" %d", n_ExternalID);
9112            printf(" %d", n_SystemID);
9113            printf(" %d", n_content);
9114            printf("\n");
9115        }
9116    }
9117    }
9118    }
9119    }
9120    }
9121    }
9122    function_tests++;
9123
9124    return(test_ret);
9125}
9126
9127
9128static int
9129test_xmlCleanupPredefinedEntities(void) {
9130    int test_ret = 0;
9131
9132#if defined(LIBXML_LEGACY_ENABLED)
9133#ifdef LIBXML_LEGACY_ENABLED
9134    int mem_base;
9135
9136        mem_base = xmlMemBlocks();
9137
9138        xmlCleanupPredefinedEntities();
9139        call_tests++;
9140        xmlResetLastError();
9141        if (mem_base != xmlMemBlocks()) {
9142            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9143	           xmlMemBlocks() - mem_base);
9144	    test_ret++;
9145            printf("\n");
9146        }
9147    function_tests++;
9148#endif
9149#endif
9150
9151    return(test_ret);
9152}
9153
9154
9155#define gen_nb_xmlEntitiesTablePtr 1
9156static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9157    return(NULL);
9158}
9159static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9160}
9161
9162static int
9163test_xmlCopyEntitiesTable(void) {
9164    int test_ret = 0;
9165
9166
9167    /* missing type support */
9168    return(test_ret);
9169}
9170
9171
9172static int
9173test_xmlCreateEntitiesTable(void) {
9174    int test_ret = 0;
9175
9176
9177    /* missing type support */
9178    return(test_ret);
9179}
9180
9181
9182static int
9183test_xmlDumpEntitiesTable(void) {
9184    int test_ret = 0;
9185
9186#if defined(LIBXML_OUTPUT_ENABLED)
9187    int mem_base;
9188    xmlBufferPtr buf; /* An XML buffer. */
9189    int n_buf;
9190    xmlEntitiesTablePtr table; /* An entity table */
9191    int n_table;
9192
9193    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9194    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9195        mem_base = xmlMemBlocks();
9196        buf = gen_xmlBufferPtr(n_buf, 0);
9197        table = gen_xmlEntitiesTablePtr(n_table, 1);
9198
9199        xmlDumpEntitiesTable(buf, table);
9200        call_tests++;
9201        des_xmlBufferPtr(n_buf, buf, 0);
9202        des_xmlEntitiesTablePtr(n_table, table, 1);
9203        xmlResetLastError();
9204        if (mem_base != xmlMemBlocks()) {
9205            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9206	           xmlMemBlocks() - mem_base);
9207	    test_ret++;
9208            printf(" %d", n_buf);
9209            printf(" %d", n_table);
9210            printf("\n");
9211        }
9212    }
9213    }
9214    function_tests++;
9215#endif
9216
9217    return(test_ret);
9218}
9219
9220
9221#define gen_nb_xmlEntityPtr 1
9222static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9223    return(NULL);
9224}
9225static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9226}
9227
9228static int
9229test_xmlDumpEntityDecl(void) {
9230    int test_ret = 0;
9231
9232#if defined(LIBXML_OUTPUT_ENABLED)
9233    int mem_base;
9234    xmlBufferPtr buf; /* An XML buffer. */
9235    int n_buf;
9236    xmlEntityPtr ent; /* An entity table */
9237    int n_ent;
9238
9239    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9240    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9241        mem_base = xmlMemBlocks();
9242        buf = gen_xmlBufferPtr(n_buf, 0);
9243        ent = gen_xmlEntityPtr(n_ent, 1);
9244
9245        xmlDumpEntityDecl(buf, ent);
9246        call_tests++;
9247        des_xmlBufferPtr(n_buf, buf, 0);
9248        des_xmlEntityPtr(n_ent, ent, 1);
9249        xmlResetLastError();
9250        if (mem_base != xmlMemBlocks()) {
9251            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9252	           xmlMemBlocks() - mem_base);
9253	    test_ret++;
9254            printf(" %d", n_buf);
9255            printf(" %d", n_ent);
9256            printf("\n");
9257        }
9258    }
9259    }
9260    function_tests++;
9261#endif
9262
9263    return(test_ret);
9264}
9265
9266
9267static int
9268test_xmlEncodeEntitiesReentrant(void) {
9269    int test_ret = 0;
9270
9271    int mem_base;
9272    xmlChar * ret_val;
9273    xmlDocPtr doc; /* the document containing the string */
9274    int n_doc;
9275    xmlChar * input; /* A string to convert to XML. */
9276    int n_input;
9277
9278    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9279    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9280        mem_base = xmlMemBlocks();
9281        doc = gen_xmlDocPtr(n_doc, 0);
9282        input = gen_const_xmlChar_ptr(n_input, 1);
9283
9284        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9285        desret_xmlChar_ptr(ret_val);
9286        call_tests++;
9287        des_xmlDocPtr(n_doc, doc, 0);
9288        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9289        xmlResetLastError();
9290        if (mem_base != xmlMemBlocks()) {
9291            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9292	           xmlMemBlocks() - mem_base);
9293	    test_ret++;
9294            printf(" %d", n_doc);
9295            printf(" %d", n_input);
9296            printf("\n");
9297        }
9298    }
9299    }
9300    function_tests++;
9301
9302    return(test_ret);
9303}
9304
9305
9306static int
9307test_xmlEncodeSpecialChars(void) {
9308    int test_ret = 0;
9309
9310    int mem_base;
9311    xmlChar * ret_val;
9312    xmlDocPtr doc; /* the document containing the string */
9313    int n_doc;
9314    xmlChar * input; /* A string to convert to XML. */
9315    int n_input;
9316
9317    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9318    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9319        mem_base = xmlMemBlocks();
9320        doc = gen_xmlDocPtr(n_doc, 0);
9321        input = gen_const_xmlChar_ptr(n_input, 1);
9322
9323        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9324        desret_xmlChar_ptr(ret_val);
9325        call_tests++;
9326        des_xmlDocPtr(n_doc, doc, 0);
9327        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9328        xmlResetLastError();
9329        if (mem_base != xmlMemBlocks()) {
9330            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9331	           xmlMemBlocks() - mem_base);
9332	    test_ret++;
9333            printf(" %d", n_doc);
9334            printf(" %d", n_input);
9335            printf("\n");
9336        }
9337    }
9338    }
9339    function_tests++;
9340
9341    return(test_ret);
9342}
9343
9344
9345static int
9346test_xmlGetDocEntity(void) {
9347    int test_ret = 0;
9348
9349    int mem_base;
9350    xmlEntityPtr ret_val;
9351    xmlDocPtr doc; /* the document referencing the entity */
9352    int n_doc;
9353    xmlChar * name; /* the entity name */
9354    int n_name;
9355
9356    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9357    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9358        mem_base = xmlMemBlocks();
9359        doc = gen_xmlDocPtr(n_doc, 0);
9360        name = gen_const_xmlChar_ptr(n_name, 1);
9361
9362        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9363        desret_xmlEntityPtr(ret_val);
9364        call_tests++;
9365        des_xmlDocPtr(n_doc, doc, 0);
9366        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9367        xmlResetLastError();
9368        if (mem_base != xmlMemBlocks()) {
9369            printf("Leak of %d blocks found in xmlGetDocEntity",
9370	           xmlMemBlocks() - mem_base);
9371	    test_ret++;
9372            printf(" %d", n_doc);
9373            printf(" %d", n_name);
9374            printf("\n");
9375        }
9376    }
9377    }
9378    function_tests++;
9379
9380    return(test_ret);
9381}
9382
9383
9384static int
9385test_xmlGetDtdEntity(void) {
9386    int test_ret = 0;
9387
9388    int mem_base;
9389    xmlEntityPtr ret_val;
9390    xmlDocPtr doc; /* the document referencing the entity */
9391    int n_doc;
9392    xmlChar * name; /* the entity name */
9393    int n_name;
9394
9395    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9396    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9397        mem_base = xmlMemBlocks();
9398        doc = gen_xmlDocPtr(n_doc, 0);
9399        name = gen_const_xmlChar_ptr(n_name, 1);
9400
9401        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9402        desret_xmlEntityPtr(ret_val);
9403        call_tests++;
9404        des_xmlDocPtr(n_doc, doc, 0);
9405        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9406        xmlResetLastError();
9407        if (mem_base != xmlMemBlocks()) {
9408            printf("Leak of %d blocks found in xmlGetDtdEntity",
9409	           xmlMemBlocks() - mem_base);
9410	    test_ret++;
9411            printf(" %d", n_doc);
9412            printf(" %d", n_name);
9413            printf("\n");
9414        }
9415    }
9416    }
9417    function_tests++;
9418
9419    return(test_ret);
9420}
9421
9422
9423static int
9424test_xmlGetParameterEntity(void) {
9425    int test_ret = 0;
9426
9427    int mem_base;
9428    xmlEntityPtr ret_val;
9429    xmlDocPtr doc; /* the document referencing the entity */
9430    int n_doc;
9431    xmlChar * name; /* the entity name */
9432    int n_name;
9433
9434    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9435    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9436        mem_base = xmlMemBlocks();
9437        doc = gen_xmlDocPtr(n_doc, 0);
9438        name = gen_const_xmlChar_ptr(n_name, 1);
9439
9440        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9441        desret_xmlEntityPtr(ret_val);
9442        call_tests++;
9443        des_xmlDocPtr(n_doc, doc, 0);
9444        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9445        xmlResetLastError();
9446        if (mem_base != xmlMemBlocks()) {
9447            printf("Leak of %d blocks found in xmlGetParameterEntity",
9448	           xmlMemBlocks() - mem_base);
9449	    test_ret++;
9450            printf(" %d", n_doc);
9451            printf(" %d", n_name);
9452            printf("\n");
9453        }
9454    }
9455    }
9456    function_tests++;
9457
9458    return(test_ret);
9459}
9460
9461
9462static int
9463test_xmlGetPredefinedEntity(void) {
9464    int test_ret = 0;
9465
9466    int mem_base;
9467    xmlEntityPtr ret_val;
9468    xmlChar * name; /* the entity name */
9469    int n_name;
9470
9471    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9472        mem_base = xmlMemBlocks();
9473        name = gen_const_xmlChar_ptr(n_name, 0);
9474
9475        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9476        desret_xmlEntityPtr(ret_val);
9477        call_tests++;
9478        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9479        xmlResetLastError();
9480        if (mem_base != xmlMemBlocks()) {
9481            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9482	           xmlMemBlocks() - mem_base);
9483	    test_ret++;
9484            printf(" %d", n_name);
9485            printf("\n");
9486        }
9487    }
9488    function_tests++;
9489
9490    return(test_ret);
9491}
9492
9493
9494static int
9495test_xmlInitializePredefinedEntities(void) {
9496    int test_ret = 0;
9497
9498#if defined(LIBXML_LEGACY_ENABLED)
9499#ifdef LIBXML_LEGACY_ENABLED
9500    int mem_base;
9501
9502        mem_base = xmlMemBlocks();
9503
9504        xmlInitializePredefinedEntities();
9505        call_tests++;
9506        xmlResetLastError();
9507        if (mem_base != xmlMemBlocks()) {
9508            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9509	           xmlMemBlocks() - mem_base);
9510	    test_ret++;
9511            printf("\n");
9512        }
9513    function_tests++;
9514#endif
9515#endif
9516
9517    return(test_ret);
9518}
9519
9520static int
9521test_entities(void) {
9522    int test_ret = 0;
9523
9524    if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
9525    test_ret += test_xmlAddDocEntity();
9526    test_ret += test_xmlAddDtdEntity();
9527    test_ret += test_xmlCleanupPredefinedEntities();
9528    test_ret += test_xmlCopyEntitiesTable();
9529    test_ret += test_xmlCreateEntitiesTable();
9530    test_ret += test_xmlDumpEntitiesTable();
9531    test_ret += test_xmlDumpEntityDecl();
9532    test_ret += test_xmlEncodeEntitiesReentrant();
9533    test_ret += test_xmlEncodeSpecialChars();
9534    test_ret += test_xmlGetDocEntity();
9535    test_ret += test_xmlGetDtdEntity();
9536    test_ret += test_xmlGetParameterEntity();
9537    test_ret += test_xmlGetPredefinedEntity();
9538    test_ret += test_xmlInitializePredefinedEntities();
9539
9540    if (test_ret != 0)
9541	printf("Module entities: %d errors\n", test_ret);
9542    return(test_ret);
9543}
9544
9545static int
9546test_xmlHashAddEntry(void) {
9547    int test_ret = 0;
9548
9549    int mem_base;
9550    int ret_val;
9551    xmlHashTablePtr table; /* the hash table */
9552    int n_table;
9553    xmlChar * name; /* the name of the userdata */
9554    int n_name;
9555    void * userdata; /* a pointer to the userdata */
9556    int n_userdata;
9557
9558    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9559    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9560    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9561        mem_base = xmlMemBlocks();
9562        table = gen_xmlHashTablePtr(n_table, 0);
9563        name = gen_const_xmlChar_ptr(n_name, 1);
9564        userdata = gen_userdata(n_userdata, 2);
9565
9566        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9567        desret_int(ret_val);
9568        call_tests++;
9569        des_xmlHashTablePtr(n_table, table, 0);
9570        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9571        des_userdata(n_userdata, userdata, 2);
9572        xmlResetLastError();
9573        if (mem_base != xmlMemBlocks()) {
9574            printf("Leak of %d blocks found in xmlHashAddEntry",
9575	           xmlMemBlocks() - mem_base);
9576	    test_ret++;
9577            printf(" %d", n_table);
9578            printf(" %d", n_name);
9579            printf(" %d", n_userdata);
9580            printf("\n");
9581        }
9582    }
9583    }
9584    }
9585    function_tests++;
9586
9587    return(test_ret);
9588}
9589
9590
9591static int
9592test_xmlHashAddEntry2(void) {
9593    int test_ret = 0;
9594
9595    int mem_base;
9596    int ret_val;
9597    xmlHashTablePtr table; /* the hash table */
9598    int n_table;
9599    xmlChar * name; /* the name of the userdata */
9600    int n_name;
9601    xmlChar * name2; /* a second name of the userdata */
9602    int n_name2;
9603    void * userdata; /* a pointer to the userdata */
9604    int n_userdata;
9605
9606    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9607    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9608    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9609    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9610        mem_base = xmlMemBlocks();
9611        table = gen_xmlHashTablePtr(n_table, 0);
9612        name = gen_const_xmlChar_ptr(n_name, 1);
9613        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9614        userdata = gen_userdata(n_userdata, 3);
9615
9616        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9617        desret_int(ret_val);
9618        call_tests++;
9619        des_xmlHashTablePtr(n_table, table, 0);
9620        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9621        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9622        des_userdata(n_userdata, userdata, 3);
9623        xmlResetLastError();
9624        if (mem_base != xmlMemBlocks()) {
9625            printf("Leak of %d blocks found in xmlHashAddEntry2",
9626	           xmlMemBlocks() - mem_base);
9627	    test_ret++;
9628            printf(" %d", n_table);
9629            printf(" %d", n_name);
9630            printf(" %d", n_name2);
9631            printf(" %d", n_userdata);
9632            printf("\n");
9633        }
9634    }
9635    }
9636    }
9637    }
9638    function_tests++;
9639
9640    return(test_ret);
9641}
9642
9643
9644static int
9645test_xmlHashAddEntry3(void) {
9646    int test_ret = 0;
9647
9648    int mem_base;
9649    int ret_val;
9650    xmlHashTablePtr table; /* the hash table */
9651    int n_table;
9652    xmlChar * name; /* the name of the userdata */
9653    int n_name;
9654    xmlChar * name2; /* a second name of the userdata */
9655    int n_name2;
9656    xmlChar * name3; /* a third name of the userdata */
9657    int n_name3;
9658    void * userdata; /* a pointer to the userdata */
9659    int n_userdata;
9660
9661    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9662    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9663    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9664    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9665    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9666        mem_base = xmlMemBlocks();
9667        table = gen_xmlHashTablePtr(n_table, 0);
9668        name = gen_const_xmlChar_ptr(n_name, 1);
9669        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9670        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9671        userdata = gen_userdata(n_userdata, 4);
9672
9673        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9674        desret_int(ret_val);
9675        call_tests++;
9676        des_xmlHashTablePtr(n_table, table, 0);
9677        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9678        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9679        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9680        des_userdata(n_userdata, userdata, 4);
9681        xmlResetLastError();
9682        if (mem_base != xmlMemBlocks()) {
9683            printf("Leak of %d blocks found in xmlHashAddEntry3",
9684	           xmlMemBlocks() - mem_base);
9685	    test_ret++;
9686            printf(" %d", n_table);
9687            printf(" %d", n_name);
9688            printf(" %d", n_name2);
9689            printf(" %d", n_name3);
9690            printf(" %d", n_userdata);
9691            printf("\n");
9692        }
9693    }
9694    }
9695    }
9696    }
9697    }
9698    function_tests++;
9699
9700    return(test_ret);
9701}
9702
9703
9704static int
9705test_xmlHashCopy(void) {
9706    int test_ret = 0;
9707
9708
9709    /* missing type support */
9710    return(test_ret);
9711}
9712
9713
9714static int
9715test_xmlHashCreate(void) {
9716    int test_ret = 0;
9717
9718
9719    /* missing type support */
9720    return(test_ret);
9721}
9722
9723
9724static int
9725test_xmlHashCreateDict(void) {
9726    int test_ret = 0;
9727
9728
9729    /* missing type support */
9730    return(test_ret);
9731}
9732
9733
9734static int
9735test_xmlHashLookup(void) {
9736    int test_ret = 0;
9737
9738    int mem_base;
9739    void * ret_val;
9740    xmlHashTablePtr table; /* the hash table */
9741    int n_table;
9742    xmlChar * name; /* the name of the userdata */
9743    int n_name;
9744
9745    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9746    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9747        mem_base = xmlMemBlocks();
9748        table = gen_xmlHashTablePtr(n_table, 0);
9749        name = gen_const_xmlChar_ptr(n_name, 1);
9750
9751        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9752        desret_void_ptr(ret_val);
9753        call_tests++;
9754        des_xmlHashTablePtr(n_table, table, 0);
9755        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9756        xmlResetLastError();
9757        if (mem_base != xmlMemBlocks()) {
9758            printf("Leak of %d blocks found in xmlHashLookup",
9759	           xmlMemBlocks() - mem_base);
9760	    test_ret++;
9761            printf(" %d", n_table);
9762            printf(" %d", n_name);
9763            printf("\n");
9764        }
9765    }
9766    }
9767    function_tests++;
9768
9769    return(test_ret);
9770}
9771
9772
9773static int
9774test_xmlHashLookup2(void) {
9775    int test_ret = 0;
9776
9777    int mem_base;
9778    void * ret_val;
9779    xmlHashTablePtr table; /* the hash table */
9780    int n_table;
9781    xmlChar * name; /* the name of the userdata */
9782    int n_name;
9783    xmlChar * name2; /* a second name of the userdata */
9784    int n_name2;
9785
9786    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9787    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9788    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9789        mem_base = xmlMemBlocks();
9790        table = gen_xmlHashTablePtr(n_table, 0);
9791        name = gen_const_xmlChar_ptr(n_name, 1);
9792        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9793
9794        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9795        desret_void_ptr(ret_val);
9796        call_tests++;
9797        des_xmlHashTablePtr(n_table, table, 0);
9798        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9799        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9800        xmlResetLastError();
9801        if (mem_base != xmlMemBlocks()) {
9802            printf("Leak of %d blocks found in xmlHashLookup2",
9803	           xmlMemBlocks() - mem_base);
9804	    test_ret++;
9805            printf(" %d", n_table);
9806            printf(" %d", n_name);
9807            printf(" %d", n_name2);
9808            printf("\n");
9809        }
9810    }
9811    }
9812    }
9813    function_tests++;
9814
9815    return(test_ret);
9816}
9817
9818
9819static int
9820test_xmlHashLookup3(void) {
9821    int test_ret = 0;
9822
9823    int mem_base;
9824    void * ret_val;
9825    xmlHashTablePtr table; /* the hash table */
9826    int n_table;
9827    xmlChar * name; /* the name of the userdata */
9828    int n_name;
9829    xmlChar * name2; /* a second name of the userdata */
9830    int n_name2;
9831    xmlChar * name3; /* a third name of the userdata */
9832    int n_name3;
9833
9834    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9835    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9836    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9837    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9838        mem_base = xmlMemBlocks();
9839        table = gen_xmlHashTablePtr(n_table, 0);
9840        name = gen_const_xmlChar_ptr(n_name, 1);
9841        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9842        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9843
9844        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
9845        desret_void_ptr(ret_val);
9846        call_tests++;
9847        des_xmlHashTablePtr(n_table, table, 0);
9848        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9849        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9850        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9851        xmlResetLastError();
9852        if (mem_base != xmlMemBlocks()) {
9853            printf("Leak of %d blocks found in xmlHashLookup3",
9854	           xmlMemBlocks() - mem_base);
9855	    test_ret++;
9856            printf(" %d", n_table);
9857            printf(" %d", n_name);
9858            printf(" %d", n_name2);
9859            printf(" %d", n_name3);
9860            printf("\n");
9861        }
9862    }
9863    }
9864    }
9865    }
9866    function_tests++;
9867
9868    return(test_ret);
9869}
9870
9871
9872static int
9873test_xmlHashQLookup(void) {
9874    int test_ret = 0;
9875
9876    int mem_base;
9877    void * ret_val;
9878    xmlHashTablePtr table; /* the hash table */
9879    int n_table;
9880    xmlChar * prefix; /* the prefix of the userdata */
9881    int n_prefix;
9882    xmlChar * name; /* the name of the userdata */
9883    int n_name;
9884
9885    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9886    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9887    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9888        mem_base = xmlMemBlocks();
9889        table = gen_xmlHashTablePtr(n_table, 0);
9890        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9891        name = gen_const_xmlChar_ptr(n_name, 2);
9892
9893        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
9894        desret_void_ptr(ret_val);
9895        call_tests++;
9896        des_xmlHashTablePtr(n_table, table, 0);
9897        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9898        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9899        xmlResetLastError();
9900        if (mem_base != xmlMemBlocks()) {
9901            printf("Leak of %d blocks found in xmlHashQLookup",
9902	           xmlMemBlocks() - mem_base);
9903	    test_ret++;
9904            printf(" %d", n_table);
9905            printf(" %d", n_prefix);
9906            printf(" %d", n_name);
9907            printf("\n");
9908        }
9909    }
9910    }
9911    }
9912    function_tests++;
9913
9914    return(test_ret);
9915}
9916
9917
9918static int
9919test_xmlHashQLookup2(void) {
9920    int test_ret = 0;
9921
9922    int mem_base;
9923    void * ret_val;
9924    xmlHashTablePtr table; /* the hash table */
9925    int n_table;
9926    xmlChar * prefix; /* the prefix of the userdata */
9927    int n_prefix;
9928    xmlChar * name; /* the name of the userdata */
9929    int n_name;
9930    xmlChar * prefix2; /* the second prefix of the userdata */
9931    int n_prefix2;
9932    xmlChar * name2; /* a second name of the userdata */
9933    int n_name2;
9934
9935    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9936    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9937    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9938    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9939    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9940        mem_base = xmlMemBlocks();
9941        table = gen_xmlHashTablePtr(n_table, 0);
9942        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9943        name = gen_const_xmlChar_ptr(n_name, 2);
9944        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9945        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9946
9947        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
9948        desret_void_ptr(ret_val);
9949        call_tests++;
9950        des_xmlHashTablePtr(n_table, table, 0);
9951        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9952        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9953        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9954        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9955        xmlResetLastError();
9956        if (mem_base != xmlMemBlocks()) {
9957            printf("Leak of %d blocks found in xmlHashQLookup2",
9958	           xmlMemBlocks() - mem_base);
9959	    test_ret++;
9960            printf(" %d", n_table);
9961            printf(" %d", n_prefix);
9962            printf(" %d", n_name);
9963            printf(" %d", n_prefix2);
9964            printf(" %d", n_name2);
9965            printf("\n");
9966        }
9967    }
9968    }
9969    }
9970    }
9971    }
9972    function_tests++;
9973
9974    return(test_ret);
9975}
9976
9977
9978static int
9979test_xmlHashQLookup3(void) {
9980    int test_ret = 0;
9981
9982    int mem_base;
9983    void * ret_val;
9984    xmlHashTablePtr table; /* the hash table */
9985    int n_table;
9986    xmlChar * prefix; /* the prefix of the userdata */
9987    int n_prefix;
9988    xmlChar * name; /* the name of the userdata */
9989    int n_name;
9990    xmlChar * prefix2; /* the second prefix of the userdata */
9991    int n_prefix2;
9992    xmlChar * name2; /* a second name of the userdata */
9993    int n_name2;
9994    xmlChar * prefix3; /* the third prefix of the userdata */
9995    int n_prefix3;
9996    xmlChar * name3; /* a third name of the userdata */
9997    int n_name3;
9998
9999    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10000    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10001    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10002    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10003    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10004    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10005    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10006        mem_base = xmlMemBlocks();
10007        table = gen_xmlHashTablePtr(n_table, 0);
10008        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10009        name = gen_const_xmlChar_ptr(n_name, 2);
10010        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10011        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10012        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10013        name3 = gen_const_xmlChar_ptr(n_name3, 6);
10014
10015        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10016        desret_void_ptr(ret_val);
10017        call_tests++;
10018        des_xmlHashTablePtr(n_table, table, 0);
10019        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10020        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10021        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10022        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10023        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10024        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10025        xmlResetLastError();
10026        if (mem_base != xmlMemBlocks()) {
10027            printf("Leak of %d blocks found in xmlHashQLookup3",
10028	           xmlMemBlocks() - mem_base);
10029	    test_ret++;
10030            printf(" %d", n_table);
10031            printf(" %d", n_prefix);
10032            printf(" %d", n_name);
10033            printf(" %d", n_prefix2);
10034            printf(" %d", n_name2);
10035            printf(" %d", n_prefix3);
10036            printf(" %d", n_name3);
10037            printf("\n");
10038        }
10039    }
10040    }
10041    }
10042    }
10043    }
10044    }
10045    }
10046    function_tests++;
10047
10048    return(test_ret);
10049}
10050
10051
10052static int
10053test_xmlHashRemoveEntry(void) {
10054    int test_ret = 0;
10055
10056    int mem_base;
10057    int ret_val;
10058    xmlHashTablePtr table; /* the hash table */
10059    int n_table;
10060    xmlChar * name; /* the name of the userdata */
10061    int n_name;
10062    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10063    int n_f;
10064
10065    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10066    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10067    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10068        mem_base = xmlMemBlocks();
10069        table = gen_xmlHashTablePtr(n_table, 0);
10070        name = gen_const_xmlChar_ptr(n_name, 1);
10071        f = gen_xmlHashDeallocator(n_f, 2);
10072
10073        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10074        desret_int(ret_val);
10075        call_tests++;
10076        des_xmlHashTablePtr(n_table, table, 0);
10077        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10078        des_xmlHashDeallocator(n_f, f, 2);
10079        xmlResetLastError();
10080        if (mem_base != xmlMemBlocks()) {
10081            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10082	           xmlMemBlocks() - mem_base);
10083	    test_ret++;
10084            printf(" %d", n_table);
10085            printf(" %d", n_name);
10086            printf(" %d", n_f);
10087            printf("\n");
10088        }
10089    }
10090    }
10091    }
10092    function_tests++;
10093
10094    return(test_ret);
10095}
10096
10097
10098static int
10099test_xmlHashRemoveEntry2(void) {
10100    int test_ret = 0;
10101
10102    int mem_base;
10103    int ret_val;
10104    xmlHashTablePtr table; /* the hash table */
10105    int n_table;
10106    xmlChar * name; /* the name of the userdata */
10107    int n_name;
10108    xmlChar * name2; /* a second name of the userdata */
10109    int n_name2;
10110    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10111    int n_f;
10112
10113    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10114    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10115    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10116    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10117        mem_base = xmlMemBlocks();
10118        table = gen_xmlHashTablePtr(n_table, 0);
10119        name = gen_const_xmlChar_ptr(n_name, 1);
10120        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10121        f = gen_xmlHashDeallocator(n_f, 3);
10122
10123        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10124        desret_int(ret_val);
10125        call_tests++;
10126        des_xmlHashTablePtr(n_table, table, 0);
10127        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10128        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10129        des_xmlHashDeallocator(n_f, f, 3);
10130        xmlResetLastError();
10131        if (mem_base != xmlMemBlocks()) {
10132            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10133	           xmlMemBlocks() - mem_base);
10134	    test_ret++;
10135            printf(" %d", n_table);
10136            printf(" %d", n_name);
10137            printf(" %d", n_name2);
10138            printf(" %d", n_f);
10139            printf("\n");
10140        }
10141    }
10142    }
10143    }
10144    }
10145    function_tests++;
10146
10147    return(test_ret);
10148}
10149
10150
10151static int
10152test_xmlHashRemoveEntry3(void) {
10153    int test_ret = 0;
10154
10155    int mem_base;
10156    int ret_val;
10157    xmlHashTablePtr table; /* the hash table */
10158    int n_table;
10159    xmlChar * name; /* the name of the userdata */
10160    int n_name;
10161    xmlChar * name2; /* a second name of the userdata */
10162    int n_name2;
10163    xmlChar * name3; /* a third name of the userdata */
10164    int n_name3;
10165    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10166    int n_f;
10167
10168    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10169    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10170    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10171    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10172    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10173        mem_base = xmlMemBlocks();
10174        table = gen_xmlHashTablePtr(n_table, 0);
10175        name = gen_const_xmlChar_ptr(n_name, 1);
10176        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10177        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10178        f = gen_xmlHashDeallocator(n_f, 4);
10179
10180        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10181        desret_int(ret_val);
10182        call_tests++;
10183        des_xmlHashTablePtr(n_table, table, 0);
10184        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10185        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10186        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10187        des_xmlHashDeallocator(n_f, f, 4);
10188        xmlResetLastError();
10189        if (mem_base != xmlMemBlocks()) {
10190            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10191	           xmlMemBlocks() - mem_base);
10192	    test_ret++;
10193            printf(" %d", n_table);
10194            printf(" %d", n_name);
10195            printf(" %d", n_name2);
10196            printf(" %d", n_name3);
10197            printf(" %d", n_f);
10198            printf("\n");
10199        }
10200    }
10201    }
10202    }
10203    }
10204    }
10205    function_tests++;
10206
10207    return(test_ret);
10208}
10209
10210
10211static int
10212test_xmlHashScan(void) {
10213    int test_ret = 0;
10214
10215
10216    /* missing type support */
10217    return(test_ret);
10218}
10219
10220
10221static int
10222test_xmlHashScan3(void) {
10223    int test_ret = 0;
10224
10225
10226    /* missing type support */
10227    return(test_ret);
10228}
10229
10230
10231static int
10232test_xmlHashScanFull(void) {
10233    int test_ret = 0;
10234
10235
10236    /* missing type support */
10237    return(test_ret);
10238}
10239
10240
10241static int
10242test_xmlHashScanFull3(void) {
10243    int test_ret = 0;
10244
10245
10246    /* missing type support */
10247    return(test_ret);
10248}
10249
10250
10251static int
10252test_xmlHashSize(void) {
10253    int test_ret = 0;
10254
10255    int mem_base;
10256    int ret_val;
10257    xmlHashTablePtr table; /* the hash table */
10258    int n_table;
10259
10260    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10261        mem_base = xmlMemBlocks();
10262        table = gen_xmlHashTablePtr(n_table, 0);
10263
10264        ret_val = xmlHashSize(table);
10265        desret_int(ret_val);
10266        call_tests++;
10267        des_xmlHashTablePtr(n_table, table, 0);
10268        xmlResetLastError();
10269        if (mem_base != xmlMemBlocks()) {
10270            printf("Leak of %d blocks found in xmlHashSize",
10271	           xmlMemBlocks() - mem_base);
10272	    test_ret++;
10273            printf(" %d", n_table);
10274            printf("\n");
10275        }
10276    }
10277    function_tests++;
10278
10279    return(test_ret);
10280}
10281
10282
10283static int
10284test_xmlHashUpdateEntry(void) {
10285    int test_ret = 0;
10286
10287    int mem_base;
10288    int ret_val;
10289    xmlHashTablePtr table; /* the hash table */
10290    int n_table;
10291    xmlChar * name; /* the name of the userdata */
10292    int n_name;
10293    void * userdata; /* a pointer to the userdata */
10294    int n_userdata;
10295    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10296    int n_f;
10297
10298    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10299    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10300    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10301    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10302        mem_base = xmlMemBlocks();
10303        table = gen_xmlHashTablePtr(n_table, 0);
10304        name = gen_const_xmlChar_ptr(n_name, 1);
10305        userdata = gen_userdata(n_userdata, 2);
10306        f = gen_xmlHashDeallocator(n_f, 3);
10307
10308        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10309        desret_int(ret_val);
10310        call_tests++;
10311        des_xmlHashTablePtr(n_table, table, 0);
10312        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10313        des_userdata(n_userdata, userdata, 2);
10314        des_xmlHashDeallocator(n_f, f, 3);
10315        xmlResetLastError();
10316        if (mem_base != xmlMemBlocks()) {
10317            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10318	           xmlMemBlocks() - mem_base);
10319	    test_ret++;
10320            printf(" %d", n_table);
10321            printf(" %d", n_name);
10322            printf(" %d", n_userdata);
10323            printf(" %d", n_f);
10324            printf("\n");
10325        }
10326    }
10327    }
10328    }
10329    }
10330    function_tests++;
10331
10332    return(test_ret);
10333}
10334
10335
10336static int
10337test_xmlHashUpdateEntry2(void) {
10338    int test_ret = 0;
10339
10340    int mem_base;
10341    int ret_val;
10342    xmlHashTablePtr table; /* the hash table */
10343    int n_table;
10344    xmlChar * name; /* the name of the userdata */
10345    int n_name;
10346    xmlChar * name2; /* a second name of the userdata */
10347    int n_name2;
10348    void * userdata; /* a pointer to the userdata */
10349    int n_userdata;
10350    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10351    int n_f;
10352
10353    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10354    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10355    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10356    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10357    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10358        mem_base = xmlMemBlocks();
10359        table = gen_xmlHashTablePtr(n_table, 0);
10360        name = gen_const_xmlChar_ptr(n_name, 1);
10361        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10362        userdata = gen_userdata(n_userdata, 3);
10363        f = gen_xmlHashDeallocator(n_f, 4);
10364
10365        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10366        desret_int(ret_val);
10367        call_tests++;
10368        des_xmlHashTablePtr(n_table, table, 0);
10369        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10370        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10371        des_userdata(n_userdata, userdata, 3);
10372        des_xmlHashDeallocator(n_f, f, 4);
10373        xmlResetLastError();
10374        if (mem_base != xmlMemBlocks()) {
10375            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10376	           xmlMemBlocks() - mem_base);
10377	    test_ret++;
10378            printf(" %d", n_table);
10379            printf(" %d", n_name);
10380            printf(" %d", n_name2);
10381            printf(" %d", n_userdata);
10382            printf(" %d", n_f);
10383            printf("\n");
10384        }
10385    }
10386    }
10387    }
10388    }
10389    }
10390    function_tests++;
10391
10392    return(test_ret);
10393}
10394
10395
10396static int
10397test_xmlHashUpdateEntry3(void) {
10398    int test_ret = 0;
10399
10400    int mem_base;
10401    int ret_val;
10402    xmlHashTablePtr table; /* the hash table */
10403    int n_table;
10404    xmlChar * name; /* the name of the userdata */
10405    int n_name;
10406    xmlChar * name2; /* a second name of the userdata */
10407    int n_name2;
10408    xmlChar * name3; /* a third name of the userdata */
10409    int n_name3;
10410    void * userdata; /* a pointer to the userdata */
10411    int n_userdata;
10412    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10413    int n_f;
10414
10415    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10416    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10417    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10418    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10419    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10420    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10421        mem_base = xmlMemBlocks();
10422        table = gen_xmlHashTablePtr(n_table, 0);
10423        name = gen_const_xmlChar_ptr(n_name, 1);
10424        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10425        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10426        userdata = gen_userdata(n_userdata, 4);
10427        f = gen_xmlHashDeallocator(n_f, 5);
10428
10429        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10430        desret_int(ret_val);
10431        call_tests++;
10432        des_xmlHashTablePtr(n_table, table, 0);
10433        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10434        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10435        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10436        des_userdata(n_userdata, userdata, 4);
10437        des_xmlHashDeallocator(n_f, f, 5);
10438        xmlResetLastError();
10439        if (mem_base != xmlMemBlocks()) {
10440            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10441	           xmlMemBlocks() - mem_base);
10442	    test_ret++;
10443            printf(" %d", n_table);
10444            printf(" %d", n_name);
10445            printf(" %d", n_name2);
10446            printf(" %d", n_name3);
10447            printf(" %d", n_userdata);
10448            printf(" %d", n_f);
10449            printf("\n");
10450        }
10451    }
10452    }
10453    }
10454    }
10455    }
10456    }
10457    function_tests++;
10458
10459    return(test_ret);
10460}
10461
10462static int
10463test_hash(void) {
10464    int test_ret = 0;
10465
10466    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10467    test_ret += test_xmlHashAddEntry();
10468    test_ret += test_xmlHashAddEntry2();
10469    test_ret += test_xmlHashAddEntry3();
10470    test_ret += test_xmlHashCopy();
10471    test_ret += test_xmlHashCreate();
10472    test_ret += test_xmlHashCreateDict();
10473    test_ret += test_xmlHashLookup();
10474    test_ret += test_xmlHashLookup2();
10475    test_ret += test_xmlHashLookup3();
10476    test_ret += test_xmlHashQLookup();
10477    test_ret += test_xmlHashQLookup2();
10478    test_ret += test_xmlHashQLookup3();
10479    test_ret += test_xmlHashRemoveEntry();
10480    test_ret += test_xmlHashRemoveEntry2();
10481    test_ret += test_xmlHashRemoveEntry3();
10482    test_ret += test_xmlHashScan();
10483    test_ret += test_xmlHashScan3();
10484    test_ret += test_xmlHashScanFull();
10485    test_ret += test_xmlHashScanFull3();
10486    test_ret += test_xmlHashSize();
10487    test_ret += test_xmlHashUpdateEntry();
10488    test_ret += test_xmlHashUpdateEntry2();
10489    test_ret += test_xmlHashUpdateEntry3();
10490
10491    if (test_ret != 0)
10492	printf("Module hash: %d errors\n", test_ret);
10493    return(test_ret);
10494}
10495
10496#define gen_nb_xmlLinkPtr 1
10497static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10498    return(NULL);
10499}
10500static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10501}
10502
10503static int
10504test_xmlLinkGetData(void) {
10505    int test_ret = 0;
10506
10507    int mem_base;
10508    void * ret_val;
10509    xmlLinkPtr lk; /* a link */
10510    int n_lk;
10511
10512    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10513        mem_base = xmlMemBlocks();
10514        lk = gen_xmlLinkPtr(n_lk, 0);
10515
10516        ret_val = xmlLinkGetData(lk);
10517        desret_void_ptr(ret_val);
10518        call_tests++;
10519        des_xmlLinkPtr(n_lk, lk, 0);
10520        xmlResetLastError();
10521        if (mem_base != xmlMemBlocks()) {
10522            printf("Leak of %d blocks found in xmlLinkGetData",
10523	           xmlMemBlocks() - mem_base);
10524	    test_ret++;
10525            printf(" %d", n_lk);
10526            printf("\n");
10527        }
10528    }
10529    function_tests++;
10530
10531    return(test_ret);
10532}
10533
10534
10535static int
10536test_xmlListAppend(void) {
10537    int test_ret = 0;
10538
10539    int mem_base;
10540    int ret_val;
10541    xmlListPtr l; /* a list */
10542    int n_l;
10543    void * data; /* the data */
10544    int n_data;
10545
10546    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10547    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10548        mem_base = xmlMemBlocks();
10549        l = gen_xmlListPtr(n_l, 0);
10550        data = gen_userdata(n_data, 1);
10551
10552        ret_val = xmlListAppend(l, data);
10553        desret_int(ret_val);
10554        call_tests++;
10555        des_xmlListPtr(n_l, l, 0);
10556        des_userdata(n_data, data, 1);
10557        xmlResetLastError();
10558        if (mem_base != xmlMemBlocks()) {
10559            printf("Leak of %d blocks found in xmlListAppend",
10560	           xmlMemBlocks() - mem_base);
10561	    test_ret++;
10562            printf(" %d", n_l);
10563            printf(" %d", n_data);
10564            printf("\n");
10565        }
10566    }
10567    }
10568    function_tests++;
10569
10570    return(test_ret);
10571}
10572
10573
10574static int
10575test_xmlListClear(void) {
10576    int test_ret = 0;
10577
10578    int mem_base;
10579    xmlListPtr l; /* a list */
10580    int n_l;
10581
10582    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10583        mem_base = xmlMemBlocks();
10584        l = gen_xmlListPtr(n_l, 0);
10585
10586        xmlListClear(l);
10587        call_tests++;
10588        des_xmlListPtr(n_l, l, 0);
10589        xmlResetLastError();
10590        if (mem_base != xmlMemBlocks()) {
10591            printf("Leak of %d blocks found in xmlListClear",
10592	           xmlMemBlocks() - mem_base);
10593	    test_ret++;
10594            printf(" %d", n_l);
10595            printf("\n");
10596        }
10597    }
10598    function_tests++;
10599
10600    return(test_ret);
10601}
10602
10603
10604#define gen_nb_const_xmlListPtr 1
10605static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10606    return(NULL);
10607}
10608static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10609}
10610
10611static int
10612test_xmlListCopy(void) {
10613    int test_ret = 0;
10614
10615    int mem_base;
10616    int ret_val;
10617    xmlListPtr cur; /* the new list */
10618    int n_cur;
10619    xmlListPtr old; /* the old list */
10620    int n_old;
10621
10622    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10623    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10624        mem_base = xmlMemBlocks();
10625        cur = gen_xmlListPtr(n_cur, 0);
10626        old = gen_const_xmlListPtr(n_old, 1);
10627
10628        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10629        desret_int(ret_val);
10630        call_tests++;
10631        des_xmlListPtr(n_cur, cur, 0);
10632        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10633        xmlResetLastError();
10634        if (mem_base != xmlMemBlocks()) {
10635            printf("Leak of %d blocks found in xmlListCopy",
10636	           xmlMemBlocks() - mem_base);
10637	    test_ret++;
10638            printf(" %d", n_cur);
10639            printf(" %d", n_old);
10640            printf("\n");
10641        }
10642    }
10643    }
10644    function_tests++;
10645
10646    return(test_ret);
10647}
10648
10649
10650static int
10651test_xmlListCreate(void) {
10652    int test_ret = 0;
10653
10654
10655    /* missing type support */
10656    return(test_ret);
10657}
10658
10659
10660static int
10661test_xmlListDup(void) {
10662    int test_ret = 0;
10663
10664
10665    /* missing type support */
10666    return(test_ret);
10667}
10668
10669
10670static int
10671test_xmlListEmpty(void) {
10672    int test_ret = 0;
10673
10674    int mem_base;
10675    int ret_val;
10676    xmlListPtr l; /* a list */
10677    int n_l;
10678
10679    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10680        mem_base = xmlMemBlocks();
10681        l = gen_xmlListPtr(n_l, 0);
10682
10683        ret_val = xmlListEmpty(l);
10684        desret_int(ret_val);
10685        call_tests++;
10686        des_xmlListPtr(n_l, l, 0);
10687        xmlResetLastError();
10688        if (mem_base != xmlMemBlocks()) {
10689            printf("Leak of %d blocks found in xmlListEmpty",
10690	           xmlMemBlocks() - mem_base);
10691	    test_ret++;
10692            printf(" %d", n_l);
10693            printf("\n");
10694        }
10695    }
10696    function_tests++;
10697
10698    return(test_ret);
10699}
10700
10701
10702static int
10703test_xmlListEnd(void) {
10704    int test_ret = 0;
10705
10706
10707    /* missing type support */
10708    return(test_ret);
10709}
10710
10711
10712static int
10713test_xmlListFront(void) {
10714    int test_ret = 0;
10715
10716
10717    /* missing type support */
10718    return(test_ret);
10719}
10720
10721
10722static int
10723test_xmlListInsert(void) {
10724    int test_ret = 0;
10725
10726    int mem_base;
10727    int ret_val;
10728    xmlListPtr l; /* a list */
10729    int n_l;
10730    void * data; /* the data */
10731    int n_data;
10732
10733    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10734    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10735        mem_base = xmlMemBlocks();
10736        l = gen_xmlListPtr(n_l, 0);
10737        data = gen_userdata(n_data, 1);
10738
10739        ret_val = xmlListInsert(l, data);
10740        desret_int(ret_val);
10741        call_tests++;
10742        des_xmlListPtr(n_l, l, 0);
10743        des_userdata(n_data, data, 1);
10744        xmlResetLastError();
10745        if (mem_base != xmlMemBlocks()) {
10746            printf("Leak of %d blocks found in xmlListInsert",
10747	           xmlMemBlocks() - mem_base);
10748	    test_ret++;
10749            printf(" %d", n_l);
10750            printf(" %d", n_data);
10751            printf("\n");
10752        }
10753    }
10754    }
10755    function_tests++;
10756
10757    return(test_ret);
10758}
10759
10760
10761static int
10762test_xmlListMerge(void) {
10763    int test_ret = 0;
10764
10765    int mem_base;
10766    xmlListPtr l1; /* the original list */
10767    int n_l1;
10768    xmlListPtr l2; /* the new list */
10769    int n_l2;
10770
10771    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10772    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10773        mem_base = xmlMemBlocks();
10774        l1 = gen_xmlListPtr(n_l1, 0);
10775        l2 = gen_xmlListPtr(n_l2, 1);
10776
10777        xmlListMerge(l1, l2);
10778        call_tests++;
10779        des_xmlListPtr(n_l1, l1, 0);
10780        des_xmlListPtr(n_l2, l2, 1);
10781        xmlResetLastError();
10782        if (mem_base != xmlMemBlocks()) {
10783            printf("Leak of %d blocks found in xmlListMerge",
10784	           xmlMemBlocks() - mem_base);
10785	    test_ret++;
10786            printf(" %d", n_l1);
10787            printf(" %d", n_l2);
10788            printf("\n");
10789        }
10790    }
10791    }
10792    function_tests++;
10793
10794    return(test_ret);
10795}
10796
10797
10798static int
10799test_xmlListPopBack(void) {
10800    int test_ret = 0;
10801
10802    int mem_base;
10803    xmlListPtr l; /* a list */
10804    int n_l;
10805
10806    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10807        mem_base = xmlMemBlocks();
10808        l = gen_xmlListPtr(n_l, 0);
10809
10810        xmlListPopBack(l);
10811        call_tests++;
10812        des_xmlListPtr(n_l, l, 0);
10813        xmlResetLastError();
10814        if (mem_base != xmlMemBlocks()) {
10815            printf("Leak of %d blocks found in xmlListPopBack",
10816	           xmlMemBlocks() - mem_base);
10817	    test_ret++;
10818            printf(" %d", n_l);
10819            printf("\n");
10820        }
10821    }
10822    function_tests++;
10823
10824    return(test_ret);
10825}
10826
10827
10828static int
10829test_xmlListPopFront(void) {
10830    int test_ret = 0;
10831
10832    int mem_base;
10833    xmlListPtr l; /* a list */
10834    int n_l;
10835
10836    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10837        mem_base = xmlMemBlocks();
10838        l = gen_xmlListPtr(n_l, 0);
10839
10840        xmlListPopFront(l);
10841        call_tests++;
10842        des_xmlListPtr(n_l, l, 0);
10843        xmlResetLastError();
10844        if (mem_base != xmlMemBlocks()) {
10845            printf("Leak of %d blocks found in xmlListPopFront",
10846	           xmlMemBlocks() - mem_base);
10847	    test_ret++;
10848            printf(" %d", n_l);
10849            printf("\n");
10850        }
10851    }
10852    function_tests++;
10853
10854    return(test_ret);
10855}
10856
10857
10858static int
10859test_xmlListPushBack(void) {
10860    int test_ret = 0;
10861
10862    int mem_base;
10863    int ret_val;
10864    xmlListPtr l; /* a list */
10865    int n_l;
10866    void * data; /* new data */
10867    int n_data;
10868
10869    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10870    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10871        mem_base = xmlMemBlocks();
10872        l = gen_xmlListPtr(n_l, 0);
10873        data = gen_userdata(n_data, 1);
10874
10875        ret_val = xmlListPushBack(l, data);
10876        desret_int(ret_val);
10877        call_tests++;
10878        des_xmlListPtr(n_l, l, 0);
10879        des_userdata(n_data, data, 1);
10880        xmlResetLastError();
10881        if (mem_base != xmlMemBlocks()) {
10882            printf("Leak of %d blocks found in xmlListPushBack",
10883	           xmlMemBlocks() - mem_base);
10884	    test_ret++;
10885            printf(" %d", n_l);
10886            printf(" %d", n_data);
10887            printf("\n");
10888        }
10889    }
10890    }
10891    function_tests++;
10892
10893    return(test_ret);
10894}
10895
10896
10897static int
10898test_xmlListPushFront(void) {
10899    int test_ret = 0;
10900
10901    int mem_base;
10902    int ret_val;
10903    xmlListPtr l; /* a list */
10904    int n_l;
10905    void * data; /* new data */
10906    int n_data;
10907
10908    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10909    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10910        mem_base = xmlMemBlocks();
10911        l = gen_xmlListPtr(n_l, 0);
10912        data = gen_userdata(n_data, 1);
10913
10914        ret_val = xmlListPushFront(l, data);
10915        desret_int(ret_val);
10916        call_tests++;
10917        des_xmlListPtr(n_l, l, 0);
10918        des_userdata(n_data, data, 1);
10919        xmlResetLastError();
10920        if (mem_base != xmlMemBlocks()) {
10921            printf("Leak of %d blocks found in xmlListPushFront",
10922	           xmlMemBlocks() - mem_base);
10923	    test_ret++;
10924            printf(" %d", n_l);
10925            printf(" %d", n_data);
10926            printf("\n");
10927        }
10928    }
10929    }
10930    function_tests++;
10931
10932    return(test_ret);
10933}
10934
10935
10936static int
10937test_xmlListRemoveAll(void) {
10938    int test_ret = 0;
10939
10940    int mem_base;
10941    int ret_val;
10942    xmlListPtr l; /* a list */
10943    int n_l;
10944    void * data; /* list data */
10945    int n_data;
10946
10947    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10948    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10949        mem_base = xmlMemBlocks();
10950        l = gen_xmlListPtr(n_l, 0);
10951        data = gen_userdata(n_data, 1);
10952
10953        ret_val = xmlListRemoveAll(l, data);
10954        desret_int(ret_val);
10955        call_tests++;
10956        des_xmlListPtr(n_l, l, 0);
10957        des_userdata(n_data, data, 1);
10958        xmlResetLastError();
10959        if (mem_base != xmlMemBlocks()) {
10960            printf("Leak of %d blocks found in xmlListRemoveAll",
10961	           xmlMemBlocks() - mem_base);
10962	    test_ret++;
10963            printf(" %d", n_l);
10964            printf(" %d", n_data);
10965            printf("\n");
10966        }
10967    }
10968    }
10969    function_tests++;
10970
10971    return(test_ret);
10972}
10973
10974
10975static int
10976test_xmlListRemoveFirst(void) {
10977    int test_ret = 0;
10978
10979    int mem_base;
10980    int ret_val;
10981    xmlListPtr l; /* a list */
10982    int n_l;
10983    void * data; /* list data */
10984    int n_data;
10985
10986    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10987    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10988        mem_base = xmlMemBlocks();
10989        l = gen_xmlListPtr(n_l, 0);
10990        data = gen_userdata(n_data, 1);
10991
10992        ret_val = xmlListRemoveFirst(l, data);
10993        desret_int(ret_val);
10994        call_tests++;
10995        des_xmlListPtr(n_l, l, 0);
10996        des_userdata(n_data, data, 1);
10997        xmlResetLastError();
10998        if (mem_base != xmlMemBlocks()) {
10999            printf("Leak of %d blocks found in xmlListRemoveFirst",
11000	           xmlMemBlocks() - mem_base);
11001	    test_ret++;
11002            printf(" %d", n_l);
11003            printf(" %d", n_data);
11004            printf("\n");
11005        }
11006    }
11007    }
11008    function_tests++;
11009
11010    return(test_ret);
11011}
11012
11013
11014static int
11015test_xmlListRemoveLast(void) {
11016    int test_ret = 0;
11017
11018    int mem_base;
11019    int ret_val;
11020    xmlListPtr l; /* a list */
11021    int n_l;
11022    void * data; /* list data */
11023    int n_data;
11024
11025    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11026    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11027        mem_base = xmlMemBlocks();
11028        l = gen_xmlListPtr(n_l, 0);
11029        data = gen_userdata(n_data, 1);
11030
11031        ret_val = xmlListRemoveLast(l, data);
11032        desret_int(ret_val);
11033        call_tests++;
11034        des_xmlListPtr(n_l, l, 0);
11035        des_userdata(n_data, data, 1);
11036        xmlResetLastError();
11037        if (mem_base != xmlMemBlocks()) {
11038            printf("Leak of %d blocks found in xmlListRemoveLast",
11039	           xmlMemBlocks() - mem_base);
11040	    test_ret++;
11041            printf(" %d", n_l);
11042            printf(" %d", n_data);
11043            printf("\n");
11044        }
11045    }
11046    }
11047    function_tests++;
11048
11049    return(test_ret);
11050}
11051
11052
11053static int
11054test_xmlListReverse(void) {
11055    int test_ret = 0;
11056
11057    int mem_base;
11058    xmlListPtr l; /* a list */
11059    int n_l;
11060
11061    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11062        mem_base = xmlMemBlocks();
11063        l = gen_xmlListPtr(n_l, 0);
11064
11065        xmlListReverse(l);
11066        call_tests++;
11067        des_xmlListPtr(n_l, l, 0);
11068        xmlResetLastError();
11069        if (mem_base != xmlMemBlocks()) {
11070            printf("Leak of %d blocks found in xmlListReverse",
11071	           xmlMemBlocks() - mem_base);
11072	    test_ret++;
11073            printf(" %d", n_l);
11074            printf("\n");
11075        }
11076    }
11077    function_tests++;
11078
11079    return(test_ret);
11080}
11081
11082
11083static int
11084test_xmlListReverseSearch(void) {
11085    int test_ret = 0;
11086
11087    int mem_base;
11088    void * ret_val;
11089    xmlListPtr l; /* a list */
11090    int n_l;
11091    void * data; /* a search value */
11092    int n_data;
11093
11094    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11095    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11096        mem_base = xmlMemBlocks();
11097        l = gen_xmlListPtr(n_l, 0);
11098        data = gen_userdata(n_data, 1);
11099
11100        ret_val = xmlListReverseSearch(l, data);
11101        desret_void_ptr(ret_val);
11102        call_tests++;
11103        des_xmlListPtr(n_l, l, 0);
11104        des_userdata(n_data, data, 1);
11105        xmlResetLastError();
11106        if (mem_base != xmlMemBlocks()) {
11107            printf("Leak of %d blocks found in xmlListReverseSearch",
11108	           xmlMemBlocks() - mem_base);
11109	    test_ret++;
11110            printf(" %d", n_l);
11111            printf(" %d", n_data);
11112            printf("\n");
11113        }
11114    }
11115    }
11116    function_tests++;
11117
11118    return(test_ret);
11119}
11120
11121
11122static int
11123test_xmlListReverseWalk(void) {
11124    int test_ret = 0;
11125
11126
11127    /* missing type support */
11128    return(test_ret);
11129}
11130
11131
11132static int
11133test_xmlListSearch(void) {
11134    int test_ret = 0;
11135
11136    int mem_base;
11137    void * ret_val;
11138    xmlListPtr l; /* a list */
11139    int n_l;
11140    void * data; /* a search value */
11141    int n_data;
11142
11143    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11144    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11145        mem_base = xmlMemBlocks();
11146        l = gen_xmlListPtr(n_l, 0);
11147        data = gen_userdata(n_data, 1);
11148
11149        ret_val = xmlListSearch(l, data);
11150        desret_void_ptr(ret_val);
11151        call_tests++;
11152        des_xmlListPtr(n_l, l, 0);
11153        des_userdata(n_data, data, 1);
11154        xmlResetLastError();
11155        if (mem_base != xmlMemBlocks()) {
11156            printf("Leak of %d blocks found in xmlListSearch",
11157	           xmlMemBlocks() - mem_base);
11158	    test_ret++;
11159            printf(" %d", n_l);
11160            printf(" %d", n_data);
11161            printf("\n");
11162        }
11163    }
11164    }
11165    function_tests++;
11166
11167    return(test_ret);
11168}
11169
11170
11171static int
11172test_xmlListSize(void) {
11173    int test_ret = 0;
11174
11175    int mem_base;
11176    int ret_val;
11177    xmlListPtr l; /* a list */
11178    int n_l;
11179
11180    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11181        mem_base = xmlMemBlocks();
11182        l = gen_xmlListPtr(n_l, 0);
11183
11184        ret_val = xmlListSize(l);
11185        desret_int(ret_val);
11186        call_tests++;
11187        des_xmlListPtr(n_l, l, 0);
11188        xmlResetLastError();
11189        if (mem_base != xmlMemBlocks()) {
11190            printf("Leak of %d blocks found in xmlListSize",
11191	           xmlMemBlocks() - mem_base);
11192	    test_ret++;
11193            printf(" %d", n_l);
11194            printf("\n");
11195        }
11196    }
11197    function_tests++;
11198
11199    return(test_ret);
11200}
11201
11202
11203static int
11204test_xmlListSort(void) {
11205    int test_ret = 0;
11206
11207    int mem_base;
11208    xmlListPtr l; /* a list */
11209    int n_l;
11210
11211    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11212        mem_base = xmlMemBlocks();
11213        l = gen_xmlListPtr(n_l, 0);
11214
11215        xmlListSort(l);
11216        call_tests++;
11217        des_xmlListPtr(n_l, l, 0);
11218        xmlResetLastError();
11219        if (mem_base != xmlMemBlocks()) {
11220            printf("Leak of %d blocks found in xmlListSort",
11221	           xmlMemBlocks() - mem_base);
11222	    test_ret++;
11223            printf(" %d", n_l);
11224            printf("\n");
11225        }
11226    }
11227    function_tests++;
11228
11229    return(test_ret);
11230}
11231
11232
11233static int
11234test_xmlListWalk(void) {
11235    int test_ret = 0;
11236
11237
11238    /* missing type support */
11239    return(test_ret);
11240}
11241
11242static int
11243test_list(void) {
11244    int test_ret = 0;
11245
11246    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11247    test_ret += test_xmlLinkGetData();
11248    test_ret += test_xmlListAppend();
11249    test_ret += test_xmlListClear();
11250    test_ret += test_xmlListCopy();
11251    test_ret += test_xmlListCreate();
11252    test_ret += test_xmlListDup();
11253    test_ret += test_xmlListEmpty();
11254    test_ret += test_xmlListEnd();
11255    test_ret += test_xmlListFront();
11256    test_ret += test_xmlListInsert();
11257    test_ret += test_xmlListMerge();
11258    test_ret += test_xmlListPopBack();
11259    test_ret += test_xmlListPopFront();
11260    test_ret += test_xmlListPushBack();
11261    test_ret += test_xmlListPushFront();
11262    test_ret += test_xmlListRemoveAll();
11263    test_ret += test_xmlListRemoveFirst();
11264    test_ret += test_xmlListRemoveLast();
11265    test_ret += test_xmlListReverse();
11266    test_ret += test_xmlListReverseSearch();
11267    test_ret += test_xmlListReverseWalk();
11268    test_ret += test_xmlListSearch();
11269    test_ret += test_xmlListSize();
11270    test_ret += test_xmlListSort();
11271    test_ret += test_xmlListWalk();
11272
11273    if (test_ret != 0)
11274	printf("Module list: %d errors\n", test_ret);
11275    return(test_ret);
11276}
11277
11278static int
11279test_xmlNanoFTPCheckResponse(void) {
11280    int test_ret = 0;
11281
11282#if defined(LIBXML_FTP_ENABLED)
11283    int mem_base;
11284    int ret_val;
11285    void * ctx; /* an FTP context */
11286    int n_ctx;
11287
11288    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11289        mem_base = xmlMemBlocks();
11290        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11291
11292        ret_val = xmlNanoFTPCheckResponse(ctx);
11293        desret_int(ret_val);
11294        call_tests++;
11295        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11296        xmlResetLastError();
11297        if (mem_base != xmlMemBlocks()) {
11298            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11299	           xmlMemBlocks() - mem_base);
11300	    test_ret++;
11301            printf(" %d", n_ctx);
11302            printf("\n");
11303        }
11304    }
11305    function_tests++;
11306#endif
11307
11308    return(test_ret);
11309}
11310
11311
11312static int
11313test_xmlNanoFTPCleanup(void) {
11314    int test_ret = 0;
11315
11316#if defined(LIBXML_FTP_ENABLED)
11317    int mem_base;
11318
11319        mem_base = xmlMemBlocks();
11320
11321        xmlNanoFTPCleanup();
11322        call_tests++;
11323        xmlResetLastError();
11324        if (mem_base != xmlMemBlocks()) {
11325            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11326	           xmlMemBlocks() - mem_base);
11327	    test_ret++;
11328            printf("\n");
11329        }
11330    function_tests++;
11331#endif
11332
11333    return(test_ret);
11334}
11335
11336
11337static int
11338test_xmlNanoFTPCloseConnection(void) {
11339    int test_ret = 0;
11340
11341#if defined(LIBXML_FTP_ENABLED)
11342    int mem_base;
11343    int ret_val;
11344    void * ctx; /* an FTP context */
11345    int n_ctx;
11346
11347    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11348        mem_base = xmlMemBlocks();
11349        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11350
11351        ret_val = xmlNanoFTPCloseConnection(ctx);
11352        desret_int(ret_val);
11353        call_tests++;
11354        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11355        xmlResetLastError();
11356        if (mem_base != xmlMemBlocks()) {
11357            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11358	           xmlMemBlocks() - mem_base);
11359	    test_ret++;
11360            printf(" %d", n_ctx);
11361            printf("\n");
11362        }
11363    }
11364    function_tests++;
11365#endif
11366
11367    return(test_ret);
11368}
11369
11370
11371static int
11372test_xmlNanoFTPCwd(void) {
11373    int test_ret = 0;
11374
11375#if defined(LIBXML_FTP_ENABLED)
11376    int mem_base;
11377    int ret_val;
11378    void * ctx; /* an FTP context */
11379    int n_ctx;
11380    char * directory; /* a directory on the server */
11381    int n_directory;
11382
11383    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11384    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11385        mem_base = xmlMemBlocks();
11386        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11387        directory = gen_const_char_ptr(n_directory, 1);
11388
11389        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11390        desret_int(ret_val);
11391        call_tests++;
11392        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11393        des_const_char_ptr(n_directory, (const char *)directory, 1);
11394        xmlResetLastError();
11395        if (mem_base != xmlMemBlocks()) {
11396            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11397	           xmlMemBlocks() - mem_base);
11398	    test_ret++;
11399            printf(" %d", n_ctx);
11400            printf(" %d", n_directory);
11401            printf("\n");
11402        }
11403    }
11404    }
11405    function_tests++;
11406#endif
11407
11408    return(test_ret);
11409}
11410
11411
11412static int
11413test_xmlNanoFTPDele(void) {
11414    int test_ret = 0;
11415
11416#if defined(LIBXML_FTP_ENABLED)
11417    int mem_base;
11418    int ret_val;
11419    void * ctx; /* an FTP context */
11420    int n_ctx;
11421    const char * file; /* a file or directory on the server */
11422    int n_file;
11423
11424    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11425    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11426        mem_base = xmlMemBlocks();
11427        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11428        file = gen_filepath(n_file, 1);
11429
11430        ret_val = xmlNanoFTPDele(ctx, file);
11431        desret_int(ret_val);
11432        call_tests++;
11433        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11434        des_filepath(n_file, file, 1);
11435        xmlResetLastError();
11436        if (mem_base != xmlMemBlocks()) {
11437            printf("Leak of %d blocks found in xmlNanoFTPDele",
11438	           xmlMemBlocks() - mem_base);
11439	    test_ret++;
11440            printf(" %d", n_ctx);
11441            printf(" %d", n_file);
11442            printf("\n");
11443        }
11444    }
11445    }
11446    function_tests++;
11447#endif
11448
11449    return(test_ret);
11450}
11451
11452
11453static int
11454test_xmlNanoFTPGet(void) {
11455    int test_ret = 0;
11456
11457
11458    /* missing type support */
11459    return(test_ret);
11460}
11461
11462
11463static int
11464test_xmlNanoFTPGetConnection(void) {
11465    int test_ret = 0;
11466
11467#if defined(LIBXML_FTP_ENABLED)
11468    int mem_base;
11469    int ret_val;
11470    void * ctx; /* an FTP context */
11471    int n_ctx;
11472
11473    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11474        mem_base = xmlMemBlocks();
11475        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11476
11477        ret_val = xmlNanoFTPGetConnection(ctx);
11478        desret_int(ret_val);
11479        call_tests++;
11480        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11481        xmlResetLastError();
11482        if (mem_base != xmlMemBlocks()) {
11483            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11484	           xmlMemBlocks() - mem_base);
11485	    test_ret++;
11486            printf(" %d", n_ctx);
11487            printf("\n");
11488        }
11489    }
11490    function_tests++;
11491#endif
11492
11493    return(test_ret);
11494}
11495
11496
11497static int
11498test_xmlNanoFTPGetResponse(void) {
11499    int test_ret = 0;
11500
11501#if defined(LIBXML_FTP_ENABLED)
11502    int mem_base;
11503    int ret_val;
11504    void * ctx; /* an FTP context */
11505    int n_ctx;
11506
11507    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11508        mem_base = xmlMemBlocks();
11509        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11510
11511        ret_val = xmlNanoFTPGetResponse(ctx);
11512        desret_int(ret_val);
11513        call_tests++;
11514        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11515        xmlResetLastError();
11516        if (mem_base != xmlMemBlocks()) {
11517            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11518	           xmlMemBlocks() - mem_base);
11519	    test_ret++;
11520            printf(" %d", n_ctx);
11521            printf("\n");
11522        }
11523    }
11524    function_tests++;
11525#endif
11526
11527    return(test_ret);
11528}
11529
11530
11531static int
11532test_xmlNanoFTPGetSocket(void) {
11533    int test_ret = 0;
11534
11535#if defined(LIBXML_FTP_ENABLED)
11536    int mem_base;
11537    int ret_val;
11538    void * ctx; /* an FTP context */
11539    int n_ctx;
11540    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11541    int n_filename;
11542
11543    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11544    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11545        mem_base = xmlMemBlocks();
11546        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11547        filename = gen_filepath(n_filename, 1);
11548
11549        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11550        desret_int(ret_val);
11551        call_tests++;
11552        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11553        des_filepath(n_filename, filename, 1);
11554        xmlResetLastError();
11555        if (mem_base != xmlMemBlocks()) {
11556            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11557	           xmlMemBlocks() - mem_base);
11558	    test_ret++;
11559            printf(" %d", n_ctx);
11560            printf(" %d", n_filename);
11561            printf("\n");
11562        }
11563    }
11564    }
11565    function_tests++;
11566#endif
11567
11568    return(test_ret);
11569}
11570
11571
11572static int
11573test_xmlNanoFTPInit(void) {
11574    int test_ret = 0;
11575
11576#if defined(LIBXML_FTP_ENABLED)
11577    int mem_base;
11578
11579        mem_base = xmlMemBlocks();
11580
11581        xmlNanoFTPInit();
11582        call_tests++;
11583        xmlResetLastError();
11584        if (mem_base != xmlMemBlocks()) {
11585            printf("Leak of %d blocks found in xmlNanoFTPInit",
11586	           xmlMemBlocks() - mem_base);
11587	    test_ret++;
11588            printf("\n");
11589        }
11590    function_tests++;
11591#endif
11592
11593    return(test_ret);
11594}
11595
11596
11597static int
11598test_xmlNanoFTPList(void) {
11599    int test_ret = 0;
11600
11601
11602    /* missing type support */
11603    return(test_ret);
11604}
11605
11606
11607static int
11608test_xmlNanoFTPNewCtxt(void) {
11609    int test_ret = 0;
11610
11611#if defined(LIBXML_FTP_ENABLED)
11612    int mem_base;
11613    void * ret_val;
11614    const char * URL; /* The URL used to initialize the context */
11615    int n_URL;
11616
11617    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11618        mem_base = xmlMemBlocks();
11619        URL = gen_filepath(n_URL, 0);
11620
11621        ret_val = xmlNanoFTPNewCtxt(URL);
11622        desret_xmlNanoFTPCtxtPtr(ret_val);
11623        call_tests++;
11624        des_filepath(n_URL, URL, 0);
11625        xmlResetLastError();
11626        if (mem_base != xmlMemBlocks()) {
11627            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11628	           xmlMemBlocks() - mem_base);
11629	    test_ret++;
11630            printf(" %d", n_URL);
11631            printf("\n");
11632        }
11633    }
11634    function_tests++;
11635#endif
11636
11637    return(test_ret);
11638}
11639
11640
11641static int
11642test_xmlNanoFTPOpen(void) {
11643    int test_ret = 0;
11644
11645#if defined(LIBXML_FTP_ENABLED)
11646    int mem_base;
11647    void * ret_val;
11648    const char * URL; /* the URL to the resource */
11649    int n_URL;
11650
11651    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11652        mem_base = xmlMemBlocks();
11653        URL = gen_filepath(n_URL, 0);
11654
11655        ret_val = xmlNanoFTPOpen(URL);
11656        desret_xmlNanoFTPCtxtPtr(ret_val);
11657        call_tests++;
11658        des_filepath(n_URL, URL, 0);
11659        xmlResetLastError();
11660        if (mem_base != xmlMemBlocks()) {
11661            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11662	           xmlMemBlocks() - mem_base);
11663	    test_ret++;
11664            printf(" %d", n_URL);
11665            printf("\n");
11666        }
11667    }
11668    function_tests++;
11669#endif
11670
11671    return(test_ret);
11672}
11673
11674
11675static int
11676test_xmlNanoFTPProxy(void) {
11677    int test_ret = 0;
11678
11679#if defined(LIBXML_FTP_ENABLED)
11680    char * host; /* the proxy host name */
11681    int n_host;
11682    int port; /* the proxy port */
11683    int n_port;
11684    char * user; /* the proxy user name */
11685    int n_user;
11686    char * passwd; /* the proxy password */
11687    int n_passwd;
11688    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11689    int n_type;
11690
11691    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11692    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11693    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11694    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11695    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11696        host = gen_const_char_ptr(n_host, 0);
11697        port = gen_int(n_port, 1);
11698        user = gen_const_char_ptr(n_user, 2);
11699        passwd = gen_const_char_ptr(n_passwd, 3);
11700        type = gen_int(n_type, 4);
11701
11702        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11703        call_tests++;
11704        des_const_char_ptr(n_host, (const char *)host, 0);
11705        des_int(n_port, port, 1);
11706        des_const_char_ptr(n_user, (const char *)user, 2);
11707        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11708        des_int(n_type, type, 4);
11709        xmlResetLastError();
11710    }
11711    }
11712    }
11713    }
11714    }
11715    function_tests++;
11716#endif
11717
11718    return(test_ret);
11719}
11720
11721
11722static int
11723test_xmlNanoFTPQuit(void) {
11724    int test_ret = 0;
11725
11726#if defined(LIBXML_FTP_ENABLED)
11727    int mem_base;
11728    int ret_val;
11729    void * ctx; /* an FTP context */
11730    int n_ctx;
11731
11732    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11733        mem_base = xmlMemBlocks();
11734        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11735
11736        ret_val = xmlNanoFTPQuit(ctx);
11737        desret_int(ret_val);
11738        call_tests++;
11739        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11740        xmlResetLastError();
11741        if (mem_base != xmlMemBlocks()) {
11742            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11743	           xmlMemBlocks() - mem_base);
11744	    test_ret++;
11745            printf(" %d", n_ctx);
11746            printf("\n");
11747        }
11748    }
11749    function_tests++;
11750#endif
11751
11752    return(test_ret);
11753}
11754
11755
11756static int
11757test_xmlNanoFTPRead(void) {
11758    int test_ret = 0;
11759
11760#if defined(LIBXML_FTP_ENABLED)
11761    int mem_base;
11762    int ret_val;
11763    void * ctx; /* the FTP context */
11764    int n_ctx;
11765    void * dest; /* a buffer */
11766    int n_dest;
11767    int len; /* the buffer length */
11768    int n_len;
11769
11770    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11771    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11772    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11773        mem_base = xmlMemBlocks();
11774        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11775        dest = gen_void_ptr(n_dest, 1);
11776        len = gen_int(n_len, 2);
11777
11778        ret_val = xmlNanoFTPRead(ctx, dest, len);
11779        desret_int(ret_val);
11780        call_tests++;
11781        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11782        des_void_ptr(n_dest, dest, 1);
11783        des_int(n_len, len, 2);
11784        xmlResetLastError();
11785        if (mem_base != xmlMemBlocks()) {
11786            printf("Leak of %d blocks found in xmlNanoFTPRead",
11787	           xmlMemBlocks() - mem_base);
11788	    test_ret++;
11789            printf(" %d", n_ctx);
11790            printf(" %d", n_dest);
11791            printf(" %d", n_len);
11792            printf("\n");
11793        }
11794    }
11795    }
11796    }
11797    function_tests++;
11798#endif
11799
11800    return(test_ret);
11801}
11802
11803
11804static int
11805test_xmlNanoFTPScanProxy(void) {
11806    int test_ret = 0;
11807
11808#if defined(LIBXML_FTP_ENABLED)
11809    const char * URL; /* The proxy URL used to initialize the proxy context */
11810    int n_URL;
11811
11812    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11813        URL = gen_filepath(n_URL, 0);
11814
11815        xmlNanoFTPScanProxy(URL);
11816        call_tests++;
11817        des_filepath(n_URL, URL, 0);
11818        xmlResetLastError();
11819    }
11820    function_tests++;
11821#endif
11822
11823    return(test_ret);
11824}
11825
11826
11827static int
11828test_xmlNanoFTPUpdateURL(void) {
11829    int test_ret = 0;
11830
11831#if defined(LIBXML_FTP_ENABLED)
11832    int mem_base;
11833    int ret_val;
11834    void * ctx; /* an FTP context */
11835    int n_ctx;
11836    const char * URL; /* The URL used to update the context */
11837    int n_URL;
11838
11839    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11840    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11841        mem_base = xmlMemBlocks();
11842        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11843        URL = gen_filepath(n_URL, 1);
11844
11845        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11846        desret_int(ret_val);
11847        call_tests++;
11848        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11849        des_filepath(n_URL, URL, 1);
11850        xmlResetLastError();
11851        if (mem_base != xmlMemBlocks()) {
11852            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11853	           xmlMemBlocks() - mem_base);
11854	    test_ret++;
11855            printf(" %d", n_ctx);
11856            printf(" %d", n_URL);
11857            printf("\n");
11858        }
11859    }
11860    }
11861    function_tests++;
11862#endif
11863
11864    return(test_ret);
11865}
11866
11867static int
11868test_nanoftp(void) {
11869    int test_ret = 0;
11870
11871    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
11872    test_ret += test_xmlNanoFTPCheckResponse();
11873    test_ret += test_xmlNanoFTPCleanup();
11874    test_ret += test_xmlNanoFTPCloseConnection();
11875    test_ret += test_xmlNanoFTPCwd();
11876    test_ret += test_xmlNanoFTPDele();
11877    test_ret += test_xmlNanoFTPGet();
11878    test_ret += test_xmlNanoFTPGetConnection();
11879    test_ret += test_xmlNanoFTPGetResponse();
11880    test_ret += test_xmlNanoFTPGetSocket();
11881    test_ret += test_xmlNanoFTPInit();
11882    test_ret += test_xmlNanoFTPList();
11883    test_ret += test_xmlNanoFTPNewCtxt();
11884    test_ret += test_xmlNanoFTPOpen();
11885    test_ret += test_xmlNanoFTPProxy();
11886    test_ret += test_xmlNanoFTPQuit();
11887    test_ret += test_xmlNanoFTPRead();
11888    test_ret += test_xmlNanoFTPScanProxy();
11889    test_ret += test_xmlNanoFTPUpdateURL();
11890
11891    if (test_ret != 0)
11892	printf("Module nanoftp: %d errors\n", test_ret);
11893    return(test_ret);
11894}
11895
11896static int
11897test_xmlNanoHTTPAuthHeader(void) {
11898    int test_ret = 0;
11899
11900#if defined(LIBXML_HTTP_ENABLED)
11901    int mem_base;
11902    const char * ret_val;
11903    void * ctx; /* the HTTP context */
11904    int n_ctx;
11905
11906    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11907        mem_base = xmlMemBlocks();
11908        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11909
11910        ret_val = xmlNanoHTTPAuthHeader(ctx);
11911        desret_const_char_ptr(ret_val);
11912        call_tests++;
11913        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11914        xmlResetLastError();
11915        if (mem_base != xmlMemBlocks()) {
11916            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11917	           xmlMemBlocks() - mem_base);
11918	    test_ret++;
11919            printf(" %d", n_ctx);
11920            printf("\n");
11921        }
11922    }
11923    function_tests++;
11924#endif
11925
11926    return(test_ret);
11927}
11928
11929
11930static int
11931test_xmlNanoHTTPCleanup(void) {
11932    int test_ret = 0;
11933
11934#if defined(LIBXML_HTTP_ENABLED)
11935    int mem_base;
11936
11937        mem_base = xmlMemBlocks();
11938
11939        xmlNanoHTTPCleanup();
11940        call_tests++;
11941        xmlResetLastError();
11942        if (mem_base != xmlMemBlocks()) {
11943            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
11944	           xmlMemBlocks() - mem_base);
11945	    test_ret++;
11946            printf("\n");
11947        }
11948    function_tests++;
11949#endif
11950
11951    return(test_ret);
11952}
11953
11954
11955static int
11956test_xmlNanoHTTPContentLength(void) {
11957    int test_ret = 0;
11958
11959#if defined(LIBXML_HTTP_ENABLED)
11960    int mem_base;
11961    int ret_val;
11962    void * ctx; /* the HTTP context */
11963    int n_ctx;
11964
11965    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11966        mem_base = xmlMemBlocks();
11967        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11968
11969        ret_val = xmlNanoHTTPContentLength(ctx);
11970        desret_int(ret_val);
11971        call_tests++;
11972        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11973        xmlResetLastError();
11974        if (mem_base != xmlMemBlocks()) {
11975            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
11976	           xmlMemBlocks() - mem_base);
11977	    test_ret++;
11978            printf(" %d", n_ctx);
11979            printf("\n");
11980        }
11981    }
11982    function_tests++;
11983#endif
11984
11985    return(test_ret);
11986}
11987
11988
11989static int
11990test_xmlNanoHTTPEncoding(void) {
11991    int test_ret = 0;
11992
11993#if defined(LIBXML_HTTP_ENABLED)
11994    int mem_base;
11995    const char * ret_val;
11996    void * ctx; /* the HTTP context */
11997    int n_ctx;
11998
11999    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12000        mem_base = xmlMemBlocks();
12001        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12002
12003        ret_val = xmlNanoHTTPEncoding(ctx);
12004        desret_const_char_ptr(ret_val);
12005        call_tests++;
12006        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12007        xmlResetLastError();
12008        if (mem_base != xmlMemBlocks()) {
12009            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12010	           xmlMemBlocks() - mem_base);
12011	    test_ret++;
12012            printf(" %d", n_ctx);
12013            printf("\n");
12014        }
12015    }
12016    function_tests++;
12017#endif
12018
12019    return(test_ret);
12020}
12021
12022
12023#define gen_nb_char_ptr_ptr 1
12024static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12025    return(NULL);
12026}
12027static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12028}
12029
12030static int
12031test_xmlNanoHTTPFetch(void) {
12032    int test_ret = 0;
12033
12034#if defined(LIBXML_HTTP_ENABLED)
12035    int mem_base;
12036    int ret_val;
12037    const char * URL; /* The URL to load */
12038    int n_URL;
12039    const char * filename; /* the filename where the content should be saved */
12040    int n_filename;
12041    char ** contentType; /* if available the Content-Type information will be returned at that location */
12042    int n_contentType;
12043
12044    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12045    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12046    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12047        mem_base = xmlMemBlocks();
12048        URL = gen_fileoutput(n_URL, 0);
12049        filename = gen_fileoutput(n_filename, 1);
12050        contentType = gen_char_ptr_ptr(n_contentType, 2);
12051
12052        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12053        desret_int(ret_val);
12054        call_tests++;
12055        des_fileoutput(n_URL, URL, 0);
12056        des_fileoutput(n_filename, filename, 1);
12057        des_char_ptr_ptr(n_contentType, contentType, 2);
12058        xmlResetLastError();
12059        if (mem_base != xmlMemBlocks()) {
12060            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12061	           xmlMemBlocks() - mem_base);
12062	    test_ret++;
12063            printf(" %d", n_URL);
12064            printf(" %d", n_filename);
12065            printf(" %d", n_contentType);
12066            printf("\n");
12067        }
12068    }
12069    }
12070    }
12071    function_tests++;
12072#endif
12073
12074    return(test_ret);
12075}
12076
12077
12078static int
12079test_xmlNanoHTTPInit(void) {
12080    int test_ret = 0;
12081
12082#if defined(LIBXML_HTTP_ENABLED)
12083    int mem_base;
12084
12085        mem_base = xmlMemBlocks();
12086
12087        xmlNanoHTTPInit();
12088        call_tests++;
12089        xmlResetLastError();
12090        if (mem_base != xmlMemBlocks()) {
12091            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12092	           xmlMemBlocks() - mem_base);
12093	    test_ret++;
12094            printf("\n");
12095        }
12096    function_tests++;
12097#endif
12098
12099    return(test_ret);
12100}
12101
12102
12103static int
12104test_xmlNanoHTTPMimeType(void) {
12105    int test_ret = 0;
12106
12107#if defined(LIBXML_HTTP_ENABLED)
12108    int mem_base;
12109    const char * ret_val;
12110    void * ctx; /* the HTTP context */
12111    int n_ctx;
12112
12113    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12114        mem_base = xmlMemBlocks();
12115        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12116
12117        ret_val = xmlNanoHTTPMimeType(ctx);
12118        desret_const_char_ptr(ret_val);
12119        call_tests++;
12120        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12121        xmlResetLastError();
12122        if (mem_base != xmlMemBlocks()) {
12123            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12124	           xmlMemBlocks() - mem_base);
12125	    test_ret++;
12126            printf(" %d", n_ctx);
12127            printf("\n");
12128        }
12129    }
12130    function_tests++;
12131#endif
12132
12133    return(test_ret);
12134}
12135
12136
12137static int
12138test_xmlNanoHTTPOpen(void) {
12139    int test_ret = 0;
12140
12141#if defined(LIBXML_HTTP_ENABLED)
12142    int mem_base;
12143    void * ret_val;
12144    const char * URL; /* The URL to load */
12145    int n_URL;
12146    char ** contentType; /* if available the Content-Type information will be returned at that location */
12147    int n_contentType;
12148
12149    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12150    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12151        mem_base = xmlMemBlocks();
12152        URL = gen_filepath(n_URL, 0);
12153        contentType = gen_char_ptr_ptr(n_contentType, 1);
12154
12155        ret_val = xmlNanoHTTPOpen(URL, contentType);
12156        desret_xmlNanoHTTPCtxtPtr(ret_val);
12157        call_tests++;
12158        des_filepath(n_URL, URL, 0);
12159        des_char_ptr_ptr(n_contentType, contentType, 1);
12160        xmlResetLastError();
12161        if (mem_base != xmlMemBlocks()) {
12162            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12163	           xmlMemBlocks() - mem_base);
12164	    test_ret++;
12165            printf(" %d", n_URL);
12166            printf(" %d", n_contentType);
12167            printf("\n");
12168        }
12169    }
12170    }
12171    function_tests++;
12172#endif
12173
12174    return(test_ret);
12175}
12176
12177
12178static int
12179test_xmlNanoHTTPOpenRedir(void) {
12180    int test_ret = 0;
12181
12182#if defined(LIBXML_HTTP_ENABLED)
12183    int mem_base;
12184    void * ret_val;
12185    const char * URL; /* The URL to load */
12186    int n_URL;
12187    char ** contentType; /* if available the Content-Type information will be returned at that location */
12188    int n_contentType;
12189    char ** redir; /* if available the redirected URL will be returned */
12190    int n_redir;
12191
12192    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12193    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12194    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12195        mem_base = xmlMemBlocks();
12196        URL = gen_filepath(n_URL, 0);
12197        contentType = gen_char_ptr_ptr(n_contentType, 1);
12198        redir = gen_char_ptr_ptr(n_redir, 2);
12199
12200        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12201        desret_xmlNanoHTTPCtxtPtr(ret_val);
12202        call_tests++;
12203        des_filepath(n_URL, URL, 0);
12204        des_char_ptr_ptr(n_contentType, contentType, 1);
12205        des_char_ptr_ptr(n_redir, redir, 2);
12206        xmlResetLastError();
12207        if (mem_base != xmlMemBlocks()) {
12208            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12209	           xmlMemBlocks() - mem_base);
12210	    test_ret++;
12211            printf(" %d", n_URL);
12212            printf(" %d", n_contentType);
12213            printf(" %d", n_redir);
12214            printf("\n");
12215        }
12216    }
12217    }
12218    }
12219    function_tests++;
12220#endif
12221
12222    return(test_ret);
12223}
12224
12225
12226static int
12227test_xmlNanoHTTPRead(void) {
12228    int test_ret = 0;
12229
12230#if defined(LIBXML_HTTP_ENABLED)
12231    int mem_base;
12232    int ret_val;
12233    void * ctx; /* the HTTP context */
12234    int n_ctx;
12235    void * dest; /* a buffer */
12236    int n_dest;
12237    int len; /* the buffer length */
12238    int n_len;
12239
12240    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12241    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12242    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12243        mem_base = xmlMemBlocks();
12244        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12245        dest = gen_void_ptr(n_dest, 1);
12246        len = gen_int(n_len, 2);
12247
12248        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12249        desret_int(ret_val);
12250        call_tests++;
12251        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12252        des_void_ptr(n_dest, dest, 1);
12253        des_int(n_len, len, 2);
12254        xmlResetLastError();
12255        if (mem_base != xmlMemBlocks()) {
12256            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12257	           xmlMemBlocks() - mem_base);
12258	    test_ret++;
12259            printf(" %d", n_ctx);
12260            printf(" %d", n_dest);
12261            printf(" %d", n_len);
12262            printf("\n");
12263        }
12264    }
12265    }
12266    }
12267    function_tests++;
12268#endif
12269
12270    return(test_ret);
12271}
12272
12273
12274static int
12275test_xmlNanoHTTPRedir(void) {
12276    int test_ret = 0;
12277
12278
12279    /* missing type support */
12280    return(test_ret);
12281}
12282
12283
12284static int
12285test_xmlNanoHTTPReturnCode(void) {
12286    int test_ret = 0;
12287
12288#if defined(LIBXML_HTTP_ENABLED)
12289    int mem_base;
12290    int ret_val;
12291    void * ctx; /* the HTTP context */
12292    int n_ctx;
12293
12294    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12295        mem_base = xmlMemBlocks();
12296        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12297
12298        ret_val = xmlNanoHTTPReturnCode(ctx);
12299        desret_int(ret_val);
12300        call_tests++;
12301        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12302        xmlResetLastError();
12303        if (mem_base != xmlMemBlocks()) {
12304            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12305	           xmlMemBlocks() - mem_base);
12306	    test_ret++;
12307            printf(" %d", n_ctx);
12308            printf("\n");
12309        }
12310    }
12311    function_tests++;
12312#endif
12313
12314    return(test_ret);
12315}
12316
12317
12318static int
12319test_xmlNanoHTTPSave(void) {
12320    int test_ret = 0;
12321
12322#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12323    int mem_base;
12324    int ret_val;
12325    void * ctxt; /* the HTTP context */
12326    int n_ctxt;
12327    const char * filename; /* the filename where the content should be saved */
12328    int n_filename;
12329
12330    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12331    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12332        mem_base = xmlMemBlocks();
12333        ctxt = gen_void_ptr(n_ctxt, 0);
12334        filename = gen_fileoutput(n_filename, 1);
12335
12336        ret_val = xmlNanoHTTPSave(ctxt, filename);
12337        desret_int(ret_val);
12338        call_tests++;
12339        des_void_ptr(n_ctxt, ctxt, 0);
12340        des_fileoutput(n_filename, filename, 1);
12341        xmlResetLastError();
12342        if (mem_base != xmlMemBlocks()) {
12343            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12344	           xmlMemBlocks() - mem_base);
12345	    test_ret++;
12346            printf(" %d", n_ctxt);
12347            printf(" %d", n_filename);
12348            printf("\n");
12349        }
12350    }
12351    }
12352    function_tests++;
12353#endif
12354
12355    return(test_ret);
12356}
12357
12358
12359static int
12360test_xmlNanoHTTPScanProxy(void) {
12361    int test_ret = 0;
12362
12363#if defined(LIBXML_HTTP_ENABLED)
12364    const char * URL; /* The proxy URL used to initialize the proxy context */
12365    int n_URL;
12366
12367    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12368        URL = gen_filepath(n_URL, 0);
12369
12370        xmlNanoHTTPScanProxy(URL);
12371        call_tests++;
12372        des_filepath(n_URL, URL, 0);
12373        xmlResetLastError();
12374    }
12375    function_tests++;
12376#endif
12377
12378    return(test_ret);
12379}
12380
12381static int
12382test_nanohttp(void) {
12383    int test_ret = 0;
12384
12385    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12386    test_ret += test_xmlNanoHTTPAuthHeader();
12387    test_ret += test_xmlNanoHTTPCleanup();
12388    test_ret += test_xmlNanoHTTPContentLength();
12389    test_ret += test_xmlNanoHTTPEncoding();
12390    test_ret += test_xmlNanoHTTPFetch();
12391    test_ret += test_xmlNanoHTTPInit();
12392    test_ret += test_xmlNanoHTTPMimeType();
12393    test_ret += test_xmlNanoHTTPOpen();
12394    test_ret += test_xmlNanoHTTPOpenRedir();
12395    test_ret += test_xmlNanoHTTPRead();
12396    test_ret += test_xmlNanoHTTPRedir();
12397    test_ret += test_xmlNanoHTTPReturnCode();
12398    test_ret += test_xmlNanoHTTPSave();
12399    test_ret += test_xmlNanoHTTPScanProxy();
12400
12401    if (test_ret != 0)
12402	printf("Module nanohttp: %d errors\n", test_ret);
12403    return(test_ret);
12404}
12405
12406static int
12407test_xmlByteConsumed(void) {
12408    int test_ret = 0;
12409
12410    int mem_base;
12411    long ret_val;
12412    xmlParserCtxtPtr ctxt; /* an XML parser context */
12413    int n_ctxt;
12414
12415    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12416        mem_base = xmlMemBlocks();
12417        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12418
12419        ret_val = xmlByteConsumed(ctxt);
12420        desret_long(ret_val);
12421        call_tests++;
12422        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12423        xmlResetLastError();
12424        if (mem_base != xmlMemBlocks()) {
12425            printf("Leak of %d blocks found in xmlByteConsumed",
12426	           xmlMemBlocks() - mem_base);
12427	    test_ret++;
12428            printf(" %d", n_ctxt);
12429            printf("\n");
12430        }
12431    }
12432    function_tests++;
12433
12434    return(test_ret);
12435}
12436
12437
12438static int
12439test_xmlClearNodeInfoSeq(void) {
12440    int test_ret = 0;
12441
12442    int mem_base;
12443    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12444    int n_seq;
12445
12446    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12447        mem_base = xmlMemBlocks();
12448        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12449
12450        xmlClearNodeInfoSeq(seq);
12451        call_tests++;
12452        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12453        xmlResetLastError();
12454        if (mem_base != xmlMemBlocks()) {
12455            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12456	           xmlMemBlocks() - mem_base);
12457	    test_ret++;
12458            printf(" %d", n_seq);
12459            printf("\n");
12460        }
12461    }
12462    function_tests++;
12463
12464    return(test_ret);
12465}
12466
12467
12468static int
12469test_xmlClearParserCtxt(void) {
12470    int test_ret = 0;
12471
12472    int mem_base;
12473    xmlParserCtxtPtr ctxt; /* an XML parser context */
12474    int n_ctxt;
12475
12476    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12477        mem_base = xmlMemBlocks();
12478        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12479
12480        xmlClearParserCtxt(ctxt);
12481        call_tests++;
12482        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12483        xmlResetLastError();
12484        if (mem_base != xmlMemBlocks()) {
12485            printf("Leak of %d blocks found in xmlClearParserCtxt",
12486	           xmlMemBlocks() - mem_base);
12487	    test_ret++;
12488            printf(" %d", n_ctxt);
12489            printf("\n");
12490        }
12491    }
12492    function_tests++;
12493
12494    return(test_ret);
12495}
12496
12497
12498static int
12499test_xmlCreateDocParserCtxt(void) {
12500    int test_ret = 0;
12501
12502    int mem_base;
12503    xmlParserCtxtPtr ret_val;
12504    xmlChar * cur; /* a pointer to an array of xmlChar */
12505    int n_cur;
12506
12507    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12508        mem_base = xmlMemBlocks();
12509        cur = gen_const_xmlChar_ptr(n_cur, 0);
12510
12511        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12512        desret_xmlParserCtxtPtr(ret_val);
12513        call_tests++;
12514        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12515        xmlResetLastError();
12516        if (mem_base != xmlMemBlocks()) {
12517            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12518	           xmlMemBlocks() - mem_base);
12519	    test_ret++;
12520            printf(" %d", n_cur);
12521            printf("\n");
12522        }
12523    }
12524    function_tests++;
12525
12526    return(test_ret);
12527}
12528
12529
12530static int
12531test_xmlCreatePushParserCtxt(void) {
12532    int test_ret = 0;
12533
12534#if defined(LIBXML_PUSH_ENABLED)
12535    int mem_base;
12536    xmlParserCtxtPtr ret_val;
12537    xmlSAXHandlerPtr sax; /* a SAX handler */
12538    int n_sax;
12539    void * user_data; /* The user data returned on SAX callbacks */
12540    int n_user_data;
12541    char * chunk; /* a pointer to an array of chars */
12542    int n_chunk;
12543    int size; /* number of chars in the array */
12544    int n_size;
12545    const char * filename; /* an optional file name or URI */
12546    int n_filename;
12547
12548    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12549    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12550    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12551    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12552    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12553        mem_base = xmlMemBlocks();
12554        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12555        user_data = gen_userdata(n_user_data, 1);
12556        chunk = gen_const_char_ptr(n_chunk, 2);
12557        size = gen_int(n_size, 3);
12558        filename = gen_fileoutput(n_filename, 4);
12559
12560        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12561        desret_xmlParserCtxtPtr(ret_val);
12562        call_tests++;
12563        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12564        des_userdata(n_user_data, user_data, 1);
12565        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12566        des_int(n_size, size, 3);
12567        des_fileoutput(n_filename, filename, 4);
12568        xmlResetLastError();
12569        if (mem_base != xmlMemBlocks()) {
12570            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12571	           xmlMemBlocks() - mem_base);
12572	    test_ret++;
12573            printf(" %d", n_sax);
12574            printf(" %d", n_user_data);
12575            printf(" %d", n_chunk);
12576            printf(" %d", n_size);
12577            printf(" %d", n_filename);
12578            printf("\n");
12579        }
12580    }
12581    }
12582    }
12583    }
12584    }
12585    function_tests++;
12586#endif
12587
12588    return(test_ret);
12589}
12590
12591
12592static int
12593test_xmlCtxtReadDoc(void) {
12594    int test_ret = 0;
12595
12596    int mem_base;
12597    xmlDocPtr ret_val;
12598    xmlParserCtxtPtr ctxt; /* an XML parser context */
12599    int n_ctxt;
12600    xmlChar * cur; /* a pointer to a zero terminated string */
12601    int n_cur;
12602    const char * URL; /* the base URL to use for the document */
12603    int n_URL;
12604    char * encoding; /* the document encoding, or NULL */
12605    int n_encoding;
12606    int options; /* a combination of xmlParserOption */
12607    int n_options;
12608
12609    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12610    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12611    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12612    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12613    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12614        mem_base = xmlMemBlocks();
12615        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12616        cur = gen_const_xmlChar_ptr(n_cur, 1);
12617        URL = gen_filepath(n_URL, 2);
12618        encoding = gen_const_char_ptr(n_encoding, 3);
12619        options = gen_parseroptions(n_options, 4);
12620
12621        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12622        desret_xmlDocPtr(ret_val);
12623        call_tests++;
12624        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12625        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12626        des_filepath(n_URL, URL, 2);
12627        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12628        des_parseroptions(n_options, options, 4);
12629        xmlResetLastError();
12630        if (mem_base != xmlMemBlocks()) {
12631            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12632	           xmlMemBlocks() - mem_base);
12633	    test_ret++;
12634            printf(" %d", n_ctxt);
12635            printf(" %d", n_cur);
12636            printf(" %d", n_URL);
12637            printf(" %d", n_encoding);
12638            printf(" %d", n_options);
12639            printf("\n");
12640        }
12641    }
12642    }
12643    }
12644    }
12645    }
12646    function_tests++;
12647
12648    return(test_ret);
12649}
12650
12651
12652static int
12653test_xmlCtxtReadFile(void) {
12654    int test_ret = 0;
12655
12656    int mem_base;
12657    xmlDocPtr ret_val;
12658    xmlParserCtxtPtr ctxt; /* an XML parser context */
12659    int n_ctxt;
12660    const char * filename; /* a file or URL */
12661    int n_filename;
12662    char * encoding; /* the document encoding, or NULL */
12663    int n_encoding;
12664    int options; /* a combination of xmlParserOption */
12665    int n_options;
12666
12667    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12668    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12669    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12670    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12671        mem_base = xmlMemBlocks();
12672        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12673        filename = gen_filepath(n_filename, 1);
12674        encoding = gen_const_char_ptr(n_encoding, 2);
12675        options = gen_parseroptions(n_options, 3);
12676
12677        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12678        desret_xmlDocPtr(ret_val);
12679        call_tests++;
12680        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12681        des_filepath(n_filename, filename, 1);
12682        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12683        des_parseroptions(n_options, options, 3);
12684        xmlResetLastError();
12685        if (mem_base != xmlMemBlocks()) {
12686            printf("Leak of %d blocks found in xmlCtxtReadFile",
12687	           xmlMemBlocks() - mem_base);
12688	    test_ret++;
12689            printf(" %d", n_ctxt);
12690            printf(" %d", n_filename);
12691            printf(" %d", n_encoding);
12692            printf(" %d", n_options);
12693            printf("\n");
12694        }
12695    }
12696    }
12697    }
12698    }
12699    function_tests++;
12700
12701    return(test_ret);
12702}
12703
12704
12705static int
12706test_xmlCtxtReadMemory(void) {
12707    int test_ret = 0;
12708
12709    int mem_base;
12710    xmlDocPtr ret_val;
12711    xmlParserCtxtPtr ctxt; /* an XML parser context */
12712    int n_ctxt;
12713    char * buffer; /* a pointer to a char array */
12714    int n_buffer;
12715    int size; /* the size of the array */
12716    int n_size;
12717    const char * URL; /* the base URL to use for the document */
12718    int n_URL;
12719    char * encoding; /* the document encoding, or NULL */
12720    int n_encoding;
12721    int options; /* a combination of xmlParserOption */
12722    int n_options;
12723
12724    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12725    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12726    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12727    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12728    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12729    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12730        mem_base = xmlMemBlocks();
12731        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12732        buffer = gen_const_char_ptr(n_buffer, 1);
12733        size = gen_int(n_size, 2);
12734        URL = gen_filepath(n_URL, 3);
12735        encoding = gen_const_char_ptr(n_encoding, 4);
12736        options = gen_parseroptions(n_options, 5);
12737
12738        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12739        desret_xmlDocPtr(ret_val);
12740        call_tests++;
12741        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12742        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12743        des_int(n_size, size, 2);
12744        des_filepath(n_URL, URL, 3);
12745        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12746        des_parseroptions(n_options, options, 5);
12747        xmlResetLastError();
12748        if (mem_base != xmlMemBlocks()) {
12749            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12750	           xmlMemBlocks() - mem_base);
12751	    test_ret++;
12752            printf(" %d", n_ctxt);
12753            printf(" %d", n_buffer);
12754            printf(" %d", n_size);
12755            printf(" %d", n_URL);
12756            printf(" %d", n_encoding);
12757            printf(" %d", n_options);
12758            printf("\n");
12759        }
12760    }
12761    }
12762    }
12763    }
12764    }
12765    }
12766    function_tests++;
12767
12768    return(test_ret);
12769}
12770
12771
12772static int
12773test_xmlCtxtReset(void) {
12774    int test_ret = 0;
12775
12776    int mem_base;
12777    xmlParserCtxtPtr ctxt; /* an XML parser context */
12778    int n_ctxt;
12779
12780    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12781        mem_base = xmlMemBlocks();
12782        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12783
12784        xmlCtxtReset(ctxt);
12785        call_tests++;
12786        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12787        xmlResetLastError();
12788        if (mem_base != xmlMemBlocks()) {
12789            printf("Leak of %d blocks found in xmlCtxtReset",
12790	           xmlMemBlocks() - mem_base);
12791	    test_ret++;
12792            printf(" %d", n_ctxt);
12793            printf("\n");
12794        }
12795    }
12796    function_tests++;
12797
12798    return(test_ret);
12799}
12800
12801
12802static int
12803test_xmlCtxtResetPush(void) {
12804    int test_ret = 0;
12805
12806    int mem_base;
12807    int ret_val;
12808    xmlParserCtxtPtr ctxt; /* an XML parser context */
12809    int n_ctxt;
12810    char * chunk; /* a pointer to an array of chars */
12811    int n_chunk;
12812    int size; /* number of chars in the array */
12813    int n_size;
12814    const char * filename; /* an optional file name or URI */
12815    int n_filename;
12816    char * encoding; /* the document encoding, or NULL */
12817    int n_encoding;
12818
12819    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12820    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12821    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12822    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12823    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12824        mem_base = xmlMemBlocks();
12825        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12826        chunk = gen_const_char_ptr(n_chunk, 1);
12827        size = gen_int(n_size, 2);
12828        filename = gen_filepath(n_filename, 3);
12829        encoding = gen_const_char_ptr(n_encoding, 4);
12830
12831        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12832        desret_int(ret_val);
12833        call_tests++;
12834        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12835        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12836        des_int(n_size, size, 2);
12837        des_filepath(n_filename, filename, 3);
12838        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12839        xmlResetLastError();
12840        if (mem_base != xmlMemBlocks()) {
12841            printf("Leak of %d blocks found in xmlCtxtResetPush",
12842	           xmlMemBlocks() - mem_base);
12843	    test_ret++;
12844            printf(" %d", n_ctxt);
12845            printf(" %d", n_chunk);
12846            printf(" %d", n_size);
12847            printf(" %d", n_filename);
12848            printf(" %d", n_encoding);
12849            printf("\n");
12850        }
12851    }
12852    }
12853    }
12854    }
12855    }
12856    function_tests++;
12857
12858    return(test_ret);
12859}
12860
12861
12862static int
12863test_xmlCtxtUseOptions(void) {
12864    int test_ret = 0;
12865
12866    int mem_base;
12867    int ret_val;
12868    xmlParserCtxtPtr ctxt; /* an XML parser context */
12869    int n_ctxt;
12870    int options; /* a combination of xmlParserOption */
12871    int n_options;
12872
12873    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12874    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12875        mem_base = xmlMemBlocks();
12876        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12877        options = gen_parseroptions(n_options, 1);
12878
12879        ret_val = xmlCtxtUseOptions(ctxt, options);
12880        desret_int(ret_val);
12881        call_tests++;
12882        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12883        des_parseroptions(n_options, options, 1);
12884        xmlResetLastError();
12885        if (mem_base != xmlMemBlocks()) {
12886            printf("Leak of %d blocks found in xmlCtxtUseOptions",
12887	           xmlMemBlocks() - mem_base);
12888	    test_ret++;
12889            printf(" %d", n_ctxt);
12890            printf(" %d", n_options);
12891            printf("\n");
12892        }
12893    }
12894    }
12895    function_tests++;
12896
12897    return(test_ret);
12898}
12899
12900
12901static int
12902test_xmlGetExternalEntityLoader(void) {
12903    int test_ret = 0;
12904
12905
12906    /* missing type support */
12907    return(test_ret);
12908}
12909
12910
12911static int
12912test_xmlGetFeature(void) {
12913    int test_ret = 0;
12914
12915#if defined(LIBXML_LEGACY_ENABLED)
12916#ifdef LIBXML_LEGACY_ENABLED
12917    int mem_base;
12918    int ret_val;
12919    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
12920    int n_ctxt;
12921    char * name; /* the feature name */
12922    int n_name;
12923    void * result; /* location to store the result */
12924    int n_result;
12925
12926    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12927    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
12928    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
12929        mem_base = xmlMemBlocks();
12930        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12931        name = gen_const_char_ptr(n_name, 1);
12932        result = gen_void_ptr(n_result, 2);
12933
12934        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
12935        desret_int(ret_val);
12936        call_tests++;
12937        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12938        des_const_char_ptr(n_name, (const char *)name, 1);
12939        des_void_ptr(n_result, result, 2);
12940        xmlResetLastError();
12941        if (mem_base != xmlMemBlocks()) {
12942            printf("Leak of %d blocks found in xmlGetFeature",
12943	           xmlMemBlocks() - mem_base);
12944	    test_ret++;
12945            printf(" %d", n_ctxt);
12946            printf(" %d", n_name);
12947            printf(" %d", n_result);
12948            printf("\n");
12949        }
12950    }
12951    }
12952    }
12953    function_tests++;
12954#endif
12955#endif
12956
12957    return(test_ret);
12958}
12959
12960
12961#define gen_nb_const_char_ptr_ptr 1
12962static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12963    return(NULL);
12964}
12965static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12966}
12967
12968static int
12969test_xmlGetFeaturesList(void) {
12970    int test_ret = 0;
12971
12972#if defined(LIBXML_LEGACY_ENABLED)
12973#ifdef LIBXML_LEGACY_ENABLED
12974    int mem_base;
12975    int ret_val;
12976    int * len; /* the length of the features name array (input/output) */
12977    int n_len;
12978    char ** result; /* an array of string to be filled with the features name. */
12979    int n_result;
12980
12981    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
12982    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
12983        mem_base = xmlMemBlocks();
12984        len = gen_int_ptr(n_len, 0);
12985        result = gen_const_char_ptr_ptr(n_result, 1);
12986
12987        ret_val = xmlGetFeaturesList(len, (const char **)result);
12988        desret_int(ret_val);
12989        call_tests++;
12990        des_int_ptr(n_len, len, 0);
12991        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
12992        xmlResetLastError();
12993        if (mem_base != xmlMemBlocks()) {
12994            printf("Leak of %d blocks found in xmlGetFeaturesList",
12995	           xmlMemBlocks() - mem_base);
12996	    test_ret++;
12997            printf(" %d", n_len);
12998            printf(" %d", n_result);
12999            printf("\n");
13000        }
13001    }
13002    }
13003    function_tests++;
13004#endif
13005#endif
13006
13007    return(test_ret);
13008}
13009
13010
13011static int
13012test_xmlHasFeature(void) {
13013    int test_ret = 0;
13014
13015    int mem_base;
13016    int ret_val;
13017    xmlFeature feature; /* the feature to be examined */
13018    int n_feature;
13019
13020    for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13021        mem_base = xmlMemBlocks();
13022        feature = gen_xmlFeature(n_feature, 0);
13023
13024        ret_val = xmlHasFeature(feature);
13025        desret_int(ret_val);
13026        call_tests++;
13027        des_xmlFeature(n_feature, feature, 0);
13028        xmlResetLastError();
13029        if (mem_base != xmlMemBlocks()) {
13030            printf("Leak of %d blocks found in xmlHasFeature",
13031	           xmlMemBlocks() - mem_base);
13032	    test_ret++;
13033            printf(" %d", n_feature);
13034            printf("\n");
13035        }
13036    }
13037    function_tests++;
13038
13039    return(test_ret);
13040}
13041
13042
13043static int
13044test_xmlIOParseDTD(void) {
13045    int test_ret = 0;
13046
13047#if defined(LIBXML_VALID_ENABLED)
13048#ifdef LIBXML_VALID_ENABLED
13049    int mem_base;
13050    xmlDtdPtr ret_val;
13051    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13052    int n_sax;
13053    xmlParserInputBufferPtr input; /* an Input Buffer */
13054    int n_input;
13055    xmlCharEncoding enc; /* the charset encoding if known */
13056    int n_enc;
13057
13058    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13059    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13060    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13061        mem_base = xmlMemBlocks();
13062        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13063        input = gen_xmlParserInputBufferPtr(n_input, 1);
13064        enc = gen_xmlCharEncoding(n_enc, 2);
13065
13066        ret_val = xmlIOParseDTD(sax, input, enc);
13067        input = NULL;
13068        desret_xmlDtdPtr(ret_val);
13069        call_tests++;
13070        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13071        des_xmlParserInputBufferPtr(n_input, input, 1);
13072        des_xmlCharEncoding(n_enc, enc, 2);
13073        xmlResetLastError();
13074        if (mem_base != xmlMemBlocks()) {
13075            printf("Leak of %d blocks found in xmlIOParseDTD",
13076	           xmlMemBlocks() - mem_base);
13077	    test_ret++;
13078            printf(" %d", n_sax);
13079            printf(" %d", n_input);
13080            printf(" %d", n_enc);
13081            printf("\n");
13082        }
13083    }
13084    }
13085    }
13086    function_tests++;
13087#endif
13088#endif
13089
13090    return(test_ret);
13091}
13092
13093
13094static int
13095test_xmlInitNodeInfoSeq(void) {
13096    int test_ret = 0;
13097
13098    int mem_base;
13099    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13100    int n_seq;
13101
13102    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13103        mem_base = xmlMemBlocks();
13104        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13105
13106        xmlInitNodeInfoSeq(seq);
13107        call_tests++;
13108        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13109        xmlResetLastError();
13110        if (mem_base != xmlMemBlocks()) {
13111            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13112	           xmlMemBlocks() - mem_base);
13113	    test_ret++;
13114            printf(" %d", n_seq);
13115            printf("\n");
13116        }
13117    }
13118    function_tests++;
13119
13120    return(test_ret);
13121}
13122
13123
13124static int
13125test_xmlInitParser(void) {
13126    int test_ret = 0;
13127
13128    int mem_base;
13129
13130        mem_base = xmlMemBlocks();
13131
13132        xmlInitParser();
13133        call_tests++;
13134        xmlResetLastError();
13135        if (mem_base != xmlMemBlocks()) {
13136            printf("Leak of %d blocks found in xmlInitParser",
13137	           xmlMemBlocks() - mem_base);
13138	    test_ret++;
13139            printf("\n");
13140        }
13141    function_tests++;
13142
13143    return(test_ret);
13144}
13145
13146
13147static int
13148test_xmlInitParserCtxt(void) {
13149    int test_ret = 0;
13150
13151    int mem_base;
13152    int ret_val;
13153    xmlParserCtxtPtr ctxt; /* an XML parser context */
13154    int n_ctxt;
13155
13156    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13157        mem_base = xmlMemBlocks();
13158        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13159
13160        ret_val = xmlInitParserCtxt(ctxt);
13161        desret_int(ret_val);
13162        call_tests++;
13163        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13164        xmlResetLastError();
13165        if (mem_base != xmlMemBlocks()) {
13166            printf("Leak of %d blocks found in xmlInitParserCtxt",
13167	           xmlMemBlocks() - mem_base);
13168	    test_ret++;
13169            printf(" %d", n_ctxt);
13170            printf("\n");
13171        }
13172    }
13173    function_tests++;
13174
13175    return(test_ret);
13176}
13177
13178
13179static int
13180test_xmlKeepBlanksDefault(void) {
13181    int test_ret = 0;
13182
13183    int mem_base;
13184    int ret_val;
13185    int val; /* int 0 or 1 */
13186    int n_val;
13187
13188    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13189        mem_base = xmlMemBlocks();
13190        val = gen_int(n_val, 0);
13191
13192        ret_val = xmlKeepBlanksDefault(val);
13193        desret_int(ret_val);
13194        call_tests++;
13195        des_int(n_val, val, 0);
13196        xmlResetLastError();
13197        if (mem_base != xmlMemBlocks()) {
13198            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13199	           xmlMemBlocks() - mem_base);
13200	    test_ret++;
13201            printf(" %d", n_val);
13202            printf("\n");
13203        }
13204    }
13205    function_tests++;
13206
13207    return(test_ret);
13208}
13209
13210
13211static int
13212test_xmlLineNumbersDefault(void) {
13213    int test_ret = 0;
13214
13215    int mem_base;
13216    int ret_val;
13217    int val; /* int 0 or 1 */
13218    int n_val;
13219
13220    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13221        mem_base = xmlMemBlocks();
13222        val = gen_int(n_val, 0);
13223
13224        ret_val = xmlLineNumbersDefault(val);
13225        desret_int(ret_val);
13226        call_tests++;
13227        des_int(n_val, val, 0);
13228        xmlResetLastError();
13229        if (mem_base != xmlMemBlocks()) {
13230            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13231	           xmlMemBlocks() - mem_base);
13232	    test_ret++;
13233            printf(" %d", n_val);
13234            printf("\n");
13235        }
13236    }
13237    function_tests++;
13238
13239    return(test_ret);
13240}
13241
13242
13243static int
13244test_xmlLoadExternalEntity(void) {
13245    int test_ret = 0;
13246
13247    int mem_base;
13248    xmlParserInputPtr ret_val;
13249    const char * URL; /* the URL for the entity to load */
13250    int n_URL;
13251    char * ID; /* the Public ID for the entity to load */
13252    int n_ID;
13253    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13254    int n_ctxt;
13255
13256    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13257    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13258    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13259        mem_base = xmlMemBlocks();
13260        URL = gen_filepath(n_URL, 0);
13261        ID = gen_const_char_ptr(n_ID, 1);
13262        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13263
13264        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13265        desret_xmlParserInputPtr(ret_val);
13266        call_tests++;
13267        des_filepath(n_URL, URL, 0);
13268        des_const_char_ptr(n_ID, (const char *)ID, 1);
13269        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13270        xmlResetLastError();
13271        if (mem_base != xmlMemBlocks()) {
13272            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13273	           xmlMemBlocks() - mem_base);
13274	    test_ret++;
13275            printf(" %d", n_URL);
13276            printf(" %d", n_ID);
13277            printf(" %d", n_ctxt);
13278            printf("\n");
13279        }
13280    }
13281    }
13282    }
13283    function_tests++;
13284
13285    return(test_ret);
13286}
13287
13288
13289static int
13290test_xmlNewIOInputStream(void) {
13291    int test_ret = 0;
13292
13293    int mem_base;
13294    xmlParserInputPtr ret_val;
13295    xmlParserCtxtPtr ctxt; /* an XML parser context */
13296    int n_ctxt;
13297    xmlParserInputBufferPtr input; /* an I/O Input */
13298    int n_input;
13299    xmlCharEncoding enc; /* the charset encoding if known */
13300    int n_enc;
13301
13302    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13303    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13304    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13305        mem_base = xmlMemBlocks();
13306        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13307        input = gen_xmlParserInputBufferPtr(n_input, 1);
13308        enc = gen_xmlCharEncoding(n_enc, 2);
13309
13310        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13311        if (ret_val != NULL) input = NULL;
13312        desret_xmlParserInputPtr(ret_val);
13313        call_tests++;
13314        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13315        des_xmlParserInputBufferPtr(n_input, input, 1);
13316        des_xmlCharEncoding(n_enc, enc, 2);
13317        xmlResetLastError();
13318        if (mem_base != xmlMemBlocks()) {
13319            printf("Leak of %d blocks found in xmlNewIOInputStream",
13320	           xmlMemBlocks() - mem_base);
13321	    test_ret++;
13322            printf(" %d", n_ctxt);
13323            printf(" %d", n_input);
13324            printf(" %d", n_enc);
13325            printf("\n");
13326        }
13327    }
13328    }
13329    }
13330    function_tests++;
13331
13332    return(test_ret);
13333}
13334
13335
13336static int
13337test_xmlNewParserCtxt(void) {
13338    int test_ret = 0;
13339
13340    int mem_base;
13341    xmlParserCtxtPtr ret_val;
13342
13343        mem_base = xmlMemBlocks();
13344
13345        ret_val = xmlNewParserCtxt();
13346        desret_xmlParserCtxtPtr(ret_val);
13347        call_tests++;
13348        xmlResetLastError();
13349        if (mem_base != xmlMemBlocks()) {
13350            printf("Leak of %d blocks found in xmlNewParserCtxt",
13351	           xmlMemBlocks() - mem_base);
13352	    test_ret++;
13353            printf("\n");
13354        }
13355    function_tests++;
13356
13357    return(test_ret);
13358}
13359
13360
13361#define gen_nb_xmlNodePtr_ptr 1
13362static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13363    return(NULL);
13364}
13365static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13366}
13367
13368static int
13369test_xmlParseBalancedChunkMemory(void) {
13370    int test_ret = 0;
13371
13372#if defined(LIBXML_SAX1_ENABLED)
13373#ifdef LIBXML_SAX1_ENABLED
13374    int mem_base;
13375    int ret_val;
13376    xmlDocPtr doc; /* the document the chunk pertains to */
13377    int n_doc;
13378    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13379    int n_sax;
13380    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13381    int n_user_data;
13382    int depth; /* Used for loop detection, use 0 */
13383    int n_depth;
13384    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13385    int n_string;
13386    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13387    int n_lst;
13388
13389    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13390    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13391    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13392    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13393    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13394    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13395        mem_base = xmlMemBlocks();
13396        doc = gen_xmlDocPtr(n_doc, 0);
13397        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13398        user_data = gen_userdata(n_user_data, 2);
13399        depth = gen_int(n_depth, 3);
13400        string = gen_const_xmlChar_ptr(n_string, 4);
13401        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13402
13403#ifdef LIBXML_SAX1_ENABLED
13404        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13405#endif
13406
13407
13408        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13409        desret_int(ret_val);
13410        call_tests++;
13411        des_xmlDocPtr(n_doc, doc, 0);
13412        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13413        des_userdata(n_user_data, user_data, 2);
13414        des_int(n_depth, depth, 3);
13415        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13416        des_xmlNodePtr_ptr(n_lst, lst, 5);
13417        xmlResetLastError();
13418        if (mem_base != xmlMemBlocks()) {
13419            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13420	           xmlMemBlocks() - mem_base);
13421	    test_ret++;
13422            printf(" %d", n_doc);
13423            printf(" %d", n_sax);
13424            printf(" %d", n_user_data);
13425            printf(" %d", n_depth);
13426            printf(" %d", n_string);
13427            printf(" %d", n_lst);
13428            printf("\n");
13429        }
13430    }
13431    }
13432    }
13433    }
13434    }
13435    }
13436    function_tests++;
13437#endif
13438#endif
13439
13440    return(test_ret);
13441}
13442
13443
13444static int
13445test_xmlParseBalancedChunkMemoryRecover(void) {
13446    int test_ret = 0;
13447
13448#if defined(LIBXML_SAX1_ENABLED)
13449#ifdef LIBXML_SAX1_ENABLED
13450    int mem_base;
13451    int ret_val;
13452    xmlDocPtr doc; /* the document the chunk pertains to */
13453    int n_doc;
13454    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13455    int n_sax;
13456    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13457    int n_user_data;
13458    int depth; /* Used for loop detection, use 0 */
13459    int n_depth;
13460    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13461    int n_string;
13462    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13463    int n_lst;
13464    int recover; /* return nodes even if the data is broken (use 0) */
13465    int n_recover;
13466
13467    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13468    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13469    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13470    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13471    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13472    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13473    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13474        mem_base = xmlMemBlocks();
13475        doc = gen_xmlDocPtr(n_doc, 0);
13476        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13477        user_data = gen_userdata(n_user_data, 2);
13478        depth = gen_int(n_depth, 3);
13479        string = gen_const_xmlChar_ptr(n_string, 4);
13480        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13481        recover = gen_int(n_recover, 6);
13482
13483#ifdef LIBXML_SAX1_ENABLED
13484        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13485#endif
13486
13487
13488        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13489        desret_int(ret_val);
13490        call_tests++;
13491        des_xmlDocPtr(n_doc, doc, 0);
13492        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13493        des_userdata(n_user_data, user_data, 2);
13494        des_int(n_depth, depth, 3);
13495        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13496        des_xmlNodePtr_ptr(n_lst, lst, 5);
13497        des_int(n_recover, recover, 6);
13498        xmlResetLastError();
13499        if (mem_base != xmlMemBlocks()) {
13500            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13501	           xmlMemBlocks() - mem_base);
13502	    test_ret++;
13503            printf(" %d", n_doc);
13504            printf(" %d", n_sax);
13505            printf(" %d", n_user_data);
13506            printf(" %d", n_depth);
13507            printf(" %d", n_string);
13508            printf(" %d", n_lst);
13509            printf(" %d", n_recover);
13510            printf("\n");
13511        }
13512    }
13513    }
13514    }
13515    }
13516    }
13517    }
13518    }
13519    function_tests++;
13520#endif
13521#endif
13522
13523    return(test_ret);
13524}
13525
13526
13527static int
13528test_xmlParseChunk(void) {
13529    int test_ret = 0;
13530
13531#if defined(LIBXML_PUSH_ENABLED)
13532    int mem_base;
13533    int ret_val;
13534    xmlParserCtxtPtr ctxt; /* an XML parser context */
13535    int n_ctxt;
13536    char * chunk; /* an char array */
13537    int n_chunk;
13538    int size; /* the size in byte of the chunk */
13539    int n_size;
13540    int terminate; /* last chunk indicator */
13541    int n_terminate;
13542
13543    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13544    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13545    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13546    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13547        mem_base = xmlMemBlocks();
13548        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13549        chunk = gen_const_char_ptr(n_chunk, 1);
13550        size = gen_int(n_size, 2);
13551        terminate = gen_int(n_terminate, 3);
13552
13553        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13554        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13555        desret_int(ret_val);
13556        call_tests++;
13557        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13558        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13559        des_int(n_size, size, 2);
13560        des_int(n_terminate, terminate, 3);
13561        xmlResetLastError();
13562        if (mem_base != xmlMemBlocks()) {
13563            printf("Leak of %d blocks found in xmlParseChunk",
13564	           xmlMemBlocks() - mem_base);
13565	    test_ret++;
13566            printf(" %d", n_ctxt);
13567            printf(" %d", n_chunk);
13568            printf(" %d", n_size);
13569            printf(" %d", n_terminate);
13570            printf("\n");
13571        }
13572    }
13573    }
13574    }
13575    }
13576    function_tests++;
13577#endif
13578
13579    return(test_ret);
13580}
13581
13582
13583static int
13584test_xmlParseCtxtExternalEntity(void) {
13585    int test_ret = 0;
13586
13587    int mem_base;
13588    int ret_val;
13589    xmlParserCtxtPtr ctx; /* the existing parsing context */
13590    int n_ctx;
13591    xmlChar * URL; /* the URL for the entity to load */
13592    int n_URL;
13593    xmlChar * ID; /* the System ID for the entity to load */
13594    int n_ID;
13595    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13596    int n_lst;
13597
13598    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13599    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13600    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13601    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13602        mem_base = xmlMemBlocks();
13603        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13604        URL = gen_const_xmlChar_ptr(n_URL, 1);
13605        ID = gen_const_xmlChar_ptr(n_ID, 2);
13606        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13607
13608        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13609        desret_int(ret_val);
13610        call_tests++;
13611        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13612        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13613        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13614        des_xmlNodePtr_ptr(n_lst, lst, 3);
13615        xmlResetLastError();
13616        if (mem_base != xmlMemBlocks()) {
13617            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13618	           xmlMemBlocks() - mem_base);
13619	    test_ret++;
13620            printf(" %d", n_ctx);
13621            printf(" %d", n_URL);
13622            printf(" %d", n_ID);
13623            printf(" %d", n_lst);
13624            printf("\n");
13625        }
13626    }
13627    }
13628    }
13629    }
13630    function_tests++;
13631
13632    return(test_ret);
13633}
13634
13635
13636static int
13637test_xmlParseDTD(void) {
13638    int test_ret = 0;
13639
13640#if defined(LIBXML_VALID_ENABLED)
13641#ifdef LIBXML_VALID_ENABLED
13642    int mem_base;
13643    xmlDtdPtr ret_val;
13644    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13645    int n_ExternalID;
13646    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13647    int n_SystemID;
13648
13649    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13650    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13651        mem_base = xmlMemBlocks();
13652        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13653        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13654
13655        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13656        desret_xmlDtdPtr(ret_val);
13657        call_tests++;
13658        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13659        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13660        xmlResetLastError();
13661        if (mem_base != xmlMemBlocks()) {
13662            printf("Leak of %d blocks found in xmlParseDTD",
13663	           xmlMemBlocks() - mem_base);
13664	    test_ret++;
13665            printf(" %d", n_ExternalID);
13666            printf(" %d", n_SystemID);
13667            printf("\n");
13668        }
13669    }
13670    }
13671    function_tests++;
13672#endif
13673#endif
13674
13675    return(test_ret);
13676}
13677
13678
13679static int
13680test_xmlParseDoc(void) {
13681    int test_ret = 0;
13682
13683#if defined(LIBXML_SAX1_ENABLED)
13684#ifdef LIBXML_SAX1_ENABLED
13685    int mem_base;
13686    xmlDocPtr ret_val;
13687    xmlChar * cur; /* a pointer to an array of xmlChar */
13688    int n_cur;
13689
13690    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13691        mem_base = xmlMemBlocks();
13692        cur = gen_const_xmlChar_ptr(n_cur, 0);
13693
13694        ret_val = xmlParseDoc((const xmlChar *)cur);
13695        desret_xmlDocPtr(ret_val);
13696        call_tests++;
13697        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13698        xmlResetLastError();
13699        if (mem_base != xmlMemBlocks()) {
13700            printf("Leak of %d blocks found in xmlParseDoc",
13701	           xmlMemBlocks() - mem_base);
13702	    test_ret++;
13703            printf(" %d", n_cur);
13704            printf("\n");
13705        }
13706    }
13707    function_tests++;
13708#endif
13709#endif
13710
13711    return(test_ret);
13712}
13713
13714
13715static int
13716test_xmlParseDocument(void) {
13717    int test_ret = 0;
13718
13719    int mem_base;
13720    int ret_val;
13721    xmlParserCtxtPtr ctxt; /* an XML parser context */
13722    int n_ctxt;
13723
13724    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13725        mem_base = xmlMemBlocks();
13726        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13727
13728        ret_val = xmlParseDocument(ctxt);
13729        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13730        desret_int(ret_val);
13731        call_tests++;
13732        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13733        xmlResetLastError();
13734        if (mem_base != xmlMemBlocks()) {
13735            printf("Leak of %d blocks found in xmlParseDocument",
13736	           xmlMemBlocks() - mem_base);
13737	    test_ret++;
13738            printf(" %d", n_ctxt);
13739            printf("\n");
13740        }
13741    }
13742    function_tests++;
13743
13744    return(test_ret);
13745}
13746
13747
13748static int
13749test_xmlParseEntity(void) {
13750    int test_ret = 0;
13751
13752#if defined(LIBXML_SAX1_ENABLED)
13753#ifdef LIBXML_SAX1_ENABLED
13754    int mem_base;
13755    xmlDocPtr ret_val;
13756    const char * filename; /* the filename */
13757    int n_filename;
13758
13759    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13760        mem_base = xmlMemBlocks();
13761        filename = gen_filepath(n_filename, 0);
13762
13763        ret_val = xmlParseEntity(filename);
13764        desret_xmlDocPtr(ret_val);
13765        call_tests++;
13766        des_filepath(n_filename, filename, 0);
13767        xmlResetLastError();
13768        if (mem_base != xmlMemBlocks()) {
13769            printf("Leak of %d blocks found in xmlParseEntity",
13770	           xmlMemBlocks() - mem_base);
13771	    test_ret++;
13772            printf(" %d", n_filename);
13773            printf("\n");
13774        }
13775    }
13776    function_tests++;
13777#endif
13778#endif
13779
13780    return(test_ret);
13781}
13782
13783
13784static int
13785test_xmlParseExtParsedEnt(void) {
13786    int test_ret = 0;
13787
13788    int mem_base;
13789    int ret_val;
13790    xmlParserCtxtPtr ctxt; /* an XML parser context */
13791    int n_ctxt;
13792
13793    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13794        mem_base = xmlMemBlocks();
13795        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13796
13797        ret_val = xmlParseExtParsedEnt(ctxt);
13798        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13799        desret_int(ret_val);
13800        call_tests++;
13801        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13802        xmlResetLastError();
13803        if (mem_base != xmlMemBlocks()) {
13804            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13805	           xmlMemBlocks() - mem_base);
13806	    test_ret++;
13807            printf(" %d", n_ctxt);
13808            printf("\n");
13809        }
13810    }
13811    function_tests++;
13812
13813    return(test_ret);
13814}
13815
13816
13817static int
13818test_xmlParseExternalEntity(void) {
13819    int test_ret = 0;
13820
13821#if defined(LIBXML_SAX1_ENABLED)
13822#ifdef LIBXML_SAX1_ENABLED
13823    int mem_base;
13824    int ret_val;
13825    xmlDocPtr doc; /* the document the chunk pertains to */
13826    int n_doc;
13827    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13828    int n_sax;
13829    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13830    int n_user_data;
13831    int depth; /* Used for loop detection, use 0 */
13832    int n_depth;
13833    xmlChar * URL; /* the URL for the entity to load */
13834    int n_URL;
13835    xmlChar * ID; /* the System ID for the entity to load */
13836    int n_ID;
13837    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13838    int n_lst;
13839
13840    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13841    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13842    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13843    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13844    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13845    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13846    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13847        mem_base = xmlMemBlocks();
13848        doc = gen_xmlDocPtr(n_doc, 0);
13849        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13850        user_data = gen_userdata(n_user_data, 2);
13851        depth = gen_int(n_depth, 3);
13852        URL = gen_const_xmlChar_ptr(n_URL, 4);
13853        ID = gen_const_xmlChar_ptr(n_ID, 5);
13854        lst = gen_xmlNodePtr_ptr(n_lst, 6);
13855
13856        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13857        desret_int(ret_val);
13858        call_tests++;
13859        des_xmlDocPtr(n_doc, doc, 0);
13860        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13861        des_userdata(n_user_data, user_data, 2);
13862        des_int(n_depth, depth, 3);
13863        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13864        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13865        des_xmlNodePtr_ptr(n_lst, lst, 6);
13866        xmlResetLastError();
13867        if (mem_base != xmlMemBlocks()) {
13868            printf("Leak of %d blocks found in xmlParseExternalEntity",
13869	           xmlMemBlocks() - mem_base);
13870	    test_ret++;
13871            printf(" %d", n_doc);
13872            printf(" %d", n_sax);
13873            printf(" %d", n_user_data);
13874            printf(" %d", n_depth);
13875            printf(" %d", n_URL);
13876            printf(" %d", n_ID);
13877            printf(" %d", n_lst);
13878            printf("\n");
13879        }
13880    }
13881    }
13882    }
13883    }
13884    }
13885    }
13886    }
13887    function_tests++;
13888#endif
13889#endif
13890
13891    return(test_ret);
13892}
13893
13894
13895static int
13896test_xmlParseFile(void) {
13897    int test_ret = 0;
13898
13899#if defined(LIBXML_SAX1_ENABLED)
13900#ifdef LIBXML_SAX1_ENABLED
13901    int mem_base;
13902    xmlDocPtr ret_val;
13903    const char * filename; /* the filename */
13904    int n_filename;
13905
13906    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13907        mem_base = xmlMemBlocks();
13908        filename = gen_filepath(n_filename, 0);
13909
13910        ret_val = xmlParseFile(filename);
13911        desret_xmlDocPtr(ret_val);
13912        call_tests++;
13913        des_filepath(n_filename, filename, 0);
13914        xmlResetLastError();
13915        if (mem_base != xmlMemBlocks()) {
13916            printf("Leak of %d blocks found in xmlParseFile",
13917	           xmlMemBlocks() - mem_base);
13918	    test_ret++;
13919            printf(" %d", n_filename);
13920            printf("\n");
13921        }
13922    }
13923    function_tests++;
13924#endif
13925#endif
13926
13927    return(test_ret);
13928}
13929
13930
13931static int
13932test_xmlParseInNodeContext(void) {
13933    int test_ret = 0;
13934
13935    int mem_base;
13936    xmlParserErrors ret_val;
13937    xmlNodePtr node; /* the context node */
13938    int n_node;
13939    char * data; /* the input string */
13940    int n_data;
13941    int datalen; /* the input string length in bytes */
13942    int n_datalen;
13943    int options; /* a combination of xmlParserOption */
13944    int n_options;
13945    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13946    int n_lst;
13947
13948    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13949    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
13950    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
13951    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13952    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13953        mem_base = xmlMemBlocks();
13954        node = gen_xmlNodePtr(n_node, 0);
13955        data = gen_const_char_ptr(n_data, 1);
13956        datalen = gen_int(n_datalen, 2);
13957        options = gen_parseroptions(n_options, 3);
13958        lst = gen_xmlNodePtr_ptr(n_lst, 4);
13959
13960        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
13961        desret_xmlParserErrors(ret_val);
13962        call_tests++;
13963        des_xmlNodePtr(n_node, node, 0);
13964        des_const_char_ptr(n_data, (const char *)data, 1);
13965        des_int(n_datalen, datalen, 2);
13966        des_parseroptions(n_options, options, 3);
13967        des_xmlNodePtr_ptr(n_lst, lst, 4);
13968        xmlResetLastError();
13969        if (mem_base != xmlMemBlocks()) {
13970            printf("Leak of %d blocks found in xmlParseInNodeContext",
13971	           xmlMemBlocks() - mem_base);
13972	    test_ret++;
13973            printf(" %d", n_node);
13974            printf(" %d", n_data);
13975            printf(" %d", n_datalen);
13976            printf(" %d", n_options);
13977            printf(" %d", n_lst);
13978            printf("\n");
13979        }
13980    }
13981    }
13982    }
13983    }
13984    }
13985    function_tests++;
13986
13987    return(test_ret);
13988}
13989
13990
13991static int
13992test_xmlParseMemory(void) {
13993    int test_ret = 0;
13994
13995#if defined(LIBXML_SAX1_ENABLED)
13996#ifdef LIBXML_SAX1_ENABLED
13997    int mem_base;
13998    xmlDocPtr ret_val;
13999    char * buffer; /* an pointer to a char array */
14000    int n_buffer;
14001    int size; /* the size of the array */
14002    int n_size;
14003
14004    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14005    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14006        mem_base = xmlMemBlocks();
14007        buffer = gen_const_char_ptr(n_buffer, 0);
14008        size = gen_int(n_size, 1);
14009
14010        ret_val = xmlParseMemory((const char *)buffer, size);
14011        desret_xmlDocPtr(ret_val);
14012        call_tests++;
14013        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14014        des_int(n_size, size, 1);
14015        xmlResetLastError();
14016        if (mem_base != xmlMemBlocks()) {
14017            printf("Leak of %d blocks found in xmlParseMemory",
14018	           xmlMemBlocks() - mem_base);
14019	    test_ret++;
14020            printf(" %d", n_buffer);
14021            printf(" %d", n_size);
14022            printf("\n");
14023        }
14024    }
14025    }
14026    function_tests++;
14027#endif
14028#endif
14029
14030    return(test_ret);
14031}
14032
14033
14034#define gen_nb_const_xmlParserNodeInfoPtr 1
14035static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14036    return(NULL);
14037}
14038static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14039}
14040
14041static int
14042test_xmlParserAddNodeInfo(void) {
14043    int test_ret = 0;
14044
14045    int mem_base;
14046    xmlParserCtxtPtr ctxt; /* an XML parser context */
14047    int n_ctxt;
14048    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14049    int n_info;
14050
14051    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14052    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14053        mem_base = xmlMemBlocks();
14054        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14055        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14056
14057        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14058        call_tests++;
14059        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14060        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14061        xmlResetLastError();
14062        if (mem_base != xmlMemBlocks()) {
14063            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14064	           xmlMemBlocks() - mem_base);
14065	    test_ret++;
14066            printf(" %d", n_ctxt);
14067            printf(" %d", n_info);
14068            printf("\n");
14069        }
14070    }
14071    }
14072    function_tests++;
14073
14074    return(test_ret);
14075}
14076
14077
14078#define gen_nb_const_xmlParserCtxtPtr 1
14079static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14080    return(NULL);
14081}
14082static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14083}
14084
14085#define gen_nb_const_xmlNodePtr 1
14086static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14087    return(NULL);
14088}
14089static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14090}
14091
14092static int
14093test_xmlParserFindNodeInfo(void) {
14094    int test_ret = 0;
14095
14096    int mem_base;
14097    const xmlParserNodeInfo * ret_val;
14098    xmlParserCtxtPtr ctx; /* an XML parser context */
14099    int n_ctx;
14100    xmlNodePtr node; /* an XML node within the tree */
14101    int n_node;
14102
14103    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14104    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14105        mem_base = xmlMemBlocks();
14106        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14107        node = gen_const_xmlNodePtr(n_node, 1);
14108
14109        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14110        desret_const_xmlParserNodeInfo_ptr(ret_val);
14111        call_tests++;
14112        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14113        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14114        xmlResetLastError();
14115        if (mem_base != xmlMemBlocks()) {
14116            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14117	           xmlMemBlocks() - mem_base);
14118	    test_ret++;
14119            printf(" %d", n_ctx);
14120            printf(" %d", n_node);
14121            printf("\n");
14122        }
14123    }
14124    }
14125    function_tests++;
14126
14127    return(test_ret);
14128}
14129
14130
14131#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14132static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14133    return(NULL);
14134}
14135static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14136}
14137
14138static int
14139test_xmlParserFindNodeInfoIndex(void) {
14140    int test_ret = 0;
14141
14142    int mem_base;
14143    unsigned long ret_val;
14144    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14145    int n_seq;
14146    xmlNodePtr node; /* an XML node pointer */
14147    int n_node;
14148
14149    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14150    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14151        mem_base = xmlMemBlocks();
14152        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14153        node = gen_const_xmlNodePtr(n_node, 1);
14154
14155        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14156        desret_unsigned_long(ret_val);
14157        call_tests++;
14158        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14159        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14160        xmlResetLastError();
14161        if (mem_base != xmlMemBlocks()) {
14162            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14163	           xmlMemBlocks() - mem_base);
14164	    test_ret++;
14165            printf(" %d", n_seq);
14166            printf(" %d", n_node);
14167            printf("\n");
14168        }
14169    }
14170    }
14171    function_tests++;
14172
14173    return(test_ret);
14174}
14175
14176
14177#define gen_nb_xmlParserInputPtr 1
14178static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14179    return(NULL);
14180}
14181static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14182}
14183
14184static int
14185test_xmlParserInputGrow(void) {
14186    int test_ret = 0;
14187
14188    int mem_base;
14189    int ret_val;
14190    xmlParserInputPtr in; /* an XML parser input */
14191    int n_in;
14192    int len; /* an indicative size for the lookahead */
14193    int n_len;
14194
14195    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14196    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14197        mem_base = xmlMemBlocks();
14198        in = gen_xmlParserInputPtr(n_in, 0);
14199        len = gen_int(n_len, 1);
14200
14201        ret_val = xmlParserInputGrow(in, len);
14202        desret_int(ret_val);
14203        call_tests++;
14204        des_xmlParserInputPtr(n_in, in, 0);
14205        des_int(n_len, len, 1);
14206        xmlResetLastError();
14207        if (mem_base != xmlMemBlocks()) {
14208            printf("Leak of %d blocks found in xmlParserInputGrow",
14209	           xmlMemBlocks() - mem_base);
14210	    test_ret++;
14211            printf(" %d", n_in);
14212            printf(" %d", n_len);
14213            printf("\n");
14214        }
14215    }
14216    }
14217    function_tests++;
14218
14219    return(test_ret);
14220}
14221
14222
14223static int
14224test_xmlParserInputRead(void) {
14225    int test_ret = 0;
14226
14227    int mem_base;
14228    int ret_val;
14229    xmlParserInputPtr in; /* an XML parser input */
14230    int n_in;
14231    int len; /* an indicative size for the lookahead */
14232    int n_len;
14233
14234    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14235    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14236        mem_base = xmlMemBlocks();
14237        in = gen_xmlParserInputPtr(n_in, 0);
14238        len = gen_int(n_len, 1);
14239
14240        ret_val = xmlParserInputRead(in, len);
14241        desret_int(ret_val);
14242        call_tests++;
14243        des_xmlParserInputPtr(n_in, in, 0);
14244        des_int(n_len, len, 1);
14245        xmlResetLastError();
14246        if (mem_base != xmlMemBlocks()) {
14247            printf("Leak of %d blocks found in xmlParserInputRead",
14248	           xmlMemBlocks() - mem_base);
14249	    test_ret++;
14250            printf(" %d", n_in);
14251            printf(" %d", n_len);
14252            printf("\n");
14253        }
14254    }
14255    }
14256    function_tests++;
14257
14258    return(test_ret);
14259}
14260
14261
14262static int
14263test_xmlPedanticParserDefault(void) {
14264    int test_ret = 0;
14265
14266    int mem_base;
14267    int ret_val;
14268    int val; /* int 0 or 1 */
14269    int n_val;
14270
14271    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14272        mem_base = xmlMemBlocks();
14273        val = gen_int(n_val, 0);
14274
14275        ret_val = xmlPedanticParserDefault(val);
14276        desret_int(ret_val);
14277        call_tests++;
14278        des_int(n_val, val, 0);
14279        xmlResetLastError();
14280        if (mem_base != xmlMemBlocks()) {
14281            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14282	           xmlMemBlocks() - mem_base);
14283	    test_ret++;
14284            printf(" %d", n_val);
14285            printf("\n");
14286        }
14287    }
14288    function_tests++;
14289
14290    return(test_ret);
14291}
14292
14293
14294static int
14295test_xmlReadDoc(void) {
14296    int test_ret = 0;
14297
14298    int mem_base;
14299    xmlDocPtr ret_val;
14300    xmlChar * cur; /* a pointer to a zero terminated string */
14301    int n_cur;
14302    const char * URL; /* the base URL to use for the document */
14303    int n_URL;
14304    char * encoding; /* the document encoding, or NULL */
14305    int n_encoding;
14306    int options; /* a combination of xmlParserOption */
14307    int n_options;
14308
14309    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14310    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14311    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14312    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14313        mem_base = xmlMemBlocks();
14314        cur = gen_const_xmlChar_ptr(n_cur, 0);
14315        URL = gen_filepath(n_URL, 1);
14316        encoding = gen_const_char_ptr(n_encoding, 2);
14317        options = gen_parseroptions(n_options, 3);
14318
14319        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14320        desret_xmlDocPtr(ret_val);
14321        call_tests++;
14322        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14323        des_filepath(n_URL, URL, 1);
14324        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14325        des_parseroptions(n_options, options, 3);
14326        xmlResetLastError();
14327        if (mem_base != xmlMemBlocks()) {
14328            printf("Leak of %d blocks found in xmlReadDoc",
14329	           xmlMemBlocks() - mem_base);
14330	    test_ret++;
14331            printf(" %d", n_cur);
14332            printf(" %d", n_URL);
14333            printf(" %d", n_encoding);
14334            printf(" %d", n_options);
14335            printf("\n");
14336        }
14337    }
14338    }
14339    }
14340    }
14341    function_tests++;
14342
14343    return(test_ret);
14344}
14345
14346
14347static int
14348test_xmlReadFile(void) {
14349    int test_ret = 0;
14350
14351    int mem_base;
14352    xmlDocPtr ret_val;
14353    const char * filename; /* a file or URL */
14354    int n_filename;
14355    char * encoding; /* the document encoding, or NULL */
14356    int n_encoding;
14357    int options; /* a combination of xmlParserOption */
14358    int n_options;
14359
14360    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14361    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14362    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14363        mem_base = xmlMemBlocks();
14364        filename = gen_filepath(n_filename, 0);
14365        encoding = gen_const_char_ptr(n_encoding, 1);
14366        options = gen_parseroptions(n_options, 2);
14367
14368        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14369        desret_xmlDocPtr(ret_val);
14370        call_tests++;
14371        des_filepath(n_filename, filename, 0);
14372        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14373        des_parseroptions(n_options, options, 2);
14374        xmlResetLastError();
14375        if (mem_base != xmlMemBlocks()) {
14376            printf("Leak of %d blocks found in xmlReadFile",
14377	           xmlMemBlocks() - mem_base);
14378	    test_ret++;
14379            printf(" %d", n_filename);
14380            printf(" %d", n_encoding);
14381            printf(" %d", n_options);
14382            printf("\n");
14383        }
14384    }
14385    }
14386    }
14387    function_tests++;
14388
14389    return(test_ret);
14390}
14391
14392
14393static int
14394test_xmlReadMemory(void) {
14395    int test_ret = 0;
14396
14397    int mem_base;
14398    xmlDocPtr ret_val;
14399    char * buffer; /* a pointer to a char array */
14400    int n_buffer;
14401    int size; /* the size of the array */
14402    int n_size;
14403    const char * URL; /* the base URL to use for the document */
14404    int n_URL;
14405    char * encoding; /* the document encoding, or NULL */
14406    int n_encoding;
14407    int options; /* a combination of xmlParserOption */
14408    int n_options;
14409
14410    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14411    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14412    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14413    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14414    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14415        mem_base = xmlMemBlocks();
14416        buffer = gen_const_char_ptr(n_buffer, 0);
14417        size = gen_int(n_size, 1);
14418        URL = gen_filepath(n_URL, 2);
14419        encoding = gen_const_char_ptr(n_encoding, 3);
14420        options = gen_parseroptions(n_options, 4);
14421
14422        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14423        desret_xmlDocPtr(ret_val);
14424        call_tests++;
14425        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14426        des_int(n_size, size, 1);
14427        des_filepath(n_URL, URL, 2);
14428        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14429        des_parseroptions(n_options, options, 4);
14430        xmlResetLastError();
14431        if (mem_base != xmlMemBlocks()) {
14432            printf("Leak of %d blocks found in xmlReadMemory",
14433	           xmlMemBlocks() - mem_base);
14434	    test_ret++;
14435            printf(" %d", n_buffer);
14436            printf(" %d", n_size);
14437            printf(" %d", n_URL);
14438            printf(" %d", n_encoding);
14439            printf(" %d", n_options);
14440            printf("\n");
14441        }
14442    }
14443    }
14444    }
14445    }
14446    }
14447    function_tests++;
14448
14449    return(test_ret);
14450}
14451
14452
14453static int
14454test_xmlRecoverDoc(void) {
14455    int test_ret = 0;
14456
14457#if defined(LIBXML_SAX1_ENABLED)
14458#ifdef LIBXML_SAX1_ENABLED
14459    int mem_base;
14460    xmlDocPtr ret_val;
14461    xmlChar * cur; /* a pointer to an array of xmlChar */
14462    int n_cur;
14463
14464    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14465        mem_base = xmlMemBlocks();
14466        cur = gen_xmlChar_ptr(n_cur, 0);
14467
14468        ret_val = xmlRecoverDoc(cur);
14469        desret_xmlDocPtr(ret_val);
14470        call_tests++;
14471        des_xmlChar_ptr(n_cur, cur, 0);
14472        xmlResetLastError();
14473        if (mem_base != xmlMemBlocks()) {
14474            printf("Leak of %d blocks found in xmlRecoverDoc",
14475	           xmlMemBlocks() - mem_base);
14476	    test_ret++;
14477            printf(" %d", n_cur);
14478            printf("\n");
14479        }
14480    }
14481    function_tests++;
14482#endif
14483#endif
14484
14485    return(test_ret);
14486}
14487
14488
14489static int
14490test_xmlRecoverFile(void) {
14491    int test_ret = 0;
14492
14493#if defined(LIBXML_SAX1_ENABLED)
14494#ifdef LIBXML_SAX1_ENABLED
14495    int mem_base;
14496    xmlDocPtr ret_val;
14497    const char * filename; /* the filename */
14498    int n_filename;
14499
14500    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14501        mem_base = xmlMemBlocks();
14502        filename = gen_filepath(n_filename, 0);
14503
14504        ret_val = xmlRecoverFile(filename);
14505        desret_xmlDocPtr(ret_val);
14506        call_tests++;
14507        des_filepath(n_filename, filename, 0);
14508        xmlResetLastError();
14509        if (mem_base != xmlMemBlocks()) {
14510            printf("Leak of %d blocks found in xmlRecoverFile",
14511	           xmlMemBlocks() - mem_base);
14512	    test_ret++;
14513            printf(" %d", n_filename);
14514            printf("\n");
14515        }
14516    }
14517    function_tests++;
14518#endif
14519#endif
14520
14521    return(test_ret);
14522}
14523
14524
14525static int
14526test_xmlRecoverMemory(void) {
14527    int test_ret = 0;
14528
14529#if defined(LIBXML_SAX1_ENABLED)
14530#ifdef LIBXML_SAX1_ENABLED
14531    int mem_base;
14532    xmlDocPtr ret_val;
14533    char * buffer; /* an pointer to a char array */
14534    int n_buffer;
14535    int size; /* the size of the array */
14536    int n_size;
14537
14538    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14539    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14540        mem_base = xmlMemBlocks();
14541        buffer = gen_const_char_ptr(n_buffer, 0);
14542        size = gen_int(n_size, 1);
14543
14544        ret_val = xmlRecoverMemory((const char *)buffer, size);
14545        desret_xmlDocPtr(ret_val);
14546        call_tests++;
14547        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14548        des_int(n_size, size, 1);
14549        xmlResetLastError();
14550        if (mem_base != xmlMemBlocks()) {
14551            printf("Leak of %d blocks found in xmlRecoverMemory",
14552	           xmlMemBlocks() - mem_base);
14553	    test_ret++;
14554            printf(" %d", n_buffer);
14555            printf(" %d", n_size);
14556            printf("\n");
14557        }
14558    }
14559    }
14560    function_tests++;
14561#endif
14562#endif
14563
14564    return(test_ret);
14565}
14566
14567
14568static int
14569test_xmlSAXParseDTD(void) {
14570    int test_ret = 0;
14571
14572#if defined(LIBXML_VALID_ENABLED)
14573#ifdef LIBXML_SAX1_ENABLED
14574    int mem_base;
14575    xmlDtdPtr ret_val;
14576    xmlSAXHandlerPtr sax; /* the SAX handler block */
14577    int n_sax;
14578    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14579    int n_ExternalID;
14580    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14581    int n_SystemID;
14582
14583    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14584    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14585    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14586        mem_base = xmlMemBlocks();
14587        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14588        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14589        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14590
14591        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14592        desret_xmlDtdPtr(ret_val);
14593        call_tests++;
14594        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14595        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14596        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14597        xmlResetLastError();
14598        if (mem_base != xmlMemBlocks()) {
14599            printf("Leak of %d blocks found in xmlSAXParseDTD",
14600	           xmlMemBlocks() - mem_base);
14601	    test_ret++;
14602            printf(" %d", n_sax);
14603            printf(" %d", n_ExternalID);
14604            printf(" %d", n_SystemID);
14605            printf("\n");
14606        }
14607    }
14608    }
14609    }
14610    function_tests++;
14611#endif
14612#endif
14613
14614    return(test_ret);
14615}
14616
14617
14618static int
14619test_xmlSAXParseDoc(void) {
14620    int test_ret = 0;
14621
14622#if defined(LIBXML_SAX1_ENABLED)
14623#ifdef LIBXML_SAX1_ENABLED
14624    int mem_base;
14625    xmlDocPtr ret_val;
14626    xmlSAXHandlerPtr sax; /* the SAX handler block */
14627    int n_sax;
14628    xmlChar * cur; /* a pointer to an array of xmlChar */
14629    int n_cur;
14630    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14631    int n_recovery;
14632
14633    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14634    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14635    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14636        mem_base = xmlMemBlocks();
14637        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14638        cur = gen_const_xmlChar_ptr(n_cur, 1);
14639        recovery = gen_int(n_recovery, 2);
14640
14641        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14642        desret_xmlDocPtr(ret_val);
14643        call_tests++;
14644        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14645        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14646        des_int(n_recovery, recovery, 2);
14647        xmlResetLastError();
14648        if (mem_base != xmlMemBlocks()) {
14649            printf("Leak of %d blocks found in xmlSAXParseDoc",
14650	           xmlMemBlocks() - mem_base);
14651	    test_ret++;
14652            printf(" %d", n_sax);
14653            printf(" %d", n_cur);
14654            printf(" %d", n_recovery);
14655            printf("\n");
14656        }
14657    }
14658    }
14659    }
14660    function_tests++;
14661#endif
14662#endif
14663
14664    return(test_ret);
14665}
14666
14667
14668static int
14669test_xmlSAXParseEntity(void) {
14670    int test_ret = 0;
14671
14672#if defined(LIBXML_SAX1_ENABLED)
14673#ifdef LIBXML_SAX1_ENABLED
14674    int mem_base;
14675    xmlDocPtr ret_val;
14676    xmlSAXHandlerPtr sax; /* the SAX handler block */
14677    int n_sax;
14678    const char * filename; /* the filename */
14679    int n_filename;
14680
14681    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14682    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14683        mem_base = xmlMemBlocks();
14684        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14685        filename = gen_filepath(n_filename, 1);
14686
14687        ret_val = xmlSAXParseEntity(sax, filename);
14688        desret_xmlDocPtr(ret_val);
14689        call_tests++;
14690        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14691        des_filepath(n_filename, filename, 1);
14692        xmlResetLastError();
14693        if (mem_base != xmlMemBlocks()) {
14694            printf("Leak of %d blocks found in xmlSAXParseEntity",
14695	           xmlMemBlocks() - mem_base);
14696	    test_ret++;
14697            printf(" %d", n_sax);
14698            printf(" %d", n_filename);
14699            printf("\n");
14700        }
14701    }
14702    }
14703    function_tests++;
14704#endif
14705#endif
14706
14707    return(test_ret);
14708}
14709
14710
14711static int
14712test_xmlSAXParseFile(void) {
14713    int test_ret = 0;
14714
14715#if defined(LIBXML_SAX1_ENABLED)
14716#ifdef LIBXML_SAX1_ENABLED
14717    int mem_base;
14718    xmlDocPtr ret_val;
14719    xmlSAXHandlerPtr sax; /* the SAX handler block */
14720    int n_sax;
14721    const char * filename; /* the filename */
14722    int n_filename;
14723    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14724    int n_recovery;
14725
14726    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14727    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14728    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14729        mem_base = xmlMemBlocks();
14730        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14731        filename = gen_filepath(n_filename, 1);
14732        recovery = gen_int(n_recovery, 2);
14733
14734        ret_val = xmlSAXParseFile(sax, filename, recovery);
14735        desret_xmlDocPtr(ret_val);
14736        call_tests++;
14737        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14738        des_filepath(n_filename, filename, 1);
14739        des_int(n_recovery, recovery, 2);
14740        xmlResetLastError();
14741        if (mem_base != xmlMemBlocks()) {
14742            printf("Leak of %d blocks found in xmlSAXParseFile",
14743	           xmlMemBlocks() - mem_base);
14744	    test_ret++;
14745            printf(" %d", n_sax);
14746            printf(" %d", n_filename);
14747            printf(" %d", n_recovery);
14748            printf("\n");
14749        }
14750    }
14751    }
14752    }
14753    function_tests++;
14754#endif
14755#endif
14756
14757    return(test_ret);
14758}
14759
14760
14761static int
14762test_xmlSAXParseFileWithData(void) {
14763    int test_ret = 0;
14764
14765#if defined(LIBXML_SAX1_ENABLED)
14766#ifdef LIBXML_SAX1_ENABLED
14767    int mem_base;
14768    xmlDocPtr ret_val;
14769    xmlSAXHandlerPtr sax; /* the SAX handler block */
14770    int n_sax;
14771    const char * filename; /* the filename */
14772    int n_filename;
14773    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14774    int n_recovery;
14775    void * data; /* the userdata */
14776    int n_data;
14777
14778    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14779    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14780    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14781    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14782        mem_base = xmlMemBlocks();
14783        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14784        filename = gen_filepath(n_filename, 1);
14785        recovery = gen_int(n_recovery, 2);
14786        data = gen_userdata(n_data, 3);
14787
14788        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14789        desret_xmlDocPtr(ret_val);
14790        call_tests++;
14791        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14792        des_filepath(n_filename, filename, 1);
14793        des_int(n_recovery, recovery, 2);
14794        des_userdata(n_data, data, 3);
14795        xmlResetLastError();
14796        if (mem_base != xmlMemBlocks()) {
14797            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14798	           xmlMemBlocks() - mem_base);
14799	    test_ret++;
14800            printf(" %d", n_sax);
14801            printf(" %d", n_filename);
14802            printf(" %d", n_recovery);
14803            printf(" %d", n_data);
14804            printf("\n");
14805        }
14806    }
14807    }
14808    }
14809    }
14810    function_tests++;
14811#endif
14812#endif
14813
14814    return(test_ret);
14815}
14816
14817
14818static int
14819test_xmlSAXParseMemory(void) {
14820    int test_ret = 0;
14821
14822#if defined(LIBXML_SAX1_ENABLED)
14823#ifdef LIBXML_SAX1_ENABLED
14824    int mem_base;
14825    xmlDocPtr ret_val;
14826    xmlSAXHandlerPtr sax; /* the SAX handler block */
14827    int n_sax;
14828    char * buffer; /* an pointer to a char array */
14829    int n_buffer;
14830    int size; /* the size of the array */
14831    int n_size;
14832    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14833    int n_recovery;
14834
14835    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14836    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14837    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14838    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14839        mem_base = xmlMemBlocks();
14840        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14841        buffer = gen_const_char_ptr(n_buffer, 1);
14842        size = gen_int(n_size, 2);
14843        recovery = gen_int(n_recovery, 3);
14844
14845        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14846        desret_xmlDocPtr(ret_val);
14847        call_tests++;
14848        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14849        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14850        des_int(n_size, size, 2);
14851        des_int(n_recovery, recovery, 3);
14852        xmlResetLastError();
14853        if (mem_base != xmlMemBlocks()) {
14854            printf("Leak of %d blocks found in xmlSAXParseMemory",
14855	           xmlMemBlocks() - mem_base);
14856	    test_ret++;
14857            printf(" %d", n_sax);
14858            printf(" %d", n_buffer);
14859            printf(" %d", n_size);
14860            printf(" %d", n_recovery);
14861            printf("\n");
14862        }
14863    }
14864    }
14865    }
14866    }
14867    function_tests++;
14868#endif
14869#endif
14870
14871    return(test_ret);
14872}
14873
14874
14875static int
14876test_xmlSAXParseMemoryWithData(void) {
14877    int test_ret = 0;
14878
14879#if defined(LIBXML_SAX1_ENABLED)
14880#ifdef LIBXML_SAX1_ENABLED
14881    int mem_base;
14882    xmlDocPtr ret_val;
14883    xmlSAXHandlerPtr sax; /* the SAX handler block */
14884    int n_sax;
14885    char * buffer; /* an pointer to a char array */
14886    int n_buffer;
14887    int size; /* the size of the array */
14888    int n_size;
14889    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14890    int n_recovery;
14891    void * data; /* the userdata */
14892    int n_data;
14893
14894    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14895    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14896    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14897    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14898    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14899        mem_base = xmlMemBlocks();
14900        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14901        buffer = gen_const_char_ptr(n_buffer, 1);
14902        size = gen_int(n_size, 2);
14903        recovery = gen_int(n_recovery, 3);
14904        data = gen_userdata(n_data, 4);
14905
14906        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
14907        desret_xmlDocPtr(ret_val);
14908        call_tests++;
14909        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14910        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14911        des_int(n_size, size, 2);
14912        des_int(n_recovery, recovery, 3);
14913        des_userdata(n_data, data, 4);
14914        xmlResetLastError();
14915        if (mem_base != xmlMemBlocks()) {
14916            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14917	           xmlMemBlocks() - mem_base);
14918	    test_ret++;
14919            printf(" %d", n_sax);
14920            printf(" %d", n_buffer);
14921            printf(" %d", n_size);
14922            printf(" %d", n_recovery);
14923            printf(" %d", n_data);
14924            printf("\n");
14925        }
14926    }
14927    }
14928    }
14929    }
14930    }
14931    function_tests++;
14932#endif
14933#endif
14934
14935    return(test_ret);
14936}
14937
14938
14939static int
14940test_xmlSAXUserParseFile(void) {
14941    int test_ret = 0;
14942
14943#if defined(LIBXML_SAX1_ENABLED)
14944#ifdef LIBXML_SAX1_ENABLED
14945    int mem_base;
14946    int ret_val;
14947    xmlSAXHandlerPtr sax; /* a SAX handler */
14948    int n_sax;
14949    void * user_data; /* The user data returned on SAX callbacks */
14950    int n_user_data;
14951    const char * filename; /* a file name */
14952    int n_filename;
14953
14954    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14955    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14956    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14957        mem_base = xmlMemBlocks();
14958        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14959        user_data = gen_userdata(n_user_data, 1);
14960        filename = gen_filepath(n_filename, 2);
14961
14962#ifdef LIBXML_SAX1_ENABLED
14963        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14964#endif
14965
14966
14967        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
14968        desret_int(ret_val);
14969        call_tests++;
14970        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14971        des_userdata(n_user_data, user_data, 1);
14972        des_filepath(n_filename, filename, 2);
14973        xmlResetLastError();
14974        if (mem_base != xmlMemBlocks()) {
14975            printf("Leak of %d blocks found in xmlSAXUserParseFile",
14976	           xmlMemBlocks() - mem_base);
14977	    test_ret++;
14978            printf(" %d", n_sax);
14979            printf(" %d", n_user_data);
14980            printf(" %d", n_filename);
14981            printf("\n");
14982        }
14983    }
14984    }
14985    }
14986    function_tests++;
14987#endif
14988#endif
14989
14990    return(test_ret);
14991}
14992
14993
14994static int
14995test_xmlSAXUserParseMemory(void) {
14996    int test_ret = 0;
14997
14998#if defined(LIBXML_SAX1_ENABLED)
14999#ifdef LIBXML_SAX1_ENABLED
15000    int mem_base;
15001    int ret_val;
15002    xmlSAXHandlerPtr sax; /* a SAX handler */
15003    int n_sax;
15004    void * user_data; /* The user data returned on SAX callbacks */
15005    int n_user_data;
15006    char * buffer; /* an in-memory XML document input */
15007    int n_buffer;
15008    int size; /* the length of the XML document in bytes */
15009    int n_size;
15010
15011    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15012    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15013    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15014    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15015        mem_base = xmlMemBlocks();
15016        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15017        user_data = gen_userdata(n_user_data, 1);
15018        buffer = gen_const_char_ptr(n_buffer, 2);
15019        size = gen_int(n_size, 3);
15020
15021#ifdef LIBXML_SAX1_ENABLED
15022        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15023#endif
15024
15025
15026        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15027        desret_int(ret_val);
15028        call_tests++;
15029        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15030        des_userdata(n_user_data, user_data, 1);
15031        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15032        des_int(n_size, size, 3);
15033        xmlResetLastError();
15034        if (mem_base != xmlMemBlocks()) {
15035            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15036	           xmlMemBlocks() - mem_base);
15037	    test_ret++;
15038            printf(" %d", n_sax);
15039            printf(" %d", n_user_data);
15040            printf(" %d", n_buffer);
15041            printf(" %d", n_size);
15042            printf("\n");
15043        }
15044    }
15045    }
15046    }
15047    }
15048    function_tests++;
15049#endif
15050#endif
15051
15052    return(test_ret);
15053}
15054
15055
15056static int
15057test_xmlSetExternalEntityLoader(void) {
15058    int test_ret = 0;
15059
15060
15061    /* missing type support */
15062    return(test_ret);
15063}
15064
15065
15066static int
15067test_xmlSetFeature(void) {
15068    int test_ret = 0;
15069
15070#if defined(LIBXML_LEGACY_ENABLED)
15071#ifdef LIBXML_LEGACY_ENABLED
15072    int mem_base;
15073    int ret_val;
15074    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15075    int n_ctxt;
15076    char * name; /* the feature name */
15077    int n_name;
15078    void * value; /* pointer to the location of the new value */
15079    int n_value;
15080
15081    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15082    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15083    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15084        mem_base = xmlMemBlocks();
15085        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15086        name = gen_const_char_ptr(n_name, 1);
15087        value = gen_void_ptr(n_value, 2);
15088
15089        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15090        desret_int(ret_val);
15091        call_tests++;
15092        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15093        des_const_char_ptr(n_name, (const char *)name, 1);
15094        des_void_ptr(n_value, value, 2);
15095        xmlResetLastError();
15096        if (mem_base != xmlMemBlocks()) {
15097            printf("Leak of %d blocks found in xmlSetFeature",
15098	           xmlMemBlocks() - mem_base);
15099	    test_ret++;
15100            printf(" %d", n_ctxt);
15101            printf(" %d", n_name);
15102            printf(" %d", n_value);
15103            printf("\n");
15104        }
15105    }
15106    }
15107    }
15108    function_tests++;
15109#endif
15110#endif
15111
15112    return(test_ret);
15113}
15114
15115
15116static int
15117test_xmlSetupParserForBuffer(void) {
15118    int test_ret = 0;
15119
15120#if defined(LIBXML_SAX1_ENABLED)
15121#ifdef LIBXML_SAX1_ENABLED
15122    int mem_base;
15123    xmlParserCtxtPtr ctxt; /* an XML parser context */
15124    int n_ctxt;
15125    xmlChar * buffer; /* a xmlChar * buffer */
15126    int n_buffer;
15127    const char * filename; /* a file name */
15128    int n_filename;
15129
15130    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15131    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15132    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15133        mem_base = xmlMemBlocks();
15134        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15135        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15136        filename = gen_filepath(n_filename, 2);
15137
15138        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15139        call_tests++;
15140        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15141        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15142        des_filepath(n_filename, filename, 2);
15143        xmlResetLastError();
15144        if (mem_base != xmlMemBlocks()) {
15145            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15146	           xmlMemBlocks() - mem_base);
15147	    test_ret++;
15148            printf(" %d", n_ctxt);
15149            printf(" %d", n_buffer);
15150            printf(" %d", n_filename);
15151            printf("\n");
15152        }
15153    }
15154    }
15155    }
15156    function_tests++;
15157#endif
15158#endif
15159
15160    return(test_ret);
15161}
15162
15163
15164static int
15165test_xmlStopParser(void) {
15166    int test_ret = 0;
15167
15168#ifdef LIBXML_PUSH_ENABLED
15169    int mem_base;
15170    xmlParserCtxtPtr ctxt; /* an XML parser context */
15171    int n_ctxt;
15172
15173    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15174        mem_base = xmlMemBlocks();
15175        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15176
15177        xmlStopParser(ctxt);
15178        call_tests++;
15179        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15180        xmlResetLastError();
15181        if (mem_base != xmlMemBlocks()) {
15182            printf("Leak of %d blocks found in xmlStopParser",
15183	           xmlMemBlocks() - mem_base);
15184	    test_ret++;
15185            printf(" %d", n_ctxt);
15186            printf("\n");
15187        }
15188    }
15189    function_tests++;
15190#endif
15191
15192    return(test_ret);
15193}
15194
15195
15196static int
15197test_xmlSubstituteEntitiesDefault(void) {
15198    int test_ret = 0;
15199
15200    int mem_base;
15201    int ret_val;
15202    int val; /* int 0 or 1 */
15203    int n_val;
15204
15205    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15206        mem_base = xmlMemBlocks();
15207        val = gen_int(n_val, 0);
15208
15209        ret_val = xmlSubstituteEntitiesDefault(val);
15210        desret_int(ret_val);
15211        call_tests++;
15212        des_int(n_val, val, 0);
15213        xmlResetLastError();
15214        if (mem_base != xmlMemBlocks()) {
15215            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15216	           xmlMemBlocks() - mem_base);
15217	    test_ret++;
15218            printf(" %d", n_val);
15219            printf("\n");
15220        }
15221    }
15222    function_tests++;
15223
15224    return(test_ret);
15225}
15226
15227static int
15228test_parser(void) {
15229    int test_ret = 0;
15230
15231    if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15232    test_ret += test_xmlByteConsumed();
15233    test_ret += test_xmlClearNodeInfoSeq();
15234    test_ret += test_xmlClearParserCtxt();
15235    test_ret += test_xmlCreateDocParserCtxt();
15236    test_ret += test_xmlCreatePushParserCtxt();
15237    test_ret += test_xmlCtxtReadDoc();
15238    test_ret += test_xmlCtxtReadFile();
15239    test_ret += test_xmlCtxtReadMemory();
15240    test_ret += test_xmlCtxtReset();
15241    test_ret += test_xmlCtxtResetPush();
15242    test_ret += test_xmlCtxtUseOptions();
15243    test_ret += test_xmlGetExternalEntityLoader();
15244    test_ret += test_xmlGetFeature();
15245    test_ret += test_xmlGetFeaturesList();
15246    test_ret += test_xmlHasFeature();
15247    test_ret += test_xmlIOParseDTD();
15248    test_ret += test_xmlInitNodeInfoSeq();
15249    test_ret += test_xmlInitParser();
15250    test_ret += test_xmlInitParserCtxt();
15251    test_ret += test_xmlKeepBlanksDefault();
15252    test_ret += test_xmlLineNumbersDefault();
15253    test_ret += test_xmlLoadExternalEntity();
15254    test_ret += test_xmlNewIOInputStream();
15255    test_ret += test_xmlNewParserCtxt();
15256    test_ret += test_xmlParseBalancedChunkMemory();
15257    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15258    test_ret += test_xmlParseChunk();
15259    test_ret += test_xmlParseCtxtExternalEntity();
15260    test_ret += test_xmlParseDTD();
15261    test_ret += test_xmlParseDoc();
15262    test_ret += test_xmlParseDocument();
15263    test_ret += test_xmlParseEntity();
15264    test_ret += test_xmlParseExtParsedEnt();
15265    test_ret += test_xmlParseExternalEntity();
15266    test_ret += test_xmlParseFile();
15267    test_ret += test_xmlParseInNodeContext();
15268    test_ret += test_xmlParseMemory();
15269    test_ret += test_xmlParserAddNodeInfo();
15270    test_ret += test_xmlParserFindNodeInfo();
15271    test_ret += test_xmlParserFindNodeInfoIndex();
15272    test_ret += test_xmlParserInputGrow();
15273    test_ret += test_xmlParserInputRead();
15274    test_ret += test_xmlPedanticParserDefault();
15275    test_ret += test_xmlReadDoc();
15276    test_ret += test_xmlReadFile();
15277    test_ret += test_xmlReadMemory();
15278    test_ret += test_xmlRecoverDoc();
15279    test_ret += test_xmlRecoverFile();
15280    test_ret += test_xmlRecoverMemory();
15281    test_ret += test_xmlSAXParseDTD();
15282    test_ret += test_xmlSAXParseDoc();
15283    test_ret += test_xmlSAXParseEntity();
15284    test_ret += test_xmlSAXParseFile();
15285    test_ret += test_xmlSAXParseFileWithData();
15286    test_ret += test_xmlSAXParseMemory();
15287    test_ret += test_xmlSAXParseMemoryWithData();
15288    test_ret += test_xmlSAXUserParseFile();
15289    test_ret += test_xmlSAXUserParseMemory();
15290    test_ret += test_xmlSetExternalEntityLoader();
15291    test_ret += test_xmlSetFeature();
15292    test_ret += test_xmlSetupParserForBuffer();
15293    test_ret += test_xmlStopParser();
15294    test_ret += test_xmlSubstituteEntitiesDefault();
15295
15296    if (test_ret != 0)
15297	printf("Module parser: %d errors\n", test_ret);
15298    return(test_ret);
15299}
15300
15301static int
15302test_htmlCreateFileParserCtxt(void) {
15303    int test_ret = 0;
15304
15305#if defined(LIBXML_HTML_ENABLED)
15306    int mem_base;
15307    htmlParserCtxtPtr ret_val;
15308    const char * filename; /* the filename */
15309    int n_filename;
15310    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15311    int n_encoding;
15312
15313    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15314    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15315        mem_base = xmlMemBlocks();
15316        filename = gen_fileoutput(n_filename, 0);
15317        encoding = gen_const_char_ptr(n_encoding, 1);
15318
15319        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15320        desret_htmlParserCtxtPtr(ret_val);
15321        call_tests++;
15322        des_fileoutput(n_filename, filename, 0);
15323        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15324        xmlResetLastError();
15325        if (mem_base != xmlMemBlocks()) {
15326            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15327	           xmlMemBlocks() - mem_base);
15328	    test_ret++;
15329            printf(" %d", n_filename);
15330            printf(" %d", n_encoding);
15331            printf("\n");
15332        }
15333    }
15334    }
15335    function_tests++;
15336#endif
15337
15338    return(test_ret);
15339}
15340
15341
15342static int
15343test_htmlInitAutoClose(void) {
15344    int test_ret = 0;
15345
15346#if defined(LIBXML_HTML_ENABLED)
15347    int mem_base;
15348
15349        mem_base = xmlMemBlocks();
15350
15351        htmlInitAutoClose();
15352        call_tests++;
15353        xmlResetLastError();
15354        if (mem_base != xmlMemBlocks()) {
15355            printf("Leak of %d blocks found in htmlInitAutoClose",
15356	           xmlMemBlocks() - mem_base);
15357	    test_ret++;
15358            printf("\n");
15359        }
15360    function_tests++;
15361#endif
15362
15363    return(test_ret);
15364}
15365
15366
15367static int
15368test_inputPop(void) {
15369    int test_ret = 0;
15370
15371    int mem_base;
15372    xmlParserInputPtr ret_val;
15373    xmlParserCtxtPtr ctxt; /* an XML parser context */
15374    int n_ctxt;
15375
15376    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15377        mem_base = xmlMemBlocks();
15378        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15379
15380        ret_val = inputPop(ctxt);
15381        desret_xmlParserInputPtr(ret_val);
15382        call_tests++;
15383        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15384        xmlResetLastError();
15385        if (mem_base != xmlMemBlocks()) {
15386            printf("Leak of %d blocks found in inputPop",
15387	           xmlMemBlocks() - mem_base);
15388	    test_ret++;
15389            printf(" %d", n_ctxt);
15390            printf("\n");
15391        }
15392    }
15393    function_tests++;
15394
15395    return(test_ret);
15396}
15397
15398
15399static int
15400test_inputPush(void) {
15401    int test_ret = 0;
15402
15403    int mem_base;
15404    int ret_val;
15405    xmlParserCtxtPtr ctxt; /* an XML parser context */
15406    int n_ctxt;
15407    xmlParserInputPtr value; /* the parser input */
15408    int n_value;
15409
15410    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15411    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15412        mem_base = xmlMemBlocks();
15413        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15414        value = gen_xmlParserInputPtr(n_value, 1);
15415
15416        ret_val = inputPush(ctxt, value);
15417        desret_int(ret_val);
15418        call_tests++;
15419        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15420        des_xmlParserInputPtr(n_value, value, 1);
15421        xmlResetLastError();
15422        if (mem_base != xmlMemBlocks()) {
15423            printf("Leak of %d blocks found in inputPush",
15424	           xmlMemBlocks() - mem_base);
15425	    test_ret++;
15426            printf(" %d", n_ctxt);
15427            printf(" %d", n_value);
15428            printf("\n");
15429        }
15430    }
15431    }
15432    function_tests++;
15433
15434    return(test_ret);
15435}
15436
15437
15438static int
15439test_namePop(void) {
15440    int test_ret = 0;
15441
15442    int mem_base;
15443    const xmlChar * ret_val;
15444    xmlParserCtxtPtr ctxt; /* an XML parser context */
15445    int n_ctxt;
15446
15447    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15448        mem_base = xmlMemBlocks();
15449        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15450
15451        ret_val = namePop(ctxt);
15452        desret_const_xmlChar_ptr(ret_val);
15453        call_tests++;
15454        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15455        xmlResetLastError();
15456        if (mem_base != xmlMemBlocks()) {
15457            printf("Leak of %d blocks found in namePop",
15458	           xmlMemBlocks() - mem_base);
15459	    test_ret++;
15460            printf(" %d", n_ctxt);
15461            printf("\n");
15462        }
15463    }
15464    function_tests++;
15465
15466    return(test_ret);
15467}
15468
15469
15470static int
15471test_namePush(void) {
15472    int test_ret = 0;
15473
15474    int mem_base;
15475    int ret_val;
15476    xmlParserCtxtPtr ctxt; /* an XML parser context */
15477    int n_ctxt;
15478    xmlChar * value; /* the element name */
15479    int n_value;
15480
15481    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15482    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15483        mem_base = xmlMemBlocks();
15484        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15485        value = gen_const_xmlChar_ptr(n_value, 1);
15486
15487        ret_val = namePush(ctxt, (const xmlChar *)value);
15488        desret_int(ret_val);
15489        call_tests++;
15490        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15491        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15492        xmlResetLastError();
15493        if (mem_base != xmlMemBlocks()) {
15494            printf("Leak of %d blocks found in namePush",
15495	           xmlMemBlocks() - mem_base);
15496	    test_ret++;
15497            printf(" %d", n_ctxt);
15498            printf(" %d", n_value);
15499            printf("\n");
15500        }
15501    }
15502    }
15503    function_tests++;
15504
15505    return(test_ret);
15506}
15507
15508
15509static int
15510test_nodePop(void) {
15511    int test_ret = 0;
15512
15513    int mem_base;
15514    xmlNodePtr ret_val;
15515    xmlParserCtxtPtr ctxt; /* an XML parser context */
15516    int n_ctxt;
15517
15518    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15519        mem_base = xmlMemBlocks();
15520        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15521
15522        ret_val = nodePop(ctxt);
15523        desret_xmlNodePtr(ret_val);
15524        call_tests++;
15525        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15526        xmlResetLastError();
15527        if (mem_base != xmlMemBlocks()) {
15528            printf("Leak of %d blocks found in nodePop",
15529	           xmlMemBlocks() - mem_base);
15530	    test_ret++;
15531            printf(" %d", n_ctxt);
15532            printf("\n");
15533        }
15534    }
15535    function_tests++;
15536
15537    return(test_ret);
15538}
15539
15540
15541static int
15542test_nodePush(void) {
15543    int test_ret = 0;
15544
15545    int mem_base;
15546    int ret_val;
15547    xmlParserCtxtPtr ctxt; /* an XML parser context */
15548    int n_ctxt;
15549    xmlNodePtr value; /* the element node */
15550    int n_value;
15551
15552    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15553    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15554        mem_base = xmlMemBlocks();
15555        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15556        value = gen_xmlNodePtr(n_value, 1);
15557
15558        ret_val = nodePush(ctxt, value);
15559        desret_int(ret_val);
15560        call_tests++;
15561        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15562        des_xmlNodePtr(n_value, value, 1);
15563        xmlResetLastError();
15564        if (mem_base != xmlMemBlocks()) {
15565            printf("Leak of %d blocks found in nodePush",
15566	           xmlMemBlocks() - mem_base);
15567	    test_ret++;
15568            printf(" %d", n_ctxt);
15569            printf(" %d", n_value);
15570            printf("\n");
15571        }
15572    }
15573    }
15574    function_tests++;
15575
15576    return(test_ret);
15577}
15578
15579
15580static int
15581test_xmlCheckLanguageID(void) {
15582    int test_ret = 0;
15583
15584    int mem_base;
15585    int ret_val;
15586    xmlChar * lang; /* pointer to the string value */
15587    int n_lang;
15588
15589    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15590        mem_base = xmlMemBlocks();
15591        lang = gen_const_xmlChar_ptr(n_lang, 0);
15592
15593        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15594        desret_int(ret_val);
15595        call_tests++;
15596        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15597        xmlResetLastError();
15598        if (mem_base != xmlMemBlocks()) {
15599            printf("Leak of %d blocks found in xmlCheckLanguageID",
15600	           xmlMemBlocks() - mem_base);
15601	    test_ret++;
15602            printf(" %d", n_lang);
15603            printf("\n");
15604        }
15605    }
15606    function_tests++;
15607
15608    return(test_ret);
15609}
15610
15611
15612static int
15613test_xmlCopyChar(void) {
15614    int test_ret = 0;
15615
15616    int mem_base;
15617    int ret_val;
15618    int len; /* Ignored, compatibility */
15619    int n_len;
15620    xmlChar * out; /* pointer to an array of xmlChar */
15621    int n_out;
15622    int val; /* the char value */
15623    int n_val;
15624
15625    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15626    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15627    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15628        mem_base = xmlMemBlocks();
15629        len = gen_int(n_len, 0);
15630        out = gen_xmlChar_ptr(n_out, 1);
15631        val = gen_int(n_val, 2);
15632
15633        ret_val = xmlCopyChar(len, out, val);
15634        desret_int(ret_val);
15635        call_tests++;
15636        des_int(n_len, len, 0);
15637        des_xmlChar_ptr(n_out, out, 1);
15638        des_int(n_val, val, 2);
15639        xmlResetLastError();
15640        if (mem_base != xmlMemBlocks()) {
15641            printf("Leak of %d blocks found in xmlCopyChar",
15642	           xmlMemBlocks() - mem_base);
15643	    test_ret++;
15644            printf(" %d", n_len);
15645            printf(" %d", n_out);
15646            printf(" %d", n_val);
15647            printf("\n");
15648        }
15649    }
15650    }
15651    }
15652    function_tests++;
15653
15654    return(test_ret);
15655}
15656
15657
15658static int
15659test_xmlCopyCharMultiByte(void) {
15660    int test_ret = 0;
15661
15662    int mem_base;
15663    int ret_val;
15664    xmlChar * out; /* pointer to an array of xmlChar */
15665    int n_out;
15666    int val; /* the char value */
15667    int n_val;
15668
15669    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15670    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15671        mem_base = xmlMemBlocks();
15672        out = gen_xmlChar_ptr(n_out, 0);
15673        val = gen_int(n_val, 1);
15674
15675        ret_val = xmlCopyCharMultiByte(out, val);
15676        desret_int(ret_val);
15677        call_tests++;
15678        des_xmlChar_ptr(n_out, out, 0);
15679        des_int(n_val, val, 1);
15680        xmlResetLastError();
15681        if (mem_base != xmlMemBlocks()) {
15682            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15683	           xmlMemBlocks() - mem_base);
15684	    test_ret++;
15685            printf(" %d", n_out);
15686            printf(" %d", n_val);
15687            printf("\n");
15688        }
15689    }
15690    }
15691    function_tests++;
15692
15693    return(test_ret);
15694}
15695
15696
15697static int
15698test_xmlCreateEntityParserCtxt(void) {
15699    int test_ret = 0;
15700
15701    int mem_base;
15702    xmlParserCtxtPtr ret_val;
15703    xmlChar * URL; /* the entity URL */
15704    int n_URL;
15705    xmlChar * ID; /* the entity PUBLIC ID */
15706    int n_ID;
15707    xmlChar * base; /* a possible base for the target URI */
15708    int n_base;
15709
15710    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15711    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15712    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15713        mem_base = xmlMemBlocks();
15714        URL = gen_const_xmlChar_ptr(n_URL, 0);
15715        ID = gen_const_xmlChar_ptr(n_ID, 1);
15716        base = gen_const_xmlChar_ptr(n_base, 2);
15717
15718        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15719        desret_xmlParserCtxtPtr(ret_val);
15720        call_tests++;
15721        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15722        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15723        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15724        xmlResetLastError();
15725        if (mem_base != xmlMemBlocks()) {
15726            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15727	           xmlMemBlocks() - mem_base);
15728	    test_ret++;
15729            printf(" %d", n_URL);
15730            printf(" %d", n_ID);
15731            printf(" %d", n_base);
15732            printf("\n");
15733        }
15734    }
15735    }
15736    }
15737    function_tests++;
15738
15739    return(test_ret);
15740}
15741
15742
15743static int
15744test_xmlCreateFileParserCtxt(void) {
15745    int test_ret = 0;
15746
15747    int mem_base;
15748    xmlParserCtxtPtr ret_val;
15749    const char * filename; /* the filename */
15750    int n_filename;
15751
15752    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15753        mem_base = xmlMemBlocks();
15754        filename = gen_fileoutput(n_filename, 0);
15755
15756        ret_val = xmlCreateFileParserCtxt(filename);
15757        desret_xmlParserCtxtPtr(ret_val);
15758        call_tests++;
15759        des_fileoutput(n_filename, filename, 0);
15760        xmlResetLastError();
15761        if (mem_base != xmlMemBlocks()) {
15762            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15763	           xmlMemBlocks() - mem_base);
15764	    test_ret++;
15765            printf(" %d", n_filename);
15766            printf("\n");
15767        }
15768    }
15769    function_tests++;
15770
15771    return(test_ret);
15772}
15773
15774
15775static int
15776test_xmlCreateMemoryParserCtxt(void) {
15777    int test_ret = 0;
15778
15779    int mem_base;
15780    xmlParserCtxtPtr ret_val;
15781    char * buffer; /* a pointer to a char array */
15782    int n_buffer;
15783    int size; /* the size of the array */
15784    int n_size;
15785
15786    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15787    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15788        mem_base = xmlMemBlocks();
15789        buffer = gen_const_char_ptr(n_buffer, 0);
15790        size = gen_int(n_size, 1);
15791
15792        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15793        desret_xmlParserCtxtPtr(ret_val);
15794        call_tests++;
15795        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15796        des_int(n_size, size, 1);
15797        xmlResetLastError();
15798        if (mem_base != xmlMemBlocks()) {
15799            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15800	           xmlMemBlocks() - mem_base);
15801	    test_ret++;
15802            printf(" %d", n_buffer);
15803            printf(" %d", n_size);
15804            printf("\n");
15805        }
15806    }
15807    }
15808    function_tests++;
15809
15810    return(test_ret);
15811}
15812
15813
15814static int
15815test_xmlCreateURLParserCtxt(void) {
15816    int test_ret = 0;
15817
15818    int mem_base;
15819    xmlParserCtxtPtr ret_val;
15820    const char * filename; /* the filename or URL */
15821    int n_filename;
15822    int options; /* a combination of xmlParserOption */
15823    int n_options;
15824
15825    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15826    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15827        mem_base = xmlMemBlocks();
15828        filename = gen_fileoutput(n_filename, 0);
15829        options = gen_int(n_options, 1);
15830
15831        ret_val = xmlCreateURLParserCtxt(filename, options);
15832        desret_xmlParserCtxtPtr(ret_val);
15833        call_tests++;
15834        des_fileoutput(n_filename, filename, 0);
15835        des_int(n_options, options, 1);
15836        xmlResetLastError();
15837        if (mem_base != xmlMemBlocks()) {
15838            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15839	           xmlMemBlocks() - mem_base);
15840	    test_ret++;
15841            printf(" %d", n_filename);
15842            printf(" %d", n_options);
15843            printf("\n");
15844        }
15845    }
15846    }
15847    function_tests++;
15848
15849    return(test_ret);
15850}
15851
15852
15853static int
15854test_xmlCurrentChar(void) {
15855    int test_ret = 0;
15856
15857    int mem_base;
15858    int ret_val;
15859    xmlParserCtxtPtr ctxt; /* the XML parser context */
15860    int n_ctxt;
15861    int * len; /* pointer to the length of the char read */
15862    int n_len;
15863
15864    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15865    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15866        mem_base = xmlMemBlocks();
15867        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15868        len = gen_int_ptr(n_len, 1);
15869
15870        ret_val = xmlCurrentChar(ctxt, len);
15871        desret_int(ret_val);
15872        call_tests++;
15873        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15874        des_int_ptr(n_len, len, 1);
15875        xmlResetLastError();
15876        if (mem_base != xmlMemBlocks()) {
15877            printf("Leak of %d blocks found in xmlCurrentChar",
15878	           xmlMemBlocks() - mem_base);
15879	    test_ret++;
15880            printf(" %d", n_ctxt);
15881            printf(" %d", n_len);
15882            printf("\n");
15883        }
15884    }
15885    }
15886    function_tests++;
15887
15888    return(test_ret);
15889}
15890
15891
15892static int
15893test_xmlErrMemory(void) {
15894    int test_ret = 0;
15895
15896    int mem_base;
15897    xmlParserCtxtPtr ctxt; /* an XML parser context */
15898    int n_ctxt;
15899    char * extra; /* extra informations */
15900    int n_extra;
15901
15902    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15903    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15904        mem_base = xmlMemBlocks();
15905        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15906        extra = gen_const_char_ptr(n_extra, 1);
15907
15908        xmlErrMemory(ctxt, (const char *)extra);
15909        call_tests++;
15910        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15911        des_const_char_ptr(n_extra, (const char *)extra, 1);
15912        xmlResetLastError();
15913        if (mem_base != xmlMemBlocks()) {
15914            printf("Leak of %d blocks found in xmlErrMemory",
15915	           xmlMemBlocks() - mem_base);
15916	    test_ret++;
15917            printf(" %d", n_ctxt);
15918            printf(" %d", n_extra);
15919            printf("\n");
15920        }
15921    }
15922    }
15923    function_tests++;
15924
15925    return(test_ret);
15926}
15927
15928
15929static int
15930test_xmlIsLetter(void) {
15931    int test_ret = 0;
15932
15933    int mem_base;
15934    int ret_val;
15935    int c; /* an unicode character (int) */
15936    int n_c;
15937
15938    for (n_c = 0;n_c < gen_nb_int;n_c++) {
15939        mem_base = xmlMemBlocks();
15940        c = gen_int(n_c, 0);
15941
15942        ret_val = xmlIsLetter(c);
15943        desret_int(ret_val);
15944        call_tests++;
15945        des_int(n_c, c, 0);
15946        xmlResetLastError();
15947        if (mem_base != xmlMemBlocks()) {
15948            printf("Leak of %d blocks found in xmlIsLetter",
15949	           xmlMemBlocks() - mem_base);
15950	    test_ret++;
15951            printf(" %d", n_c);
15952            printf("\n");
15953        }
15954    }
15955    function_tests++;
15956
15957    return(test_ret);
15958}
15959
15960
15961static int
15962test_xmlNewEntityInputStream(void) {
15963    int test_ret = 0;
15964
15965    int mem_base;
15966    xmlParserInputPtr ret_val;
15967    xmlParserCtxtPtr ctxt; /* an XML parser context */
15968    int n_ctxt;
15969    xmlEntityPtr entity; /* an Entity pointer */
15970    int n_entity;
15971
15972    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15973    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
15974        mem_base = xmlMemBlocks();
15975        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15976        entity = gen_xmlEntityPtr(n_entity, 1);
15977
15978        ret_val = xmlNewEntityInputStream(ctxt, entity);
15979        desret_xmlParserInputPtr(ret_val);
15980        call_tests++;
15981        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15982        des_xmlEntityPtr(n_entity, entity, 1);
15983        xmlResetLastError();
15984        if (mem_base != xmlMemBlocks()) {
15985            printf("Leak of %d blocks found in xmlNewEntityInputStream",
15986	           xmlMemBlocks() - mem_base);
15987	    test_ret++;
15988            printf(" %d", n_ctxt);
15989            printf(" %d", n_entity);
15990            printf("\n");
15991        }
15992    }
15993    }
15994    function_tests++;
15995
15996    return(test_ret);
15997}
15998
15999
16000static int
16001test_xmlNewInputFromFile(void) {
16002    int test_ret = 0;
16003
16004    int mem_base;
16005    xmlParserInputPtr ret_val;
16006    xmlParserCtxtPtr ctxt; /* an XML parser context */
16007    int n_ctxt;
16008    const char * filename; /* the filename to use as entity */
16009    int n_filename;
16010
16011    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16012    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16013        mem_base = xmlMemBlocks();
16014        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16015        filename = gen_filepath(n_filename, 1);
16016
16017        ret_val = xmlNewInputFromFile(ctxt, filename);
16018        desret_xmlParserInputPtr(ret_val);
16019        call_tests++;
16020        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16021        des_filepath(n_filename, filename, 1);
16022        xmlResetLastError();
16023        if (mem_base != xmlMemBlocks()) {
16024            printf("Leak of %d blocks found in xmlNewInputFromFile",
16025	           xmlMemBlocks() - mem_base);
16026	    test_ret++;
16027            printf(" %d", n_ctxt);
16028            printf(" %d", n_filename);
16029            printf("\n");
16030        }
16031    }
16032    }
16033    function_tests++;
16034
16035    return(test_ret);
16036}
16037
16038
16039static int
16040test_xmlNewInputStream(void) {
16041    int test_ret = 0;
16042
16043    int mem_base;
16044    xmlParserInputPtr ret_val;
16045    xmlParserCtxtPtr ctxt; /* an XML parser context */
16046    int n_ctxt;
16047
16048    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16049        mem_base = xmlMemBlocks();
16050        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16051
16052        ret_val = xmlNewInputStream(ctxt);
16053        desret_xmlParserInputPtr(ret_val);
16054        call_tests++;
16055        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16056        xmlResetLastError();
16057        if (mem_base != xmlMemBlocks()) {
16058            printf("Leak of %d blocks found in xmlNewInputStream",
16059	           xmlMemBlocks() - mem_base);
16060	    test_ret++;
16061            printf(" %d", n_ctxt);
16062            printf("\n");
16063        }
16064    }
16065    function_tests++;
16066
16067    return(test_ret);
16068}
16069
16070
16071static int
16072test_xmlNewStringInputStream(void) {
16073    int test_ret = 0;
16074
16075    int mem_base;
16076    xmlParserInputPtr ret_val;
16077    xmlParserCtxtPtr ctxt; /* an XML parser context */
16078    int n_ctxt;
16079    xmlChar * buffer; /* an memory buffer */
16080    int n_buffer;
16081
16082    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16083    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16084        mem_base = xmlMemBlocks();
16085        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16086        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16087
16088        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16089        desret_xmlParserInputPtr(ret_val);
16090        call_tests++;
16091        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16092        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16093        xmlResetLastError();
16094        if (mem_base != xmlMemBlocks()) {
16095            printf("Leak of %d blocks found in xmlNewStringInputStream",
16096	           xmlMemBlocks() - mem_base);
16097	    test_ret++;
16098            printf(" %d", n_ctxt);
16099            printf(" %d", n_buffer);
16100            printf("\n");
16101        }
16102    }
16103    }
16104    function_tests++;
16105
16106    return(test_ret);
16107}
16108
16109
16110static int
16111test_xmlNextChar(void) {
16112    int test_ret = 0;
16113
16114    int mem_base;
16115    xmlParserCtxtPtr ctxt; /* the XML parser context */
16116    int n_ctxt;
16117
16118    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16119        mem_base = xmlMemBlocks();
16120        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16121
16122        xmlNextChar(ctxt);
16123        call_tests++;
16124        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16125        xmlResetLastError();
16126        if (mem_base != xmlMemBlocks()) {
16127            printf("Leak of %d blocks found in xmlNextChar",
16128	           xmlMemBlocks() - mem_base);
16129	    test_ret++;
16130            printf(" %d", n_ctxt);
16131            printf("\n");
16132        }
16133    }
16134    function_tests++;
16135
16136    return(test_ret);
16137}
16138
16139
16140static int
16141test_xmlParserInputShrink(void) {
16142    int test_ret = 0;
16143
16144    int mem_base;
16145    xmlParserInputPtr in; /* an XML parser input */
16146    int n_in;
16147
16148    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16149        mem_base = xmlMemBlocks();
16150        in = gen_xmlParserInputPtr(n_in, 0);
16151
16152        xmlParserInputShrink(in);
16153        call_tests++;
16154        des_xmlParserInputPtr(n_in, in, 0);
16155        xmlResetLastError();
16156        if (mem_base != xmlMemBlocks()) {
16157            printf("Leak of %d blocks found in xmlParserInputShrink",
16158	           xmlMemBlocks() - mem_base);
16159	    test_ret++;
16160            printf(" %d", n_in);
16161            printf("\n");
16162        }
16163    }
16164    function_tests++;
16165
16166    return(test_ret);
16167}
16168
16169
16170static int
16171test_xmlPopInput(void) {
16172    int test_ret = 0;
16173
16174    int mem_base;
16175    xmlChar ret_val;
16176    xmlParserCtxtPtr ctxt; /* an XML parser context */
16177    int n_ctxt;
16178
16179    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16180        mem_base = xmlMemBlocks();
16181        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16182
16183        ret_val = xmlPopInput(ctxt);
16184        desret_xmlChar(ret_val);
16185        call_tests++;
16186        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16187        xmlResetLastError();
16188        if (mem_base != xmlMemBlocks()) {
16189            printf("Leak of %d blocks found in xmlPopInput",
16190	           xmlMemBlocks() - mem_base);
16191	    test_ret++;
16192            printf(" %d", n_ctxt);
16193            printf("\n");
16194        }
16195    }
16196    function_tests++;
16197
16198    return(test_ret);
16199}
16200
16201
16202static int
16203test_xmlPushInput(void) {
16204    int test_ret = 0;
16205
16206    int mem_base;
16207    xmlParserCtxtPtr ctxt; /* an XML parser context */
16208    int n_ctxt;
16209    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16210    int n_input;
16211
16212    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16213    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16214        mem_base = xmlMemBlocks();
16215        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16216        input = gen_xmlParserInputPtr(n_input, 1);
16217
16218        xmlPushInput(ctxt, input);
16219        call_tests++;
16220        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16221        des_xmlParserInputPtr(n_input, input, 1);
16222        xmlResetLastError();
16223        if (mem_base != xmlMemBlocks()) {
16224            printf("Leak of %d blocks found in xmlPushInput",
16225	           xmlMemBlocks() - mem_base);
16226	    test_ret++;
16227            printf(" %d", n_ctxt);
16228            printf(" %d", n_input);
16229            printf("\n");
16230        }
16231    }
16232    }
16233    function_tests++;
16234
16235    return(test_ret);
16236}
16237
16238
16239static int
16240test_xmlSetEntityReferenceFunc(void) {
16241    int test_ret = 0;
16242
16243
16244    /* missing type support */
16245    return(test_ret);
16246}
16247
16248
16249static int
16250test_xmlSplitQName(void) {
16251    int test_ret = 0;
16252
16253    int mem_base;
16254    xmlChar * ret_val;
16255    xmlParserCtxtPtr ctxt; /* an XML parser context */
16256    int n_ctxt;
16257    xmlChar * name; /* an XML parser context */
16258    int n_name;
16259    xmlChar ** prefix; /* a xmlChar ** */
16260    int n_prefix;
16261
16262    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16263    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16264    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16265        mem_base = xmlMemBlocks();
16266        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16267        name = gen_const_xmlChar_ptr(n_name, 1);
16268        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16269
16270        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16271        desret_xmlChar_ptr(ret_val);
16272        call_tests++;
16273        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16274        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16275        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16276        xmlResetLastError();
16277        if (mem_base != xmlMemBlocks()) {
16278            printf("Leak of %d blocks found in xmlSplitQName",
16279	           xmlMemBlocks() - mem_base);
16280	    test_ret++;
16281            printf(" %d", n_ctxt);
16282            printf(" %d", n_name);
16283            printf(" %d", n_prefix);
16284            printf("\n");
16285        }
16286    }
16287    }
16288    }
16289    function_tests++;
16290
16291    return(test_ret);
16292}
16293
16294
16295static int
16296test_xmlStringCurrentChar(void) {
16297    int test_ret = 0;
16298
16299    int mem_base;
16300    int ret_val;
16301    xmlParserCtxtPtr ctxt; /* the XML parser context */
16302    int n_ctxt;
16303    xmlChar * cur; /* pointer to the beginning of the char */
16304    int n_cur;
16305    int * len; /* pointer to the length of the char read */
16306    int n_len;
16307
16308    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16309    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16310    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16311        mem_base = xmlMemBlocks();
16312        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16313        cur = gen_const_xmlChar_ptr(n_cur, 1);
16314        len = gen_int_ptr(n_len, 2);
16315
16316        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16317        desret_int(ret_val);
16318        call_tests++;
16319        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16320        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16321        des_int_ptr(n_len, len, 2);
16322        xmlResetLastError();
16323        if (mem_base != xmlMemBlocks()) {
16324            printf("Leak of %d blocks found in xmlStringCurrentChar",
16325	           xmlMemBlocks() - mem_base);
16326	    test_ret++;
16327            printf(" %d", n_ctxt);
16328            printf(" %d", n_cur);
16329            printf(" %d", n_len);
16330            printf("\n");
16331        }
16332    }
16333    }
16334    }
16335    function_tests++;
16336
16337    return(test_ret);
16338}
16339
16340
16341static int
16342test_xmlStringDecodeEntities(void) {
16343    int test_ret = 0;
16344
16345    int mem_base;
16346    xmlChar * ret_val;
16347    xmlParserCtxtPtr ctxt; /* the parser context */
16348    int n_ctxt;
16349    xmlChar * str; /* the input string */
16350    int n_str;
16351    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16352    int n_what;
16353    xmlChar end; /* an end marker xmlChar, 0 if none */
16354    int n_end;
16355    xmlChar end2; /* an end marker xmlChar, 0 if none */
16356    int n_end2;
16357    xmlChar end3; /* an end marker xmlChar, 0 if none */
16358    int n_end3;
16359
16360    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16361    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16362    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16363    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16364    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16365    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16366        mem_base = xmlMemBlocks();
16367        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16368        str = gen_const_xmlChar_ptr(n_str, 1);
16369        what = gen_int(n_what, 2);
16370        end = gen_xmlChar(n_end, 3);
16371        end2 = gen_xmlChar(n_end2, 4);
16372        end3 = gen_xmlChar(n_end3, 5);
16373
16374        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16375        desret_xmlChar_ptr(ret_val);
16376        call_tests++;
16377        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16378        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16379        des_int(n_what, what, 2);
16380        des_xmlChar(n_end, end, 3);
16381        des_xmlChar(n_end2, end2, 4);
16382        des_xmlChar(n_end3, end3, 5);
16383        xmlResetLastError();
16384        if (mem_base != xmlMemBlocks()) {
16385            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16386	           xmlMemBlocks() - mem_base);
16387	    test_ret++;
16388            printf(" %d", n_ctxt);
16389            printf(" %d", n_str);
16390            printf(" %d", n_what);
16391            printf(" %d", n_end);
16392            printf(" %d", n_end2);
16393            printf(" %d", n_end3);
16394            printf("\n");
16395        }
16396    }
16397    }
16398    }
16399    }
16400    }
16401    }
16402    function_tests++;
16403
16404    return(test_ret);
16405}
16406
16407
16408static int
16409test_xmlStringLenDecodeEntities(void) {
16410    int test_ret = 0;
16411
16412    int mem_base;
16413    xmlChar * ret_val;
16414    xmlParserCtxtPtr ctxt; /* the parser context */
16415    int n_ctxt;
16416    xmlChar * str; /* the input string */
16417    int n_str;
16418    int len; /* the string length */
16419    int n_len;
16420    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16421    int n_what;
16422    xmlChar end; /* an end marker xmlChar, 0 if none */
16423    int n_end;
16424    xmlChar end2; /* an end marker xmlChar, 0 if none */
16425    int n_end2;
16426    xmlChar end3; /* an end marker xmlChar, 0 if none */
16427    int n_end3;
16428
16429    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16430    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16431    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16432    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16433    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16434    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16435    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16436        mem_base = xmlMemBlocks();
16437        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16438        str = gen_const_xmlChar_ptr(n_str, 1);
16439        len = gen_int(n_len, 2);
16440        what = gen_int(n_what, 3);
16441        end = gen_xmlChar(n_end, 4);
16442        end2 = gen_xmlChar(n_end2, 5);
16443        end3 = gen_xmlChar(n_end3, 6);
16444
16445        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16446        desret_xmlChar_ptr(ret_val);
16447        call_tests++;
16448        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16449        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16450        des_int(n_len, len, 2);
16451        des_int(n_what, what, 3);
16452        des_xmlChar(n_end, end, 4);
16453        des_xmlChar(n_end2, end2, 5);
16454        des_xmlChar(n_end3, end3, 6);
16455        xmlResetLastError();
16456        if (mem_base != xmlMemBlocks()) {
16457            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16458	           xmlMemBlocks() - mem_base);
16459	    test_ret++;
16460            printf(" %d", n_ctxt);
16461            printf(" %d", n_str);
16462            printf(" %d", n_len);
16463            printf(" %d", n_what);
16464            printf(" %d", n_end);
16465            printf(" %d", n_end2);
16466            printf(" %d", n_end3);
16467            printf("\n");
16468        }
16469    }
16470    }
16471    }
16472    }
16473    }
16474    }
16475    }
16476    function_tests++;
16477
16478    return(test_ret);
16479}
16480
16481
16482static int
16483test_xmlSwitchEncoding(void) {
16484    int test_ret = 0;
16485
16486    int mem_base;
16487    int ret_val;
16488    xmlParserCtxtPtr ctxt; /* the parser context */
16489    int n_ctxt;
16490    xmlCharEncoding enc; /* the encoding value (number) */
16491    int n_enc;
16492
16493    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16494    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16495        mem_base = xmlMemBlocks();
16496        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16497        enc = gen_xmlCharEncoding(n_enc, 1);
16498
16499        ret_val = xmlSwitchEncoding(ctxt, enc);
16500        desret_int(ret_val);
16501        call_tests++;
16502        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16503        des_xmlCharEncoding(n_enc, enc, 1);
16504        xmlResetLastError();
16505        if (mem_base != xmlMemBlocks()) {
16506            printf("Leak of %d blocks found in xmlSwitchEncoding",
16507	           xmlMemBlocks() - mem_base);
16508	    test_ret++;
16509            printf(" %d", n_ctxt);
16510            printf(" %d", n_enc);
16511            printf("\n");
16512        }
16513    }
16514    }
16515    function_tests++;
16516
16517    return(test_ret);
16518}
16519
16520
16521static int
16522test_xmlSwitchInputEncoding(void) {
16523    int test_ret = 0;
16524
16525    int mem_base;
16526    int ret_val;
16527    xmlParserCtxtPtr ctxt; /* the parser context */
16528    int n_ctxt;
16529    xmlParserInputPtr input; /* the input stream */
16530    int n_input;
16531    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16532    int n_handler;
16533
16534    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16535    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16536    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16537        mem_base = xmlMemBlocks();
16538        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16539        input = gen_xmlParserInputPtr(n_input, 1);
16540        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16541
16542        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16543        desret_int(ret_val);
16544        call_tests++;
16545        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16546        des_xmlParserInputPtr(n_input, input, 1);
16547        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16548        xmlResetLastError();
16549        if (mem_base != xmlMemBlocks()) {
16550            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16551	           xmlMemBlocks() - mem_base);
16552	    test_ret++;
16553            printf(" %d", n_ctxt);
16554            printf(" %d", n_input);
16555            printf(" %d", n_handler);
16556            printf("\n");
16557        }
16558    }
16559    }
16560    }
16561    function_tests++;
16562
16563    return(test_ret);
16564}
16565
16566
16567static int
16568test_xmlSwitchToEncoding(void) {
16569    int test_ret = 0;
16570
16571    int mem_base;
16572    int ret_val;
16573    xmlParserCtxtPtr ctxt; /* the parser context */
16574    int n_ctxt;
16575    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16576    int n_handler;
16577
16578    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16579    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16580        mem_base = xmlMemBlocks();
16581        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16582        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16583
16584        ret_val = xmlSwitchToEncoding(ctxt, handler);
16585        desret_int(ret_val);
16586        call_tests++;
16587        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16588        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16589        xmlResetLastError();
16590        if (mem_base != xmlMemBlocks()) {
16591            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16592	           xmlMemBlocks() - mem_base);
16593	    test_ret++;
16594            printf(" %d", n_ctxt);
16595            printf(" %d", n_handler);
16596            printf("\n");
16597        }
16598    }
16599    }
16600    function_tests++;
16601
16602    return(test_ret);
16603}
16604
16605static int
16606test_parserInternals(void) {
16607    int test_ret = 0;
16608
16609    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16610    test_ret += test_htmlCreateFileParserCtxt();
16611    test_ret += test_htmlInitAutoClose();
16612    test_ret += test_inputPop();
16613    test_ret += test_inputPush();
16614    test_ret += test_namePop();
16615    test_ret += test_namePush();
16616    test_ret += test_nodePop();
16617    test_ret += test_nodePush();
16618    test_ret += test_xmlCheckLanguageID();
16619    test_ret += test_xmlCopyChar();
16620    test_ret += test_xmlCopyCharMultiByte();
16621    test_ret += test_xmlCreateEntityParserCtxt();
16622    test_ret += test_xmlCreateFileParserCtxt();
16623    test_ret += test_xmlCreateMemoryParserCtxt();
16624    test_ret += test_xmlCreateURLParserCtxt();
16625    test_ret += test_xmlCurrentChar();
16626    test_ret += test_xmlErrMemory();
16627    test_ret += test_xmlIsLetter();
16628    test_ret += test_xmlNewEntityInputStream();
16629    test_ret += test_xmlNewInputFromFile();
16630    test_ret += test_xmlNewInputStream();
16631    test_ret += test_xmlNewStringInputStream();
16632    test_ret += test_xmlNextChar();
16633    test_ret += test_xmlParserInputShrink();
16634    test_ret += test_xmlPopInput();
16635    test_ret += test_xmlPushInput();
16636    test_ret += test_xmlSetEntityReferenceFunc();
16637    test_ret += test_xmlSplitQName();
16638    test_ret += test_xmlStringCurrentChar();
16639    test_ret += test_xmlStringDecodeEntities();
16640    test_ret += test_xmlStringLenDecodeEntities();
16641    test_ret += test_xmlSwitchEncoding();
16642    test_ret += test_xmlSwitchInputEncoding();
16643    test_ret += test_xmlSwitchToEncoding();
16644
16645    if (test_ret != 0)
16646	printf("Module parserInternals: %d errors\n", test_ret);
16647    return(test_ret);
16648}
16649
16650static int
16651test_xmlPatternFromRoot(void) {
16652    int test_ret = 0;
16653
16654#if defined(LIBXML_PATTERN_ENABLED)
16655    int mem_base;
16656    int ret_val;
16657    xmlPatternPtr comp; /* the precompiled pattern */
16658    int n_comp;
16659
16660    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16661        mem_base = xmlMemBlocks();
16662        comp = gen_xmlPatternPtr(n_comp, 0);
16663
16664        ret_val = xmlPatternFromRoot(comp);
16665        desret_int(ret_val);
16666        call_tests++;
16667        des_xmlPatternPtr(n_comp, comp, 0);
16668        xmlResetLastError();
16669        if (mem_base != xmlMemBlocks()) {
16670            printf("Leak of %d blocks found in xmlPatternFromRoot",
16671	           xmlMemBlocks() - mem_base);
16672	    test_ret++;
16673            printf(" %d", n_comp);
16674            printf("\n");
16675        }
16676    }
16677    function_tests++;
16678#endif
16679
16680    return(test_ret);
16681}
16682
16683
16684static int
16685test_xmlPatternGetStreamCtxt(void) {
16686    int test_ret = 0;
16687
16688
16689    /* missing type support */
16690    return(test_ret);
16691}
16692
16693
16694static int
16695test_xmlPatternMatch(void) {
16696    int test_ret = 0;
16697
16698#if defined(LIBXML_PATTERN_ENABLED)
16699    int mem_base;
16700    int ret_val;
16701    xmlPatternPtr comp; /* the precompiled pattern */
16702    int n_comp;
16703    xmlNodePtr node; /* a node */
16704    int n_node;
16705
16706    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16707    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16708        mem_base = xmlMemBlocks();
16709        comp = gen_xmlPatternPtr(n_comp, 0);
16710        node = gen_xmlNodePtr(n_node, 1);
16711
16712        ret_val = xmlPatternMatch(comp, node);
16713        desret_int(ret_val);
16714        call_tests++;
16715        des_xmlPatternPtr(n_comp, comp, 0);
16716        des_xmlNodePtr(n_node, node, 1);
16717        xmlResetLastError();
16718        if (mem_base != xmlMemBlocks()) {
16719            printf("Leak of %d blocks found in xmlPatternMatch",
16720	           xmlMemBlocks() - mem_base);
16721	    test_ret++;
16722            printf(" %d", n_comp);
16723            printf(" %d", n_node);
16724            printf("\n");
16725        }
16726    }
16727    }
16728    function_tests++;
16729#endif
16730
16731    return(test_ret);
16732}
16733
16734
16735static int
16736test_xmlPatternMaxDepth(void) {
16737    int test_ret = 0;
16738
16739#if defined(LIBXML_PATTERN_ENABLED)
16740    int mem_base;
16741    int ret_val;
16742    xmlPatternPtr comp; /* the precompiled pattern */
16743    int n_comp;
16744
16745    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16746        mem_base = xmlMemBlocks();
16747        comp = gen_xmlPatternPtr(n_comp, 0);
16748
16749        ret_val = xmlPatternMaxDepth(comp);
16750        desret_int(ret_val);
16751        call_tests++;
16752        des_xmlPatternPtr(n_comp, comp, 0);
16753        xmlResetLastError();
16754        if (mem_base != xmlMemBlocks()) {
16755            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16756	           xmlMemBlocks() - mem_base);
16757	    test_ret++;
16758            printf(" %d", n_comp);
16759            printf("\n");
16760        }
16761    }
16762    function_tests++;
16763#endif
16764
16765    return(test_ret);
16766}
16767
16768
16769static int
16770test_xmlPatternMinDepth(void) {
16771    int test_ret = 0;
16772
16773#if defined(LIBXML_PATTERN_ENABLED)
16774    int mem_base;
16775    int ret_val;
16776    xmlPatternPtr comp; /* the precompiled pattern */
16777    int n_comp;
16778
16779    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16780        mem_base = xmlMemBlocks();
16781        comp = gen_xmlPatternPtr(n_comp, 0);
16782
16783        ret_val = xmlPatternMinDepth(comp);
16784        desret_int(ret_val);
16785        call_tests++;
16786        des_xmlPatternPtr(n_comp, comp, 0);
16787        xmlResetLastError();
16788        if (mem_base != xmlMemBlocks()) {
16789            printf("Leak of %d blocks found in xmlPatternMinDepth",
16790	           xmlMemBlocks() - mem_base);
16791	    test_ret++;
16792            printf(" %d", n_comp);
16793            printf("\n");
16794        }
16795    }
16796    function_tests++;
16797#endif
16798
16799    return(test_ret);
16800}
16801
16802
16803static int
16804test_xmlPatternStreamable(void) {
16805    int test_ret = 0;
16806
16807#if defined(LIBXML_PATTERN_ENABLED)
16808    int mem_base;
16809    int ret_val;
16810    xmlPatternPtr comp; /* the precompiled pattern */
16811    int n_comp;
16812
16813    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16814        mem_base = xmlMemBlocks();
16815        comp = gen_xmlPatternPtr(n_comp, 0);
16816
16817        ret_val = xmlPatternStreamable(comp);
16818        desret_int(ret_val);
16819        call_tests++;
16820        des_xmlPatternPtr(n_comp, comp, 0);
16821        xmlResetLastError();
16822        if (mem_base != xmlMemBlocks()) {
16823            printf("Leak of %d blocks found in xmlPatternStreamable",
16824	           xmlMemBlocks() - mem_base);
16825	    test_ret++;
16826            printf(" %d", n_comp);
16827            printf("\n");
16828        }
16829    }
16830    function_tests++;
16831#endif
16832
16833    return(test_ret);
16834}
16835
16836
16837static int
16838test_xmlPatterncompile(void) {
16839    int test_ret = 0;
16840
16841
16842    /* missing type support */
16843    return(test_ret);
16844}
16845
16846#ifdef LIBXML_PATTERN_ENABLED
16847
16848#define gen_nb_xmlStreamCtxtPtr 1
16849static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16850    return(NULL);
16851}
16852static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16853}
16854#endif
16855
16856
16857static int
16858test_xmlStreamPop(void) {
16859    int test_ret = 0;
16860
16861#if defined(LIBXML_PATTERN_ENABLED)
16862    int mem_base;
16863    int ret_val;
16864    xmlStreamCtxtPtr stream; /* the stream context */
16865    int n_stream;
16866
16867    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16868        mem_base = xmlMemBlocks();
16869        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16870
16871        ret_val = xmlStreamPop(stream);
16872        desret_int(ret_val);
16873        call_tests++;
16874        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16875        xmlResetLastError();
16876        if (mem_base != xmlMemBlocks()) {
16877            printf("Leak of %d blocks found in xmlStreamPop",
16878	           xmlMemBlocks() - mem_base);
16879	    test_ret++;
16880            printf(" %d", n_stream);
16881            printf("\n");
16882        }
16883    }
16884    function_tests++;
16885#endif
16886
16887    return(test_ret);
16888}
16889
16890
16891static int
16892test_xmlStreamPush(void) {
16893    int test_ret = 0;
16894
16895#if defined(LIBXML_PATTERN_ENABLED)
16896    int mem_base;
16897    int ret_val;
16898    xmlStreamCtxtPtr stream; /* the stream context */
16899    int n_stream;
16900    xmlChar * name; /* the current name */
16901    int n_name;
16902    xmlChar * ns; /* the namespace name */
16903    int n_ns;
16904
16905    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16906    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16907    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16908        mem_base = xmlMemBlocks();
16909        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16910        name = gen_const_xmlChar_ptr(n_name, 1);
16911        ns = gen_const_xmlChar_ptr(n_ns, 2);
16912
16913        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
16914        desret_int(ret_val);
16915        call_tests++;
16916        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16917        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16918        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16919        xmlResetLastError();
16920        if (mem_base != xmlMemBlocks()) {
16921            printf("Leak of %d blocks found in xmlStreamPush",
16922	           xmlMemBlocks() - mem_base);
16923	    test_ret++;
16924            printf(" %d", n_stream);
16925            printf(" %d", n_name);
16926            printf(" %d", n_ns);
16927            printf("\n");
16928        }
16929    }
16930    }
16931    }
16932    function_tests++;
16933#endif
16934
16935    return(test_ret);
16936}
16937
16938
16939static int
16940test_xmlStreamPushAttr(void) {
16941    int test_ret = 0;
16942
16943#if defined(LIBXML_PATTERN_ENABLED)
16944    int mem_base;
16945    int ret_val;
16946    xmlStreamCtxtPtr stream; /* the stream context */
16947    int n_stream;
16948    xmlChar * name; /* the current name */
16949    int n_name;
16950    xmlChar * ns; /* the namespace name */
16951    int n_ns;
16952
16953    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16954    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16955    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16956        mem_base = xmlMemBlocks();
16957        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16958        name = gen_const_xmlChar_ptr(n_name, 1);
16959        ns = gen_const_xmlChar_ptr(n_ns, 2);
16960
16961        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
16962        desret_int(ret_val);
16963        call_tests++;
16964        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16965        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16966        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16967        xmlResetLastError();
16968        if (mem_base != xmlMemBlocks()) {
16969            printf("Leak of %d blocks found in xmlStreamPushAttr",
16970	           xmlMemBlocks() - mem_base);
16971	    test_ret++;
16972            printf(" %d", n_stream);
16973            printf(" %d", n_name);
16974            printf(" %d", n_ns);
16975            printf("\n");
16976        }
16977    }
16978    }
16979    }
16980    function_tests++;
16981#endif
16982
16983    return(test_ret);
16984}
16985
16986static int
16987test_pattern(void) {
16988    int test_ret = 0;
16989
16990    if (quiet == 0) printf("Testing pattern : 8 of 13 functions ...\n");
16991    test_ret += test_xmlPatternFromRoot();
16992    test_ret += test_xmlPatternGetStreamCtxt();
16993    test_ret += test_xmlPatternMatch();
16994    test_ret += test_xmlPatternMaxDepth();
16995    test_ret += test_xmlPatternMinDepth();
16996    test_ret += test_xmlPatternStreamable();
16997    test_ret += test_xmlPatterncompile();
16998    test_ret += test_xmlStreamPop();
16999    test_ret += test_xmlStreamPush();
17000    test_ret += test_xmlStreamPushAttr();
17001
17002    if (test_ret != 0)
17003	printf("Module pattern: %d errors\n", test_ret);
17004    return(test_ret);
17005}
17006#ifdef LIBXML_SCHEMAS_ENABLED
17007
17008#define gen_nb_xmlRelaxNGPtr 1
17009static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17010    return(NULL);
17011}
17012static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17013}
17014#endif
17015
17016
17017static int
17018test_xmlRelaxNGDump(void) {
17019    int test_ret = 0;
17020
17021#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17022    int mem_base;
17023    FILE * output; /* the file output */
17024    int n_output;
17025    xmlRelaxNGPtr schema; /* a schema structure */
17026    int n_schema;
17027
17028    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17029    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17030        mem_base = xmlMemBlocks();
17031        output = gen_FILE_ptr(n_output, 0);
17032        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17033
17034        xmlRelaxNGDump(output, schema);
17035        call_tests++;
17036        des_FILE_ptr(n_output, output, 0);
17037        des_xmlRelaxNGPtr(n_schema, schema, 1);
17038        xmlResetLastError();
17039        if (mem_base != xmlMemBlocks()) {
17040            printf("Leak of %d blocks found in xmlRelaxNGDump",
17041	           xmlMemBlocks() - mem_base);
17042	    test_ret++;
17043            printf(" %d", n_output);
17044            printf(" %d", n_schema);
17045            printf("\n");
17046        }
17047    }
17048    }
17049    function_tests++;
17050#endif
17051
17052    return(test_ret);
17053}
17054
17055
17056static int
17057test_xmlRelaxNGDumpTree(void) {
17058    int test_ret = 0;
17059
17060#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17061    int mem_base;
17062    FILE * output; /* the file output */
17063    int n_output;
17064    xmlRelaxNGPtr schema; /* a schema structure */
17065    int n_schema;
17066
17067    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17068    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17069        mem_base = xmlMemBlocks();
17070        output = gen_FILE_ptr(n_output, 0);
17071        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17072
17073        xmlRelaxNGDumpTree(output, schema);
17074        call_tests++;
17075        des_FILE_ptr(n_output, output, 0);
17076        des_xmlRelaxNGPtr(n_schema, schema, 1);
17077        xmlResetLastError();
17078        if (mem_base != xmlMemBlocks()) {
17079            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17080	           xmlMemBlocks() - mem_base);
17081	    test_ret++;
17082            printf(" %d", n_output);
17083            printf(" %d", n_schema);
17084            printf("\n");
17085        }
17086    }
17087    }
17088    function_tests++;
17089#endif
17090
17091    return(test_ret);
17092}
17093
17094#ifdef LIBXML_SCHEMAS_ENABLED
17095
17096#define gen_nb_xmlRelaxNGParserCtxtPtr 1
17097static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17098    return(NULL);
17099}
17100static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17101}
17102#endif
17103
17104#ifdef LIBXML_SCHEMAS_ENABLED
17105
17106#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17107static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17108    return(NULL);
17109}
17110static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17111}
17112#endif
17113
17114#ifdef LIBXML_SCHEMAS_ENABLED
17115
17116#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17117static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17118    return(NULL);
17119}
17120static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17121}
17122#endif
17123
17124#ifdef LIBXML_SCHEMAS_ENABLED
17125
17126#define gen_nb_void_ptr_ptr 1
17127static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17128    return(NULL);
17129}
17130static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17131}
17132#endif
17133
17134
17135static int
17136test_xmlRelaxNGGetParserErrors(void) {
17137    int test_ret = 0;
17138
17139#if defined(LIBXML_SCHEMAS_ENABLED)
17140    int mem_base;
17141    int ret_val;
17142    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17143    int n_ctxt;
17144    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17145    int n_err;
17146    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17147    int n_warn;
17148    void ** ctx; /* contextual data for the callbacks result */
17149    int n_ctx;
17150
17151    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17152    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17153    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17154    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17155        mem_base = xmlMemBlocks();
17156        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17157        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17158        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17159        ctx = gen_void_ptr_ptr(n_ctx, 3);
17160
17161        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17162        desret_int(ret_val);
17163        call_tests++;
17164        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17165        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17166        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17167        des_void_ptr_ptr(n_ctx, ctx, 3);
17168        xmlResetLastError();
17169        if (mem_base != xmlMemBlocks()) {
17170            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17171	           xmlMemBlocks() - mem_base);
17172	    test_ret++;
17173            printf(" %d", n_ctxt);
17174            printf(" %d", n_err);
17175            printf(" %d", n_warn);
17176            printf(" %d", n_ctx);
17177            printf("\n");
17178        }
17179    }
17180    }
17181    }
17182    }
17183    function_tests++;
17184#endif
17185
17186    return(test_ret);
17187}
17188
17189#ifdef LIBXML_SCHEMAS_ENABLED
17190
17191#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17192static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17193    return(NULL);
17194}
17195static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17196}
17197#endif
17198
17199
17200static int
17201test_xmlRelaxNGGetValidErrors(void) {
17202    int test_ret = 0;
17203
17204#if defined(LIBXML_SCHEMAS_ENABLED)
17205    int mem_base;
17206    int ret_val;
17207    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17208    int n_ctxt;
17209    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17210    int n_err;
17211    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17212    int n_warn;
17213    void ** ctx; /* the functions context result */
17214    int n_ctx;
17215
17216    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17217    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17218    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17219    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17220        mem_base = xmlMemBlocks();
17221        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17222        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17223        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17224        ctx = gen_void_ptr_ptr(n_ctx, 3);
17225
17226        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17227        desret_int(ret_val);
17228        call_tests++;
17229        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17230        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17231        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17232        des_void_ptr_ptr(n_ctx, ctx, 3);
17233        xmlResetLastError();
17234        if (mem_base != xmlMemBlocks()) {
17235            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17236	           xmlMemBlocks() - mem_base);
17237	    test_ret++;
17238            printf(" %d", n_ctxt);
17239            printf(" %d", n_err);
17240            printf(" %d", n_warn);
17241            printf(" %d", n_ctx);
17242            printf("\n");
17243        }
17244    }
17245    }
17246    }
17247    }
17248    function_tests++;
17249#endif
17250
17251    return(test_ret);
17252}
17253
17254
17255static int
17256test_xmlRelaxNGInitTypes(void) {
17257    int test_ret = 0;
17258
17259#if defined(LIBXML_SCHEMAS_ENABLED)
17260    int mem_base;
17261    int ret_val;
17262
17263        mem_base = xmlMemBlocks();
17264
17265        ret_val = xmlRelaxNGInitTypes();
17266        desret_int(ret_val);
17267        call_tests++;
17268        xmlResetLastError();
17269        if (mem_base != xmlMemBlocks()) {
17270            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17271	           xmlMemBlocks() - mem_base);
17272	    test_ret++;
17273            printf("\n");
17274        }
17275    function_tests++;
17276#endif
17277
17278    return(test_ret);
17279}
17280
17281
17282static int
17283test_xmlRelaxNGNewDocParserCtxt(void) {
17284    int test_ret = 0;
17285
17286#if defined(LIBXML_SCHEMAS_ENABLED)
17287    int mem_base;
17288    xmlRelaxNGParserCtxtPtr ret_val;
17289    xmlDocPtr doc; /* a preparsed document tree */
17290    int n_doc;
17291
17292    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17293        mem_base = xmlMemBlocks();
17294        doc = gen_xmlDocPtr(n_doc, 0);
17295
17296        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17297        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17298        call_tests++;
17299        des_xmlDocPtr(n_doc, doc, 0);
17300        xmlResetLastError();
17301        if (mem_base != xmlMemBlocks()) {
17302            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17303	           xmlMemBlocks() - mem_base);
17304	    test_ret++;
17305            printf(" %d", n_doc);
17306            printf("\n");
17307        }
17308    }
17309    function_tests++;
17310#endif
17311
17312    return(test_ret);
17313}
17314
17315
17316static int
17317test_xmlRelaxNGNewMemParserCtxt(void) {
17318    int test_ret = 0;
17319
17320#if defined(LIBXML_SCHEMAS_ENABLED)
17321    int mem_base;
17322    xmlRelaxNGParserCtxtPtr ret_val;
17323    char * buffer; /* a pointer to a char array containing the schemas */
17324    int n_buffer;
17325    int size; /* the size of the array */
17326    int n_size;
17327
17328    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17329    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17330        mem_base = xmlMemBlocks();
17331        buffer = gen_const_char_ptr(n_buffer, 0);
17332        size = gen_int(n_size, 1);
17333
17334        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17335        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17336        call_tests++;
17337        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17338        des_int(n_size, size, 1);
17339        xmlResetLastError();
17340        if (mem_base != xmlMemBlocks()) {
17341            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17342	           xmlMemBlocks() - mem_base);
17343	    test_ret++;
17344            printf(" %d", n_buffer);
17345            printf(" %d", n_size);
17346            printf("\n");
17347        }
17348    }
17349    }
17350    function_tests++;
17351#endif
17352
17353    return(test_ret);
17354}
17355
17356
17357static int
17358test_xmlRelaxNGNewParserCtxt(void) {
17359    int test_ret = 0;
17360
17361#if defined(LIBXML_SCHEMAS_ENABLED)
17362    int mem_base;
17363    xmlRelaxNGParserCtxtPtr ret_val;
17364    char * URL; /* the location of the schema */
17365    int n_URL;
17366
17367    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17368        mem_base = xmlMemBlocks();
17369        URL = gen_const_char_ptr(n_URL, 0);
17370
17371        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17372        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17373        call_tests++;
17374        des_const_char_ptr(n_URL, (const char *)URL, 0);
17375        xmlResetLastError();
17376        if (mem_base != xmlMemBlocks()) {
17377            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17378	           xmlMemBlocks() - mem_base);
17379	    test_ret++;
17380            printf(" %d", n_URL);
17381            printf("\n");
17382        }
17383    }
17384    function_tests++;
17385#endif
17386
17387    return(test_ret);
17388}
17389
17390
17391static int
17392test_xmlRelaxNGNewValidCtxt(void) {
17393    int test_ret = 0;
17394
17395
17396    /* missing type support */
17397    return(test_ret);
17398}
17399
17400
17401static int
17402test_xmlRelaxNGParse(void) {
17403    int test_ret = 0;
17404
17405
17406    /* missing type support */
17407    return(test_ret);
17408}
17409
17410
17411static int
17412test_xmlRelaxNGSetParserErrors(void) {
17413    int test_ret = 0;
17414
17415
17416    /* missing type support */
17417    return(test_ret);
17418}
17419
17420
17421static int
17422test_xmlRelaxNGSetValidErrors(void) {
17423    int test_ret = 0;
17424
17425
17426    /* missing type support */
17427    return(test_ret);
17428}
17429
17430
17431static int
17432test_xmlRelaxNGSetValidStructuredErrors(void) {
17433    int test_ret = 0;
17434
17435
17436    /* missing type support */
17437    return(test_ret);
17438}
17439
17440
17441static int
17442test_xmlRelaxNGValidateDoc(void) {
17443    int test_ret = 0;
17444
17445#if defined(LIBXML_SCHEMAS_ENABLED)
17446    int mem_base;
17447    int ret_val;
17448    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17449    int n_ctxt;
17450    xmlDocPtr doc; /* a parsed document tree */
17451    int n_doc;
17452
17453    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17454    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17455        mem_base = xmlMemBlocks();
17456        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17457        doc = gen_xmlDocPtr(n_doc, 1);
17458
17459        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17460        desret_int(ret_val);
17461        call_tests++;
17462        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17463        des_xmlDocPtr(n_doc, doc, 1);
17464        xmlResetLastError();
17465        if (mem_base != xmlMemBlocks()) {
17466            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17467	           xmlMemBlocks() - mem_base);
17468	    test_ret++;
17469            printf(" %d", n_ctxt);
17470            printf(" %d", n_doc);
17471            printf("\n");
17472        }
17473    }
17474    }
17475    function_tests++;
17476#endif
17477
17478    return(test_ret);
17479}
17480
17481
17482static int
17483test_xmlRelaxNGValidateFullElement(void) {
17484    int test_ret = 0;
17485
17486#if defined(LIBXML_SCHEMAS_ENABLED)
17487    int mem_base;
17488    int ret_val;
17489    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17490    int n_ctxt;
17491    xmlDocPtr doc; /* a document instance */
17492    int n_doc;
17493    xmlNodePtr elem; /* an element instance */
17494    int n_elem;
17495
17496    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17497    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17498    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17499        mem_base = xmlMemBlocks();
17500        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17501        doc = gen_xmlDocPtr(n_doc, 1);
17502        elem = gen_xmlNodePtr(n_elem, 2);
17503
17504        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17505        desret_int(ret_val);
17506        call_tests++;
17507        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17508        des_xmlDocPtr(n_doc, doc, 1);
17509        des_xmlNodePtr(n_elem, elem, 2);
17510        xmlResetLastError();
17511        if (mem_base != xmlMemBlocks()) {
17512            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17513	           xmlMemBlocks() - mem_base);
17514	    test_ret++;
17515            printf(" %d", n_ctxt);
17516            printf(" %d", n_doc);
17517            printf(" %d", n_elem);
17518            printf("\n");
17519        }
17520    }
17521    }
17522    }
17523    function_tests++;
17524#endif
17525
17526    return(test_ret);
17527}
17528
17529
17530static int
17531test_xmlRelaxNGValidatePopElement(void) {
17532    int test_ret = 0;
17533
17534#if defined(LIBXML_SCHEMAS_ENABLED)
17535    int mem_base;
17536    int ret_val;
17537    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17538    int n_ctxt;
17539    xmlDocPtr doc; /* a document instance */
17540    int n_doc;
17541    xmlNodePtr elem; /* an element instance */
17542    int n_elem;
17543
17544    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17545    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17546    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17547        mem_base = xmlMemBlocks();
17548        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17549        doc = gen_xmlDocPtr(n_doc, 1);
17550        elem = gen_xmlNodePtr(n_elem, 2);
17551
17552        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17553        desret_int(ret_val);
17554        call_tests++;
17555        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17556        des_xmlDocPtr(n_doc, doc, 1);
17557        des_xmlNodePtr(n_elem, elem, 2);
17558        xmlResetLastError();
17559        if (mem_base != xmlMemBlocks()) {
17560            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17561	           xmlMemBlocks() - mem_base);
17562	    test_ret++;
17563            printf(" %d", n_ctxt);
17564            printf(" %d", n_doc);
17565            printf(" %d", n_elem);
17566            printf("\n");
17567        }
17568    }
17569    }
17570    }
17571    function_tests++;
17572#endif
17573
17574    return(test_ret);
17575}
17576
17577
17578static int
17579test_xmlRelaxNGValidatePushCData(void) {
17580    int test_ret = 0;
17581
17582#if defined(LIBXML_SCHEMAS_ENABLED)
17583    int mem_base;
17584    int ret_val;
17585    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17586    int n_ctxt;
17587    xmlChar * data; /* some character data read */
17588    int n_data;
17589    int len; /* the lenght of the data */
17590    int n_len;
17591
17592    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17593    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17594    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17595        mem_base = xmlMemBlocks();
17596        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17597        data = gen_const_xmlChar_ptr(n_data, 1);
17598        len = gen_int(n_len, 2);
17599
17600        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17601        desret_int(ret_val);
17602        call_tests++;
17603        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17604        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17605        des_int(n_len, len, 2);
17606        xmlResetLastError();
17607        if (mem_base != xmlMemBlocks()) {
17608            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17609	           xmlMemBlocks() - mem_base);
17610	    test_ret++;
17611            printf(" %d", n_ctxt);
17612            printf(" %d", n_data);
17613            printf(" %d", n_len);
17614            printf("\n");
17615        }
17616    }
17617    }
17618    }
17619    function_tests++;
17620#endif
17621
17622    return(test_ret);
17623}
17624
17625
17626static int
17627test_xmlRelaxNGValidatePushElement(void) {
17628    int test_ret = 0;
17629
17630#if defined(LIBXML_SCHEMAS_ENABLED)
17631    int mem_base;
17632    int ret_val;
17633    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17634    int n_ctxt;
17635    xmlDocPtr doc; /* a document instance */
17636    int n_doc;
17637    xmlNodePtr elem; /* an element instance */
17638    int n_elem;
17639
17640    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17641    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17642    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17643        mem_base = xmlMemBlocks();
17644        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17645        doc = gen_xmlDocPtr(n_doc, 1);
17646        elem = gen_xmlNodePtr(n_elem, 2);
17647
17648        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17649        desret_int(ret_val);
17650        call_tests++;
17651        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17652        des_xmlDocPtr(n_doc, doc, 1);
17653        des_xmlNodePtr(n_elem, elem, 2);
17654        xmlResetLastError();
17655        if (mem_base != xmlMemBlocks()) {
17656            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17657	           xmlMemBlocks() - mem_base);
17658	    test_ret++;
17659            printf(" %d", n_ctxt);
17660            printf(" %d", n_doc);
17661            printf(" %d", n_elem);
17662            printf("\n");
17663        }
17664    }
17665    }
17666    }
17667    function_tests++;
17668#endif
17669
17670    return(test_ret);
17671}
17672
17673
17674static int
17675test_xmlRelaxParserSetFlag(void) {
17676    int test_ret = 0;
17677
17678#if defined(LIBXML_SCHEMAS_ENABLED)
17679    int mem_base;
17680    int ret_val;
17681    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17682    int n_ctxt;
17683    int flags; /* a set of flags values */
17684    int n_flags;
17685
17686    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17687    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17688        mem_base = xmlMemBlocks();
17689        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17690        flags = gen_int(n_flags, 1);
17691
17692        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17693        desret_int(ret_val);
17694        call_tests++;
17695        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17696        des_int(n_flags, flags, 1);
17697        xmlResetLastError();
17698        if (mem_base != xmlMemBlocks()) {
17699            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17700	           xmlMemBlocks() - mem_base);
17701	    test_ret++;
17702            printf(" %d", n_ctxt);
17703            printf(" %d", n_flags);
17704            printf("\n");
17705        }
17706    }
17707    }
17708    function_tests++;
17709#endif
17710
17711    return(test_ret);
17712}
17713
17714static int
17715test_relaxng(void) {
17716    int test_ret = 0;
17717
17718    if (quiet == 0) printf("Testing relaxng : 14 of 23 functions ...\n");
17719    test_ret += test_xmlRelaxNGDump();
17720    test_ret += test_xmlRelaxNGDumpTree();
17721    test_ret += test_xmlRelaxNGGetParserErrors();
17722    test_ret += test_xmlRelaxNGGetValidErrors();
17723    test_ret += test_xmlRelaxNGInitTypes();
17724    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17725    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17726    test_ret += test_xmlRelaxNGNewParserCtxt();
17727    test_ret += test_xmlRelaxNGNewValidCtxt();
17728    test_ret += test_xmlRelaxNGParse();
17729    test_ret += test_xmlRelaxNGSetParserErrors();
17730    test_ret += test_xmlRelaxNGSetValidErrors();
17731    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17732    test_ret += test_xmlRelaxNGValidateDoc();
17733    test_ret += test_xmlRelaxNGValidateFullElement();
17734    test_ret += test_xmlRelaxNGValidatePopElement();
17735    test_ret += test_xmlRelaxNGValidatePushCData();
17736    test_ret += test_xmlRelaxNGValidatePushElement();
17737    test_ret += test_xmlRelaxParserSetFlag();
17738
17739    if (test_ret != 0)
17740	printf("Module relaxng: %d errors\n", test_ret);
17741    return(test_ret);
17742}
17743static int
17744test_schemasInternals(void) {
17745    int test_ret = 0;
17746
17747    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17748
17749    if (test_ret != 0)
17750	printf("Module schemasInternals: %d errors\n", test_ret);
17751    return(test_ret);
17752}
17753
17754static int
17755test_xmlSchematronNewDocParserCtxt(void) {
17756    int test_ret = 0;
17757
17758
17759    /* missing type support */
17760    return(test_ret);
17761}
17762
17763
17764static int
17765test_xmlSchematronNewMemParserCtxt(void) {
17766    int test_ret = 0;
17767
17768
17769    /* missing type support */
17770    return(test_ret);
17771}
17772
17773
17774static int
17775test_xmlSchematronNewParserCtxt(void) {
17776    int test_ret = 0;
17777
17778
17779    /* missing type support */
17780    return(test_ret);
17781}
17782
17783#ifdef LIBXML_SCHEMATRON_ENABLED
17784
17785#define gen_nb_xmlSchematronPtr 1
17786static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17787    return(NULL);
17788}
17789static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17790}
17791#endif
17792
17793
17794static int
17795test_xmlSchematronNewValidCtxt(void) {
17796    int test_ret = 0;
17797
17798
17799    /* missing type support */
17800    return(test_ret);
17801}
17802
17803#ifdef LIBXML_SCHEMATRON_ENABLED
17804
17805#define gen_nb_xmlSchematronParserCtxtPtr 1
17806static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17807    return(NULL);
17808}
17809static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17810}
17811#endif
17812
17813
17814static int
17815test_xmlSchematronParse(void) {
17816    int test_ret = 0;
17817
17818
17819    /* missing type support */
17820    return(test_ret);
17821}
17822
17823#ifdef LIBXML_SCHEMATRON_ENABLED
17824
17825#define gen_nb_xmlSchematronValidCtxtPtr 1
17826static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17827    return(NULL);
17828}
17829static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17830}
17831#endif
17832
17833
17834static int
17835test_xmlSchematronValidateDoc(void) {
17836    int test_ret = 0;
17837
17838#if defined(LIBXML_SCHEMATRON_ENABLED)
17839    int mem_base;
17840    int ret_val;
17841    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
17842    int n_ctxt;
17843    xmlDocPtr instance; /* the document instace tree */
17844    int n_instance;
17845
17846    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
17847    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
17848        mem_base = xmlMemBlocks();
17849        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
17850        instance = gen_xmlDocPtr(n_instance, 1);
17851
17852        ret_val = xmlSchematronValidateDoc(ctxt, instance);
17853        desret_int(ret_val);
17854        call_tests++;
17855        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
17856        des_xmlDocPtr(n_instance, instance, 1);
17857        xmlResetLastError();
17858        if (mem_base != xmlMemBlocks()) {
17859            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
17860	           xmlMemBlocks() - mem_base);
17861	    test_ret++;
17862            printf(" %d", n_ctxt);
17863            printf(" %d", n_instance);
17864            printf("\n");
17865        }
17866    }
17867    }
17868    function_tests++;
17869#endif
17870
17871    return(test_ret);
17872}
17873
17874static int
17875test_schematron(void) {
17876    int test_ret = 0;
17877
17878    if (quiet == 0) printf("Testing schematron : 1 of 9 functions ...\n");
17879    test_ret += test_xmlSchematronNewDocParserCtxt();
17880    test_ret += test_xmlSchematronNewMemParserCtxt();
17881    test_ret += test_xmlSchematronNewParserCtxt();
17882    test_ret += test_xmlSchematronNewValidCtxt();
17883    test_ret += test_xmlSchematronParse();
17884    test_ret += test_xmlSchematronValidateDoc();
17885
17886    if (test_ret != 0)
17887	printf("Module schematron: %d errors\n", test_ret);
17888    return(test_ret);
17889}
17890
17891static int
17892test_xmlAddChild(void) {
17893    int test_ret = 0;
17894
17895    int mem_base;
17896    xmlNodePtr ret_val;
17897    xmlNodePtr parent; /* the parent node */
17898    int n_parent;
17899    xmlNodePtr cur; /* the child node */
17900    int n_cur;
17901
17902    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17903    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17904        mem_base = xmlMemBlocks();
17905        parent = gen_xmlNodePtr(n_parent, 0);
17906        cur = gen_xmlNodePtr_in(n_cur, 1);
17907
17908        ret_val = xmlAddChild(parent, cur);
17909        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
17910        desret_xmlNodePtr(ret_val);
17911        call_tests++;
17912        des_xmlNodePtr(n_parent, parent, 0);
17913        des_xmlNodePtr_in(n_cur, cur, 1);
17914        xmlResetLastError();
17915        if (mem_base != xmlMemBlocks()) {
17916            printf("Leak of %d blocks found in xmlAddChild",
17917	           xmlMemBlocks() - mem_base);
17918	    test_ret++;
17919            printf(" %d", n_parent);
17920            printf(" %d", n_cur);
17921            printf("\n");
17922        }
17923    }
17924    }
17925    function_tests++;
17926
17927    return(test_ret);
17928}
17929
17930
17931static int
17932test_xmlAddChildList(void) {
17933    int test_ret = 0;
17934
17935    int mem_base;
17936    xmlNodePtr ret_val;
17937    xmlNodePtr parent; /* the parent node */
17938    int n_parent;
17939    xmlNodePtr cur; /* the first node in the list */
17940    int n_cur;
17941
17942    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17943    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17944        mem_base = xmlMemBlocks();
17945        parent = gen_xmlNodePtr(n_parent, 0);
17946        cur = gen_xmlNodePtr_in(n_cur, 1);
17947
17948        ret_val = xmlAddChildList(parent, cur);
17949        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
17950        desret_xmlNodePtr(ret_val);
17951        call_tests++;
17952        des_xmlNodePtr(n_parent, parent, 0);
17953        des_xmlNodePtr_in(n_cur, cur, 1);
17954        xmlResetLastError();
17955        if (mem_base != xmlMemBlocks()) {
17956            printf("Leak of %d blocks found in xmlAddChildList",
17957	           xmlMemBlocks() - mem_base);
17958	    test_ret++;
17959            printf(" %d", n_parent);
17960            printf(" %d", n_cur);
17961            printf("\n");
17962        }
17963    }
17964    }
17965    function_tests++;
17966
17967    return(test_ret);
17968}
17969
17970
17971static int
17972test_xmlAddNextSibling(void) {
17973    int test_ret = 0;
17974
17975    int mem_base;
17976    xmlNodePtr ret_val;
17977    xmlNodePtr cur; /* the child node */
17978    int n_cur;
17979    xmlNodePtr elem; /* the new node */
17980    int n_elem;
17981
17982    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17983    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17984        mem_base = xmlMemBlocks();
17985        cur = gen_xmlNodePtr(n_cur, 0);
17986        elem = gen_xmlNodePtr_in(n_elem, 1);
17987
17988        ret_val = xmlAddNextSibling(cur, elem);
17989        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17990        desret_xmlNodePtr(ret_val);
17991        call_tests++;
17992        des_xmlNodePtr(n_cur, cur, 0);
17993        des_xmlNodePtr_in(n_elem, elem, 1);
17994        xmlResetLastError();
17995        if (mem_base != xmlMemBlocks()) {
17996            printf("Leak of %d blocks found in xmlAddNextSibling",
17997	           xmlMemBlocks() - mem_base);
17998	    test_ret++;
17999            printf(" %d", n_cur);
18000            printf(" %d", n_elem);
18001            printf("\n");
18002        }
18003    }
18004    }
18005    function_tests++;
18006
18007    return(test_ret);
18008}
18009
18010
18011static int
18012test_xmlAddPrevSibling(void) {
18013    int test_ret = 0;
18014
18015#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18016    int mem_base;
18017    xmlNodePtr ret_val;
18018    xmlNodePtr cur; /* the child node */
18019    int n_cur;
18020    xmlNodePtr elem; /* the new node */
18021    int n_elem;
18022
18023    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18024    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18025        mem_base = xmlMemBlocks();
18026        cur = gen_xmlNodePtr(n_cur, 0);
18027        elem = gen_xmlNodePtr_in(n_elem, 1);
18028
18029        ret_val = xmlAddPrevSibling(cur, elem);
18030        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18031        desret_xmlNodePtr(ret_val);
18032        call_tests++;
18033        des_xmlNodePtr(n_cur, cur, 0);
18034        des_xmlNodePtr_in(n_elem, elem, 1);
18035        xmlResetLastError();
18036        if (mem_base != xmlMemBlocks()) {
18037            printf("Leak of %d blocks found in xmlAddPrevSibling",
18038	           xmlMemBlocks() - mem_base);
18039	    test_ret++;
18040            printf(" %d", n_cur);
18041            printf(" %d", n_elem);
18042            printf("\n");
18043        }
18044    }
18045    }
18046    function_tests++;
18047#endif
18048
18049    return(test_ret);
18050}
18051
18052
18053static int
18054test_xmlAddSibling(void) {
18055    int test_ret = 0;
18056
18057    int mem_base;
18058    xmlNodePtr ret_val;
18059    xmlNodePtr cur; /* the child node */
18060    int n_cur;
18061    xmlNodePtr elem; /* the new node */
18062    int n_elem;
18063
18064    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18065    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18066        mem_base = xmlMemBlocks();
18067        cur = gen_xmlNodePtr(n_cur, 0);
18068        elem = gen_xmlNodePtr_in(n_elem, 1);
18069
18070        ret_val = xmlAddSibling(cur, elem);
18071        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18072        desret_xmlNodePtr(ret_val);
18073        call_tests++;
18074        des_xmlNodePtr(n_cur, cur, 0);
18075        des_xmlNodePtr_in(n_elem, elem, 1);
18076        xmlResetLastError();
18077        if (mem_base != xmlMemBlocks()) {
18078            printf("Leak of %d blocks found in xmlAddSibling",
18079	           xmlMemBlocks() - mem_base);
18080	    test_ret++;
18081            printf(" %d", n_cur);
18082            printf(" %d", n_elem);
18083            printf("\n");
18084        }
18085    }
18086    }
18087    function_tests++;
18088
18089    return(test_ret);
18090}
18091
18092
18093static int
18094test_xmlAttrSerializeTxtContent(void) {
18095    int test_ret = 0;
18096
18097#if defined(LIBXML_OUTPUT_ENABLED)
18098#ifdef LIBXML_OUTPUT_ENABLED
18099    int mem_base;
18100    xmlBufferPtr buf; /* the XML buffer output */
18101    int n_buf;
18102    xmlDocPtr doc; /* the document */
18103    int n_doc;
18104    xmlAttrPtr attr; /* the attribute node */
18105    int n_attr;
18106    xmlChar * string; /* the text content */
18107    int n_string;
18108
18109    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18110    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18111    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18112    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18113        mem_base = xmlMemBlocks();
18114        buf = gen_xmlBufferPtr(n_buf, 0);
18115        doc = gen_xmlDocPtr(n_doc, 1);
18116        attr = gen_xmlAttrPtr(n_attr, 2);
18117        string = gen_const_xmlChar_ptr(n_string, 3);
18118
18119        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18120        call_tests++;
18121        des_xmlBufferPtr(n_buf, buf, 0);
18122        des_xmlDocPtr(n_doc, doc, 1);
18123        des_xmlAttrPtr(n_attr, attr, 2);
18124        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18125        xmlResetLastError();
18126        if (mem_base != xmlMemBlocks()) {
18127            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18128	           xmlMemBlocks() - mem_base);
18129	    test_ret++;
18130            printf(" %d", n_buf);
18131            printf(" %d", n_doc);
18132            printf(" %d", n_attr);
18133            printf(" %d", n_string);
18134            printf("\n");
18135        }
18136    }
18137    }
18138    }
18139    }
18140    function_tests++;
18141#endif
18142#endif
18143
18144    return(test_ret);
18145}
18146
18147
18148static int
18149test_xmlBufferAdd(void) {
18150    int test_ret = 0;
18151
18152    int mem_base;
18153    int ret_val;
18154    xmlBufferPtr buf; /* the buffer to dump */
18155    int n_buf;
18156    xmlChar * str; /* the #xmlChar string */
18157    int n_str;
18158    int len; /* the number of #xmlChar to add */
18159    int n_len;
18160
18161    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18162    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18163    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18164        mem_base = xmlMemBlocks();
18165        buf = gen_xmlBufferPtr(n_buf, 0);
18166        str = gen_const_xmlChar_ptr(n_str, 1);
18167        len = gen_int(n_len, 2);
18168
18169        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18170        desret_int(ret_val);
18171        call_tests++;
18172        des_xmlBufferPtr(n_buf, buf, 0);
18173        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18174        des_int(n_len, len, 2);
18175        xmlResetLastError();
18176        if (mem_base != xmlMemBlocks()) {
18177            printf("Leak of %d blocks found in xmlBufferAdd",
18178	           xmlMemBlocks() - mem_base);
18179	    test_ret++;
18180            printf(" %d", n_buf);
18181            printf(" %d", n_str);
18182            printf(" %d", n_len);
18183            printf("\n");
18184        }
18185    }
18186    }
18187    }
18188    function_tests++;
18189
18190    return(test_ret);
18191}
18192
18193
18194static int
18195test_xmlBufferAddHead(void) {
18196    int test_ret = 0;
18197
18198    int mem_base;
18199    int ret_val;
18200    xmlBufferPtr buf; /* the buffer */
18201    int n_buf;
18202    xmlChar * str; /* the #xmlChar string */
18203    int n_str;
18204    int len; /* the number of #xmlChar to add */
18205    int n_len;
18206
18207    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18208    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18209    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18210        mem_base = xmlMemBlocks();
18211        buf = gen_xmlBufferPtr(n_buf, 0);
18212        str = gen_const_xmlChar_ptr(n_str, 1);
18213        len = gen_int(n_len, 2);
18214
18215        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18216        desret_int(ret_val);
18217        call_tests++;
18218        des_xmlBufferPtr(n_buf, buf, 0);
18219        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18220        des_int(n_len, len, 2);
18221        xmlResetLastError();
18222        if (mem_base != xmlMemBlocks()) {
18223            printf("Leak of %d blocks found in xmlBufferAddHead",
18224	           xmlMemBlocks() - mem_base);
18225	    test_ret++;
18226            printf(" %d", n_buf);
18227            printf(" %d", n_str);
18228            printf(" %d", n_len);
18229            printf("\n");
18230        }
18231    }
18232    }
18233    }
18234    function_tests++;
18235
18236    return(test_ret);
18237}
18238
18239
18240static int
18241test_xmlBufferCCat(void) {
18242    int test_ret = 0;
18243
18244    int mem_base;
18245    int ret_val;
18246    xmlBufferPtr buf; /* the buffer to dump */
18247    int n_buf;
18248    char * str; /* the C char string */
18249    int n_str;
18250
18251    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18252    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18253        mem_base = xmlMemBlocks();
18254        buf = gen_xmlBufferPtr(n_buf, 0);
18255        str = gen_const_char_ptr(n_str, 1);
18256
18257        ret_val = xmlBufferCCat(buf, (const char *)str);
18258        desret_int(ret_val);
18259        call_tests++;
18260        des_xmlBufferPtr(n_buf, buf, 0);
18261        des_const_char_ptr(n_str, (const char *)str, 1);
18262        xmlResetLastError();
18263        if (mem_base != xmlMemBlocks()) {
18264            printf("Leak of %d blocks found in xmlBufferCCat",
18265	           xmlMemBlocks() - mem_base);
18266	    test_ret++;
18267            printf(" %d", n_buf);
18268            printf(" %d", n_str);
18269            printf("\n");
18270        }
18271    }
18272    }
18273    function_tests++;
18274
18275    return(test_ret);
18276}
18277
18278
18279static int
18280test_xmlBufferCat(void) {
18281    int test_ret = 0;
18282
18283    int mem_base;
18284    int ret_val;
18285    xmlBufferPtr buf; /* the buffer to add to */
18286    int n_buf;
18287    xmlChar * str; /* the #xmlChar string */
18288    int n_str;
18289
18290    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18291    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18292        mem_base = xmlMemBlocks();
18293        buf = gen_xmlBufferPtr(n_buf, 0);
18294        str = gen_const_xmlChar_ptr(n_str, 1);
18295
18296        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18297        desret_int(ret_val);
18298        call_tests++;
18299        des_xmlBufferPtr(n_buf, buf, 0);
18300        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18301        xmlResetLastError();
18302        if (mem_base != xmlMemBlocks()) {
18303            printf("Leak of %d blocks found in xmlBufferCat",
18304	           xmlMemBlocks() - mem_base);
18305	    test_ret++;
18306            printf(" %d", n_buf);
18307            printf(" %d", n_str);
18308            printf("\n");
18309        }
18310    }
18311    }
18312    function_tests++;
18313
18314    return(test_ret);
18315}
18316
18317
18318#define gen_nb_const_xmlBufferPtr 1
18319static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18320    return(NULL);
18321}
18322static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18323}
18324
18325static int
18326test_xmlBufferContent(void) {
18327    int test_ret = 0;
18328
18329    int mem_base;
18330    const xmlChar * ret_val;
18331    xmlBufferPtr buf; /* the buffer */
18332    int n_buf;
18333
18334    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18335        mem_base = xmlMemBlocks();
18336        buf = gen_const_xmlBufferPtr(n_buf, 0);
18337
18338        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18339        desret_const_xmlChar_ptr(ret_val);
18340        call_tests++;
18341        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18342        xmlResetLastError();
18343        if (mem_base != xmlMemBlocks()) {
18344            printf("Leak of %d blocks found in xmlBufferContent",
18345	           xmlMemBlocks() - mem_base);
18346	    test_ret++;
18347            printf(" %d", n_buf);
18348            printf("\n");
18349        }
18350    }
18351    function_tests++;
18352
18353    return(test_ret);
18354}
18355
18356
18357static int
18358test_xmlBufferCreate(void) {
18359    int test_ret = 0;
18360
18361    int mem_base;
18362    xmlBufferPtr ret_val;
18363
18364        mem_base = xmlMemBlocks();
18365
18366        ret_val = xmlBufferCreate();
18367        desret_xmlBufferPtr(ret_val);
18368        call_tests++;
18369        xmlResetLastError();
18370        if (mem_base != xmlMemBlocks()) {
18371            printf("Leak of %d blocks found in xmlBufferCreate",
18372	           xmlMemBlocks() - mem_base);
18373	    test_ret++;
18374            printf("\n");
18375        }
18376    function_tests++;
18377
18378    return(test_ret);
18379}
18380
18381
18382static int
18383test_xmlBufferCreateSize(void) {
18384    int test_ret = 0;
18385
18386
18387    /* missing type support */
18388    return(test_ret);
18389}
18390
18391
18392static int
18393test_xmlBufferCreateStatic(void) {
18394    int test_ret = 0;
18395
18396
18397    /* missing type support */
18398    return(test_ret);
18399}
18400
18401
18402static int
18403test_xmlBufferEmpty(void) {
18404    int test_ret = 0;
18405
18406    int mem_base;
18407    xmlBufferPtr buf; /* the buffer */
18408    int n_buf;
18409
18410    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18411        mem_base = xmlMemBlocks();
18412        buf = gen_xmlBufferPtr(n_buf, 0);
18413
18414        xmlBufferEmpty(buf);
18415        call_tests++;
18416        des_xmlBufferPtr(n_buf, buf, 0);
18417        xmlResetLastError();
18418        if (mem_base != xmlMemBlocks()) {
18419            printf("Leak of %d blocks found in xmlBufferEmpty",
18420	           xmlMemBlocks() - mem_base);
18421	    test_ret++;
18422            printf(" %d", n_buf);
18423            printf("\n");
18424        }
18425    }
18426    function_tests++;
18427
18428    return(test_ret);
18429}
18430
18431
18432static int
18433test_xmlBufferGrow(void) {
18434    int test_ret = 0;
18435
18436    int mem_base;
18437    int ret_val;
18438    xmlBufferPtr buf; /* the buffer */
18439    int n_buf;
18440    unsigned int len; /* the minimum free size to allocate */
18441    int n_len;
18442
18443    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18444    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18445        mem_base = xmlMemBlocks();
18446        buf = gen_xmlBufferPtr(n_buf, 0);
18447        len = gen_unsigned_int(n_len, 1);
18448
18449        ret_val = xmlBufferGrow(buf, len);
18450        desret_int(ret_val);
18451        call_tests++;
18452        des_xmlBufferPtr(n_buf, buf, 0);
18453        des_unsigned_int(n_len, len, 1);
18454        xmlResetLastError();
18455        if (mem_base != xmlMemBlocks()) {
18456            printf("Leak of %d blocks found in xmlBufferGrow",
18457	           xmlMemBlocks() - mem_base);
18458	    test_ret++;
18459            printf(" %d", n_buf);
18460            printf(" %d", n_len);
18461            printf("\n");
18462        }
18463    }
18464    }
18465    function_tests++;
18466
18467    return(test_ret);
18468}
18469
18470
18471static int
18472test_xmlBufferLength(void) {
18473    int test_ret = 0;
18474
18475    int mem_base;
18476    int ret_val;
18477    xmlBufferPtr buf; /* the buffer */
18478    int n_buf;
18479
18480    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18481        mem_base = xmlMemBlocks();
18482        buf = gen_const_xmlBufferPtr(n_buf, 0);
18483
18484        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18485        desret_int(ret_val);
18486        call_tests++;
18487        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18488        xmlResetLastError();
18489        if (mem_base != xmlMemBlocks()) {
18490            printf("Leak of %d blocks found in xmlBufferLength",
18491	           xmlMemBlocks() - mem_base);
18492	    test_ret++;
18493            printf(" %d", n_buf);
18494            printf("\n");
18495        }
18496    }
18497    function_tests++;
18498
18499    return(test_ret);
18500}
18501
18502
18503static int
18504test_xmlBufferResize(void) {
18505    int test_ret = 0;
18506
18507    int mem_base;
18508    int ret_val;
18509    xmlBufferPtr buf; /* the buffer to resize */
18510    int n_buf;
18511    unsigned int size; /* the desired size */
18512    int n_size;
18513
18514    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18515    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18516        mem_base = xmlMemBlocks();
18517        buf = gen_xmlBufferPtr(n_buf, 0);
18518        size = gen_unsigned_int(n_size, 1);
18519
18520        ret_val = xmlBufferResize(buf, size);
18521        desret_int(ret_val);
18522        call_tests++;
18523        des_xmlBufferPtr(n_buf, buf, 0);
18524        des_unsigned_int(n_size, size, 1);
18525        xmlResetLastError();
18526        if (mem_base != xmlMemBlocks()) {
18527            printf("Leak of %d blocks found in xmlBufferResize",
18528	           xmlMemBlocks() - mem_base);
18529	    test_ret++;
18530            printf(" %d", n_buf);
18531            printf(" %d", n_size);
18532            printf("\n");
18533        }
18534    }
18535    }
18536    function_tests++;
18537
18538    return(test_ret);
18539}
18540
18541
18542static int
18543test_xmlBufferSetAllocationScheme(void) {
18544    int test_ret = 0;
18545
18546    int mem_base;
18547    xmlBufferPtr buf; /* the buffer to tune */
18548    int n_buf;
18549    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18550    int n_scheme;
18551
18552    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18553    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18554        mem_base = xmlMemBlocks();
18555        buf = gen_xmlBufferPtr(n_buf, 0);
18556        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18557
18558        xmlBufferSetAllocationScheme(buf, scheme);
18559        call_tests++;
18560        des_xmlBufferPtr(n_buf, buf, 0);
18561        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18562        xmlResetLastError();
18563        if (mem_base != xmlMemBlocks()) {
18564            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18565	           xmlMemBlocks() - mem_base);
18566	    test_ret++;
18567            printf(" %d", n_buf);
18568            printf(" %d", n_scheme);
18569            printf("\n");
18570        }
18571    }
18572    }
18573    function_tests++;
18574
18575    return(test_ret);
18576}
18577
18578
18579static int
18580test_xmlBufferShrink(void) {
18581    int test_ret = 0;
18582
18583    int mem_base;
18584    int ret_val;
18585    xmlBufferPtr buf; /* the buffer to dump */
18586    int n_buf;
18587    unsigned int len; /* the number of xmlChar to remove */
18588    int n_len;
18589
18590    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18591    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18592        mem_base = xmlMemBlocks();
18593        buf = gen_xmlBufferPtr(n_buf, 0);
18594        len = gen_unsigned_int(n_len, 1);
18595
18596        ret_val = xmlBufferShrink(buf, len);
18597        desret_int(ret_val);
18598        call_tests++;
18599        des_xmlBufferPtr(n_buf, buf, 0);
18600        des_unsigned_int(n_len, len, 1);
18601        xmlResetLastError();
18602        if (mem_base != xmlMemBlocks()) {
18603            printf("Leak of %d blocks found in xmlBufferShrink",
18604	           xmlMemBlocks() - mem_base);
18605	    test_ret++;
18606            printf(" %d", n_buf);
18607            printf(" %d", n_len);
18608            printf("\n");
18609        }
18610    }
18611    }
18612    function_tests++;
18613
18614    return(test_ret);
18615}
18616
18617
18618static int
18619test_xmlBufferWriteCHAR(void) {
18620    int test_ret = 0;
18621
18622    int mem_base;
18623    xmlBufferPtr buf; /* the XML buffer */
18624    int n_buf;
18625    xmlChar * string; /* the string to add */
18626    int n_string;
18627
18628    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18629    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18630        mem_base = xmlMemBlocks();
18631        buf = gen_xmlBufferPtr(n_buf, 0);
18632        string = gen_const_xmlChar_ptr(n_string, 1);
18633
18634        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18635        call_tests++;
18636        des_xmlBufferPtr(n_buf, buf, 0);
18637        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18638        xmlResetLastError();
18639        if (mem_base != xmlMemBlocks()) {
18640            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18641	           xmlMemBlocks() - mem_base);
18642	    test_ret++;
18643            printf(" %d", n_buf);
18644            printf(" %d", n_string);
18645            printf("\n");
18646        }
18647    }
18648    }
18649    function_tests++;
18650
18651    return(test_ret);
18652}
18653
18654
18655static int
18656test_xmlBufferWriteChar(void) {
18657    int test_ret = 0;
18658
18659    int mem_base;
18660    xmlBufferPtr buf; /* the XML buffer output */
18661    int n_buf;
18662    char * string; /* the string to add */
18663    int n_string;
18664
18665    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18666    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18667        mem_base = xmlMemBlocks();
18668        buf = gen_xmlBufferPtr(n_buf, 0);
18669        string = gen_const_char_ptr(n_string, 1);
18670
18671        xmlBufferWriteChar(buf, (const char *)string);
18672        call_tests++;
18673        des_xmlBufferPtr(n_buf, buf, 0);
18674        des_const_char_ptr(n_string, (const char *)string, 1);
18675        xmlResetLastError();
18676        if (mem_base != xmlMemBlocks()) {
18677            printf("Leak of %d blocks found in xmlBufferWriteChar",
18678	           xmlMemBlocks() - mem_base);
18679	    test_ret++;
18680            printf(" %d", n_buf);
18681            printf(" %d", n_string);
18682            printf("\n");
18683        }
18684    }
18685    }
18686    function_tests++;
18687
18688    return(test_ret);
18689}
18690
18691
18692static int
18693test_xmlBufferWriteQuotedString(void) {
18694    int test_ret = 0;
18695
18696    int mem_base;
18697    xmlBufferPtr buf; /* the XML buffer output */
18698    int n_buf;
18699    xmlChar * string; /* the string to add */
18700    int n_string;
18701
18702    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18703    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18704        mem_base = xmlMemBlocks();
18705        buf = gen_xmlBufferPtr(n_buf, 0);
18706        string = gen_const_xmlChar_ptr(n_string, 1);
18707
18708        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18709        call_tests++;
18710        des_xmlBufferPtr(n_buf, buf, 0);
18711        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18712        xmlResetLastError();
18713        if (mem_base != xmlMemBlocks()) {
18714            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18715	           xmlMemBlocks() - mem_base);
18716	    test_ret++;
18717            printf(" %d", n_buf);
18718            printf(" %d", n_string);
18719            printf("\n");
18720        }
18721    }
18722    }
18723    function_tests++;
18724
18725    return(test_ret);
18726}
18727
18728
18729static int
18730test_xmlBuildQName(void) {
18731    int test_ret = 0;
18732
18733    int mem_base;
18734    xmlChar * ret_val;
18735    xmlChar * ncname; /* the Name */
18736    int n_ncname;
18737    xmlChar * prefix; /* the prefix */
18738    int n_prefix;
18739    xmlChar * memory; /* preallocated memory */
18740    int n_memory;
18741    int len; /* preallocated memory length */
18742    int n_len;
18743
18744    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18745    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18746    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18747    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18748        mem_base = xmlMemBlocks();
18749        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18750        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18751        memory = gen_xmlChar_ptr(n_memory, 2);
18752        len = gen_int(n_len, 3);
18753
18754        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18755        if ((ret_val != NULL) && (ret_val != ncname) &&
18756              (ret_val != prefix) && (ret_val != memory))
18757              xmlFree(ret_val);
18758	  ret_val = NULL;
18759        desret_xmlChar_ptr(ret_val);
18760        call_tests++;
18761        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18762        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18763        des_xmlChar_ptr(n_memory, memory, 2);
18764        des_int(n_len, len, 3);
18765        xmlResetLastError();
18766        if (mem_base != xmlMemBlocks()) {
18767            printf("Leak of %d blocks found in xmlBuildQName",
18768	           xmlMemBlocks() - mem_base);
18769	    test_ret++;
18770            printf(" %d", n_ncname);
18771            printf(" %d", n_prefix);
18772            printf(" %d", n_memory);
18773            printf(" %d", n_len);
18774            printf("\n");
18775        }
18776    }
18777    }
18778    }
18779    }
18780    function_tests++;
18781
18782    return(test_ret);
18783}
18784
18785
18786static int
18787test_xmlCopyDoc(void) {
18788    int test_ret = 0;
18789
18790#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18791    int mem_base;
18792    xmlDocPtr ret_val;
18793    xmlDocPtr doc; /* the document */
18794    int n_doc;
18795    int recursive; /* if not zero do a recursive copy. */
18796    int n_recursive;
18797
18798    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18799    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18800        mem_base = xmlMemBlocks();
18801        doc = gen_xmlDocPtr(n_doc, 0);
18802        recursive = gen_int(n_recursive, 1);
18803
18804        ret_val = xmlCopyDoc(doc, recursive);
18805        desret_xmlDocPtr(ret_val);
18806        call_tests++;
18807        des_xmlDocPtr(n_doc, doc, 0);
18808        des_int(n_recursive, recursive, 1);
18809        xmlResetLastError();
18810        if (mem_base != xmlMemBlocks()) {
18811            printf("Leak of %d blocks found in xmlCopyDoc",
18812	           xmlMemBlocks() - mem_base);
18813	    test_ret++;
18814            printf(" %d", n_doc);
18815            printf(" %d", n_recursive);
18816            printf("\n");
18817        }
18818    }
18819    }
18820    function_tests++;
18821#endif
18822
18823    return(test_ret);
18824}
18825
18826
18827static int
18828test_xmlCopyDtd(void) {
18829    int test_ret = 0;
18830
18831#if defined(LIBXML_TREE_ENABLED)
18832    int mem_base;
18833    xmlDtdPtr ret_val;
18834    xmlDtdPtr dtd; /* the dtd */
18835    int n_dtd;
18836
18837    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18838        mem_base = xmlMemBlocks();
18839        dtd = gen_xmlDtdPtr(n_dtd, 0);
18840
18841        ret_val = xmlCopyDtd(dtd);
18842        desret_xmlDtdPtr(ret_val);
18843        call_tests++;
18844        des_xmlDtdPtr(n_dtd, dtd, 0);
18845        xmlResetLastError();
18846        if (mem_base != xmlMemBlocks()) {
18847            printf("Leak of %d blocks found in xmlCopyDtd",
18848	           xmlMemBlocks() - mem_base);
18849	    test_ret++;
18850            printf(" %d", n_dtd);
18851            printf("\n");
18852        }
18853    }
18854    function_tests++;
18855#endif
18856
18857    return(test_ret);
18858}
18859
18860
18861static int
18862test_xmlCopyNamespace(void) {
18863    int test_ret = 0;
18864
18865    int mem_base;
18866    xmlNsPtr ret_val;
18867    xmlNsPtr cur; /* the namespace */
18868    int n_cur;
18869
18870    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18871        mem_base = xmlMemBlocks();
18872        cur = gen_xmlNsPtr(n_cur, 0);
18873
18874        ret_val = xmlCopyNamespace(cur);
18875        if (ret_val != NULL) xmlFreeNs(ret_val);
18876        desret_xmlNsPtr(ret_val);
18877        call_tests++;
18878        des_xmlNsPtr(n_cur, cur, 0);
18879        xmlResetLastError();
18880        if (mem_base != xmlMemBlocks()) {
18881            printf("Leak of %d blocks found in xmlCopyNamespace",
18882	           xmlMemBlocks() - mem_base);
18883	    test_ret++;
18884            printf(" %d", n_cur);
18885            printf("\n");
18886        }
18887    }
18888    function_tests++;
18889
18890    return(test_ret);
18891}
18892
18893
18894static int
18895test_xmlCopyNamespaceList(void) {
18896    int test_ret = 0;
18897
18898    int mem_base;
18899    xmlNsPtr ret_val;
18900    xmlNsPtr cur; /* the first namespace */
18901    int n_cur;
18902
18903    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18904        mem_base = xmlMemBlocks();
18905        cur = gen_xmlNsPtr(n_cur, 0);
18906
18907        ret_val = xmlCopyNamespaceList(cur);
18908        if (ret_val != NULL) xmlFreeNsList(ret_val);
18909        desret_xmlNsPtr(ret_val);
18910        call_tests++;
18911        des_xmlNsPtr(n_cur, cur, 0);
18912        xmlResetLastError();
18913        if (mem_base != xmlMemBlocks()) {
18914            printf("Leak of %d blocks found in xmlCopyNamespaceList",
18915	           xmlMemBlocks() - mem_base);
18916	    test_ret++;
18917            printf(" %d", n_cur);
18918            printf("\n");
18919        }
18920    }
18921    function_tests++;
18922
18923    return(test_ret);
18924}
18925
18926
18927static int
18928test_xmlCopyNode(void) {
18929    int test_ret = 0;
18930
18931    int mem_base;
18932    xmlNodePtr ret_val;
18933    xmlNodePtr node; /* the node */
18934    int n_node;
18935    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18936    int n_extended;
18937
18938    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18939    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18940        mem_base = xmlMemBlocks();
18941        node = gen_const_xmlNodePtr(n_node, 0);
18942        extended = gen_int(n_extended, 1);
18943
18944        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
18945        desret_xmlNodePtr(ret_val);
18946        call_tests++;
18947        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18948        des_int(n_extended, extended, 1);
18949        xmlResetLastError();
18950        if (mem_base != xmlMemBlocks()) {
18951            printf("Leak of %d blocks found in xmlCopyNode",
18952	           xmlMemBlocks() - mem_base);
18953	    test_ret++;
18954            printf(" %d", n_node);
18955            printf(" %d", n_extended);
18956            printf("\n");
18957        }
18958    }
18959    }
18960    function_tests++;
18961
18962    return(test_ret);
18963}
18964
18965
18966static int
18967test_xmlCopyNodeList(void) {
18968    int test_ret = 0;
18969
18970    int mem_base;
18971    xmlNodePtr ret_val;
18972    xmlNodePtr node; /* the first node in the list. */
18973    int n_node;
18974
18975    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18976        mem_base = xmlMemBlocks();
18977        node = gen_const_xmlNodePtr(n_node, 0);
18978
18979        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
18980        desret_xmlNodePtr(ret_val);
18981        call_tests++;
18982        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18983        xmlResetLastError();
18984        if (mem_base != xmlMemBlocks()) {
18985            printf("Leak of %d blocks found in xmlCopyNodeList",
18986	           xmlMemBlocks() - mem_base);
18987	    test_ret++;
18988            printf(" %d", n_node);
18989            printf("\n");
18990        }
18991    }
18992    function_tests++;
18993
18994    return(test_ret);
18995}
18996
18997
18998static int
18999test_xmlCopyProp(void) {
19000    int test_ret = 0;
19001
19002    int mem_base;
19003    xmlAttrPtr ret_val;
19004    xmlNodePtr target; /* the element where the attribute will be grafted */
19005    int n_target;
19006    xmlAttrPtr cur; /* the attribute */
19007    int n_cur;
19008
19009    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19010    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19011        mem_base = xmlMemBlocks();
19012        target = gen_xmlNodePtr(n_target, 0);
19013        cur = gen_xmlAttrPtr(n_cur, 1);
19014
19015        ret_val = xmlCopyProp(target, cur);
19016        desret_xmlAttrPtr(ret_val);
19017        call_tests++;
19018        des_xmlNodePtr(n_target, target, 0);
19019        des_xmlAttrPtr(n_cur, cur, 1);
19020        xmlResetLastError();
19021        if (mem_base != xmlMemBlocks()) {
19022            printf("Leak of %d blocks found in xmlCopyProp",
19023	           xmlMemBlocks() - mem_base);
19024	    test_ret++;
19025            printf(" %d", n_target);
19026            printf(" %d", n_cur);
19027            printf("\n");
19028        }
19029    }
19030    }
19031    function_tests++;
19032
19033    return(test_ret);
19034}
19035
19036
19037static int
19038test_xmlCopyPropList(void) {
19039    int test_ret = 0;
19040
19041    int mem_base;
19042    xmlAttrPtr ret_val;
19043    xmlNodePtr target; /* the element where the attributes will be grafted */
19044    int n_target;
19045    xmlAttrPtr cur; /* the first attribute */
19046    int n_cur;
19047
19048    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19049    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19050        mem_base = xmlMemBlocks();
19051        target = gen_xmlNodePtr(n_target, 0);
19052        cur = gen_xmlAttrPtr(n_cur, 1);
19053
19054        ret_val = xmlCopyPropList(target, cur);
19055        desret_xmlAttrPtr(ret_val);
19056        call_tests++;
19057        des_xmlNodePtr(n_target, target, 0);
19058        des_xmlAttrPtr(n_cur, cur, 1);
19059        xmlResetLastError();
19060        if (mem_base != xmlMemBlocks()) {
19061            printf("Leak of %d blocks found in xmlCopyPropList",
19062	           xmlMemBlocks() - mem_base);
19063	    test_ret++;
19064            printf(" %d", n_target);
19065            printf(" %d", n_cur);
19066            printf("\n");
19067        }
19068    }
19069    }
19070    function_tests++;
19071
19072    return(test_ret);
19073}
19074
19075
19076static int
19077test_xmlCreateIntSubset(void) {
19078    int test_ret = 0;
19079
19080    int mem_base;
19081    xmlDtdPtr ret_val;
19082    xmlDocPtr doc; /* the document pointer */
19083    int n_doc;
19084    xmlChar * name; /* the DTD name */
19085    int n_name;
19086    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19087    int n_ExternalID;
19088    xmlChar * SystemID; /* the system ID */
19089    int n_SystemID;
19090
19091    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19092    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19093    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19094    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19095        mem_base = xmlMemBlocks();
19096        doc = gen_xmlDocPtr(n_doc, 0);
19097        name = gen_const_xmlChar_ptr(n_name, 1);
19098        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19099        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19100
19101        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19102        desret_xmlDtdPtr(ret_val);
19103        call_tests++;
19104        des_xmlDocPtr(n_doc, doc, 0);
19105        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19106        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19107        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19108        xmlResetLastError();
19109        if (mem_base != xmlMemBlocks()) {
19110            printf("Leak of %d blocks found in xmlCreateIntSubset",
19111	           xmlMemBlocks() - mem_base);
19112	    test_ret++;
19113            printf(" %d", n_doc);
19114            printf(" %d", n_name);
19115            printf(" %d", n_ExternalID);
19116            printf(" %d", n_SystemID);
19117            printf("\n");
19118        }
19119    }
19120    }
19121    }
19122    }
19123    function_tests++;
19124
19125    return(test_ret);
19126}
19127
19128
19129#define gen_nb_xmlDOMWrapCtxtPtr 1
19130static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19131    return(NULL);
19132}
19133static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19134}
19135
19136static int
19137test_xmlDOMWrapAdoptNode(void) {
19138    int test_ret = 0;
19139
19140    int mem_base;
19141    int ret_val;
19142    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19143    int n_ctxt;
19144    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19145    int n_sourceDoc;
19146    xmlNodePtr node; /* the node to start with */
19147    int n_node;
19148    xmlDocPtr destDoc; /* the destination doc */
19149    int n_destDoc;
19150    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19151    int n_destParent;
19152    int options; /* option flags */
19153    int n_options;
19154
19155    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19156    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19157    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19158    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19159    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19160    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19161        mem_base = xmlMemBlocks();
19162        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19163        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19164        node = gen_xmlNodePtr(n_node, 2);
19165        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19166        destParent = gen_xmlNodePtr(n_destParent, 4);
19167        options = gen_int(n_options, 5);
19168
19169        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19170        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19171        desret_int(ret_val);
19172        call_tests++;
19173        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19174        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19175        des_xmlNodePtr(n_node, node, 2);
19176        des_xmlDocPtr(n_destDoc, destDoc, 3);
19177        des_xmlNodePtr(n_destParent, destParent, 4);
19178        des_int(n_options, options, 5);
19179        xmlResetLastError();
19180        if (mem_base != xmlMemBlocks()) {
19181            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19182	           xmlMemBlocks() - mem_base);
19183	    test_ret++;
19184            printf(" %d", n_ctxt);
19185            printf(" %d", n_sourceDoc);
19186            printf(" %d", n_node);
19187            printf(" %d", n_destDoc);
19188            printf(" %d", n_destParent);
19189            printf(" %d", n_options);
19190            printf("\n");
19191        }
19192    }
19193    }
19194    }
19195    }
19196    }
19197    }
19198    function_tests++;
19199
19200    return(test_ret);
19201}
19202
19203
19204static int
19205test_xmlDOMWrapNewCtxt(void) {
19206    int test_ret = 0;
19207
19208
19209    /* missing type support */
19210    return(test_ret);
19211}
19212
19213
19214static int
19215test_xmlDOMWrapReconcileNamespaces(void) {
19216    int test_ret = 0;
19217
19218    int mem_base;
19219    int ret_val;
19220    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19221    int n_ctxt;
19222    xmlNodePtr elem; /* the element-node */
19223    int n_elem;
19224    int options; /* option flags */
19225    int n_options;
19226
19227    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19228    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19229    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19230        mem_base = xmlMemBlocks();
19231        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19232        elem = gen_xmlNodePtr(n_elem, 1);
19233        options = gen_int(n_options, 2);
19234
19235        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19236        desret_int(ret_val);
19237        call_tests++;
19238        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19239        des_xmlNodePtr(n_elem, elem, 1);
19240        des_int(n_options, options, 2);
19241        xmlResetLastError();
19242        if (mem_base != xmlMemBlocks()) {
19243            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19244	           xmlMemBlocks() - mem_base);
19245	    test_ret++;
19246            printf(" %d", n_ctxt);
19247            printf(" %d", n_elem);
19248            printf(" %d", n_options);
19249            printf("\n");
19250        }
19251    }
19252    }
19253    }
19254    function_tests++;
19255
19256    return(test_ret);
19257}
19258
19259
19260static int
19261test_xmlDOMWrapRemoveNode(void) {
19262    int test_ret = 0;
19263
19264    int mem_base;
19265    int ret_val;
19266    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19267    int n_ctxt;
19268    xmlDocPtr doc; /* the doc */
19269    int n_doc;
19270    xmlNodePtr node; /* the node to be removed. */
19271    int n_node;
19272    int options; /* set of options, unused at the moment */
19273    int n_options;
19274
19275    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19276    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19277    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19278    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19279        mem_base = xmlMemBlocks();
19280        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19281        doc = gen_xmlDocPtr(n_doc, 1);
19282        node = gen_xmlNodePtr(n_node, 2);
19283        options = gen_int(n_options, 3);
19284
19285        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19286        desret_int(ret_val);
19287        call_tests++;
19288        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19289        des_xmlDocPtr(n_doc, doc, 1);
19290        des_xmlNodePtr(n_node, node, 2);
19291        des_int(n_options, options, 3);
19292        xmlResetLastError();
19293        if (mem_base != xmlMemBlocks()) {
19294            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19295	           xmlMemBlocks() - mem_base);
19296	    test_ret++;
19297            printf(" %d", n_ctxt);
19298            printf(" %d", n_doc);
19299            printf(" %d", n_node);
19300            printf(" %d", n_options);
19301            printf("\n");
19302        }
19303    }
19304    }
19305    }
19306    }
19307    function_tests++;
19308
19309    return(test_ret);
19310}
19311
19312
19313static int
19314test_xmlDocCopyNode(void) {
19315    int test_ret = 0;
19316
19317    int mem_base;
19318    xmlNodePtr ret_val;
19319    xmlNodePtr node; /* the node */
19320    int n_node;
19321    xmlDocPtr doc; /* the document */
19322    int n_doc;
19323    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19324    int n_extended;
19325
19326    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19327    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19328    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19329        mem_base = xmlMemBlocks();
19330        node = gen_const_xmlNodePtr(n_node, 0);
19331        doc = gen_xmlDocPtr(n_doc, 1);
19332        extended = gen_int(n_extended, 2);
19333
19334        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19335        desret_xmlNodePtr(ret_val);
19336        call_tests++;
19337        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19338        des_xmlDocPtr(n_doc, doc, 1);
19339        des_int(n_extended, extended, 2);
19340        xmlResetLastError();
19341        if (mem_base != xmlMemBlocks()) {
19342            printf("Leak of %d blocks found in xmlDocCopyNode",
19343	           xmlMemBlocks() - mem_base);
19344	    test_ret++;
19345            printf(" %d", n_node);
19346            printf(" %d", n_doc);
19347            printf(" %d", n_extended);
19348            printf("\n");
19349        }
19350    }
19351    }
19352    }
19353    function_tests++;
19354
19355    return(test_ret);
19356}
19357
19358
19359static int
19360test_xmlDocCopyNodeList(void) {
19361    int test_ret = 0;
19362
19363    int mem_base;
19364    xmlNodePtr ret_val;
19365    xmlDocPtr doc; /* the target document */
19366    int n_doc;
19367    xmlNodePtr node; /* the first node in the list. */
19368    int n_node;
19369
19370    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19371    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19372        mem_base = xmlMemBlocks();
19373        doc = gen_xmlDocPtr(n_doc, 0);
19374        node = gen_const_xmlNodePtr(n_node, 1);
19375
19376        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19377        desret_xmlNodePtr(ret_val);
19378        call_tests++;
19379        des_xmlDocPtr(n_doc, doc, 0);
19380        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19381        xmlResetLastError();
19382        if (mem_base != xmlMemBlocks()) {
19383            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19384	           xmlMemBlocks() - mem_base);
19385	    test_ret++;
19386            printf(" %d", n_doc);
19387            printf(" %d", n_node);
19388            printf("\n");
19389        }
19390    }
19391    }
19392    function_tests++;
19393
19394    return(test_ret);
19395}
19396
19397
19398static int
19399test_xmlDocDump(void) {
19400    int test_ret = 0;
19401
19402#if defined(LIBXML_OUTPUT_ENABLED)
19403    int mem_base;
19404    int ret_val;
19405    FILE * f; /* the FILE* */
19406    int n_f;
19407    xmlDocPtr cur; /* the document */
19408    int n_cur;
19409
19410    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19411    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19412        mem_base = xmlMemBlocks();
19413        f = gen_FILE_ptr(n_f, 0);
19414        cur = gen_xmlDocPtr(n_cur, 1);
19415
19416        ret_val = xmlDocDump(f, cur);
19417        desret_int(ret_val);
19418        call_tests++;
19419        des_FILE_ptr(n_f, f, 0);
19420        des_xmlDocPtr(n_cur, cur, 1);
19421        xmlResetLastError();
19422        if (mem_base != xmlMemBlocks()) {
19423            printf("Leak of %d blocks found in xmlDocDump",
19424	           xmlMemBlocks() - mem_base);
19425	    test_ret++;
19426            printf(" %d", n_f);
19427            printf(" %d", n_cur);
19428            printf("\n");
19429        }
19430    }
19431    }
19432    function_tests++;
19433#endif
19434
19435    return(test_ret);
19436}
19437
19438
19439static int
19440test_xmlDocDumpFormatMemory(void) {
19441    int test_ret = 0;
19442
19443#if defined(LIBXML_OUTPUT_ENABLED)
19444    int mem_base;
19445    xmlDocPtr cur; /* the document */
19446    int n_cur;
19447    xmlChar ** mem; /* OUT: the memory pointer */
19448    int n_mem;
19449    int * size; /* OUT: the memory length */
19450    int n_size;
19451    int format; /* should formatting spaces been added */
19452    int n_format;
19453
19454    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19455    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19456    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19457    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19458        mem_base = xmlMemBlocks();
19459        cur = gen_xmlDocPtr(n_cur, 0);
19460        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19461        size = gen_int_ptr(n_size, 2);
19462        format = gen_int(n_format, 3);
19463
19464        xmlDocDumpFormatMemory(cur, mem, size, format);
19465        call_tests++;
19466        des_xmlDocPtr(n_cur, cur, 0);
19467        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19468        des_int_ptr(n_size, size, 2);
19469        des_int(n_format, format, 3);
19470        xmlResetLastError();
19471        if (mem_base != xmlMemBlocks()) {
19472            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19473	           xmlMemBlocks() - mem_base);
19474	    test_ret++;
19475            printf(" %d", n_cur);
19476            printf(" %d", n_mem);
19477            printf(" %d", n_size);
19478            printf(" %d", n_format);
19479            printf("\n");
19480        }
19481    }
19482    }
19483    }
19484    }
19485    function_tests++;
19486#endif
19487
19488    return(test_ret);
19489}
19490
19491
19492static int
19493test_xmlDocDumpFormatMemoryEnc(void) {
19494    int test_ret = 0;
19495
19496#if defined(LIBXML_OUTPUT_ENABLED)
19497    int mem_base;
19498    xmlDocPtr out_doc; /* Document to generate XML text from */
19499    int n_out_doc;
19500    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19501    int n_doc_txt_ptr;
19502    int * doc_txt_len; /* Length of the generated XML text */
19503    int n_doc_txt_len;
19504    char * txt_encoding; /* Character encoding to use when generating XML text */
19505    int n_txt_encoding;
19506    int format; /* should formatting spaces been added */
19507    int n_format;
19508
19509    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19510    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19511    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19512    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19513    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19514        mem_base = xmlMemBlocks();
19515        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19516        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19517        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19518        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19519        format = gen_int(n_format, 4);
19520
19521        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19522        call_tests++;
19523        des_xmlDocPtr(n_out_doc, out_doc, 0);
19524        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19525        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19526        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19527        des_int(n_format, format, 4);
19528        xmlResetLastError();
19529        if (mem_base != xmlMemBlocks()) {
19530            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19531	           xmlMemBlocks() - mem_base);
19532	    test_ret++;
19533            printf(" %d", n_out_doc);
19534            printf(" %d", n_doc_txt_ptr);
19535            printf(" %d", n_doc_txt_len);
19536            printf(" %d", n_txt_encoding);
19537            printf(" %d", n_format);
19538            printf("\n");
19539        }
19540    }
19541    }
19542    }
19543    }
19544    }
19545    function_tests++;
19546#endif
19547
19548    return(test_ret);
19549}
19550
19551
19552static int
19553test_xmlDocDumpMemory(void) {
19554    int test_ret = 0;
19555
19556#if defined(LIBXML_OUTPUT_ENABLED)
19557    int mem_base;
19558    xmlDocPtr cur; /* the document */
19559    int n_cur;
19560    xmlChar ** mem; /* OUT: the memory pointer */
19561    int n_mem;
19562    int * size; /* OUT: the memory length */
19563    int n_size;
19564
19565    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19566    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19567    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19568        mem_base = xmlMemBlocks();
19569        cur = gen_xmlDocPtr(n_cur, 0);
19570        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19571        size = gen_int_ptr(n_size, 2);
19572
19573        xmlDocDumpMemory(cur, mem, size);
19574        call_tests++;
19575        des_xmlDocPtr(n_cur, cur, 0);
19576        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19577        des_int_ptr(n_size, size, 2);
19578        xmlResetLastError();
19579        if (mem_base != xmlMemBlocks()) {
19580            printf("Leak of %d blocks found in xmlDocDumpMemory",
19581	           xmlMemBlocks() - mem_base);
19582	    test_ret++;
19583            printf(" %d", n_cur);
19584            printf(" %d", n_mem);
19585            printf(" %d", n_size);
19586            printf("\n");
19587        }
19588    }
19589    }
19590    }
19591    function_tests++;
19592#endif
19593
19594    return(test_ret);
19595}
19596
19597
19598static int
19599test_xmlDocDumpMemoryEnc(void) {
19600    int test_ret = 0;
19601
19602#if defined(LIBXML_OUTPUT_ENABLED)
19603    int mem_base;
19604    xmlDocPtr out_doc; /* Document to generate XML text from */
19605    int n_out_doc;
19606    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19607    int n_doc_txt_ptr;
19608    int * doc_txt_len; /* Length of the generated XML text */
19609    int n_doc_txt_len;
19610    char * txt_encoding; /* Character encoding to use when generating XML text */
19611    int n_txt_encoding;
19612
19613    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19614    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19615    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19616    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19617        mem_base = xmlMemBlocks();
19618        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19619        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19620        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19621        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19622
19623        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19624        call_tests++;
19625        des_xmlDocPtr(n_out_doc, out_doc, 0);
19626        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19627        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19628        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19629        xmlResetLastError();
19630        if (mem_base != xmlMemBlocks()) {
19631            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19632	           xmlMemBlocks() - mem_base);
19633	    test_ret++;
19634            printf(" %d", n_out_doc);
19635            printf(" %d", n_doc_txt_ptr);
19636            printf(" %d", n_doc_txt_len);
19637            printf(" %d", n_txt_encoding);
19638            printf("\n");
19639        }
19640    }
19641    }
19642    }
19643    }
19644    function_tests++;
19645#endif
19646
19647    return(test_ret);
19648}
19649
19650
19651static int
19652test_xmlDocFormatDump(void) {
19653    int test_ret = 0;
19654
19655#if defined(LIBXML_OUTPUT_ENABLED)
19656    int mem_base;
19657    int ret_val;
19658    FILE * f; /* the FILE* */
19659    int n_f;
19660    xmlDocPtr cur; /* the document */
19661    int n_cur;
19662    int format; /* should formatting spaces been added */
19663    int n_format;
19664
19665    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19666    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19667    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19668        mem_base = xmlMemBlocks();
19669        f = gen_FILE_ptr(n_f, 0);
19670        cur = gen_xmlDocPtr(n_cur, 1);
19671        format = gen_int(n_format, 2);
19672
19673        ret_val = xmlDocFormatDump(f, cur, format);
19674        desret_int(ret_val);
19675        call_tests++;
19676        des_FILE_ptr(n_f, f, 0);
19677        des_xmlDocPtr(n_cur, cur, 1);
19678        des_int(n_format, format, 2);
19679        xmlResetLastError();
19680        if (mem_base != xmlMemBlocks()) {
19681            printf("Leak of %d blocks found in xmlDocFormatDump",
19682	           xmlMemBlocks() - mem_base);
19683	    test_ret++;
19684            printf(" %d", n_f);
19685            printf(" %d", n_cur);
19686            printf(" %d", n_format);
19687            printf("\n");
19688        }
19689    }
19690    }
19691    }
19692    function_tests++;
19693#endif
19694
19695    return(test_ret);
19696}
19697
19698
19699static int
19700test_xmlDocGetRootElement(void) {
19701    int test_ret = 0;
19702
19703    int mem_base;
19704    xmlNodePtr ret_val;
19705    xmlDocPtr doc; /* the document */
19706    int n_doc;
19707
19708    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19709        mem_base = xmlMemBlocks();
19710        doc = gen_xmlDocPtr(n_doc, 0);
19711
19712        ret_val = xmlDocGetRootElement(doc);
19713        desret_xmlNodePtr(ret_val);
19714        call_tests++;
19715        des_xmlDocPtr(n_doc, doc, 0);
19716        xmlResetLastError();
19717        if (mem_base != xmlMemBlocks()) {
19718            printf("Leak of %d blocks found in xmlDocGetRootElement",
19719	           xmlMemBlocks() - mem_base);
19720	    test_ret++;
19721            printf(" %d", n_doc);
19722            printf("\n");
19723        }
19724    }
19725    function_tests++;
19726
19727    return(test_ret);
19728}
19729
19730
19731static int
19732test_xmlDocSetRootElement(void) {
19733    int test_ret = 0;
19734
19735#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
19736    int mem_base;
19737    xmlNodePtr ret_val;
19738    xmlDocPtr doc; /* the document */
19739    int n_doc;
19740    xmlNodePtr root; /* the new document root element */
19741    int n_root;
19742
19743    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19744    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
19745        mem_base = xmlMemBlocks();
19746        doc = gen_xmlDocPtr(n_doc, 0);
19747        root = gen_xmlNodePtr_in(n_root, 1);
19748
19749        ret_val = xmlDocSetRootElement(doc, root);
19750        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
19751        desret_xmlNodePtr(ret_val);
19752        call_tests++;
19753        des_xmlDocPtr(n_doc, doc, 0);
19754        des_xmlNodePtr_in(n_root, root, 1);
19755        xmlResetLastError();
19756        if (mem_base != xmlMemBlocks()) {
19757            printf("Leak of %d blocks found in xmlDocSetRootElement",
19758	           xmlMemBlocks() - mem_base);
19759	    test_ret++;
19760            printf(" %d", n_doc);
19761            printf(" %d", n_root);
19762            printf("\n");
19763        }
19764    }
19765    }
19766    function_tests++;
19767#endif
19768
19769    return(test_ret);
19770}
19771
19772
19773static int
19774test_xmlElemDump(void) {
19775    int test_ret = 0;
19776
19777#if defined(LIBXML_OUTPUT_ENABLED)
19778    int mem_base;
19779    FILE * f; /* the FILE * for the output */
19780    int n_f;
19781    xmlDocPtr doc; /* the document */
19782    int n_doc;
19783    xmlNodePtr cur; /* the current node */
19784    int n_cur;
19785
19786    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19787    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19788    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
19789        mem_base = xmlMemBlocks();
19790        f = gen_FILE_ptr(n_f, 0);
19791        doc = gen_xmlDocPtr(n_doc, 1);
19792        cur = gen_xmlNodePtr(n_cur, 2);
19793
19794        xmlElemDump(f, doc, cur);
19795        call_tests++;
19796        des_FILE_ptr(n_f, f, 0);
19797        des_xmlDocPtr(n_doc, doc, 1);
19798        des_xmlNodePtr(n_cur, cur, 2);
19799        xmlResetLastError();
19800        if (mem_base != xmlMemBlocks()) {
19801            printf("Leak of %d blocks found in xmlElemDump",
19802	           xmlMemBlocks() - mem_base);
19803	    test_ret++;
19804            printf(" %d", n_f);
19805            printf(" %d", n_doc);
19806            printf(" %d", n_cur);
19807            printf("\n");
19808        }
19809    }
19810    }
19811    }
19812    function_tests++;
19813#endif
19814
19815    return(test_ret);
19816}
19817
19818
19819static int
19820test_xmlGetBufferAllocationScheme(void) {
19821    int test_ret = 0;
19822
19823    int mem_base;
19824    xmlBufferAllocationScheme ret_val;
19825
19826        mem_base = xmlMemBlocks();
19827
19828        ret_val = xmlGetBufferAllocationScheme();
19829        desret_xmlBufferAllocationScheme(ret_val);
19830        call_tests++;
19831        xmlResetLastError();
19832        if (mem_base != xmlMemBlocks()) {
19833            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
19834	           xmlMemBlocks() - mem_base);
19835	    test_ret++;
19836            printf("\n");
19837        }
19838    function_tests++;
19839
19840    return(test_ret);
19841}
19842
19843
19844static int
19845test_xmlGetCompressMode(void) {
19846    int test_ret = 0;
19847
19848    int mem_base;
19849    int ret_val;
19850
19851        mem_base = xmlMemBlocks();
19852
19853        ret_val = xmlGetCompressMode();
19854        desret_int(ret_val);
19855        call_tests++;
19856        xmlResetLastError();
19857        if (mem_base != xmlMemBlocks()) {
19858            printf("Leak of %d blocks found in xmlGetCompressMode",
19859	           xmlMemBlocks() - mem_base);
19860	    test_ret++;
19861            printf("\n");
19862        }
19863    function_tests++;
19864
19865    return(test_ret);
19866}
19867
19868
19869static int
19870test_xmlGetDocCompressMode(void) {
19871    int test_ret = 0;
19872
19873    int mem_base;
19874    int ret_val;
19875    xmlDocPtr doc; /* the document */
19876    int n_doc;
19877
19878    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19879        mem_base = xmlMemBlocks();
19880        doc = gen_xmlDocPtr(n_doc, 0);
19881
19882        ret_val = xmlGetDocCompressMode(doc);
19883        desret_int(ret_val);
19884        call_tests++;
19885        des_xmlDocPtr(n_doc, doc, 0);
19886        xmlResetLastError();
19887        if (mem_base != xmlMemBlocks()) {
19888            printf("Leak of %d blocks found in xmlGetDocCompressMode",
19889	           xmlMemBlocks() - mem_base);
19890	    test_ret++;
19891            printf(" %d", n_doc);
19892            printf("\n");
19893        }
19894    }
19895    function_tests++;
19896
19897    return(test_ret);
19898}
19899
19900
19901static int
19902test_xmlGetIntSubset(void) {
19903    int test_ret = 0;
19904
19905    int mem_base;
19906    xmlDtdPtr ret_val;
19907    xmlDocPtr doc; /* the document pointer */
19908    int n_doc;
19909
19910    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19911        mem_base = xmlMemBlocks();
19912        doc = gen_xmlDocPtr(n_doc, 0);
19913
19914        ret_val = xmlGetIntSubset(doc);
19915        desret_xmlDtdPtr(ret_val);
19916        call_tests++;
19917        des_xmlDocPtr(n_doc, doc, 0);
19918        xmlResetLastError();
19919        if (mem_base != xmlMemBlocks()) {
19920            printf("Leak of %d blocks found in xmlGetIntSubset",
19921	           xmlMemBlocks() - mem_base);
19922	    test_ret++;
19923            printf(" %d", n_doc);
19924            printf("\n");
19925        }
19926    }
19927    function_tests++;
19928
19929    return(test_ret);
19930}
19931
19932
19933static int
19934test_xmlGetLastChild(void) {
19935    int test_ret = 0;
19936
19937    int mem_base;
19938    xmlNodePtr ret_val;
19939    xmlNodePtr parent; /* the parent node */
19940    int n_parent;
19941
19942    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19943        mem_base = xmlMemBlocks();
19944        parent = gen_xmlNodePtr(n_parent, 0);
19945
19946        ret_val = xmlGetLastChild(parent);
19947        desret_xmlNodePtr(ret_val);
19948        call_tests++;
19949        des_xmlNodePtr(n_parent, parent, 0);
19950        xmlResetLastError();
19951        if (mem_base != xmlMemBlocks()) {
19952            printf("Leak of %d blocks found in xmlGetLastChild",
19953	           xmlMemBlocks() - mem_base);
19954	    test_ret++;
19955            printf(" %d", n_parent);
19956            printf("\n");
19957        }
19958    }
19959    function_tests++;
19960
19961    return(test_ret);
19962}
19963
19964
19965static int
19966test_xmlGetLineNo(void) {
19967    int test_ret = 0;
19968
19969    int mem_base;
19970    long ret_val;
19971    xmlNodePtr node; /* valid node */
19972    int n_node;
19973
19974    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19975        mem_base = xmlMemBlocks();
19976        node = gen_xmlNodePtr(n_node, 0);
19977
19978        ret_val = xmlGetLineNo(node);
19979        desret_long(ret_val);
19980        call_tests++;
19981        des_xmlNodePtr(n_node, node, 0);
19982        xmlResetLastError();
19983        if (mem_base != xmlMemBlocks()) {
19984            printf("Leak of %d blocks found in xmlGetLineNo",
19985	           xmlMemBlocks() - mem_base);
19986	    test_ret++;
19987            printf(" %d", n_node);
19988            printf("\n");
19989        }
19990    }
19991    function_tests++;
19992
19993    return(test_ret);
19994}
19995
19996
19997static int
19998test_xmlGetNoNsProp(void) {
19999    int test_ret = 0;
20000
20001    int mem_base;
20002    xmlChar * ret_val;
20003    xmlNodePtr node; /* the node */
20004    int n_node;
20005    xmlChar * name; /* the attribute name */
20006    int n_name;
20007
20008    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20009    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20010        mem_base = xmlMemBlocks();
20011        node = gen_xmlNodePtr(n_node, 0);
20012        name = gen_const_xmlChar_ptr(n_name, 1);
20013
20014        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20015        desret_xmlChar_ptr(ret_val);
20016        call_tests++;
20017        des_xmlNodePtr(n_node, node, 0);
20018        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20019        xmlResetLastError();
20020        if (mem_base != xmlMemBlocks()) {
20021            printf("Leak of %d blocks found in xmlGetNoNsProp",
20022	           xmlMemBlocks() - mem_base);
20023	    test_ret++;
20024            printf(" %d", n_node);
20025            printf(" %d", n_name);
20026            printf("\n");
20027        }
20028    }
20029    }
20030    function_tests++;
20031
20032    return(test_ret);
20033}
20034
20035
20036static int
20037test_xmlGetNodePath(void) {
20038    int test_ret = 0;
20039
20040#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20041    int mem_base;
20042    xmlChar * ret_val;
20043    xmlNodePtr node; /* a node */
20044    int n_node;
20045
20046    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20047        mem_base = xmlMemBlocks();
20048        node = gen_xmlNodePtr(n_node, 0);
20049
20050        ret_val = xmlGetNodePath(node);
20051        desret_xmlChar_ptr(ret_val);
20052        call_tests++;
20053        des_xmlNodePtr(n_node, node, 0);
20054        xmlResetLastError();
20055        if (mem_base != xmlMemBlocks()) {
20056            printf("Leak of %d blocks found in xmlGetNodePath",
20057	           xmlMemBlocks() - mem_base);
20058	    test_ret++;
20059            printf(" %d", n_node);
20060            printf("\n");
20061        }
20062    }
20063    function_tests++;
20064#endif
20065
20066    return(test_ret);
20067}
20068
20069
20070static int
20071test_xmlGetNsList(void) {
20072    int test_ret = 0;
20073
20074
20075    /* missing type support */
20076    return(test_ret);
20077}
20078
20079
20080static int
20081test_xmlGetNsProp(void) {
20082    int test_ret = 0;
20083
20084    int mem_base;
20085    xmlChar * ret_val;
20086    xmlNodePtr node; /* the node */
20087    int n_node;
20088    xmlChar * name; /* the attribute name */
20089    int n_name;
20090    xmlChar * nameSpace; /* the URI of the namespace */
20091    int n_nameSpace;
20092
20093    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20094    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20095    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20096        mem_base = xmlMemBlocks();
20097        node = gen_xmlNodePtr(n_node, 0);
20098        name = gen_const_xmlChar_ptr(n_name, 1);
20099        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20100
20101        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20102        desret_xmlChar_ptr(ret_val);
20103        call_tests++;
20104        des_xmlNodePtr(n_node, node, 0);
20105        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20106        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20107        xmlResetLastError();
20108        if (mem_base != xmlMemBlocks()) {
20109            printf("Leak of %d blocks found in xmlGetNsProp",
20110	           xmlMemBlocks() - mem_base);
20111	    test_ret++;
20112            printf(" %d", n_node);
20113            printf(" %d", n_name);
20114            printf(" %d", n_nameSpace);
20115            printf("\n");
20116        }
20117    }
20118    }
20119    }
20120    function_tests++;
20121
20122    return(test_ret);
20123}
20124
20125
20126static int
20127test_xmlGetProp(void) {
20128    int test_ret = 0;
20129
20130    int mem_base;
20131    xmlChar * ret_val;
20132    xmlNodePtr node; /* the node */
20133    int n_node;
20134    xmlChar * name; /* the attribute name */
20135    int n_name;
20136
20137    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20138    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20139        mem_base = xmlMemBlocks();
20140        node = gen_xmlNodePtr(n_node, 0);
20141        name = gen_const_xmlChar_ptr(n_name, 1);
20142
20143        ret_val = xmlGetProp(node, (const xmlChar *)name);
20144        desret_xmlChar_ptr(ret_val);
20145        call_tests++;
20146        des_xmlNodePtr(n_node, node, 0);
20147        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20148        xmlResetLastError();
20149        if (mem_base != xmlMemBlocks()) {
20150            printf("Leak of %d blocks found in xmlGetProp",
20151	           xmlMemBlocks() - mem_base);
20152	    test_ret++;
20153            printf(" %d", n_node);
20154            printf(" %d", n_name);
20155            printf("\n");
20156        }
20157    }
20158    }
20159    function_tests++;
20160
20161    return(test_ret);
20162}
20163
20164
20165static int
20166test_xmlHasNsProp(void) {
20167    int test_ret = 0;
20168
20169    int mem_base;
20170    xmlAttrPtr ret_val;
20171    xmlNodePtr node; /* the node */
20172    int n_node;
20173    xmlChar * name; /* the attribute name */
20174    int n_name;
20175    xmlChar * nameSpace; /* the URI of the namespace */
20176    int n_nameSpace;
20177
20178    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20179    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20180    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20181        mem_base = xmlMemBlocks();
20182        node = gen_xmlNodePtr(n_node, 0);
20183        name = gen_const_xmlChar_ptr(n_name, 1);
20184        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20185
20186        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20187        desret_xmlAttrPtr(ret_val);
20188        call_tests++;
20189        des_xmlNodePtr(n_node, node, 0);
20190        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20191        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20192        xmlResetLastError();
20193        if (mem_base != xmlMemBlocks()) {
20194            printf("Leak of %d blocks found in xmlHasNsProp",
20195	           xmlMemBlocks() - mem_base);
20196	    test_ret++;
20197            printf(" %d", n_node);
20198            printf(" %d", n_name);
20199            printf(" %d", n_nameSpace);
20200            printf("\n");
20201        }
20202    }
20203    }
20204    }
20205    function_tests++;
20206
20207    return(test_ret);
20208}
20209
20210
20211static int
20212test_xmlHasProp(void) {
20213    int test_ret = 0;
20214
20215    int mem_base;
20216    xmlAttrPtr ret_val;
20217    xmlNodePtr node; /* the node */
20218    int n_node;
20219    xmlChar * name; /* the attribute name */
20220    int n_name;
20221
20222    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20223    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20224        mem_base = xmlMemBlocks();
20225        node = gen_xmlNodePtr(n_node, 0);
20226        name = gen_const_xmlChar_ptr(n_name, 1);
20227
20228        ret_val = xmlHasProp(node, (const xmlChar *)name);
20229        desret_xmlAttrPtr(ret_val);
20230        call_tests++;
20231        des_xmlNodePtr(n_node, node, 0);
20232        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20233        xmlResetLastError();
20234        if (mem_base != xmlMemBlocks()) {
20235            printf("Leak of %d blocks found in xmlHasProp",
20236	           xmlMemBlocks() - mem_base);
20237	    test_ret++;
20238            printf(" %d", n_node);
20239            printf(" %d", n_name);
20240            printf("\n");
20241        }
20242    }
20243    }
20244    function_tests++;
20245
20246    return(test_ret);
20247}
20248
20249
20250static int
20251test_xmlIsBlankNode(void) {
20252    int test_ret = 0;
20253
20254    int mem_base;
20255    int ret_val;
20256    xmlNodePtr node; /* the node */
20257    int n_node;
20258
20259    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20260        mem_base = xmlMemBlocks();
20261        node = gen_xmlNodePtr(n_node, 0);
20262
20263        ret_val = xmlIsBlankNode(node);
20264        desret_int(ret_val);
20265        call_tests++;
20266        des_xmlNodePtr(n_node, node, 0);
20267        xmlResetLastError();
20268        if (mem_base != xmlMemBlocks()) {
20269            printf("Leak of %d blocks found in xmlIsBlankNode",
20270	           xmlMemBlocks() - mem_base);
20271	    test_ret++;
20272            printf(" %d", n_node);
20273            printf("\n");
20274        }
20275    }
20276    function_tests++;
20277
20278    return(test_ret);
20279}
20280
20281
20282static int
20283test_xmlIsXHTML(void) {
20284    int test_ret = 0;
20285
20286    int mem_base;
20287    int ret_val;
20288    xmlChar * systemID; /* the system identifier */
20289    int n_systemID;
20290    xmlChar * publicID; /* the public identifier */
20291    int n_publicID;
20292
20293    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20294    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20295        mem_base = xmlMemBlocks();
20296        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20297        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20298
20299        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20300        desret_int(ret_val);
20301        call_tests++;
20302        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20303        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20304        xmlResetLastError();
20305        if (mem_base != xmlMemBlocks()) {
20306            printf("Leak of %d blocks found in xmlIsXHTML",
20307	           xmlMemBlocks() - mem_base);
20308	    test_ret++;
20309            printf(" %d", n_systemID);
20310            printf(" %d", n_publicID);
20311            printf("\n");
20312        }
20313    }
20314    }
20315    function_tests++;
20316
20317    return(test_ret);
20318}
20319
20320
20321static int
20322test_xmlNewCDataBlock(void) {
20323    int test_ret = 0;
20324
20325    int mem_base;
20326    xmlNodePtr ret_val;
20327    xmlDocPtr doc; /* the document */
20328    int n_doc;
20329    xmlChar * content; /* the CDATA block content content */
20330    int n_content;
20331    int len; /* the length of the block */
20332    int n_len;
20333
20334    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20335    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20336    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20337        mem_base = xmlMemBlocks();
20338        doc = gen_xmlDocPtr(n_doc, 0);
20339        content = gen_const_xmlChar_ptr(n_content, 1);
20340        len = gen_int(n_len, 2);
20341
20342        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20343        desret_xmlNodePtr(ret_val);
20344        call_tests++;
20345        des_xmlDocPtr(n_doc, doc, 0);
20346        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20347        des_int(n_len, len, 2);
20348        xmlResetLastError();
20349        if (mem_base != xmlMemBlocks()) {
20350            printf("Leak of %d blocks found in xmlNewCDataBlock",
20351	           xmlMemBlocks() - mem_base);
20352	    test_ret++;
20353            printf(" %d", n_doc);
20354            printf(" %d", n_content);
20355            printf(" %d", n_len);
20356            printf("\n");
20357        }
20358    }
20359    }
20360    }
20361    function_tests++;
20362
20363    return(test_ret);
20364}
20365
20366
20367static int
20368test_xmlNewCharRef(void) {
20369    int test_ret = 0;
20370
20371    int mem_base;
20372    xmlNodePtr ret_val;
20373    xmlDocPtr doc; /* the document */
20374    int n_doc;
20375    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20376    int n_name;
20377
20378    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20379    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20380        mem_base = xmlMemBlocks();
20381        doc = gen_xmlDocPtr(n_doc, 0);
20382        name = gen_const_xmlChar_ptr(n_name, 1);
20383
20384        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20385        desret_xmlNodePtr(ret_val);
20386        call_tests++;
20387        des_xmlDocPtr(n_doc, doc, 0);
20388        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20389        xmlResetLastError();
20390        if (mem_base != xmlMemBlocks()) {
20391            printf("Leak of %d blocks found in xmlNewCharRef",
20392	           xmlMemBlocks() - mem_base);
20393	    test_ret++;
20394            printf(" %d", n_doc);
20395            printf(" %d", n_name);
20396            printf("\n");
20397        }
20398    }
20399    }
20400    function_tests++;
20401
20402    return(test_ret);
20403}
20404
20405
20406static int
20407test_xmlNewChild(void) {
20408    int test_ret = 0;
20409
20410#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20411#ifdef LIBXML_TREE_ENABLED
20412    int mem_base;
20413    xmlNodePtr ret_val;
20414    xmlNodePtr parent; /* the parent node */
20415    int n_parent;
20416    xmlNsPtr ns; /* a namespace if any */
20417    int n_ns;
20418    xmlChar * name; /* the name of the child */
20419    int n_name;
20420    xmlChar * content; /* the XML content of the child if any. */
20421    int n_content;
20422
20423    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20424    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20425    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20426    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20427        mem_base = xmlMemBlocks();
20428        parent = gen_xmlNodePtr(n_parent, 0);
20429        ns = gen_xmlNsPtr(n_ns, 1);
20430        name = gen_const_xmlChar_ptr(n_name, 2);
20431        content = gen_const_xmlChar_ptr(n_content, 3);
20432
20433        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20434        desret_xmlNodePtr(ret_val);
20435        call_tests++;
20436        des_xmlNodePtr(n_parent, parent, 0);
20437        des_xmlNsPtr(n_ns, ns, 1);
20438        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20439        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20440        xmlResetLastError();
20441        if (mem_base != xmlMemBlocks()) {
20442            printf("Leak of %d blocks found in xmlNewChild",
20443	           xmlMemBlocks() - mem_base);
20444	    test_ret++;
20445            printf(" %d", n_parent);
20446            printf(" %d", n_ns);
20447            printf(" %d", n_name);
20448            printf(" %d", n_content);
20449            printf("\n");
20450        }
20451    }
20452    }
20453    }
20454    }
20455    function_tests++;
20456#endif
20457#endif
20458
20459    return(test_ret);
20460}
20461
20462
20463static int
20464test_xmlNewComment(void) {
20465    int test_ret = 0;
20466
20467    int mem_base;
20468    xmlNodePtr ret_val;
20469    xmlChar * content; /* the comment content */
20470    int n_content;
20471
20472    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20473        mem_base = xmlMemBlocks();
20474        content = gen_const_xmlChar_ptr(n_content, 0);
20475
20476        ret_val = xmlNewComment((const xmlChar *)content);
20477        desret_xmlNodePtr(ret_val);
20478        call_tests++;
20479        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20480        xmlResetLastError();
20481        if (mem_base != xmlMemBlocks()) {
20482            printf("Leak of %d blocks found in xmlNewComment",
20483	           xmlMemBlocks() - mem_base);
20484	    test_ret++;
20485            printf(" %d", n_content);
20486            printf("\n");
20487        }
20488    }
20489    function_tests++;
20490
20491    return(test_ret);
20492}
20493
20494
20495static int
20496test_xmlNewDoc(void) {
20497    int test_ret = 0;
20498
20499    int mem_base;
20500    xmlDocPtr ret_val;
20501    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20502    int n_version;
20503
20504    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20505        mem_base = xmlMemBlocks();
20506        version = gen_const_xmlChar_ptr(n_version, 0);
20507
20508        ret_val = xmlNewDoc((const xmlChar *)version);
20509        desret_xmlDocPtr(ret_val);
20510        call_tests++;
20511        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20512        xmlResetLastError();
20513        if (mem_base != xmlMemBlocks()) {
20514            printf("Leak of %d blocks found in xmlNewDoc",
20515	           xmlMemBlocks() - mem_base);
20516	    test_ret++;
20517            printf(" %d", n_version);
20518            printf("\n");
20519        }
20520    }
20521    function_tests++;
20522
20523    return(test_ret);
20524}
20525
20526
20527static int
20528test_xmlNewDocComment(void) {
20529    int test_ret = 0;
20530
20531    int mem_base;
20532    xmlNodePtr ret_val;
20533    xmlDocPtr doc; /* the document */
20534    int n_doc;
20535    xmlChar * content; /* the comment content */
20536    int n_content;
20537
20538    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
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        content = gen_const_xmlChar_ptr(n_content, 1);
20543
20544        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20545        desret_xmlNodePtr(ret_val);
20546        call_tests++;
20547        des_xmlDocPtr(n_doc, doc, 0);
20548        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20549        xmlResetLastError();
20550        if (mem_base != xmlMemBlocks()) {
20551            printf("Leak of %d blocks found in xmlNewDocComment",
20552	           xmlMemBlocks() - mem_base);
20553	    test_ret++;
20554            printf(" %d", n_doc);
20555            printf(" %d", n_content);
20556            printf("\n");
20557        }
20558    }
20559    }
20560    function_tests++;
20561
20562    return(test_ret);
20563}
20564
20565
20566static int
20567test_xmlNewDocFragment(void) {
20568    int test_ret = 0;
20569
20570#if defined(LIBXML_TREE_ENABLED)
20571    int mem_base;
20572    xmlNodePtr ret_val;
20573    xmlDocPtr doc; /* the document owning the fragment */
20574    int n_doc;
20575
20576    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20577        mem_base = xmlMemBlocks();
20578        doc = gen_xmlDocPtr(n_doc, 0);
20579
20580        ret_val = xmlNewDocFragment(doc);
20581        desret_xmlNodePtr(ret_val);
20582        call_tests++;
20583        des_xmlDocPtr(n_doc, doc, 0);
20584        xmlResetLastError();
20585        if (mem_base != xmlMemBlocks()) {
20586            printf("Leak of %d blocks found in xmlNewDocFragment",
20587	           xmlMemBlocks() - mem_base);
20588	    test_ret++;
20589            printf(" %d", n_doc);
20590            printf("\n");
20591        }
20592    }
20593    function_tests++;
20594#endif
20595
20596    return(test_ret);
20597}
20598
20599
20600static int
20601test_xmlNewDocNode(void) {
20602    int test_ret = 0;
20603
20604    int mem_base;
20605    xmlNodePtr ret_val;
20606    xmlDocPtr doc; /* the document */
20607    int n_doc;
20608    xmlNsPtr ns; /* namespace if any */
20609    int n_ns;
20610    xmlChar * name; /* the node name */
20611    int n_name;
20612    xmlChar * content; /* the XML text content if any */
20613    int n_content;
20614
20615    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20616    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20617    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20618    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20619        mem_base = xmlMemBlocks();
20620        doc = gen_xmlDocPtr(n_doc, 0);
20621        ns = gen_xmlNsPtr(n_ns, 1);
20622        name = gen_const_xmlChar_ptr(n_name, 2);
20623        content = gen_const_xmlChar_ptr(n_content, 3);
20624
20625        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20626        desret_xmlNodePtr(ret_val);
20627        call_tests++;
20628        des_xmlDocPtr(n_doc, doc, 0);
20629        des_xmlNsPtr(n_ns, ns, 1);
20630        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20631        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20632        xmlResetLastError();
20633        if (mem_base != xmlMemBlocks()) {
20634            printf("Leak of %d blocks found in xmlNewDocNode",
20635	           xmlMemBlocks() - mem_base);
20636	    test_ret++;
20637            printf(" %d", n_doc);
20638            printf(" %d", n_ns);
20639            printf(" %d", n_name);
20640            printf(" %d", n_content);
20641            printf("\n");
20642        }
20643    }
20644    }
20645    }
20646    }
20647    function_tests++;
20648
20649    return(test_ret);
20650}
20651
20652
20653static int
20654test_xmlNewDocNodeEatName(void) {
20655    int test_ret = 0;
20656
20657    int mem_base;
20658    xmlNodePtr ret_val;
20659    xmlDocPtr doc; /* the document */
20660    int n_doc;
20661    xmlNsPtr ns; /* namespace if any */
20662    int n_ns;
20663    xmlChar * name; /* the node name */
20664    int n_name;
20665    xmlChar * content; /* the XML text content if any */
20666    int n_content;
20667
20668    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20669    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20670    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20671    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20672        mem_base = xmlMemBlocks();
20673        doc = gen_xmlDocPtr(n_doc, 0);
20674        ns = gen_xmlNsPtr(n_ns, 1);
20675        name = gen_eaten_name(n_name, 2);
20676        content = gen_const_xmlChar_ptr(n_content, 3);
20677
20678        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
20679        desret_xmlNodePtr(ret_val);
20680        call_tests++;
20681        des_xmlDocPtr(n_doc, doc, 0);
20682        des_xmlNsPtr(n_ns, ns, 1);
20683        des_eaten_name(n_name, name, 2);
20684        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20685        xmlResetLastError();
20686        if (mem_base != xmlMemBlocks()) {
20687            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20688	           xmlMemBlocks() - mem_base);
20689	    test_ret++;
20690            printf(" %d", n_doc);
20691            printf(" %d", n_ns);
20692            printf(" %d", n_name);
20693            printf(" %d", n_content);
20694            printf("\n");
20695        }
20696    }
20697    }
20698    }
20699    }
20700    function_tests++;
20701
20702    return(test_ret);
20703}
20704
20705
20706static int
20707test_xmlNewDocPI(void) {
20708    int test_ret = 0;
20709
20710    int mem_base;
20711    xmlNodePtr ret_val;
20712    xmlDocPtr doc; /* the target document */
20713    int n_doc;
20714    xmlChar * name; /* the processing instruction name */
20715    int n_name;
20716    xmlChar * content; /* the PI content */
20717    int n_content;
20718
20719    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20720    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20721    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20722        mem_base = xmlMemBlocks();
20723        doc = gen_xmlDocPtr(n_doc, 0);
20724        name = gen_const_xmlChar_ptr(n_name, 1);
20725        content = gen_const_xmlChar_ptr(n_content, 2);
20726
20727        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
20728        desret_xmlNodePtr(ret_val);
20729        call_tests++;
20730        des_xmlDocPtr(n_doc, doc, 0);
20731        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20732        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
20733        xmlResetLastError();
20734        if (mem_base != xmlMemBlocks()) {
20735            printf("Leak of %d blocks found in xmlNewDocPI",
20736	           xmlMemBlocks() - mem_base);
20737	    test_ret++;
20738            printf(" %d", n_doc);
20739            printf(" %d", n_name);
20740            printf(" %d", n_content);
20741            printf("\n");
20742        }
20743    }
20744    }
20745    }
20746    function_tests++;
20747
20748    return(test_ret);
20749}
20750
20751
20752static int
20753test_xmlNewDocProp(void) {
20754    int test_ret = 0;
20755
20756    int mem_base;
20757    xmlAttrPtr ret_val;
20758    xmlDocPtr doc; /* the document */
20759    int n_doc;
20760    xmlChar * name; /* the name of the attribute */
20761    int n_name;
20762    xmlChar * value; /* the value of the attribute */
20763    int n_value;
20764
20765    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20766    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20767    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20768        mem_base = xmlMemBlocks();
20769        doc = gen_xmlDocPtr(n_doc, 0);
20770        name = gen_const_xmlChar_ptr(n_name, 1);
20771        value = gen_const_xmlChar_ptr(n_value, 2);
20772
20773        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
20774        desret_xmlAttrPtr(ret_val);
20775        call_tests++;
20776        des_xmlDocPtr(n_doc, doc, 0);
20777        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20778        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20779        xmlResetLastError();
20780        if (mem_base != xmlMemBlocks()) {
20781            printf("Leak of %d blocks found in xmlNewDocProp",
20782	           xmlMemBlocks() - mem_base);
20783	    test_ret++;
20784            printf(" %d", n_doc);
20785            printf(" %d", n_name);
20786            printf(" %d", n_value);
20787            printf("\n");
20788        }
20789    }
20790    }
20791    }
20792    function_tests++;
20793
20794    return(test_ret);
20795}
20796
20797
20798static int
20799test_xmlNewDocRawNode(void) {
20800    int test_ret = 0;
20801
20802#if defined(LIBXML_TREE_ENABLED)
20803#ifdef LIBXML_TREE_ENABLED
20804    int mem_base;
20805    xmlNodePtr ret_val;
20806    xmlDocPtr doc; /* the document */
20807    int n_doc;
20808    xmlNsPtr ns; /* namespace if any */
20809    int n_ns;
20810    xmlChar * name; /* the node name */
20811    int n_name;
20812    xmlChar * content; /* the text content if any */
20813    int n_content;
20814
20815    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20816    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20817    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20818    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20819        mem_base = xmlMemBlocks();
20820        doc = gen_xmlDocPtr(n_doc, 0);
20821        ns = gen_xmlNsPtr(n_ns, 1);
20822        name = gen_const_xmlChar_ptr(n_name, 2);
20823        content = gen_const_xmlChar_ptr(n_content, 3);
20824
20825        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20826        desret_xmlNodePtr(ret_val);
20827        call_tests++;
20828        des_xmlDocPtr(n_doc, doc, 0);
20829        des_xmlNsPtr(n_ns, ns, 1);
20830        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20831        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20832        xmlResetLastError();
20833        if (mem_base != xmlMemBlocks()) {
20834            printf("Leak of %d blocks found in xmlNewDocRawNode",
20835	           xmlMemBlocks() - mem_base);
20836	    test_ret++;
20837            printf(" %d", n_doc);
20838            printf(" %d", n_ns);
20839            printf(" %d", n_name);
20840            printf(" %d", n_content);
20841            printf("\n");
20842        }
20843    }
20844    }
20845    }
20846    }
20847    function_tests++;
20848#endif
20849#endif
20850
20851    return(test_ret);
20852}
20853
20854
20855static int
20856test_xmlNewDocText(void) {
20857    int test_ret = 0;
20858
20859    int mem_base;
20860    xmlNodePtr ret_val;
20861    xmlDocPtr doc; /* the document */
20862    int n_doc;
20863    xmlChar * content; /* the text content */
20864    int n_content;
20865
20866    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20867    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20868        mem_base = xmlMemBlocks();
20869        doc = gen_xmlDocPtr(n_doc, 0);
20870        content = gen_const_xmlChar_ptr(n_content, 1);
20871
20872        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
20873        desret_xmlNodePtr(ret_val);
20874        call_tests++;
20875        des_xmlDocPtr(n_doc, doc, 0);
20876        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20877        xmlResetLastError();
20878        if (mem_base != xmlMemBlocks()) {
20879            printf("Leak of %d blocks found in xmlNewDocText",
20880	           xmlMemBlocks() - mem_base);
20881	    test_ret++;
20882            printf(" %d", n_doc);
20883            printf(" %d", n_content);
20884            printf("\n");
20885        }
20886    }
20887    }
20888    function_tests++;
20889
20890    return(test_ret);
20891}
20892
20893
20894static int
20895test_xmlNewDocTextLen(void) {
20896    int test_ret = 0;
20897
20898    int mem_base;
20899    xmlNodePtr ret_val;
20900    xmlDocPtr doc; /* the document */
20901    int n_doc;
20902    xmlChar * content; /* the text content */
20903    int n_content;
20904    int len; /* the text len. */
20905    int n_len;
20906
20907    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20908    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20909    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20910        mem_base = xmlMemBlocks();
20911        doc = gen_xmlDocPtr(n_doc, 0);
20912        content = gen_const_xmlChar_ptr(n_content, 1);
20913        len = gen_int(n_len, 2);
20914
20915        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
20916        desret_xmlNodePtr(ret_val);
20917        call_tests++;
20918        des_xmlDocPtr(n_doc, doc, 0);
20919        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20920        des_int(n_len, len, 2);
20921        xmlResetLastError();
20922        if (mem_base != xmlMemBlocks()) {
20923            printf("Leak of %d blocks found in xmlNewDocTextLen",
20924	           xmlMemBlocks() - mem_base);
20925	    test_ret++;
20926            printf(" %d", n_doc);
20927            printf(" %d", n_content);
20928            printf(" %d", n_len);
20929            printf("\n");
20930        }
20931    }
20932    }
20933    }
20934    function_tests++;
20935
20936    return(test_ret);
20937}
20938
20939
20940static int
20941test_xmlNewDtd(void) {
20942    int test_ret = 0;
20943
20944    int mem_base;
20945    xmlDtdPtr ret_val;
20946    xmlDocPtr doc; /* the document pointer */
20947    int n_doc;
20948    xmlChar * name; /* the DTD name */
20949    int n_name;
20950    xmlChar * ExternalID; /* the external ID */
20951    int n_ExternalID;
20952    xmlChar * SystemID; /* the system ID */
20953    int n_SystemID;
20954
20955    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20956    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20957    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20958    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20959        mem_base = xmlMemBlocks();
20960        doc = gen_xmlDocPtr(n_doc, 0);
20961        name = gen_const_xmlChar_ptr(n_name, 1);
20962        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20963        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20964
20965        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
20966        desret_xmlDtdPtr(ret_val);
20967        call_tests++;
20968        des_xmlDocPtr(n_doc, doc, 0);
20969        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20970        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
20971        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
20972        xmlResetLastError();
20973        if (mem_base != xmlMemBlocks()) {
20974            printf("Leak of %d blocks found in xmlNewDtd",
20975	           xmlMemBlocks() - mem_base);
20976	    test_ret++;
20977            printf(" %d", n_doc);
20978            printf(" %d", n_name);
20979            printf(" %d", n_ExternalID);
20980            printf(" %d", n_SystemID);
20981            printf("\n");
20982        }
20983    }
20984    }
20985    }
20986    }
20987    function_tests++;
20988
20989    return(test_ret);
20990}
20991
20992
20993static int
20994test_xmlNewNode(void) {
20995    int test_ret = 0;
20996
20997    int mem_base;
20998    xmlNodePtr ret_val;
20999    xmlNsPtr ns; /* namespace if any */
21000    int n_ns;
21001    xmlChar * name; /* the node name */
21002    int n_name;
21003
21004    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21005    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21006        mem_base = xmlMemBlocks();
21007        ns = gen_xmlNsPtr(n_ns, 0);
21008        name = gen_const_xmlChar_ptr(n_name, 1);
21009
21010        ret_val = xmlNewNode(ns, (const xmlChar *)name);
21011        desret_xmlNodePtr(ret_val);
21012        call_tests++;
21013        des_xmlNsPtr(n_ns, ns, 0);
21014        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21015        xmlResetLastError();
21016        if (mem_base != xmlMemBlocks()) {
21017            printf("Leak of %d blocks found in xmlNewNode",
21018	           xmlMemBlocks() - mem_base);
21019	    test_ret++;
21020            printf(" %d", n_ns);
21021            printf(" %d", n_name);
21022            printf("\n");
21023        }
21024    }
21025    }
21026    function_tests++;
21027
21028    return(test_ret);
21029}
21030
21031
21032static int
21033test_xmlNewNodeEatName(void) {
21034    int test_ret = 0;
21035
21036    int mem_base;
21037    xmlNodePtr ret_val;
21038    xmlNsPtr ns; /* namespace if any */
21039    int n_ns;
21040    xmlChar * name; /* the node name */
21041    int n_name;
21042
21043    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21044    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21045        mem_base = xmlMemBlocks();
21046        ns = gen_xmlNsPtr(n_ns, 0);
21047        name = gen_eaten_name(n_name, 1);
21048
21049        ret_val = xmlNewNodeEatName(ns, name);
21050        desret_xmlNodePtr(ret_val);
21051        call_tests++;
21052        des_xmlNsPtr(n_ns, ns, 0);
21053        des_eaten_name(n_name, name, 1);
21054        xmlResetLastError();
21055        if (mem_base != xmlMemBlocks()) {
21056            printf("Leak of %d blocks found in xmlNewNodeEatName",
21057	           xmlMemBlocks() - mem_base);
21058	    test_ret++;
21059            printf(" %d", n_ns);
21060            printf(" %d", n_name);
21061            printf("\n");
21062        }
21063    }
21064    }
21065    function_tests++;
21066
21067    return(test_ret);
21068}
21069
21070
21071static int
21072test_xmlNewNs(void) {
21073    int test_ret = 0;
21074
21075    int mem_base;
21076    xmlNsPtr ret_val;
21077    xmlNodePtr node; /* the element carrying the namespace */
21078    int n_node;
21079    xmlChar * href; /* the URI associated */
21080    int n_href;
21081    xmlChar * prefix; /* the prefix for the namespace */
21082    int n_prefix;
21083
21084    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21085    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21086    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21087        mem_base = xmlMemBlocks();
21088        node = gen_xmlNodePtr(n_node, 0);
21089        href = gen_const_xmlChar_ptr(n_href, 1);
21090        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21091
21092        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21093        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21094        desret_xmlNsPtr(ret_val);
21095        call_tests++;
21096        des_xmlNodePtr(n_node, node, 0);
21097        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21098        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21099        xmlResetLastError();
21100        if (mem_base != xmlMemBlocks()) {
21101            printf("Leak of %d blocks found in xmlNewNs",
21102	           xmlMemBlocks() - mem_base);
21103	    test_ret++;
21104            printf(" %d", n_node);
21105            printf(" %d", n_href);
21106            printf(" %d", n_prefix);
21107            printf("\n");
21108        }
21109    }
21110    }
21111    }
21112    function_tests++;
21113
21114    return(test_ret);
21115}
21116
21117
21118static int
21119test_xmlNewNsProp(void) {
21120    int test_ret = 0;
21121
21122    int mem_base;
21123    xmlAttrPtr ret_val;
21124    xmlNodePtr node; /* the holding node */
21125    int n_node;
21126    xmlNsPtr ns; /* the namespace */
21127    int n_ns;
21128    xmlChar * name; /* the name of the attribute */
21129    int n_name;
21130    xmlChar * value; /* the value of the attribute */
21131    int n_value;
21132
21133    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21134    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21135    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21136    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21137        mem_base = xmlMemBlocks();
21138        node = gen_xmlNodePtr(n_node, 0);
21139        ns = gen_xmlNsPtr(n_ns, 1);
21140        name = gen_const_xmlChar_ptr(n_name, 2);
21141        value = gen_const_xmlChar_ptr(n_value, 3);
21142
21143        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21144        desret_xmlAttrPtr(ret_val);
21145        call_tests++;
21146        des_xmlNodePtr(n_node, node, 0);
21147        des_xmlNsPtr(n_ns, ns, 1);
21148        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21149        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21150        xmlResetLastError();
21151        if (mem_base != xmlMemBlocks()) {
21152            printf("Leak of %d blocks found in xmlNewNsProp",
21153	           xmlMemBlocks() - mem_base);
21154	    test_ret++;
21155            printf(" %d", n_node);
21156            printf(" %d", n_ns);
21157            printf(" %d", n_name);
21158            printf(" %d", n_value);
21159            printf("\n");
21160        }
21161    }
21162    }
21163    }
21164    }
21165    function_tests++;
21166
21167    return(test_ret);
21168}
21169
21170
21171static int
21172test_xmlNewNsPropEatName(void) {
21173    int test_ret = 0;
21174
21175    int mem_base;
21176    xmlAttrPtr ret_val;
21177    xmlNodePtr node; /* the holding node */
21178    int n_node;
21179    xmlNsPtr ns; /* the namespace */
21180    int n_ns;
21181    xmlChar * name; /* the name of the attribute */
21182    int n_name;
21183    xmlChar * value; /* the value of the attribute */
21184    int n_value;
21185
21186    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21187    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21188    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21189    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21190        mem_base = xmlMemBlocks();
21191        node = gen_xmlNodePtr(n_node, 0);
21192        ns = gen_xmlNsPtr(n_ns, 1);
21193        name = gen_eaten_name(n_name, 2);
21194        value = gen_const_xmlChar_ptr(n_value, 3);
21195
21196        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21197        desret_xmlAttrPtr(ret_val);
21198        call_tests++;
21199        des_xmlNodePtr(n_node, node, 0);
21200        des_xmlNsPtr(n_ns, ns, 1);
21201        des_eaten_name(n_name, name, 2);
21202        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21203        xmlResetLastError();
21204        if (mem_base != xmlMemBlocks()) {
21205            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21206	           xmlMemBlocks() - mem_base);
21207	    test_ret++;
21208            printf(" %d", n_node);
21209            printf(" %d", n_ns);
21210            printf(" %d", n_name);
21211            printf(" %d", n_value);
21212            printf("\n");
21213        }
21214    }
21215    }
21216    }
21217    }
21218    function_tests++;
21219
21220    return(test_ret);
21221}
21222
21223
21224static int
21225test_xmlNewPI(void) {
21226    int test_ret = 0;
21227
21228    int mem_base;
21229    xmlNodePtr ret_val;
21230    xmlChar * name; /* the processing instruction name */
21231    int n_name;
21232    xmlChar * content; /* the PI content */
21233    int n_content;
21234
21235    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21236    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21237        mem_base = xmlMemBlocks();
21238        name = gen_const_xmlChar_ptr(n_name, 0);
21239        content = gen_const_xmlChar_ptr(n_content, 1);
21240
21241        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21242        desret_xmlNodePtr(ret_val);
21243        call_tests++;
21244        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21245        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21246        xmlResetLastError();
21247        if (mem_base != xmlMemBlocks()) {
21248            printf("Leak of %d blocks found in xmlNewPI",
21249	           xmlMemBlocks() - mem_base);
21250	    test_ret++;
21251            printf(" %d", n_name);
21252            printf(" %d", n_content);
21253            printf("\n");
21254        }
21255    }
21256    }
21257    function_tests++;
21258
21259    return(test_ret);
21260}
21261
21262
21263static int
21264test_xmlNewProp(void) {
21265    int test_ret = 0;
21266
21267#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21268#ifdef LIBXML_TREE_ENABLED
21269    int mem_base;
21270    xmlAttrPtr ret_val;
21271    xmlNodePtr node; /* the holding node */
21272    int n_node;
21273    xmlChar * name; /* the name of the attribute */
21274    int n_name;
21275    xmlChar * value; /* the value of the attribute */
21276    int n_value;
21277
21278    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21279    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21280    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21281        mem_base = xmlMemBlocks();
21282        node = gen_xmlNodePtr(n_node, 0);
21283        name = gen_const_xmlChar_ptr(n_name, 1);
21284        value = gen_const_xmlChar_ptr(n_value, 2);
21285
21286        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21287        desret_xmlAttrPtr(ret_val);
21288        call_tests++;
21289        des_xmlNodePtr(n_node, node, 0);
21290        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21291        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21292        xmlResetLastError();
21293        if (mem_base != xmlMemBlocks()) {
21294            printf("Leak of %d blocks found in xmlNewProp",
21295	           xmlMemBlocks() - mem_base);
21296	    test_ret++;
21297            printf(" %d", n_node);
21298            printf(" %d", n_name);
21299            printf(" %d", n_value);
21300            printf("\n");
21301        }
21302    }
21303    }
21304    }
21305    function_tests++;
21306#endif
21307#endif
21308
21309    return(test_ret);
21310}
21311
21312
21313static int
21314test_xmlNewReference(void) {
21315    int test_ret = 0;
21316
21317    int mem_base;
21318    xmlNodePtr ret_val;
21319    xmlDocPtr doc; /* the document */
21320    int n_doc;
21321    xmlChar * name; /* the reference name, or the reference string with & and ; */
21322    int n_name;
21323
21324    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21325    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21326        mem_base = xmlMemBlocks();
21327        doc = gen_xmlDocPtr(n_doc, 0);
21328        name = gen_const_xmlChar_ptr(n_name, 1);
21329
21330        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21331        desret_xmlNodePtr(ret_val);
21332        call_tests++;
21333        des_xmlDocPtr(n_doc, doc, 0);
21334        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21335        xmlResetLastError();
21336        if (mem_base != xmlMemBlocks()) {
21337            printf("Leak of %d blocks found in xmlNewReference",
21338	           xmlMemBlocks() - mem_base);
21339	    test_ret++;
21340            printf(" %d", n_doc);
21341            printf(" %d", n_name);
21342            printf("\n");
21343        }
21344    }
21345    }
21346    function_tests++;
21347
21348    return(test_ret);
21349}
21350
21351
21352static int
21353test_xmlNewText(void) {
21354    int test_ret = 0;
21355
21356    int mem_base;
21357    xmlNodePtr ret_val;
21358    xmlChar * content; /* the text content */
21359    int n_content;
21360
21361    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21362        mem_base = xmlMemBlocks();
21363        content = gen_const_xmlChar_ptr(n_content, 0);
21364
21365        ret_val = xmlNewText((const xmlChar *)content);
21366        desret_xmlNodePtr(ret_val);
21367        call_tests++;
21368        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21369        xmlResetLastError();
21370        if (mem_base != xmlMemBlocks()) {
21371            printf("Leak of %d blocks found in xmlNewText",
21372	           xmlMemBlocks() - mem_base);
21373	    test_ret++;
21374            printf(" %d", n_content);
21375            printf("\n");
21376        }
21377    }
21378    function_tests++;
21379
21380    return(test_ret);
21381}
21382
21383
21384static int
21385test_xmlNewTextChild(void) {
21386    int test_ret = 0;
21387
21388#if defined(LIBXML_TREE_ENABLED)
21389#ifdef LIBXML_TREE_ENABLED
21390    int mem_base;
21391    xmlNodePtr ret_val;
21392    xmlNodePtr parent; /* the parent node */
21393    int n_parent;
21394    xmlNsPtr ns; /* a namespace if any */
21395    int n_ns;
21396    xmlChar * name; /* the name of the child */
21397    int n_name;
21398    xmlChar * content; /* the text content of the child if any. */
21399    int n_content;
21400
21401    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21402    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21403    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21404    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21405        mem_base = xmlMemBlocks();
21406        parent = gen_xmlNodePtr(n_parent, 0);
21407        ns = gen_xmlNsPtr(n_ns, 1);
21408        name = gen_const_xmlChar_ptr(n_name, 2);
21409        content = gen_const_xmlChar_ptr(n_content, 3);
21410
21411        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21412        desret_xmlNodePtr(ret_val);
21413        call_tests++;
21414        des_xmlNodePtr(n_parent, parent, 0);
21415        des_xmlNsPtr(n_ns, ns, 1);
21416        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21417        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21418        xmlResetLastError();
21419        if (mem_base != xmlMemBlocks()) {
21420            printf("Leak of %d blocks found in xmlNewTextChild",
21421	           xmlMemBlocks() - mem_base);
21422	    test_ret++;
21423            printf(" %d", n_parent);
21424            printf(" %d", n_ns);
21425            printf(" %d", n_name);
21426            printf(" %d", n_content);
21427            printf("\n");
21428        }
21429    }
21430    }
21431    }
21432    }
21433    function_tests++;
21434#endif
21435#endif
21436
21437    return(test_ret);
21438}
21439
21440
21441static int
21442test_xmlNewTextLen(void) {
21443    int test_ret = 0;
21444
21445    int mem_base;
21446    xmlNodePtr ret_val;
21447    xmlChar * content; /* the text content */
21448    int n_content;
21449    int len; /* the text len. */
21450    int n_len;
21451
21452    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21453    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21454        mem_base = xmlMemBlocks();
21455        content = gen_const_xmlChar_ptr(n_content, 0);
21456        len = gen_int(n_len, 1);
21457
21458        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21459        desret_xmlNodePtr(ret_val);
21460        call_tests++;
21461        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21462        des_int(n_len, len, 1);
21463        xmlResetLastError();
21464        if (mem_base != xmlMemBlocks()) {
21465            printf("Leak of %d blocks found in xmlNewTextLen",
21466	           xmlMemBlocks() - mem_base);
21467	    test_ret++;
21468            printf(" %d", n_content);
21469            printf(" %d", n_len);
21470            printf("\n");
21471        }
21472    }
21473    }
21474    function_tests++;
21475
21476    return(test_ret);
21477}
21478
21479
21480static int
21481test_xmlNodeAddContent(void) {
21482    int test_ret = 0;
21483
21484    int mem_base;
21485    xmlNodePtr cur; /* the node being modified */
21486    int n_cur;
21487    xmlChar * content; /* extra content */
21488    int n_content;
21489
21490    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21491    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21492        mem_base = xmlMemBlocks();
21493        cur = gen_xmlNodePtr(n_cur, 0);
21494        content = gen_const_xmlChar_ptr(n_content, 1);
21495
21496        xmlNodeAddContent(cur, (const xmlChar *)content);
21497        call_tests++;
21498        des_xmlNodePtr(n_cur, cur, 0);
21499        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21500        xmlResetLastError();
21501        if (mem_base != xmlMemBlocks()) {
21502            printf("Leak of %d blocks found in xmlNodeAddContent",
21503	           xmlMemBlocks() - mem_base);
21504	    test_ret++;
21505            printf(" %d", n_cur);
21506            printf(" %d", n_content);
21507            printf("\n");
21508        }
21509    }
21510    }
21511    function_tests++;
21512
21513    return(test_ret);
21514}
21515
21516
21517static int
21518test_xmlNodeAddContentLen(void) {
21519    int test_ret = 0;
21520
21521    int mem_base;
21522    xmlNodePtr cur; /* the node being modified */
21523    int n_cur;
21524    xmlChar * content; /* extra content */
21525    int n_content;
21526    int len; /* the size of @content */
21527    int n_len;
21528
21529    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21530    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21531    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21532        mem_base = xmlMemBlocks();
21533        cur = gen_xmlNodePtr(n_cur, 0);
21534        content = gen_const_xmlChar_ptr(n_content, 1);
21535        len = gen_int(n_len, 2);
21536
21537        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21538        call_tests++;
21539        des_xmlNodePtr(n_cur, cur, 0);
21540        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21541        des_int(n_len, len, 2);
21542        xmlResetLastError();
21543        if (mem_base != xmlMemBlocks()) {
21544            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21545	           xmlMemBlocks() - mem_base);
21546	    test_ret++;
21547            printf(" %d", n_cur);
21548            printf(" %d", n_content);
21549            printf(" %d", n_len);
21550            printf("\n");
21551        }
21552    }
21553    }
21554    }
21555    function_tests++;
21556
21557    return(test_ret);
21558}
21559
21560
21561static int
21562test_xmlNodeBufGetContent(void) {
21563    int test_ret = 0;
21564
21565    int mem_base;
21566    int ret_val;
21567    xmlBufferPtr buffer; /* a buffer */
21568    int n_buffer;
21569    xmlNodePtr cur; /* the node being read */
21570    int n_cur;
21571
21572    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21573    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21574        mem_base = xmlMemBlocks();
21575        buffer = gen_xmlBufferPtr(n_buffer, 0);
21576        cur = gen_xmlNodePtr(n_cur, 1);
21577
21578        ret_val = xmlNodeBufGetContent(buffer, cur);
21579        desret_int(ret_val);
21580        call_tests++;
21581        des_xmlBufferPtr(n_buffer, buffer, 0);
21582        des_xmlNodePtr(n_cur, cur, 1);
21583        xmlResetLastError();
21584        if (mem_base != xmlMemBlocks()) {
21585            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21586	           xmlMemBlocks() - mem_base);
21587	    test_ret++;
21588            printf(" %d", n_buffer);
21589            printf(" %d", n_cur);
21590            printf("\n");
21591        }
21592    }
21593    }
21594    function_tests++;
21595
21596    return(test_ret);
21597}
21598
21599
21600static int
21601test_xmlNodeDump(void) {
21602    int test_ret = 0;
21603
21604#if defined(LIBXML_OUTPUT_ENABLED)
21605    int mem_base;
21606    int ret_val;
21607    xmlBufferPtr buf; /* the XML buffer output */
21608    int n_buf;
21609    xmlDocPtr doc; /* the document */
21610    int n_doc;
21611    xmlNodePtr cur; /* the current node */
21612    int n_cur;
21613    int level; /* the imbrication level for indenting */
21614    int n_level;
21615    int format; /* is formatting allowed */
21616    int n_format;
21617
21618    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21619    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21620    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21621    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21622    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21623        mem_base = xmlMemBlocks();
21624        buf = gen_xmlBufferPtr(n_buf, 0);
21625        doc = gen_xmlDocPtr(n_doc, 1);
21626        cur = gen_xmlNodePtr(n_cur, 2);
21627        level = gen_int(n_level, 3);
21628        format = gen_int(n_format, 4);
21629
21630        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21631        desret_int(ret_val);
21632        call_tests++;
21633        des_xmlBufferPtr(n_buf, buf, 0);
21634        des_xmlDocPtr(n_doc, doc, 1);
21635        des_xmlNodePtr(n_cur, cur, 2);
21636        des_int(n_level, level, 3);
21637        des_int(n_format, format, 4);
21638        xmlResetLastError();
21639        if (mem_base != xmlMemBlocks()) {
21640            printf("Leak of %d blocks found in xmlNodeDump",
21641	           xmlMemBlocks() - mem_base);
21642	    test_ret++;
21643            printf(" %d", n_buf);
21644            printf(" %d", n_doc);
21645            printf(" %d", n_cur);
21646            printf(" %d", n_level);
21647            printf(" %d", n_format);
21648            printf("\n");
21649        }
21650    }
21651    }
21652    }
21653    }
21654    }
21655    function_tests++;
21656#endif
21657
21658    return(test_ret);
21659}
21660
21661
21662static int
21663test_xmlNodeDumpOutput(void) {
21664    int test_ret = 0;
21665
21666#if defined(LIBXML_OUTPUT_ENABLED)
21667    int mem_base;
21668    xmlOutputBufferPtr buf; /* the XML buffer output */
21669    int n_buf;
21670    xmlDocPtr doc; /* the document */
21671    int n_doc;
21672    xmlNodePtr cur; /* the current node */
21673    int n_cur;
21674    int level; /* the imbrication level for indenting */
21675    int n_level;
21676    int format; /* is formatting allowed */
21677    int n_format;
21678    char * encoding; /* an optional encoding string */
21679    int n_encoding;
21680
21681    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21682    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21683    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21684    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21685    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21686    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21687        mem_base = xmlMemBlocks();
21688        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21689        doc = gen_xmlDocPtr(n_doc, 1);
21690        cur = gen_xmlNodePtr(n_cur, 2);
21691        level = gen_int(n_level, 3);
21692        format = gen_int(n_format, 4);
21693        encoding = gen_const_char_ptr(n_encoding, 5);
21694
21695        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
21696        call_tests++;
21697        des_xmlOutputBufferPtr(n_buf, buf, 0);
21698        des_xmlDocPtr(n_doc, doc, 1);
21699        des_xmlNodePtr(n_cur, cur, 2);
21700        des_int(n_level, level, 3);
21701        des_int(n_format, format, 4);
21702        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
21703        xmlResetLastError();
21704        if (mem_base != xmlMemBlocks()) {
21705            printf("Leak of %d blocks found in xmlNodeDumpOutput",
21706	           xmlMemBlocks() - mem_base);
21707	    test_ret++;
21708            printf(" %d", n_buf);
21709            printf(" %d", n_doc);
21710            printf(" %d", n_cur);
21711            printf(" %d", n_level);
21712            printf(" %d", n_format);
21713            printf(" %d", n_encoding);
21714            printf("\n");
21715        }
21716    }
21717    }
21718    }
21719    }
21720    }
21721    }
21722    function_tests++;
21723#endif
21724
21725    return(test_ret);
21726}
21727
21728
21729static int
21730test_xmlNodeGetBase(void) {
21731    int test_ret = 0;
21732
21733    int mem_base;
21734    xmlChar * ret_val;
21735    xmlDocPtr doc; /* the document the node pertains to */
21736    int n_doc;
21737    xmlNodePtr cur; /* the node being checked */
21738    int n_cur;
21739
21740    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21741    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21742        mem_base = xmlMemBlocks();
21743        doc = gen_xmlDocPtr(n_doc, 0);
21744        cur = gen_xmlNodePtr(n_cur, 1);
21745
21746        ret_val = xmlNodeGetBase(doc, cur);
21747        desret_xmlChar_ptr(ret_val);
21748        call_tests++;
21749        des_xmlDocPtr(n_doc, doc, 0);
21750        des_xmlNodePtr(n_cur, cur, 1);
21751        xmlResetLastError();
21752        if (mem_base != xmlMemBlocks()) {
21753            printf("Leak of %d blocks found in xmlNodeGetBase",
21754	           xmlMemBlocks() - mem_base);
21755	    test_ret++;
21756            printf(" %d", n_doc);
21757            printf(" %d", n_cur);
21758            printf("\n");
21759        }
21760    }
21761    }
21762    function_tests++;
21763
21764    return(test_ret);
21765}
21766
21767
21768static int
21769test_xmlNodeGetContent(void) {
21770    int test_ret = 0;
21771
21772    int mem_base;
21773    xmlChar * ret_val;
21774    xmlNodePtr cur; /* the node being read */
21775    int n_cur;
21776
21777    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21778        mem_base = xmlMemBlocks();
21779        cur = gen_xmlNodePtr(n_cur, 0);
21780
21781        ret_val = xmlNodeGetContent(cur);
21782        desret_xmlChar_ptr(ret_val);
21783        call_tests++;
21784        des_xmlNodePtr(n_cur, cur, 0);
21785        xmlResetLastError();
21786        if (mem_base != xmlMemBlocks()) {
21787            printf("Leak of %d blocks found in xmlNodeGetContent",
21788	           xmlMemBlocks() - mem_base);
21789	    test_ret++;
21790            printf(" %d", n_cur);
21791            printf("\n");
21792        }
21793    }
21794    function_tests++;
21795
21796    return(test_ret);
21797}
21798
21799
21800static int
21801test_xmlNodeGetLang(void) {
21802    int test_ret = 0;
21803
21804    int mem_base;
21805    xmlChar * ret_val;
21806    xmlNodePtr cur; /* the node being checked */
21807    int n_cur;
21808
21809    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21810        mem_base = xmlMemBlocks();
21811        cur = gen_xmlNodePtr(n_cur, 0);
21812
21813        ret_val = xmlNodeGetLang(cur);
21814        desret_xmlChar_ptr(ret_val);
21815        call_tests++;
21816        des_xmlNodePtr(n_cur, cur, 0);
21817        xmlResetLastError();
21818        if (mem_base != xmlMemBlocks()) {
21819            printf("Leak of %d blocks found in xmlNodeGetLang",
21820	           xmlMemBlocks() - mem_base);
21821	    test_ret++;
21822            printf(" %d", n_cur);
21823            printf("\n");
21824        }
21825    }
21826    function_tests++;
21827
21828    return(test_ret);
21829}
21830
21831
21832static int
21833test_xmlNodeGetSpacePreserve(void) {
21834    int test_ret = 0;
21835
21836    int mem_base;
21837    int ret_val;
21838    xmlNodePtr cur; /* the node being checked */
21839    int n_cur;
21840
21841    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21842        mem_base = xmlMemBlocks();
21843        cur = gen_xmlNodePtr(n_cur, 0);
21844
21845        ret_val = xmlNodeGetSpacePreserve(cur);
21846        desret_int(ret_val);
21847        call_tests++;
21848        des_xmlNodePtr(n_cur, cur, 0);
21849        xmlResetLastError();
21850        if (mem_base != xmlMemBlocks()) {
21851            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
21852	           xmlMemBlocks() - mem_base);
21853	    test_ret++;
21854            printf(" %d", n_cur);
21855            printf("\n");
21856        }
21857    }
21858    function_tests++;
21859
21860    return(test_ret);
21861}
21862
21863
21864static int
21865test_xmlNodeIsText(void) {
21866    int test_ret = 0;
21867
21868    int mem_base;
21869    int ret_val;
21870    xmlNodePtr node; /* the node */
21871    int n_node;
21872
21873    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21874        mem_base = xmlMemBlocks();
21875        node = gen_xmlNodePtr(n_node, 0);
21876
21877        ret_val = xmlNodeIsText(node);
21878        desret_int(ret_val);
21879        call_tests++;
21880        des_xmlNodePtr(n_node, node, 0);
21881        xmlResetLastError();
21882        if (mem_base != xmlMemBlocks()) {
21883            printf("Leak of %d blocks found in xmlNodeIsText",
21884	           xmlMemBlocks() - mem_base);
21885	    test_ret++;
21886            printf(" %d", n_node);
21887            printf("\n");
21888        }
21889    }
21890    function_tests++;
21891
21892    return(test_ret);
21893}
21894
21895
21896static int
21897test_xmlNodeListGetRawString(void) {
21898    int test_ret = 0;
21899
21900#if defined(LIBXML_TREE_ENABLED)
21901    int mem_base;
21902    xmlChar * ret_val;
21903    xmlDocPtr doc; /* the document */
21904    int n_doc;
21905    xmlNodePtr list; /* a Node list */
21906    int n_list;
21907    int inLine; /* should we replace entity contents or show their external form */
21908    int n_inLine;
21909
21910    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21911    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21912    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21913        mem_base = xmlMemBlocks();
21914        doc = gen_xmlDocPtr(n_doc, 0);
21915        list = gen_xmlNodePtr(n_list, 1);
21916        inLine = gen_int(n_inLine, 2);
21917
21918        ret_val = xmlNodeListGetRawString(doc, list, inLine);
21919        desret_xmlChar_ptr(ret_val);
21920        call_tests++;
21921        des_xmlDocPtr(n_doc, doc, 0);
21922        des_xmlNodePtr(n_list, list, 1);
21923        des_int(n_inLine, inLine, 2);
21924        xmlResetLastError();
21925        if (mem_base != xmlMemBlocks()) {
21926            printf("Leak of %d blocks found in xmlNodeListGetRawString",
21927	           xmlMemBlocks() - mem_base);
21928	    test_ret++;
21929            printf(" %d", n_doc);
21930            printf(" %d", n_list);
21931            printf(" %d", n_inLine);
21932            printf("\n");
21933        }
21934    }
21935    }
21936    }
21937    function_tests++;
21938#endif
21939
21940    return(test_ret);
21941}
21942
21943
21944static int
21945test_xmlNodeListGetString(void) {
21946    int test_ret = 0;
21947
21948    int mem_base;
21949    xmlChar * ret_val;
21950    xmlDocPtr doc; /* the document */
21951    int n_doc;
21952    xmlNodePtr list; /* a Node list */
21953    int n_list;
21954    int inLine; /* should we replace entity contents or show their external form */
21955    int n_inLine;
21956
21957    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21958    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21959    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21960        mem_base = xmlMemBlocks();
21961        doc = gen_xmlDocPtr(n_doc, 0);
21962        list = gen_xmlNodePtr(n_list, 1);
21963        inLine = gen_int(n_inLine, 2);
21964
21965        ret_val = xmlNodeListGetString(doc, list, inLine);
21966        desret_xmlChar_ptr(ret_val);
21967        call_tests++;
21968        des_xmlDocPtr(n_doc, doc, 0);
21969        des_xmlNodePtr(n_list, list, 1);
21970        des_int(n_inLine, inLine, 2);
21971        xmlResetLastError();
21972        if (mem_base != xmlMemBlocks()) {
21973            printf("Leak of %d blocks found in xmlNodeListGetString",
21974	           xmlMemBlocks() - mem_base);
21975	    test_ret++;
21976            printf(" %d", n_doc);
21977            printf(" %d", n_list);
21978            printf(" %d", n_inLine);
21979            printf("\n");
21980        }
21981    }
21982    }
21983    }
21984    function_tests++;
21985
21986    return(test_ret);
21987}
21988
21989
21990static int
21991test_xmlNodeSetBase(void) {
21992    int test_ret = 0;
21993
21994#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
21995    int mem_base;
21996    xmlNodePtr cur; /* the node being changed */
21997    int n_cur;
21998    xmlChar * uri; /* the new base URI */
21999    int n_uri;
22000
22001    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22002    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22003        mem_base = xmlMemBlocks();
22004        cur = gen_xmlNodePtr(n_cur, 0);
22005        uri = gen_const_xmlChar_ptr(n_uri, 1);
22006
22007        xmlNodeSetBase(cur, (const xmlChar *)uri);
22008        call_tests++;
22009        des_xmlNodePtr(n_cur, cur, 0);
22010        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22011        xmlResetLastError();
22012        if (mem_base != xmlMemBlocks()) {
22013            printf("Leak of %d blocks found in xmlNodeSetBase",
22014	           xmlMemBlocks() - mem_base);
22015	    test_ret++;
22016            printf(" %d", n_cur);
22017            printf(" %d", n_uri);
22018            printf("\n");
22019        }
22020    }
22021    }
22022    function_tests++;
22023#endif
22024
22025    return(test_ret);
22026}
22027
22028
22029static int
22030test_xmlNodeSetContent(void) {
22031    int test_ret = 0;
22032
22033    int mem_base;
22034    xmlNodePtr cur; /* the node being modified */
22035    int n_cur;
22036    xmlChar * content; /* the new value of the content */
22037    int n_content;
22038
22039    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22040    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22041        mem_base = xmlMemBlocks();
22042        cur = gen_xmlNodePtr(n_cur, 0);
22043        content = gen_const_xmlChar_ptr(n_content, 1);
22044
22045        xmlNodeSetContent(cur, (const xmlChar *)content);
22046        call_tests++;
22047        des_xmlNodePtr(n_cur, cur, 0);
22048        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22049        xmlResetLastError();
22050        if (mem_base != xmlMemBlocks()) {
22051            printf("Leak of %d blocks found in xmlNodeSetContent",
22052	           xmlMemBlocks() - mem_base);
22053	    test_ret++;
22054            printf(" %d", n_cur);
22055            printf(" %d", n_content);
22056            printf("\n");
22057        }
22058    }
22059    }
22060    function_tests++;
22061
22062    return(test_ret);
22063}
22064
22065
22066static int
22067test_xmlNodeSetContentLen(void) {
22068    int test_ret = 0;
22069
22070#if defined(LIBXML_TREE_ENABLED)
22071    int mem_base;
22072    xmlNodePtr cur; /* the node being modified */
22073    int n_cur;
22074    xmlChar * content; /* the new value of the content */
22075    int n_content;
22076    int len; /* the size of @content */
22077    int n_len;
22078
22079    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22080    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22081    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22082        mem_base = xmlMemBlocks();
22083        cur = gen_xmlNodePtr(n_cur, 0);
22084        content = gen_const_xmlChar_ptr(n_content, 1);
22085        len = gen_int(n_len, 2);
22086
22087        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22088        call_tests++;
22089        des_xmlNodePtr(n_cur, cur, 0);
22090        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22091        des_int(n_len, len, 2);
22092        xmlResetLastError();
22093        if (mem_base != xmlMemBlocks()) {
22094            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22095	           xmlMemBlocks() - mem_base);
22096	    test_ret++;
22097            printf(" %d", n_cur);
22098            printf(" %d", n_content);
22099            printf(" %d", n_len);
22100            printf("\n");
22101        }
22102    }
22103    }
22104    }
22105    function_tests++;
22106#endif
22107
22108    return(test_ret);
22109}
22110
22111
22112static int
22113test_xmlNodeSetLang(void) {
22114    int test_ret = 0;
22115
22116#if defined(LIBXML_TREE_ENABLED)
22117    int mem_base;
22118    xmlNodePtr cur; /* the node being changed */
22119    int n_cur;
22120    xmlChar * lang; /* the language description */
22121    int n_lang;
22122
22123    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22124    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22125        mem_base = xmlMemBlocks();
22126        cur = gen_xmlNodePtr(n_cur, 0);
22127        lang = gen_const_xmlChar_ptr(n_lang, 1);
22128
22129        xmlNodeSetLang(cur, (const xmlChar *)lang);
22130        call_tests++;
22131        des_xmlNodePtr(n_cur, cur, 0);
22132        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22133        xmlResetLastError();
22134        if (mem_base != xmlMemBlocks()) {
22135            printf("Leak of %d blocks found in xmlNodeSetLang",
22136	           xmlMemBlocks() - mem_base);
22137	    test_ret++;
22138            printf(" %d", n_cur);
22139            printf(" %d", n_lang);
22140            printf("\n");
22141        }
22142    }
22143    }
22144    function_tests++;
22145#endif
22146
22147    return(test_ret);
22148}
22149
22150
22151static int
22152test_xmlNodeSetName(void) {
22153    int test_ret = 0;
22154
22155#if defined(LIBXML_TREE_ENABLED)
22156    int mem_base;
22157    xmlNodePtr cur; /* the node being changed */
22158    int n_cur;
22159    xmlChar * name; /* the new tag name */
22160    int n_name;
22161
22162    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22163    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22164        mem_base = xmlMemBlocks();
22165        cur = gen_xmlNodePtr(n_cur, 0);
22166        name = gen_const_xmlChar_ptr(n_name, 1);
22167
22168        xmlNodeSetName(cur, (const xmlChar *)name);
22169        call_tests++;
22170        des_xmlNodePtr(n_cur, cur, 0);
22171        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22172        xmlResetLastError();
22173        if (mem_base != xmlMemBlocks()) {
22174            printf("Leak of %d blocks found in xmlNodeSetName",
22175	           xmlMemBlocks() - mem_base);
22176	    test_ret++;
22177            printf(" %d", n_cur);
22178            printf(" %d", n_name);
22179            printf("\n");
22180        }
22181    }
22182    }
22183    function_tests++;
22184#endif
22185
22186    return(test_ret);
22187}
22188
22189
22190static int
22191test_xmlNodeSetSpacePreserve(void) {
22192    int test_ret = 0;
22193
22194#if defined(LIBXML_TREE_ENABLED)
22195    int mem_base;
22196    xmlNodePtr cur; /* the node being changed */
22197    int n_cur;
22198    int val; /* the xml:space value ("0": default, 1: "preserve") */
22199    int n_val;
22200
22201    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22202    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22203        mem_base = xmlMemBlocks();
22204        cur = gen_xmlNodePtr(n_cur, 0);
22205        val = gen_int(n_val, 1);
22206
22207        xmlNodeSetSpacePreserve(cur, val);
22208        call_tests++;
22209        des_xmlNodePtr(n_cur, cur, 0);
22210        des_int(n_val, val, 1);
22211        xmlResetLastError();
22212        if (mem_base != xmlMemBlocks()) {
22213            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22214	           xmlMemBlocks() - mem_base);
22215	    test_ret++;
22216            printf(" %d", n_cur);
22217            printf(" %d", n_val);
22218            printf("\n");
22219        }
22220    }
22221    }
22222    function_tests++;
22223#endif
22224
22225    return(test_ret);
22226}
22227
22228
22229static int
22230test_xmlReconciliateNs(void) {
22231    int test_ret = 0;
22232
22233#if defined(LIBXML_TREE_ENABLED)
22234#ifdef LIBXML_TREE_ENABLED
22235    int mem_base;
22236    int ret_val;
22237    xmlDocPtr doc; /* the document */
22238    int n_doc;
22239    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22240    int n_tree;
22241
22242    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22243    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22244        mem_base = xmlMemBlocks();
22245        doc = gen_xmlDocPtr(n_doc, 0);
22246        tree = gen_xmlNodePtr(n_tree, 1);
22247
22248        ret_val = xmlReconciliateNs(doc, tree);
22249        desret_int(ret_val);
22250        call_tests++;
22251        des_xmlDocPtr(n_doc, doc, 0);
22252        des_xmlNodePtr(n_tree, tree, 1);
22253        xmlResetLastError();
22254        if (mem_base != xmlMemBlocks()) {
22255            printf("Leak of %d blocks found in xmlReconciliateNs",
22256	           xmlMemBlocks() - mem_base);
22257	    test_ret++;
22258            printf(" %d", n_doc);
22259            printf(" %d", n_tree);
22260            printf("\n");
22261        }
22262    }
22263    }
22264    function_tests++;
22265#endif
22266#endif
22267
22268    return(test_ret);
22269}
22270
22271
22272static int
22273test_xmlRemoveProp(void) {
22274    int test_ret = 0;
22275
22276#if defined(LIBXML_TREE_ENABLED)
22277    int mem_base;
22278    int ret_val;
22279    xmlAttrPtr cur; /* an attribute */
22280    int n_cur;
22281
22282    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22283        mem_base = xmlMemBlocks();
22284        cur = gen_xmlAttrPtr(n_cur, 0);
22285
22286        ret_val = xmlRemoveProp(cur);
22287        cur = NULL;
22288        desret_int(ret_val);
22289        call_tests++;
22290        des_xmlAttrPtr(n_cur, cur, 0);
22291        xmlResetLastError();
22292        if (mem_base != xmlMemBlocks()) {
22293            printf("Leak of %d blocks found in xmlRemoveProp",
22294	           xmlMemBlocks() - mem_base);
22295	    test_ret++;
22296            printf(" %d", n_cur);
22297            printf("\n");
22298        }
22299    }
22300    function_tests++;
22301#endif
22302
22303    return(test_ret);
22304}
22305
22306
22307static int
22308test_xmlReplaceNode(void) {
22309    int test_ret = 0;
22310
22311#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22312    int mem_base;
22313    xmlNodePtr ret_val;
22314    xmlNodePtr old; /* the old node */
22315    int n_old;
22316    xmlNodePtr cur; /* the node */
22317    int n_cur;
22318
22319    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22320    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22321        mem_base = xmlMemBlocks();
22322        old = gen_xmlNodePtr(n_old, 0);
22323        cur = gen_xmlNodePtr_in(n_cur, 1);
22324
22325        ret_val = xmlReplaceNode(old, cur);
22326        if (cur != NULL) {
22327              xmlUnlinkNode(cur);
22328              xmlFreeNode(cur) ; cur = NULL ; }
22329          if (old != NULL) {
22330              xmlUnlinkNode(old);
22331              xmlFreeNode(old) ; old = NULL ; }
22332	  ret_val = NULL;
22333        desret_xmlNodePtr(ret_val);
22334        call_tests++;
22335        des_xmlNodePtr(n_old, old, 0);
22336        des_xmlNodePtr_in(n_cur, cur, 1);
22337        xmlResetLastError();
22338        if (mem_base != xmlMemBlocks()) {
22339            printf("Leak of %d blocks found in xmlReplaceNode",
22340	           xmlMemBlocks() - mem_base);
22341	    test_ret++;
22342            printf(" %d", n_old);
22343            printf(" %d", n_cur);
22344            printf("\n");
22345        }
22346    }
22347    }
22348    function_tests++;
22349#endif
22350
22351    return(test_ret);
22352}
22353
22354
22355static int
22356test_xmlSaveFile(void) {
22357    int test_ret = 0;
22358
22359#if defined(LIBXML_OUTPUT_ENABLED)
22360    int mem_base;
22361    int ret_val;
22362    const char * filename; /* the filename (or URL) */
22363    int n_filename;
22364    xmlDocPtr cur; /* the document */
22365    int n_cur;
22366
22367    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22368    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22369        mem_base = xmlMemBlocks();
22370        filename = gen_fileoutput(n_filename, 0);
22371        cur = gen_xmlDocPtr(n_cur, 1);
22372
22373        ret_val = xmlSaveFile(filename, cur);
22374        desret_int(ret_val);
22375        call_tests++;
22376        des_fileoutput(n_filename, filename, 0);
22377        des_xmlDocPtr(n_cur, cur, 1);
22378        xmlResetLastError();
22379        if (mem_base != xmlMemBlocks()) {
22380            printf("Leak of %d blocks found in xmlSaveFile",
22381	           xmlMemBlocks() - mem_base);
22382	    test_ret++;
22383            printf(" %d", n_filename);
22384            printf(" %d", n_cur);
22385            printf("\n");
22386        }
22387    }
22388    }
22389    function_tests++;
22390#endif
22391
22392    return(test_ret);
22393}
22394
22395
22396static int
22397test_xmlSaveFileEnc(void) {
22398    int test_ret = 0;
22399
22400#if defined(LIBXML_OUTPUT_ENABLED)
22401    int mem_base;
22402    int ret_val;
22403    const char * filename; /* the filename (or URL) */
22404    int n_filename;
22405    xmlDocPtr cur; /* the document */
22406    int n_cur;
22407    char * encoding; /* the name of an encoding (or NULL) */
22408    int n_encoding;
22409
22410    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22411    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22412    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22413        mem_base = xmlMemBlocks();
22414        filename = gen_fileoutput(n_filename, 0);
22415        cur = gen_xmlDocPtr(n_cur, 1);
22416        encoding = gen_const_char_ptr(n_encoding, 2);
22417
22418        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22419        desret_int(ret_val);
22420        call_tests++;
22421        des_fileoutput(n_filename, filename, 0);
22422        des_xmlDocPtr(n_cur, cur, 1);
22423        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22424        xmlResetLastError();
22425        if (mem_base != xmlMemBlocks()) {
22426            printf("Leak of %d blocks found in xmlSaveFileEnc",
22427	           xmlMemBlocks() - mem_base);
22428	    test_ret++;
22429            printf(" %d", n_filename);
22430            printf(" %d", n_cur);
22431            printf(" %d", n_encoding);
22432            printf("\n");
22433        }
22434    }
22435    }
22436    }
22437    function_tests++;
22438#endif
22439
22440    return(test_ret);
22441}
22442
22443
22444static int
22445test_xmlSaveFileTo(void) {
22446    int test_ret = 0;
22447
22448#if defined(LIBXML_OUTPUT_ENABLED)
22449    int mem_base;
22450    int ret_val;
22451    xmlOutputBufferPtr buf; /* an output I/O buffer */
22452    int n_buf;
22453    xmlDocPtr cur; /* the document */
22454    int n_cur;
22455    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22456    int n_encoding;
22457
22458    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22459    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22460    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22461        mem_base = xmlMemBlocks();
22462        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22463        cur = gen_xmlDocPtr(n_cur, 1);
22464        encoding = gen_const_char_ptr(n_encoding, 2);
22465
22466        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22467        buf = NULL;
22468        desret_int(ret_val);
22469        call_tests++;
22470        des_xmlOutputBufferPtr(n_buf, buf, 0);
22471        des_xmlDocPtr(n_cur, cur, 1);
22472        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22473        xmlResetLastError();
22474        if (mem_base != xmlMemBlocks()) {
22475            printf("Leak of %d blocks found in xmlSaveFileTo",
22476	           xmlMemBlocks() - mem_base);
22477	    test_ret++;
22478            printf(" %d", n_buf);
22479            printf(" %d", n_cur);
22480            printf(" %d", n_encoding);
22481            printf("\n");
22482        }
22483    }
22484    }
22485    }
22486    function_tests++;
22487#endif
22488
22489    return(test_ret);
22490}
22491
22492
22493static int
22494test_xmlSaveFormatFile(void) {
22495    int test_ret = 0;
22496
22497#if defined(LIBXML_OUTPUT_ENABLED)
22498    int mem_base;
22499    int ret_val;
22500    const char * filename; /* the filename (or URL) */
22501    int n_filename;
22502    xmlDocPtr cur; /* the document */
22503    int n_cur;
22504    int format; /* should formatting spaces been added */
22505    int n_format;
22506
22507    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22508    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22509    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22510        mem_base = xmlMemBlocks();
22511        filename = gen_fileoutput(n_filename, 0);
22512        cur = gen_xmlDocPtr(n_cur, 1);
22513        format = gen_int(n_format, 2);
22514
22515        ret_val = xmlSaveFormatFile(filename, cur, format);
22516        desret_int(ret_val);
22517        call_tests++;
22518        des_fileoutput(n_filename, filename, 0);
22519        des_xmlDocPtr(n_cur, cur, 1);
22520        des_int(n_format, format, 2);
22521        xmlResetLastError();
22522        if (mem_base != xmlMemBlocks()) {
22523            printf("Leak of %d blocks found in xmlSaveFormatFile",
22524	           xmlMemBlocks() - mem_base);
22525	    test_ret++;
22526            printf(" %d", n_filename);
22527            printf(" %d", n_cur);
22528            printf(" %d", n_format);
22529            printf("\n");
22530        }
22531    }
22532    }
22533    }
22534    function_tests++;
22535#endif
22536
22537    return(test_ret);
22538}
22539
22540
22541static int
22542test_xmlSaveFormatFileEnc(void) {
22543    int test_ret = 0;
22544
22545#if defined(LIBXML_OUTPUT_ENABLED)
22546    int mem_base;
22547    int ret_val;
22548    const char * filename; /* the filename or URL to output */
22549    int n_filename;
22550    xmlDocPtr cur; /* the document being saved */
22551    int n_cur;
22552    char * encoding; /* the name of the encoding to use or NULL. */
22553    int n_encoding;
22554    int format; /* should formatting spaces be added. */
22555    int n_format;
22556
22557    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22558    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22559    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22560    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22561        mem_base = xmlMemBlocks();
22562        filename = gen_fileoutput(n_filename, 0);
22563        cur = gen_xmlDocPtr(n_cur, 1);
22564        encoding = gen_const_char_ptr(n_encoding, 2);
22565        format = gen_int(n_format, 3);
22566
22567        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22568        desret_int(ret_val);
22569        call_tests++;
22570        des_fileoutput(n_filename, filename, 0);
22571        des_xmlDocPtr(n_cur, cur, 1);
22572        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22573        des_int(n_format, format, 3);
22574        xmlResetLastError();
22575        if (mem_base != xmlMemBlocks()) {
22576            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22577	           xmlMemBlocks() - mem_base);
22578	    test_ret++;
22579            printf(" %d", n_filename);
22580            printf(" %d", n_cur);
22581            printf(" %d", n_encoding);
22582            printf(" %d", n_format);
22583            printf("\n");
22584        }
22585    }
22586    }
22587    }
22588    }
22589    function_tests++;
22590#endif
22591
22592    return(test_ret);
22593}
22594
22595
22596static int
22597test_xmlSaveFormatFileTo(void) {
22598    int test_ret = 0;
22599
22600#if defined(LIBXML_OUTPUT_ENABLED)
22601    int mem_base;
22602    int ret_val;
22603    xmlOutputBufferPtr buf; /* an output I/O buffer */
22604    int n_buf;
22605    xmlDocPtr cur; /* the document */
22606    int n_cur;
22607    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22608    int n_encoding;
22609    int format; /* should formatting spaces been added */
22610    int n_format;
22611
22612    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22613    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22614    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22615    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22616        mem_base = xmlMemBlocks();
22617        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22618        cur = gen_xmlDocPtr(n_cur, 1);
22619        encoding = gen_const_char_ptr(n_encoding, 2);
22620        format = gen_int(n_format, 3);
22621
22622        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22623        buf = NULL;
22624        desret_int(ret_val);
22625        call_tests++;
22626        des_xmlOutputBufferPtr(n_buf, buf, 0);
22627        des_xmlDocPtr(n_cur, cur, 1);
22628        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22629        des_int(n_format, format, 3);
22630        xmlResetLastError();
22631        if (mem_base != xmlMemBlocks()) {
22632            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22633	           xmlMemBlocks() - mem_base);
22634	    test_ret++;
22635            printf(" %d", n_buf);
22636            printf(" %d", n_cur);
22637            printf(" %d", n_encoding);
22638            printf(" %d", n_format);
22639            printf("\n");
22640        }
22641    }
22642    }
22643    }
22644    }
22645    function_tests++;
22646#endif
22647
22648    return(test_ret);
22649}
22650
22651
22652static int
22653test_xmlSearchNs(void) {
22654    int test_ret = 0;
22655
22656    int mem_base;
22657    xmlNsPtr ret_val;
22658    xmlDocPtr doc; /* the document */
22659    int n_doc;
22660    xmlNodePtr node; /* the current node */
22661    int n_node;
22662    xmlChar * nameSpace; /* the namespace prefix */
22663    int n_nameSpace;
22664
22665    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22666    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22667    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22668        mem_base = xmlMemBlocks();
22669        doc = gen_xmlDocPtr(n_doc, 0);
22670        node = gen_xmlNodePtr(n_node, 1);
22671        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22672
22673        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
22674        desret_xmlNsPtr(ret_val);
22675        call_tests++;
22676        des_xmlDocPtr(n_doc, doc, 0);
22677        des_xmlNodePtr(n_node, node, 1);
22678        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
22679        xmlResetLastError();
22680        if (mem_base != xmlMemBlocks()) {
22681            printf("Leak of %d blocks found in xmlSearchNs",
22682	           xmlMemBlocks() - mem_base);
22683	    test_ret++;
22684            printf(" %d", n_doc);
22685            printf(" %d", n_node);
22686            printf(" %d", n_nameSpace);
22687            printf("\n");
22688        }
22689    }
22690    }
22691    }
22692    function_tests++;
22693
22694    return(test_ret);
22695}
22696
22697
22698static int
22699test_xmlSearchNsByHref(void) {
22700    int test_ret = 0;
22701
22702    int mem_base;
22703    xmlNsPtr ret_val;
22704    xmlDocPtr doc; /* the document */
22705    int n_doc;
22706    xmlNodePtr node; /* the current node */
22707    int n_node;
22708    xmlChar * href; /* the namespace value */
22709    int n_href;
22710
22711    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22712    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22713    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22714        mem_base = xmlMemBlocks();
22715        doc = gen_xmlDocPtr(n_doc, 0);
22716        node = gen_xmlNodePtr(n_node, 1);
22717        href = gen_const_xmlChar_ptr(n_href, 2);
22718
22719        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
22720        desret_xmlNsPtr(ret_val);
22721        call_tests++;
22722        des_xmlDocPtr(n_doc, doc, 0);
22723        des_xmlNodePtr(n_node, node, 1);
22724        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
22725        xmlResetLastError();
22726        if (mem_base != xmlMemBlocks()) {
22727            printf("Leak of %d blocks found in xmlSearchNsByHref",
22728	           xmlMemBlocks() - mem_base);
22729	    test_ret++;
22730            printf(" %d", n_doc);
22731            printf(" %d", n_node);
22732            printf(" %d", n_href);
22733            printf("\n");
22734        }
22735    }
22736    }
22737    }
22738    function_tests++;
22739
22740    return(test_ret);
22741}
22742
22743
22744static int
22745test_xmlSetBufferAllocationScheme(void) {
22746    int test_ret = 0;
22747
22748    int mem_base;
22749    xmlBufferAllocationScheme scheme; /* allocation method to use */
22750    int n_scheme;
22751
22752    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
22753        mem_base = xmlMemBlocks();
22754        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
22755
22756        xmlSetBufferAllocationScheme(scheme);
22757        call_tests++;
22758        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
22759        xmlResetLastError();
22760        if (mem_base != xmlMemBlocks()) {
22761            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
22762	           xmlMemBlocks() - mem_base);
22763	    test_ret++;
22764            printf(" %d", n_scheme);
22765            printf("\n");
22766        }
22767    }
22768    function_tests++;
22769
22770    return(test_ret);
22771}
22772
22773
22774static int
22775test_xmlSetCompressMode(void) {
22776    int test_ret = 0;
22777
22778    int mem_base;
22779    int mode; /* the compression ratio */
22780    int n_mode;
22781
22782    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22783        mem_base = xmlMemBlocks();
22784        mode = gen_int(n_mode, 0);
22785
22786        xmlSetCompressMode(mode);
22787        call_tests++;
22788        des_int(n_mode, mode, 0);
22789        xmlResetLastError();
22790        if (mem_base != xmlMemBlocks()) {
22791            printf("Leak of %d blocks found in xmlSetCompressMode",
22792	           xmlMemBlocks() - mem_base);
22793	    test_ret++;
22794            printf(" %d", n_mode);
22795            printf("\n");
22796        }
22797    }
22798    function_tests++;
22799
22800    return(test_ret);
22801}
22802
22803
22804static int
22805test_xmlSetDocCompressMode(void) {
22806    int test_ret = 0;
22807
22808    int mem_base;
22809    xmlDocPtr doc; /* the document */
22810    int n_doc;
22811    int mode; /* the compression ratio */
22812    int n_mode;
22813
22814    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22815    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22816        mem_base = xmlMemBlocks();
22817        doc = gen_xmlDocPtr(n_doc, 0);
22818        mode = gen_int(n_mode, 1);
22819
22820        xmlSetDocCompressMode(doc, mode);
22821        call_tests++;
22822        des_xmlDocPtr(n_doc, doc, 0);
22823        des_int(n_mode, mode, 1);
22824        xmlResetLastError();
22825        if (mem_base != xmlMemBlocks()) {
22826            printf("Leak of %d blocks found in xmlSetDocCompressMode",
22827	           xmlMemBlocks() - mem_base);
22828	    test_ret++;
22829            printf(" %d", n_doc);
22830            printf(" %d", n_mode);
22831            printf("\n");
22832        }
22833    }
22834    }
22835    function_tests++;
22836
22837    return(test_ret);
22838}
22839
22840
22841static int
22842test_xmlSetNs(void) {
22843    int test_ret = 0;
22844
22845    int mem_base;
22846    xmlNodePtr node; /* a node in the document */
22847    int n_node;
22848    xmlNsPtr ns; /* a namespace pointer */
22849    int n_ns;
22850
22851    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22852    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22853        mem_base = xmlMemBlocks();
22854        node = gen_xmlNodePtr(n_node, 0);
22855        ns = gen_xmlNsPtr(n_ns, 1);
22856
22857        xmlSetNs(node, ns);
22858        call_tests++;
22859        des_xmlNodePtr(n_node, node, 0);
22860        des_xmlNsPtr(n_ns, ns, 1);
22861        xmlResetLastError();
22862        if (mem_base != xmlMemBlocks()) {
22863            printf("Leak of %d blocks found in xmlSetNs",
22864	           xmlMemBlocks() - mem_base);
22865	    test_ret++;
22866            printf(" %d", n_node);
22867            printf(" %d", n_ns);
22868            printf("\n");
22869        }
22870    }
22871    }
22872    function_tests++;
22873
22874    return(test_ret);
22875}
22876
22877
22878static int
22879test_xmlSetNsProp(void) {
22880    int test_ret = 0;
22881
22882#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22883    int mem_base;
22884    xmlAttrPtr ret_val;
22885    xmlNodePtr node; /* the node */
22886    int n_node;
22887    xmlNsPtr ns; /* the namespace definition */
22888    int n_ns;
22889    xmlChar * name; /* the attribute name */
22890    int n_name;
22891    xmlChar * value; /* the attribute value */
22892    int n_value;
22893
22894    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22895    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22896    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22897    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22898        mem_base = xmlMemBlocks();
22899        node = gen_xmlNodePtr(n_node, 0);
22900        ns = gen_xmlNsPtr(n_ns, 1);
22901        name = gen_const_xmlChar_ptr(n_name, 2);
22902        value = gen_const_xmlChar_ptr(n_value, 3);
22903
22904        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
22905        desret_xmlAttrPtr(ret_val);
22906        call_tests++;
22907        des_xmlNodePtr(n_node, node, 0);
22908        des_xmlNsPtr(n_ns, ns, 1);
22909        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22910        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22911        xmlResetLastError();
22912        if (mem_base != xmlMemBlocks()) {
22913            printf("Leak of %d blocks found in xmlSetNsProp",
22914	           xmlMemBlocks() - mem_base);
22915	    test_ret++;
22916            printf(" %d", n_node);
22917            printf(" %d", n_ns);
22918            printf(" %d", n_name);
22919            printf(" %d", n_value);
22920            printf("\n");
22921        }
22922    }
22923    }
22924    }
22925    }
22926    function_tests++;
22927#endif
22928
22929    return(test_ret);
22930}
22931
22932
22933static int
22934test_xmlSetProp(void) {
22935    int test_ret = 0;
22936
22937#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22938    int mem_base;
22939    xmlAttrPtr ret_val;
22940    xmlNodePtr node; /* the node */
22941    int n_node;
22942    xmlChar * name; /* the attribute name */
22943    int n_name;
22944    xmlChar * value; /* the attribute value */
22945    int n_value;
22946
22947    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22948    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22949    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22950        mem_base = xmlMemBlocks();
22951        node = gen_xmlNodePtr(n_node, 0);
22952        name = gen_const_xmlChar_ptr(n_name, 1);
22953        value = gen_const_xmlChar_ptr(n_value, 2);
22954
22955        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
22956        desret_xmlAttrPtr(ret_val);
22957        call_tests++;
22958        des_xmlNodePtr(n_node, node, 0);
22959        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22960        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22961        xmlResetLastError();
22962        if (mem_base != xmlMemBlocks()) {
22963            printf("Leak of %d blocks found in xmlSetProp",
22964	           xmlMemBlocks() - mem_base);
22965	    test_ret++;
22966            printf(" %d", n_node);
22967            printf(" %d", n_name);
22968            printf(" %d", n_value);
22969            printf("\n");
22970        }
22971    }
22972    }
22973    }
22974    function_tests++;
22975#endif
22976
22977    return(test_ret);
22978}
22979
22980
22981static int
22982test_xmlSplitQName2(void) {
22983    int test_ret = 0;
22984
22985    int mem_base;
22986    xmlChar * ret_val;
22987    xmlChar * name; /* the full QName */
22988    int n_name;
22989    xmlChar ** prefix; /* a xmlChar ** */
22990    int n_prefix;
22991
22992    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22993    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
22994        mem_base = xmlMemBlocks();
22995        name = gen_const_xmlChar_ptr(n_name, 0);
22996        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
22997
22998        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
22999        desret_xmlChar_ptr(ret_val);
23000        call_tests++;
23001        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23002        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23003        xmlResetLastError();
23004        if (mem_base != xmlMemBlocks()) {
23005            printf("Leak of %d blocks found in xmlSplitQName2",
23006	           xmlMemBlocks() - mem_base);
23007	    test_ret++;
23008            printf(" %d", n_name);
23009            printf(" %d", n_prefix);
23010            printf("\n");
23011        }
23012    }
23013    }
23014    function_tests++;
23015
23016    return(test_ret);
23017}
23018
23019
23020static int
23021test_xmlSplitQName3(void) {
23022    int test_ret = 0;
23023
23024    int mem_base;
23025    const xmlChar * ret_val;
23026    xmlChar * name; /* the full QName */
23027    int n_name;
23028    int * len; /* an int * */
23029    int n_len;
23030
23031    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23032    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23033        mem_base = xmlMemBlocks();
23034        name = gen_const_xmlChar_ptr(n_name, 0);
23035        len = gen_int_ptr(n_len, 1);
23036
23037        ret_val = xmlSplitQName3((const xmlChar *)name, len);
23038        desret_const_xmlChar_ptr(ret_val);
23039        call_tests++;
23040        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23041        des_int_ptr(n_len, len, 1);
23042        xmlResetLastError();
23043        if (mem_base != xmlMemBlocks()) {
23044            printf("Leak of %d blocks found in xmlSplitQName3",
23045	           xmlMemBlocks() - mem_base);
23046	    test_ret++;
23047            printf(" %d", n_name);
23048            printf(" %d", n_len);
23049            printf("\n");
23050        }
23051    }
23052    }
23053    function_tests++;
23054
23055    return(test_ret);
23056}
23057
23058
23059static int
23060test_xmlStringGetNodeList(void) {
23061    int test_ret = 0;
23062
23063    int mem_base;
23064    xmlNodePtr ret_val;
23065    xmlDocPtr doc; /* the document */
23066    int n_doc;
23067    xmlChar * value; /* the value of the attribute */
23068    int n_value;
23069
23070    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23071    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23072        mem_base = xmlMemBlocks();
23073        doc = gen_xmlDocPtr(n_doc, 0);
23074        value = gen_const_xmlChar_ptr(n_value, 1);
23075
23076        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23077        desret_xmlNodePtr(ret_val);
23078        call_tests++;
23079        des_xmlDocPtr(n_doc, doc, 0);
23080        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23081        xmlResetLastError();
23082        if (mem_base != xmlMemBlocks()) {
23083            printf("Leak of %d blocks found in xmlStringGetNodeList",
23084	           xmlMemBlocks() - mem_base);
23085	    test_ret++;
23086            printf(" %d", n_doc);
23087            printf(" %d", n_value);
23088            printf("\n");
23089        }
23090    }
23091    }
23092    function_tests++;
23093
23094    return(test_ret);
23095}
23096
23097
23098static int
23099test_xmlStringLenGetNodeList(void) {
23100    int test_ret = 0;
23101
23102    int mem_base;
23103    xmlNodePtr ret_val;
23104    xmlDocPtr doc; /* the document */
23105    int n_doc;
23106    xmlChar * value; /* the value of the text */
23107    int n_value;
23108    int len; /* the length of the string value */
23109    int n_len;
23110
23111    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23112    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23113    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23114        mem_base = xmlMemBlocks();
23115        doc = gen_xmlDocPtr(n_doc, 0);
23116        value = gen_const_xmlChar_ptr(n_value, 1);
23117        len = gen_int(n_len, 2);
23118
23119        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23120        desret_xmlNodePtr(ret_val);
23121        call_tests++;
23122        des_xmlDocPtr(n_doc, doc, 0);
23123        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23124        des_int(n_len, len, 2);
23125        xmlResetLastError();
23126        if (mem_base != xmlMemBlocks()) {
23127            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23128	           xmlMemBlocks() - mem_base);
23129	    test_ret++;
23130            printf(" %d", n_doc);
23131            printf(" %d", n_value);
23132            printf(" %d", n_len);
23133            printf("\n");
23134        }
23135    }
23136    }
23137    }
23138    function_tests++;
23139
23140    return(test_ret);
23141}
23142
23143
23144static int
23145test_xmlTextConcat(void) {
23146    int test_ret = 0;
23147
23148    int mem_base;
23149    int ret_val;
23150    xmlNodePtr node; /* the node */
23151    int n_node;
23152    xmlChar * content; /* the content */
23153    int n_content;
23154    int len; /* @content length */
23155    int n_len;
23156
23157    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23158    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23159    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23160        mem_base = xmlMemBlocks();
23161        node = gen_xmlNodePtr(n_node, 0);
23162        content = gen_const_xmlChar_ptr(n_content, 1);
23163        len = gen_int(n_len, 2);
23164
23165        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23166        desret_int(ret_val);
23167        call_tests++;
23168        des_xmlNodePtr(n_node, node, 0);
23169        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23170        des_int(n_len, len, 2);
23171        xmlResetLastError();
23172        if (mem_base != xmlMemBlocks()) {
23173            printf("Leak of %d blocks found in xmlTextConcat",
23174	           xmlMemBlocks() - mem_base);
23175	    test_ret++;
23176            printf(" %d", n_node);
23177            printf(" %d", n_content);
23178            printf(" %d", n_len);
23179            printf("\n");
23180        }
23181    }
23182    }
23183    }
23184    function_tests++;
23185
23186    return(test_ret);
23187}
23188
23189
23190static int
23191test_xmlTextMerge(void) {
23192    int test_ret = 0;
23193
23194    int mem_base;
23195    xmlNodePtr ret_val;
23196    xmlNodePtr first; /* the first text node */
23197    int n_first;
23198    xmlNodePtr second; /* the second text node being merged */
23199    int n_second;
23200
23201    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23202    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23203        mem_base = xmlMemBlocks();
23204        first = gen_xmlNodePtr_in(n_first, 0);
23205        second = gen_xmlNodePtr_in(n_second, 1);
23206
23207        ret_val = xmlTextMerge(first, second);
23208        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23209              xmlUnlinkNode(second);
23210              xmlFreeNode(second) ; second = NULL ; }
23211        desret_xmlNodePtr(ret_val);
23212        call_tests++;
23213        des_xmlNodePtr_in(n_first, first, 0);
23214        des_xmlNodePtr_in(n_second, second, 1);
23215        xmlResetLastError();
23216        if (mem_base != xmlMemBlocks()) {
23217            printf("Leak of %d blocks found in xmlTextMerge",
23218	           xmlMemBlocks() - mem_base);
23219	    test_ret++;
23220            printf(" %d", n_first);
23221            printf(" %d", n_second);
23222            printf("\n");
23223        }
23224    }
23225    }
23226    function_tests++;
23227
23228    return(test_ret);
23229}
23230
23231
23232static int
23233test_xmlUnsetNsProp(void) {
23234    int test_ret = 0;
23235
23236#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23237    int mem_base;
23238    int ret_val;
23239    xmlNodePtr node; /* the node */
23240    int n_node;
23241    xmlNsPtr ns; /* the namespace definition */
23242    int n_ns;
23243    xmlChar * name; /* the attribute name */
23244    int n_name;
23245
23246    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23247    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23248    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23249        mem_base = xmlMemBlocks();
23250        node = gen_xmlNodePtr(n_node, 0);
23251        ns = gen_xmlNsPtr(n_ns, 1);
23252        name = gen_const_xmlChar_ptr(n_name, 2);
23253
23254        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23255        desret_int(ret_val);
23256        call_tests++;
23257        des_xmlNodePtr(n_node, node, 0);
23258        des_xmlNsPtr(n_ns, ns, 1);
23259        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23260        xmlResetLastError();
23261        if (mem_base != xmlMemBlocks()) {
23262            printf("Leak of %d blocks found in xmlUnsetNsProp",
23263	           xmlMemBlocks() - mem_base);
23264	    test_ret++;
23265            printf(" %d", n_node);
23266            printf(" %d", n_ns);
23267            printf(" %d", n_name);
23268            printf("\n");
23269        }
23270    }
23271    }
23272    }
23273    function_tests++;
23274#endif
23275
23276    return(test_ret);
23277}
23278
23279
23280static int
23281test_xmlUnsetProp(void) {
23282    int test_ret = 0;
23283
23284#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23285    int mem_base;
23286    int ret_val;
23287    xmlNodePtr node; /* the node */
23288    int n_node;
23289    xmlChar * name; /* the attribute name */
23290    int n_name;
23291
23292    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23293    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23294        mem_base = xmlMemBlocks();
23295        node = gen_xmlNodePtr(n_node, 0);
23296        name = gen_const_xmlChar_ptr(n_name, 1);
23297
23298        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23299        desret_int(ret_val);
23300        call_tests++;
23301        des_xmlNodePtr(n_node, node, 0);
23302        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23303        xmlResetLastError();
23304        if (mem_base != xmlMemBlocks()) {
23305            printf("Leak of %d blocks found in xmlUnsetProp",
23306	           xmlMemBlocks() - mem_base);
23307	    test_ret++;
23308            printf(" %d", n_node);
23309            printf(" %d", n_name);
23310            printf("\n");
23311        }
23312    }
23313    }
23314    function_tests++;
23315#endif
23316
23317    return(test_ret);
23318}
23319
23320
23321static int
23322test_xmlValidateNCName(void) {
23323    int test_ret = 0;
23324
23325#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED)
23326#ifdef LIBXML_TREE_ENABLED
23327    int mem_base;
23328    int ret_val;
23329    xmlChar * value; /* the value to check */
23330    int n_value;
23331    int space; /* allow spaces in front and end of the string */
23332    int n_space;
23333
23334    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23335    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23336        mem_base = xmlMemBlocks();
23337        value = gen_const_xmlChar_ptr(n_value, 0);
23338        space = gen_int(n_space, 1);
23339
23340        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23341        desret_int(ret_val);
23342        call_tests++;
23343        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23344        des_int(n_space, space, 1);
23345        xmlResetLastError();
23346        if (mem_base != xmlMemBlocks()) {
23347            printf("Leak of %d blocks found in xmlValidateNCName",
23348	           xmlMemBlocks() - mem_base);
23349	    test_ret++;
23350            printf(" %d", n_value);
23351            printf(" %d", n_space);
23352            printf("\n");
23353        }
23354    }
23355    }
23356    function_tests++;
23357#endif
23358#endif
23359
23360    return(test_ret);
23361}
23362
23363
23364static int
23365test_xmlValidateNMToken(void) {
23366    int test_ret = 0;
23367
23368#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23369#ifdef LIBXML_TREE_ENABLED
23370    int mem_base;
23371    int ret_val;
23372    xmlChar * value; /* the value to check */
23373    int n_value;
23374    int space; /* allow spaces in front and end of the string */
23375    int n_space;
23376
23377    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23378    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23379        mem_base = xmlMemBlocks();
23380        value = gen_const_xmlChar_ptr(n_value, 0);
23381        space = gen_int(n_space, 1);
23382
23383        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23384        desret_int(ret_val);
23385        call_tests++;
23386        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23387        des_int(n_space, space, 1);
23388        xmlResetLastError();
23389        if (mem_base != xmlMemBlocks()) {
23390            printf("Leak of %d blocks found in xmlValidateNMToken",
23391	           xmlMemBlocks() - mem_base);
23392	    test_ret++;
23393            printf(" %d", n_value);
23394            printf(" %d", n_space);
23395            printf("\n");
23396        }
23397    }
23398    }
23399    function_tests++;
23400#endif
23401#endif
23402
23403    return(test_ret);
23404}
23405
23406
23407static int
23408test_xmlValidateName(void) {
23409    int test_ret = 0;
23410
23411#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23412#ifdef LIBXML_TREE_ENABLED
23413    int mem_base;
23414    int ret_val;
23415    xmlChar * value; /* the value to check */
23416    int n_value;
23417    int space; /* allow spaces in front and end of the string */
23418    int n_space;
23419
23420    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23421    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23422        mem_base = xmlMemBlocks();
23423        value = gen_const_xmlChar_ptr(n_value, 0);
23424        space = gen_int(n_space, 1);
23425
23426        ret_val = xmlValidateName((const xmlChar *)value, space);
23427        desret_int(ret_val);
23428        call_tests++;
23429        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23430        des_int(n_space, space, 1);
23431        xmlResetLastError();
23432        if (mem_base != xmlMemBlocks()) {
23433            printf("Leak of %d blocks found in xmlValidateName",
23434	           xmlMemBlocks() - mem_base);
23435	    test_ret++;
23436            printf(" %d", n_value);
23437            printf(" %d", n_space);
23438            printf("\n");
23439        }
23440    }
23441    }
23442    function_tests++;
23443#endif
23444#endif
23445
23446    return(test_ret);
23447}
23448
23449
23450static int
23451test_xmlValidateQName(void) {
23452    int test_ret = 0;
23453
23454#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23455#ifdef LIBXML_TREE_ENABLED
23456    int mem_base;
23457    int ret_val;
23458    xmlChar * value; /* the value to check */
23459    int n_value;
23460    int space; /* allow spaces in front and end of the string */
23461    int n_space;
23462
23463    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23464    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23465        mem_base = xmlMemBlocks();
23466        value = gen_const_xmlChar_ptr(n_value, 0);
23467        space = gen_int(n_space, 1);
23468
23469        ret_val = xmlValidateQName((const xmlChar *)value, space);
23470        desret_int(ret_val);
23471        call_tests++;
23472        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23473        des_int(n_space, space, 1);
23474        xmlResetLastError();
23475        if (mem_base != xmlMemBlocks()) {
23476            printf("Leak of %d blocks found in xmlValidateQName",
23477	           xmlMemBlocks() - mem_base);
23478	    test_ret++;
23479            printf(" %d", n_value);
23480            printf(" %d", n_space);
23481            printf("\n");
23482        }
23483    }
23484    }
23485    function_tests++;
23486#endif
23487#endif
23488
23489    return(test_ret);
23490}
23491
23492static int
23493test_tree(void) {
23494    int test_ret = 0;
23495
23496    if (quiet == 0) printf("Testing tree : 132 of 151 functions ...\n");
23497    test_ret += test_xmlAddChild();
23498    test_ret += test_xmlAddChildList();
23499    test_ret += test_xmlAddNextSibling();
23500    test_ret += test_xmlAddPrevSibling();
23501    test_ret += test_xmlAddSibling();
23502    test_ret += test_xmlAttrSerializeTxtContent();
23503    test_ret += test_xmlBufferAdd();
23504    test_ret += test_xmlBufferAddHead();
23505    test_ret += test_xmlBufferCCat();
23506    test_ret += test_xmlBufferCat();
23507    test_ret += test_xmlBufferContent();
23508    test_ret += test_xmlBufferCreate();
23509    test_ret += test_xmlBufferCreateSize();
23510    test_ret += test_xmlBufferCreateStatic();
23511    test_ret += test_xmlBufferEmpty();
23512    test_ret += test_xmlBufferGrow();
23513    test_ret += test_xmlBufferLength();
23514    test_ret += test_xmlBufferResize();
23515    test_ret += test_xmlBufferSetAllocationScheme();
23516    test_ret += test_xmlBufferShrink();
23517    test_ret += test_xmlBufferWriteCHAR();
23518    test_ret += test_xmlBufferWriteChar();
23519    test_ret += test_xmlBufferWriteQuotedString();
23520    test_ret += test_xmlBuildQName();
23521    test_ret += test_xmlCopyDoc();
23522    test_ret += test_xmlCopyDtd();
23523    test_ret += test_xmlCopyNamespace();
23524    test_ret += test_xmlCopyNamespaceList();
23525    test_ret += test_xmlCopyNode();
23526    test_ret += test_xmlCopyNodeList();
23527    test_ret += test_xmlCopyProp();
23528    test_ret += test_xmlCopyPropList();
23529    test_ret += test_xmlCreateIntSubset();
23530    test_ret += test_xmlDOMWrapAdoptNode();
23531    test_ret += test_xmlDOMWrapNewCtxt();
23532    test_ret += test_xmlDOMWrapReconcileNamespaces();
23533    test_ret += test_xmlDOMWrapRemoveNode();
23534    test_ret += test_xmlDocCopyNode();
23535    test_ret += test_xmlDocCopyNodeList();
23536    test_ret += test_xmlDocDump();
23537    test_ret += test_xmlDocDumpFormatMemory();
23538    test_ret += test_xmlDocDumpFormatMemoryEnc();
23539    test_ret += test_xmlDocDumpMemory();
23540    test_ret += test_xmlDocDumpMemoryEnc();
23541    test_ret += test_xmlDocFormatDump();
23542    test_ret += test_xmlDocGetRootElement();
23543    test_ret += test_xmlDocSetRootElement();
23544    test_ret += test_xmlElemDump();
23545    test_ret += test_xmlGetBufferAllocationScheme();
23546    test_ret += test_xmlGetCompressMode();
23547    test_ret += test_xmlGetDocCompressMode();
23548    test_ret += test_xmlGetIntSubset();
23549    test_ret += test_xmlGetLastChild();
23550    test_ret += test_xmlGetLineNo();
23551    test_ret += test_xmlGetNoNsProp();
23552    test_ret += test_xmlGetNodePath();
23553    test_ret += test_xmlGetNsList();
23554    test_ret += test_xmlGetNsProp();
23555    test_ret += test_xmlGetProp();
23556    test_ret += test_xmlHasNsProp();
23557    test_ret += test_xmlHasProp();
23558    test_ret += test_xmlIsBlankNode();
23559    test_ret += test_xmlIsXHTML();
23560    test_ret += test_xmlNewCDataBlock();
23561    test_ret += test_xmlNewCharRef();
23562    test_ret += test_xmlNewChild();
23563    test_ret += test_xmlNewComment();
23564    test_ret += test_xmlNewDoc();
23565    test_ret += test_xmlNewDocComment();
23566    test_ret += test_xmlNewDocFragment();
23567    test_ret += test_xmlNewDocNode();
23568    test_ret += test_xmlNewDocNodeEatName();
23569    test_ret += test_xmlNewDocPI();
23570    test_ret += test_xmlNewDocProp();
23571    test_ret += test_xmlNewDocRawNode();
23572    test_ret += test_xmlNewDocText();
23573    test_ret += test_xmlNewDocTextLen();
23574    test_ret += test_xmlNewDtd();
23575    test_ret += test_xmlNewNode();
23576    test_ret += test_xmlNewNodeEatName();
23577    test_ret += test_xmlNewNs();
23578    test_ret += test_xmlNewNsProp();
23579    test_ret += test_xmlNewNsPropEatName();
23580    test_ret += test_xmlNewPI();
23581    test_ret += test_xmlNewProp();
23582    test_ret += test_xmlNewReference();
23583    test_ret += test_xmlNewText();
23584    test_ret += test_xmlNewTextChild();
23585    test_ret += test_xmlNewTextLen();
23586    test_ret += test_xmlNodeAddContent();
23587    test_ret += test_xmlNodeAddContentLen();
23588    test_ret += test_xmlNodeBufGetContent();
23589    test_ret += test_xmlNodeDump();
23590    test_ret += test_xmlNodeDumpOutput();
23591    test_ret += test_xmlNodeGetBase();
23592    test_ret += test_xmlNodeGetContent();
23593    test_ret += test_xmlNodeGetLang();
23594    test_ret += test_xmlNodeGetSpacePreserve();
23595    test_ret += test_xmlNodeIsText();
23596    test_ret += test_xmlNodeListGetRawString();
23597    test_ret += test_xmlNodeListGetString();
23598    test_ret += test_xmlNodeSetBase();
23599    test_ret += test_xmlNodeSetContent();
23600    test_ret += test_xmlNodeSetContentLen();
23601    test_ret += test_xmlNodeSetLang();
23602    test_ret += test_xmlNodeSetName();
23603    test_ret += test_xmlNodeSetSpacePreserve();
23604    test_ret += test_xmlReconciliateNs();
23605    test_ret += test_xmlRemoveProp();
23606    test_ret += test_xmlReplaceNode();
23607    test_ret += test_xmlSaveFile();
23608    test_ret += test_xmlSaveFileEnc();
23609    test_ret += test_xmlSaveFileTo();
23610    test_ret += test_xmlSaveFormatFile();
23611    test_ret += test_xmlSaveFormatFileEnc();
23612    test_ret += test_xmlSaveFormatFileTo();
23613    test_ret += test_xmlSearchNs();
23614    test_ret += test_xmlSearchNsByHref();
23615    test_ret += test_xmlSetBufferAllocationScheme();
23616    test_ret += test_xmlSetCompressMode();
23617    test_ret += test_xmlSetDocCompressMode();
23618    test_ret += test_xmlSetNs();
23619    test_ret += test_xmlSetNsProp();
23620    test_ret += test_xmlSetProp();
23621    test_ret += test_xmlSplitQName2();
23622    test_ret += test_xmlSplitQName3();
23623    test_ret += test_xmlStringGetNodeList();
23624    test_ret += test_xmlStringLenGetNodeList();
23625    test_ret += test_xmlTextConcat();
23626    test_ret += test_xmlTextMerge();
23627    test_ret += test_xmlUnsetNsProp();
23628    test_ret += test_xmlUnsetProp();
23629    test_ret += test_xmlValidateNCName();
23630    test_ret += test_xmlValidateNMToken();
23631    test_ret += test_xmlValidateName();
23632    test_ret += test_xmlValidateQName();
23633
23634    if (test_ret != 0)
23635	printf("Module tree: %d errors\n", test_ret);
23636    return(test_ret);
23637}
23638
23639static int
23640test_xmlBuildRelativeURI(void) {
23641    int test_ret = 0;
23642
23643    int mem_base;
23644    xmlChar * ret_val;
23645    xmlChar * URI; /* the URI reference under consideration */
23646    int n_URI;
23647    xmlChar * base; /* the base value */
23648    int n_base;
23649
23650    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23651    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23652        mem_base = xmlMemBlocks();
23653        URI = gen_const_xmlChar_ptr(n_URI, 0);
23654        base = gen_const_xmlChar_ptr(n_base, 1);
23655
23656        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
23657        desret_xmlChar_ptr(ret_val);
23658        call_tests++;
23659        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23660        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23661        xmlResetLastError();
23662        if (mem_base != xmlMemBlocks()) {
23663            printf("Leak of %d blocks found in xmlBuildRelativeURI",
23664	           xmlMemBlocks() - mem_base);
23665	    test_ret++;
23666            printf(" %d", n_URI);
23667            printf(" %d", n_base);
23668            printf("\n");
23669        }
23670    }
23671    }
23672    function_tests++;
23673
23674    return(test_ret);
23675}
23676
23677
23678static int
23679test_xmlBuildURI(void) {
23680    int test_ret = 0;
23681
23682    int mem_base;
23683    xmlChar * ret_val;
23684    xmlChar * URI; /* the URI instance found in the document */
23685    int n_URI;
23686    xmlChar * base; /* the base value */
23687    int n_base;
23688
23689    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23690    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23691        mem_base = xmlMemBlocks();
23692        URI = gen_const_xmlChar_ptr(n_URI, 0);
23693        base = gen_const_xmlChar_ptr(n_base, 1);
23694
23695        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
23696        desret_xmlChar_ptr(ret_val);
23697        call_tests++;
23698        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23699        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23700        xmlResetLastError();
23701        if (mem_base != xmlMemBlocks()) {
23702            printf("Leak of %d blocks found in xmlBuildURI",
23703	           xmlMemBlocks() - mem_base);
23704	    test_ret++;
23705            printf(" %d", n_URI);
23706            printf(" %d", n_base);
23707            printf("\n");
23708        }
23709    }
23710    }
23711    function_tests++;
23712
23713    return(test_ret);
23714}
23715
23716
23717static int
23718test_xmlCanonicPath(void) {
23719    int test_ret = 0;
23720
23721    int mem_base;
23722    xmlChar * ret_val;
23723    xmlChar * path; /* the resource locator in a filesystem notation */
23724    int n_path;
23725
23726    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
23727        mem_base = xmlMemBlocks();
23728        path = gen_const_xmlChar_ptr(n_path, 0);
23729
23730        ret_val = xmlCanonicPath((const xmlChar *)path);
23731        desret_xmlChar_ptr(ret_val);
23732        call_tests++;
23733        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
23734        xmlResetLastError();
23735        if (mem_base != xmlMemBlocks()) {
23736            printf("Leak of %d blocks found in xmlCanonicPath",
23737	           xmlMemBlocks() - mem_base);
23738	    test_ret++;
23739            printf(" %d", n_path);
23740            printf("\n");
23741        }
23742    }
23743    function_tests++;
23744
23745    return(test_ret);
23746}
23747
23748
23749static int
23750test_xmlCreateURI(void) {
23751    int test_ret = 0;
23752
23753
23754    /* missing type support */
23755    return(test_ret);
23756}
23757
23758
23759static int
23760test_xmlNormalizeURIPath(void) {
23761    int test_ret = 0;
23762
23763    int mem_base;
23764    int ret_val;
23765    char * path; /* pointer to the path string */
23766    int n_path;
23767
23768    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
23769        mem_base = xmlMemBlocks();
23770        path = gen_char_ptr(n_path, 0);
23771
23772        ret_val = xmlNormalizeURIPath(path);
23773        desret_int(ret_val);
23774        call_tests++;
23775        des_char_ptr(n_path, path, 0);
23776        xmlResetLastError();
23777        if (mem_base != xmlMemBlocks()) {
23778            printf("Leak of %d blocks found in xmlNormalizeURIPath",
23779	           xmlMemBlocks() - mem_base);
23780	    test_ret++;
23781            printf(" %d", n_path);
23782            printf("\n");
23783        }
23784    }
23785    function_tests++;
23786
23787    return(test_ret);
23788}
23789
23790
23791static int
23792test_xmlParseURI(void) {
23793    int test_ret = 0;
23794
23795
23796    /* missing type support */
23797    return(test_ret);
23798}
23799
23800
23801static int
23802test_xmlParseURIRaw(void) {
23803    int test_ret = 0;
23804
23805
23806    /* missing type support */
23807    return(test_ret);
23808}
23809
23810
23811#define gen_nb_xmlURIPtr 1
23812static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23813    return(NULL);
23814}
23815static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23816}
23817
23818static int
23819test_xmlParseURIReference(void) {
23820    int test_ret = 0;
23821
23822    int mem_base;
23823    int ret_val;
23824    xmlURIPtr uri; /* pointer to an URI structure */
23825    int n_uri;
23826    char * str; /* the string to analyze */
23827    int n_str;
23828
23829    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23830    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
23831        mem_base = xmlMemBlocks();
23832        uri = gen_xmlURIPtr(n_uri, 0);
23833        str = gen_const_char_ptr(n_str, 1);
23834
23835        ret_val = xmlParseURIReference(uri, (const char *)str);
23836        desret_int(ret_val);
23837        call_tests++;
23838        des_xmlURIPtr(n_uri, uri, 0);
23839        des_const_char_ptr(n_str, (const char *)str, 1);
23840        xmlResetLastError();
23841        if (mem_base != xmlMemBlocks()) {
23842            printf("Leak of %d blocks found in xmlParseURIReference",
23843	           xmlMemBlocks() - mem_base);
23844	    test_ret++;
23845            printf(" %d", n_uri);
23846            printf(" %d", n_str);
23847            printf("\n");
23848        }
23849    }
23850    }
23851    function_tests++;
23852
23853    return(test_ret);
23854}
23855
23856
23857static int
23858test_xmlPrintURI(void) {
23859    int test_ret = 0;
23860
23861    int mem_base;
23862    FILE * stream; /* a FILE* for the output */
23863    int n_stream;
23864    xmlURIPtr uri; /* pointer to an xmlURI */
23865    int n_uri;
23866
23867    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
23868    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23869        mem_base = xmlMemBlocks();
23870        stream = gen_FILE_ptr(n_stream, 0);
23871        uri = gen_xmlURIPtr(n_uri, 1);
23872
23873        xmlPrintURI(stream, uri);
23874        call_tests++;
23875        des_FILE_ptr(n_stream, stream, 0);
23876        des_xmlURIPtr(n_uri, uri, 1);
23877        xmlResetLastError();
23878        if (mem_base != xmlMemBlocks()) {
23879            printf("Leak of %d blocks found in xmlPrintURI",
23880	           xmlMemBlocks() - mem_base);
23881	    test_ret++;
23882            printf(" %d", n_stream);
23883            printf(" %d", n_uri);
23884            printf("\n");
23885        }
23886    }
23887    }
23888    function_tests++;
23889
23890    return(test_ret);
23891}
23892
23893
23894static int
23895test_xmlSaveUri(void) {
23896    int test_ret = 0;
23897
23898    int mem_base;
23899    xmlChar * ret_val;
23900    xmlURIPtr uri; /* pointer to an xmlURI */
23901    int n_uri;
23902
23903    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23904        mem_base = xmlMemBlocks();
23905        uri = gen_xmlURIPtr(n_uri, 0);
23906
23907        ret_val = xmlSaveUri(uri);
23908        desret_xmlChar_ptr(ret_val);
23909        call_tests++;
23910        des_xmlURIPtr(n_uri, uri, 0);
23911        xmlResetLastError();
23912        if (mem_base != xmlMemBlocks()) {
23913            printf("Leak of %d blocks found in xmlSaveUri",
23914	           xmlMemBlocks() - mem_base);
23915	    test_ret++;
23916            printf(" %d", n_uri);
23917            printf("\n");
23918        }
23919    }
23920    function_tests++;
23921
23922    return(test_ret);
23923}
23924
23925
23926static int
23927test_xmlURIEscape(void) {
23928    int test_ret = 0;
23929
23930    int mem_base;
23931    xmlChar * ret_val;
23932    xmlChar * str; /* the string of the URI to escape */
23933    int n_str;
23934
23935    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23936        mem_base = xmlMemBlocks();
23937        str = gen_const_xmlChar_ptr(n_str, 0);
23938
23939        ret_val = xmlURIEscape((const xmlChar *)str);
23940        desret_xmlChar_ptr(ret_val);
23941        call_tests++;
23942        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23943        xmlResetLastError();
23944        if (mem_base != xmlMemBlocks()) {
23945            printf("Leak of %d blocks found in xmlURIEscape",
23946	           xmlMemBlocks() - mem_base);
23947	    test_ret++;
23948            printf(" %d", n_str);
23949            printf("\n");
23950        }
23951    }
23952    function_tests++;
23953
23954    return(test_ret);
23955}
23956
23957
23958static int
23959test_xmlURIEscapeStr(void) {
23960    int test_ret = 0;
23961
23962    int mem_base;
23963    xmlChar * ret_val;
23964    xmlChar * str; /* string to escape */
23965    int n_str;
23966    xmlChar * list; /* exception list string of chars not to escape */
23967    int n_list;
23968
23969    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23970    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
23971        mem_base = xmlMemBlocks();
23972        str = gen_const_xmlChar_ptr(n_str, 0);
23973        list = gen_const_xmlChar_ptr(n_list, 1);
23974
23975        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
23976        desret_xmlChar_ptr(ret_val);
23977        call_tests++;
23978        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23979        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
23980        xmlResetLastError();
23981        if (mem_base != xmlMemBlocks()) {
23982            printf("Leak of %d blocks found in xmlURIEscapeStr",
23983	           xmlMemBlocks() - mem_base);
23984	    test_ret++;
23985            printf(" %d", n_str);
23986            printf(" %d", n_list);
23987            printf("\n");
23988        }
23989    }
23990    }
23991    function_tests++;
23992
23993    return(test_ret);
23994}
23995
23996
23997static int
23998test_xmlURIUnescapeString(void) {
23999    int test_ret = 0;
24000
24001
24002    /* missing type support */
24003    return(test_ret);
24004}
24005
24006static int
24007test_uri(void) {
24008    int test_ret = 0;
24009
24010    if (quiet == 0) printf("Testing uri : 9 of 14 functions ...\n");
24011    test_ret += test_xmlBuildRelativeURI();
24012    test_ret += test_xmlBuildURI();
24013    test_ret += test_xmlCanonicPath();
24014    test_ret += test_xmlCreateURI();
24015    test_ret += test_xmlNormalizeURIPath();
24016    test_ret += test_xmlParseURI();
24017    test_ret += test_xmlParseURIRaw();
24018    test_ret += test_xmlParseURIReference();
24019    test_ret += test_xmlPrintURI();
24020    test_ret += test_xmlSaveUri();
24021    test_ret += test_xmlURIEscape();
24022    test_ret += test_xmlURIEscapeStr();
24023    test_ret += test_xmlURIUnescapeString();
24024
24025    if (test_ret != 0)
24026	printf("Module uri: %d errors\n", test_ret);
24027    return(test_ret);
24028}
24029
24030static int
24031test_xmlAddAttributeDecl(void) {
24032    int test_ret = 0;
24033
24034    int mem_base;
24035    xmlAttributePtr ret_val;
24036    xmlValidCtxtPtr ctxt; /* the validation context */
24037    int n_ctxt;
24038    xmlDtdPtr dtd; /* pointer to the DTD */
24039    int n_dtd;
24040    xmlChar * elem; /* the element name */
24041    int n_elem;
24042    xmlChar * name; /* the attribute name */
24043    int n_name;
24044    xmlChar * ns; /* the attribute namespace prefix */
24045    int n_ns;
24046    xmlAttributeType type; /* the attribute type */
24047    int n_type;
24048    xmlAttributeDefault def; /* the attribute default type */
24049    int n_def;
24050    xmlChar * defaultValue; /* the attribute default value */
24051    int n_defaultValue;
24052    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24053    int n_tree;
24054
24055    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24056    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24057    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24058    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24059    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24060    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24061    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24062    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24063    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24064        mem_base = xmlMemBlocks();
24065        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24066        dtd = gen_xmlDtdPtr(n_dtd, 1);
24067        elem = gen_const_xmlChar_ptr(n_elem, 2);
24068        name = gen_const_xmlChar_ptr(n_name, 3);
24069        ns = gen_const_xmlChar_ptr(n_ns, 4);
24070        type = gen_xmlAttributeType(n_type, 5);
24071        def = gen_xmlAttributeDefault(n_def, 6);
24072        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24073        tree = gen_xmlEnumerationPtr(n_tree, 8);
24074
24075        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24076        desret_xmlAttributePtr(ret_val);
24077        call_tests++;
24078        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24079        des_xmlDtdPtr(n_dtd, dtd, 1);
24080        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24081        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24082        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24083        des_xmlAttributeType(n_type, type, 5);
24084        des_xmlAttributeDefault(n_def, def, 6);
24085        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24086        des_xmlEnumerationPtr(n_tree, tree, 8);
24087        xmlResetLastError();
24088        if (mem_base != xmlMemBlocks()) {
24089            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24090	           xmlMemBlocks() - mem_base);
24091	    test_ret++;
24092            printf(" %d", n_ctxt);
24093            printf(" %d", n_dtd);
24094            printf(" %d", n_elem);
24095            printf(" %d", n_name);
24096            printf(" %d", n_ns);
24097            printf(" %d", n_type);
24098            printf(" %d", n_def);
24099            printf(" %d", n_defaultValue);
24100            printf(" %d", n_tree);
24101            printf("\n");
24102        }
24103    }
24104    }
24105    }
24106    }
24107    }
24108    }
24109    }
24110    }
24111    }
24112    function_tests++;
24113
24114    return(test_ret);
24115}
24116
24117
24118static int
24119test_xmlAddElementDecl(void) {
24120    int test_ret = 0;
24121
24122    int mem_base;
24123    xmlElementPtr ret_val;
24124    xmlValidCtxtPtr ctxt; /* the validation context */
24125    int n_ctxt;
24126    xmlDtdPtr dtd; /* pointer to the DTD */
24127    int n_dtd;
24128    xmlChar * name; /* the entity name */
24129    int n_name;
24130    xmlElementTypeVal type; /* the element type */
24131    int n_type;
24132    xmlElementContentPtr content; /* the element content tree or NULL */
24133    int n_content;
24134
24135    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24136    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24137    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24138    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24139    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24140        mem_base = xmlMemBlocks();
24141        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24142        dtd = gen_xmlDtdPtr(n_dtd, 1);
24143        name = gen_const_xmlChar_ptr(n_name, 2);
24144        type = gen_xmlElementTypeVal(n_type, 3);
24145        content = gen_xmlElementContentPtr(n_content, 4);
24146
24147        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24148        desret_xmlElementPtr(ret_val);
24149        call_tests++;
24150        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24151        des_xmlDtdPtr(n_dtd, dtd, 1);
24152        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24153        des_xmlElementTypeVal(n_type, type, 3);
24154        des_xmlElementContentPtr(n_content, content, 4);
24155        xmlResetLastError();
24156        if (mem_base != xmlMemBlocks()) {
24157            printf("Leak of %d blocks found in xmlAddElementDecl",
24158	           xmlMemBlocks() - mem_base);
24159	    test_ret++;
24160            printf(" %d", n_ctxt);
24161            printf(" %d", n_dtd);
24162            printf(" %d", n_name);
24163            printf(" %d", n_type);
24164            printf(" %d", n_content);
24165            printf("\n");
24166        }
24167    }
24168    }
24169    }
24170    }
24171    }
24172    function_tests++;
24173
24174    return(test_ret);
24175}
24176
24177
24178static int
24179test_xmlAddID(void) {
24180    int test_ret = 0;
24181
24182
24183    /* missing type support */
24184    return(test_ret);
24185}
24186
24187
24188static int
24189test_xmlAddNotationDecl(void) {
24190    int test_ret = 0;
24191
24192
24193    /* missing type support */
24194    return(test_ret);
24195}
24196
24197
24198static int
24199test_xmlAddRef(void) {
24200    int test_ret = 0;
24201
24202
24203    /* missing type support */
24204    return(test_ret);
24205}
24206
24207
24208#define gen_nb_xmlAttributeTablePtr 1
24209static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24210    return(NULL);
24211}
24212static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24213}
24214
24215static int
24216test_xmlCopyAttributeTable(void) {
24217    int test_ret = 0;
24218
24219
24220    /* missing type support */
24221    return(test_ret);
24222}
24223
24224
24225static int
24226test_xmlCopyDocElementContent(void) {
24227    int test_ret = 0;
24228
24229    int mem_base;
24230    xmlElementContentPtr ret_val;
24231    xmlDocPtr doc; /* the document owning the element declaration */
24232    int n_doc;
24233    xmlElementContentPtr cur; /* An element content pointer. */
24234    int n_cur;
24235
24236    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24237    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24238        mem_base = xmlMemBlocks();
24239        doc = gen_xmlDocPtr(n_doc, 0);
24240        cur = gen_xmlElementContentPtr(n_cur, 1);
24241
24242        ret_val = xmlCopyDocElementContent(doc, cur);
24243        desret_xmlElementContentPtr(ret_val);
24244        call_tests++;
24245        des_xmlDocPtr(n_doc, doc, 0);
24246        des_xmlElementContentPtr(n_cur, cur, 1);
24247        xmlResetLastError();
24248        if (mem_base != xmlMemBlocks()) {
24249            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24250	           xmlMemBlocks() - mem_base);
24251	    test_ret++;
24252            printf(" %d", n_doc);
24253            printf(" %d", n_cur);
24254            printf("\n");
24255        }
24256    }
24257    }
24258    function_tests++;
24259
24260    return(test_ret);
24261}
24262
24263
24264static int
24265test_xmlCopyElementContent(void) {
24266    int test_ret = 0;
24267
24268    int mem_base;
24269    xmlElementContentPtr ret_val;
24270    xmlElementContentPtr cur; /* An element content pointer. */
24271    int n_cur;
24272
24273    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24274        mem_base = xmlMemBlocks();
24275        cur = gen_xmlElementContentPtr(n_cur, 0);
24276
24277        ret_val = xmlCopyElementContent(cur);
24278        desret_xmlElementContentPtr(ret_val);
24279        call_tests++;
24280        des_xmlElementContentPtr(n_cur, cur, 0);
24281        xmlResetLastError();
24282        if (mem_base != xmlMemBlocks()) {
24283            printf("Leak of %d blocks found in xmlCopyElementContent",
24284	           xmlMemBlocks() - mem_base);
24285	    test_ret++;
24286            printf(" %d", n_cur);
24287            printf("\n");
24288        }
24289    }
24290    function_tests++;
24291
24292    return(test_ret);
24293}
24294
24295
24296#define gen_nb_xmlElementTablePtr 1
24297static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24298    return(NULL);
24299}
24300static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24301}
24302
24303static int
24304test_xmlCopyElementTable(void) {
24305    int test_ret = 0;
24306
24307
24308    /* missing type support */
24309    return(test_ret);
24310}
24311
24312
24313static int
24314test_xmlCopyEnumeration(void) {
24315    int test_ret = 0;
24316
24317
24318    /* missing type support */
24319    return(test_ret);
24320}
24321
24322
24323#define gen_nb_xmlNotationTablePtr 1
24324static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24325    return(NULL);
24326}
24327static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24328}
24329
24330static int
24331test_xmlCopyNotationTable(void) {
24332    int test_ret = 0;
24333
24334
24335    /* missing type support */
24336    return(test_ret);
24337}
24338
24339
24340static int
24341test_xmlCreateEnumeration(void) {
24342    int test_ret = 0;
24343
24344
24345    /* missing type support */
24346    return(test_ret);
24347}
24348
24349
24350#define gen_nb_xmlAttributePtr 1
24351static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24352    return(NULL);
24353}
24354static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24355}
24356
24357static int
24358test_xmlDumpAttributeDecl(void) {
24359    int test_ret = 0;
24360
24361#if defined(LIBXML_OUTPUT_ENABLED)
24362    int mem_base;
24363    xmlBufferPtr buf; /* the XML buffer output */
24364    int n_buf;
24365    xmlAttributePtr attr; /* An attribute declaration */
24366    int n_attr;
24367
24368    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24369    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24370        mem_base = xmlMemBlocks();
24371        buf = gen_xmlBufferPtr(n_buf, 0);
24372        attr = gen_xmlAttributePtr(n_attr, 1);
24373
24374        xmlDumpAttributeDecl(buf, attr);
24375        call_tests++;
24376        des_xmlBufferPtr(n_buf, buf, 0);
24377        des_xmlAttributePtr(n_attr, attr, 1);
24378        xmlResetLastError();
24379        if (mem_base != xmlMemBlocks()) {
24380            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24381	           xmlMemBlocks() - mem_base);
24382	    test_ret++;
24383            printf(" %d", n_buf);
24384            printf(" %d", n_attr);
24385            printf("\n");
24386        }
24387    }
24388    }
24389    function_tests++;
24390#endif
24391
24392    return(test_ret);
24393}
24394
24395
24396static int
24397test_xmlDumpAttributeTable(void) {
24398    int test_ret = 0;
24399
24400#if defined(LIBXML_OUTPUT_ENABLED)
24401    int mem_base;
24402    xmlBufferPtr buf; /* the XML buffer output */
24403    int n_buf;
24404    xmlAttributeTablePtr table; /* An attribute table */
24405    int n_table;
24406
24407    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24408    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24409        mem_base = xmlMemBlocks();
24410        buf = gen_xmlBufferPtr(n_buf, 0);
24411        table = gen_xmlAttributeTablePtr(n_table, 1);
24412
24413        xmlDumpAttributeTable(buf, table);
24414        call_tests++;
24415        des_xmlBufferPtr(n_buf, buf, 0);
24416        des_xmlAttributeTablePtr(n_table, table, 1);
24417        xmlResetLastError();
24418        if (mem_base != xmlMemBlocks()) {
24419            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24420	           xmlMemBlocks() - mem_base);
24421	    test_ret++;
24422            printf(" %d", n_buf);
24423            printf(" %d", n_table);
24424            printf("\n");
24425        }
24426    }
24427    }
24428    function_tests++;
24429#endif
24430
24431    return(test_ret);
24432}
24433
24434
24435#define gen_nb_xmlElementPtr 1
24436static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24437    return(NULL);
24438}
24439static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24440}
24441
24442static int
24443test_xmlDumpElementDecl(void) {
24444    int test_ret = 0;
24445
24446#if defined(LIBXML_OUTPUT_ENABLED)
24447    int mem_base;
24448    xmlBufferPtr buf; /* the XML buffer output */
24449    int n_buf;
24450    xmlElementPtr elem; /* An element table */
24451    int n_elem;
24452
24453    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24454    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24455        mem_base = xmlMemBlocks();
24456        buf = gen_xmlBufferPtr(n_buf, 0);
24457        elem = gen_xmlElementPtr(n_elem, 1);
24458
24459        xmlDumpElementDecl(buf, elem);
24460        call_tests++;
24461        des_xmlBufferPtr(n_buf, buf, 0);
24462        des_xmlElementPtr(n_elem, elem, 1);
24463        xmlResetLastError();
24464        if (mem_base != xmlMemBlocks()) {
24465            printf("Leak of %d blocks found in xmlDumpElementDecl",
24466	           xmlMemBlocks() - mem_base);
24467	    test_ret++;
24468            printf(" %d", n_buf);
24469            printf(" %d", n_elem);
24470            printf("\n");
24471        }
24472    }
24473    }
24474    function_tests++;
24475#endif
24476
24477    return(test_ret);
24478}
24479
24480
24481static int
24482test_xmlDumpElementTable(void) {
24483    int test_ret = 0;
24484
24485#if defined(LIBXML_OUTPUT_ENABLED)
24486    int mem_base;
24487    xmlBufferPtr buf; /* the XML buffer output */
24488    int n_buf;
24489    xmlElementTablePtr table; /* An element table */
24490    int n_table;
24491
24492    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24493    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24494        mem_base = xmlMemBlocks();
24495        buf = gen_xmlBufferPtr(n_buf, 0);
24496        table = gen_xmlElementTablePtr(n_table, 1);
24497
24498        xmlDumpElementTable(buf, table);
24499        call_tests++;
24500        des_xmlBufferPtr(n_buf, buf, 0);
24501        des_xmlElementTablePtr(n_table, table, 1);
24502        xmlResetLastError();
24503        if (mem_base != xmlMemBlocks()) {
24504            printf("Leak of %d blocks found in xmlDumpElementTable",
24505	           xmlMemBlocks() - mem_base);
24506	    test_ret++;
24507            printf(" %d", n_buf);
24508            printf(" %d", n_table);
24509            printf("\n");
24510        }
24511    }
24512    }
24513    function_tests++;
24514#endif
24515
24516    return(test_ret);
24517}
24518
24519
24520#define gen_nb_xmlNotationPtr 1
24521static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24522    return(NULL);
24523}
24524static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24525}
24526
24527static int
24528test_xmlDumpNotationDecl(void) {
24529    int test_ret = 0;
24530
24531#if defined(LIBXML_OUTPUT_ENABLED)
24532    int mem_base;
24533    xmlBufferPtr buf; /* the XML buffer output */
24534    int n_buf;
24535    xmlNotationPtr nota; /* A notation declaration */
24536    int n_nota;
24537
24538    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24539    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24540        mem_base = xmlMemBlocks();
24541        buf = gen_xmlBufferPtr(n_buf, 0);
24542        nota = gen_xmlNotationPtr(n_nota, 1);
24543
24544        xmlDumpNotationDecl(buf, nota);
24545        call_tests++;
24546        des_xmlBufferPtr(n_buf, buf, 0);
24547        des_xmlNotationPtr(n_nota, nota, 1);
24548        xmlResetLastError();
24549        if (mem_base != xmlMemBlocks()) {
24550            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24551	           xmlMemBlocks() - mem_base);
24552	    test_ret++;
24553            printf(" %d", n_buf);
24554            printf(" %d", n_nota);
24555            printf("\n");
24556        }
24557    }
24558    }
24559    function_tests++;
24560#endif
24561
24562    return(test_ret);
24563}
24564
24565
24566static int
24567test_xmlDumpNotationTable(void) {
24568    int test_ret = 0;
24569
24570#if defined(LIBXML_OUTPUT_ENABLED)
24571    int mem_base;
24572    xmlBufferPtr buf; /* the XML buffer output */
24573    int n_buf;
24574    xmlNotationTablePtr table; /* A notation table */
24575    int n_table;
24576
24577    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24578    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24579        mem_base = xmlMemBlocks();
24580        buf = gen_xmlBufferPtr(n_buf, 0);
24581        table = gen_xmlNotationTablePtr(n_table, 1);
24582
24583        xmlDumpNotationTable(buf, table);
24584        call_tests++;
24585        des_xmlBufferPtr(n_buf, buf, 0);
24586        des_xmlNotationTablePtr(n_table, table, 1);
24587        xmlResetLastError();
24588        if (mem_base != xmlMemBlocks()) {
24589            printf("Leak of %d blocks found in xmlDumpNotationTable",
24590	           xmlMemBlocks() - mem_base);
24591	    test_ret++;
24592            printf(" %d", n_buf);
24593            printf(" %d", n_table);
24594            printf("\n");
24595        }
24596    }
24597    }
24598    function_tests++;
24599#endif
24600
24601    return(test_ret);
24602}
24603
24604
24605static int
24606test_xmlGetDtdAttrDesc(void) {
24607    int test_ret = 0;
24608
24609    int mem_base;
24610    xmlAttributePtr ret_val;
24611    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24612    int n_dtd;
24613    xmlChar * elem; /* the element name */
24614    int n_elem;
24615    xmlChar * name; /* the attribute name */
24616    int n_name;
24617
24618    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24619    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24620    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24621        mem_base = xmlMemBlocks();
24622        dtd = gen_xmlDtdPtr(n_dtd, 0);
24623        elem = gen_const_xmlChar_ptr(n_elem, 1);
24624        name = gen_const_xmlChar_ptr(n_name, 2);
24625
24626        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
24627        desret_xmlAttributePtr(ret_val);
24628        call_tests++;
24629        des_xmlDtdPtr(n_dtd, dtd, 0);
24630        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24631        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24632        xmlResetLastError();
24633        if (mem_base != xmlMemBlocks()) {
24634            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
24635	           xmlMemBlocks() - mem_base);
24636	    test_ret++;
24637            printf(" %d", n_dtd);
24638            printf(" %d", n_elem);
24639            printf(" %d", n_name);
24640            printf("\n");
24641        }
24642    }
24643    }
24644    }
24645    function_tests++;
24646
24647    return(test_ret);
24648}
24649
24650
24651static int
24652test_xmlGetDtdElementDesc(void) {
24653    int test_ret = 0;
24654
24655    int mem_base;
24656    xmlElementPtr ret_val;
24657    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24658    int n_dtd;
24659    xmlChar * name; /* the element name */
24660    int n_name;
24661
24662    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24663    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24664        mem_base = xmlMemBlocks();
24665        dtd = gen_xmlDtdPtr(n_dtd, 0);
24666        name = gen_const_xmlChar_ptr(n_name, 1);
24667
24668        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
24669        desret_xmlElementPtr(ret_val);
24670        call_tests++;
24671        des_xmlDtdPtr(n_dtd, dtd, 0);
24672        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24673        xmlResetLastError();
24674        if (mem_base != xmlMemBlocks()) {
24675            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
24676	           xmlMemBlocks() - mem_base);
24677	    test_ret++;
24678            printf(" %d", n_dtd);
24679            printf(" %d", n_name);
24680            printf("\n");
24681        }
24682    }
24683    }
24684    function_tests++;
24685
24686    return(test_ret);
24687}
24688
24689
24690static int
24691test_xmlGetDtdNotationDesc(void) {
24692    int test_ret = 0;
24693
24694
24695    /* missing type support */
24696    return(test_ret);
24697}
24698
24699
24700static int
24701test_xmlGetDtdQAttrDesc(void) {
24702    int test_ret = 0;
24703
24704    int mem_base;
24705    xmlAttributePtr ret_val;
24706    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24707    int n_dtd;
24708    xmlChar * elem; /* the element name */
24709    int n_elem;
24710    xmlChar * name; /* the attribute name */
24711    int n_name;
24712    xmlChar * prefix; /* the attribute namespace prefix */
24713    int n_prefix;
24714
24715    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24716    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24717    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24718    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24719        mem_base = xmlMemBlocks();
24720        dtd = gen_xmlDtdPtr(n_dtd, 0);
24721        elem = gen_const_xmlChar_ptr(n_elem, 1);
24722        name = gen_const_xmlChar_ptr(n_name, 2);
24723        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
24724
24725        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
24726        desret_xmlAttributePtr(ret_val);
24727        call_tests++;
24728        des_xmlDtdPtr(n_dtd, dtd, 0);
24729        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24730        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24731        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
24732        xmlResetLastError();
24733        if (mem_base != xmlMemBlocks()) {
24734            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
24735	           xmlMemBlocks() - mem_base);
24736	    test_ret++;
24737            printf(" %d", n_dtd);
24738            printf(" %d", n_elem);
24739            printf(" %d", n_name);
24740            printf(" %d", n_prefix);
24741            printf("\n");
24742        }
24743    }
24744    }
24745    }
24746    }
24747    function_tests++;
24748
24749    return(test_ret);
24750}
24751
24752
24753static int
24754test_xmlGetDtdQElementDesc(void) {
24755    int test_ret = 0;
24756
24757    int mem_base;
24758    xmlElementPtr ret_val;
24759    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24760    int n_dtd;
24761    xmlChar * name; /* the element name */
24762    int n_name;
24763    xmlChar * prefix; /* the element namespace prefix */
24764    int n_prefix;
24765
24766    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24767    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24768    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24769        mem_base = xmlMemBlocks();
24770        dtd = gen_xmlDtdPtr(n_dtd, 0);
24771        name = gen_const_xmlChar_ptr(n_name, 1);
24772        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
24773
24774        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
24775        desret_xmlElementPtr(ret_val);
24776        call_tests++;
24777        des_xmlDtdPtr(n_dtd, dtd, 0);
24778        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24779        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
24780        xmlResetLastError();
24781        if (mem_base != xmlMemBlocks()) {
24782            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
24783	           xmlMemBlocks() - mem_base);
24784	    test_ret++;
24785            printf(" %d", n_dtd);
24786            printf(" %d", n_name);
24787            printf(" %d", n_prefix);
24788            printf("\n");
24789        }
24790    }
24791    }
24792    }
24793    function_tests++;
24794
24795    return(test_ret);
24796}
24797
24798
24799static int
24800test_xmlGetID(void) {
24801    int test_ret = 0;
24802
24803    int mem_base;
24804    xmlAttrPtr ret_val;
24805    xmlDocPtr doc; /* pointer to the document */
24806    int n_doc;
24807    xmlChar * ID; /* the ID value */
24808    int n_ID;
24809
24810    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24811    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
24812        mem_base = xmlMemBlocks();
24813        doc = gen_xmlDocPtr(n_doc, 0);
24814        ID = gen_const_xmlChar_ptr(n_ID, 1);
24815
24816        ret_val = xmlGetID(doc, (const xmlChar *)ID);
24817        desret_xmlAttrPtr(ret_val);
24818        call_tests++;
24819        des_xmlDocPtr(n_doc, doc, 0);
24820        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
24821        xmlResetLastError();
24822        if (mem_base != xmlMemBlocks()) {
24823            printf("Leak of %d blocks found in xmlGetID",
24824	           xmlMemBlocks() - mem_base);
24825	    test_ret++;
24826            printf(" %d", n_doc);
24827            printf(" %d", n_ID);
24828            printf("\n");
24829        }
24830    }
24831    }
24832    function_tests++;
24833
24834    return(test_ret);
24835}
24836
24837
24838static int
24839test_xmlGetRefs(void) {
24840    int test_ret = 0;
24841
24842
24843    /* missing type support */
24844    return(test_ret);
24845}
24846
24847
24848static int
24849test_xmlIsID(void) {
24850    int test_ret = 0;
24851
24852    int mem_base;
24853    int ret_val;
24854    xmlDocPtr doc; /* the document */
24855    int n_doc;
24856    xmlNodePtr elem; /* the element carrying the attribute */
24857    int n_elem;
24858    xmlAttrPtr attr; /* the attribute */
24859    int n_attr;
24860
24861    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24862    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24863    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24864        mem_base = xmlMemBlocks();
24865        doc = gen_xmlDocPtr(n_doc, 0);
24866        elem = gen_xmlNodePtr(n_elem, 1);
24867        attr = gen_xmlAttrPtr(n_attr, 2);
24868
24869        ret_val = xmlIsID(doc, elem, attr);
24870        desret_int(ret_val);
24871        call_tests++;
24872        des_xmlDocPtr(n_doc, doc, 0);
24873        des_xmlNodePtr(n_elem, elem, 1);
24874        des_xmlAttrPtr(n_attr, attr, 2);
24875        xmlResetLastError();
24876        if (mem_base != xmlMemBlocks()) {
24877            printf("Leak of %d blocks found in xmlIsID",
24878	           xmlMemBlocks() - mem_base);
24879	    test_ret++;
24880            printf(" %d", n_doc);
24881            printf(" %d", n_elem);
24882            printf(" %d", n_attr);
24883            printf("\n");
24884        }
24885    }
24886    }
24887    }
24888    function_tests++;
24889
24890    return(test_ret);
24891}
24892
24893
24894static int
24895test_xmlIsMixedElement(void) {
24896    int test_ret = 0;
24897
24898    int mem_base;
24899    int ret_val;
24900    xmlDocPtr doc; /* the document */
24901    int n_doc;
24902    xmlChar * name; /* the element name */
24903    int n_name;
24904
24905    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24906    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24907        mem_base = xmlMemBlocks();
24908        doc = gen_xmlDocPtr(n_doc, 0);
24909        name = gen_const_xmlChar_ptr(n_name, 1);
24910
24911        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
24912        desret_int(ret_val);
24913        call_tests++;
24914        des_xmlDocPtr(n_doc, doc, 0);
24915        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24916        xmlResetLastError();
24917        if (mem_base != xmlMemBlocks()) {
24918            printf("Leak of %d blocks found in xmlIsMixedElement",
24919	           xmlMemBlocks() - mem_base);
24920	    test_ret++;
24921            printf(" %d", n_doc);
24922            printf(" %d", n_name);
24923            printf("\n");
24924        }
24925    }
24926    }
24927    function_tests++;
24928
24929    return(test_ret);
24930}
24931
24932
24933static int
24934test_xmlIsRef(void) {
24935    int test_ret = 0;
24936
24937    int mem_base;
24938    int ret_val;
24939    xmlDocPtr doc; /* the document */
24940    int n_doc;
24941    xmlNodePtr elem; /* the element carrying the attribute */
24942    int n_elem;
24943    xmlAttrPtr attr; /* the attribute */
24944    int n_attr;
24945
24946    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24947    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24948    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24949        mem_base = xmlMemBlocks();
24950        doc = gen_xmlDocPtr(n_doc, 0);
24951        elem = gen_xmlNodePtr(n_elem, 1);
24952        attr = gen_xmlAttrPtr(n_attr, 2);
24953
24954        ret_val = xmlIsRef(doc, elem, attr);
24955        desret_int(ret_val);
24956        call_tests++;
24957        des_xmlDocPtr(n_doc, doc, 0);
24958        des_xmlNodePtr(n_elem, elem, 1);
24959        des_xmlAttrPtr(n_attr, attr, 2);
24960        xmlResetLastError();
24961        if (mem_base != xmlMemBlocks()) {
24962            printf("Leak of %d blocks found in xmlIsRef",
24963	           xmlMemBlocks() - mem_base);
24964	    test_ret++;
24965            printf(" %d", n_doc);
24966            printf(" %d", n_elem);
24967            printf(" %d", n_attr);
24968            printf("\n");
24969        }
24970    }
24971    }
24972    }
24973    function_tests++;
24974
24975    return(test_ret);
24976}
24977
24978
24979static int
24980test_xmlNewDocElementContent(void) {
24981    int test_ret = 0;
24982
24983    int mem_base;
24984    xmlElementContentPtr ret_val;
24985    xmlDocPtr doc; /* the document */
24986    int n_doc;
24987    xmlChar * name; /* the subelement name or NULL */
24988    int n_name;
24989    xmlElementContentType type; /* the type of element content decl */
24990    int n_type;
24991
24992    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24993    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24994    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24995        mem_base = xmlMemBlocks();
24996        doc = gen_xmlDocPtr(n_doc, 0);
24997        name = gen_const_xmlChar_ptr(n_name, 1);
24998        type = gen_xmlElementContentType(n_type, 2);
24999
25000        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25001        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25002        desret_xmlElementContentPtr(ret_val);
25003        call_tests++;
25004        des_xmlDocPtr(n_doc, doc, 0);
25005        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25006        des_xmlElementContentType(n_type, type, 2);
25007        xmlResetLastError();
25008        if (mem_base != xmlMemBlocks()) {
25009            printf("Leak of %d blocks found in xmlNewDocElementContent",
25010	           xmlMemBlocks() - mem_base);
25011	    test_ret++;
25012            printf(" %d", n_doc);
25013            printf(" %d", n_name);
25014            printf(" %d", n_type);
25015            printf("\n");
25016        }
25017    }
25018    }
25019    }
25020    function_tests++;
25021
25022    return(test_ret);
25023}
25024
25025
25026static int
25027test_xmlNewElementContent(void) {
25028    int test_ret = 0;
25029
25030    int mem_base;
25031    xmlElementContentPtr ret_val;
25032    xmlChar * name; /* the subelement name or NULL */
25033    int n_name;
25034    xmlElementContentType type; /* the type of element content decl */
25035    int n_type;
25036
25037    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25038    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25039        mem_base = xmlMemBlocks();
25040        name = gen_const_xmlChar_ptr(n_name, 0);
25041        type = gen_xmlElementContentType(n_type, 1);
25042
25043        ret_val = xmlNewElementContent((const xmlChar *)name, type);
25044        desret_xmlElementContentPtr(ret_val);
25045        call_tests++;
25046        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25047        des_xmlElementContentType(n_type, type, 1);
25048        xmlResetLastError();
25049        if (mem_base != xmlMemBlocks()) {
25050            printf("Leak of %d blocks found in xmlNewElementContent",
25051	           xmlMemBlocks() - mem_base);
25052	    test_ret++;
25053            printf(" %d", n_name);
25054            printf(" %d", n_type);
25055            printf("\n");
25056        }
25057    }
25058    }
25059    function_tests++;
25060
25061    return(test_ret);
25062}
25063
25064
25065static int
25066test_xmlNewValidCtxt(void) {
25067    int test_ret = 0;
25068
25069
25070    /* missing type support */
25071    return(test_ret);
25072}
25073
25074
25075static int
25076test_xmlRemoveID(void) {
25077    int test_ret = 0;
25078
25079    int mem_base;
25080    int ret_val;
25081    xmlDocPtr doc; /* the document */
25082    int n_doc;
25083    xmlAttrPtr attr; /* the attribute */
25084    int n_attr;
25085
25086    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25087    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25088        mem_base = xmlMemBlocks();
25089        doc = gen_xmlDocPtr(n_doc, 0);
25090        attr = gen_xmlAttrPtr(n_attr, 1);
25091
25092        ret_val = xmlRemoveID(doc, attr);
25093        desret_int(ret_val);
25094        call_tests++;
25095        des_xmlDocPtr(n_doc, doc, 0);
25096        des_xmlAttrPtr(n_attr, attr, 1);
25097        xmlResetLastError();
25098        if (mem_base != xmlMemBlocks()) {
25099            printf("Leak of %d blocks found in xmlRemoveID",
25100	           xmlMemBlocks() - mem_base);
25101	    test_ret++;
25102            printf(" %d", n_doc);
25103            printf(" %d", n_attr);
25104            printf("\n");
25105        }
25106    }
25107    }
25108    function_tests++;
25109
25110    return(test_ret);
25111}
25112
25113
25114static int
25115test_xmlRemoveRef(void) {
25116    int test_ret = 0;
25117
25118    int mem_base;
25119    int ret_val;
25120    xmlDocPtr doc; /* the document */
25121    int n_doc;
25122    xmlAttrPtr attr; /* the attribute */
25123    int n_attr;
25124
25125    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25126    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25127        mem_base = xmlMemBlocks();
25128        doc = gen_xmlDocPtr(n_doc, 0);
25129        attr = gen_xmlAttrPtr(n_attr, 1);
25130
25131        ret_val = xmlRemoveRef(doc, attr);
25132        desret_int(ret_val);
25133        call_tests++;
25134        des_xmlDocPtr(n_doc, doc, 0);
25135        des_xmlAttrPtr(n_attr, attr, 1);
25136        xmlResetLastError();
25137        if (mem_base != xmlMemBlocks()) {
25138            printf("Leak of %d blocks found in xmlRemoveRef",
25139	           xmlMemBlocks() - mem_base);
25140	    test_ret++;
25141            printf(" %d", n_doc);
25142            printf(" %d", n_attr);
25143            printf("\n");
25144        }
25145    }
25146    }
25147    function_tests++;
25148
25149    return(test_ret);
25150}
25151
25152
25153static int
25154test_xmlSnprintfElementContent(void) {
25155    int test_ret = 0;
25156
25157    int mem_base;
25158    char * buf; /* an output buffer */
25159    int n_buf;
25160    int size; /* the buffer size */
25161    int n_size;
25162    xmlElementContentPtr content; /* An element table */
25163    int n_content;
25164    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25165    int n_englob;
25166
25167    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25168    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25169    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25170    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25171        mem_base = xmlMemBlocks();
25172        buf = gen_char_ptr(n_buf, 0);
25173        size = gen_int(n_size, 1);
25174        content = gen_xmlElementContentPtr(n_content, 2);
25175        englob = gen_int(n_englob, 3);
25176
25177        xmlSnprintfElementContent(buf, size, content, englob);
25178        call_tests++;
25179        des_char_ptr(n_buf, buf, 0);
25180        des_int(n_size, size, 1);
25181        des_xmlElementContentPtr(n_content, content, 2);
25182        des_int(n_englob, englob, 3);
25183        xmlResetLastError();
25184        if (mem_base != xmlMemBlocks()) {
25185            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25186	           xmlMemBlocks() - mem_base);
25187	    test_ret++;
25188            printf(" %d", n_buf);
25189            printf(" %d", n_size);
25190            printf(" %d", n_content);
25191            printf(" %d", n_englob);
25192            printf("\n");
25193        }
25194    }
25195    }
25196    }
25197    }
25198    function_tests++;
25199
25200    return(test_ret);
25201}
25202
25203
25204static int
25205test_xmlSprintfElementContent(void) {
25206    int test_ret = 0;
25207
25208#if defined(LIBXML_OUTPUT_ENABLED)
25209#ifdef LIBXML_OUTPUT_ENABLED
25210    int mem_base;
25211    char * buf; /* an output buffer */
25212    int n_buf;
25213    xmlElementContentPtr content; /* An element table */
25214    int n_content;
25215    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25216    int n_englob;
25217
25218    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25219    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25220    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25221        mem_base = xmlMemBlocks();
25222        buf = gen_char_ptr(n_buf, 0);
25223        content = gen_xmlElementContentPtr(n_content, 1);
25224        englob = gen_int(n_englob, 2);
25225
25226        xmlSprintfElementContent(buf, content, englob);
25227        call_tests++;
25228        des_char_ptr(n_buf, buf, 0);
25229        des_xmlElementContentPtr(n_content, content, 1);
25230        des_int(n_englob, englob, 2);
25231        xmlResetLastError();
25232        if (mem_base != xmlMemBlocks()) {
25233            printf("Leak of %d blocks found in xmlSprintfElementContent",
25234	           xmlMemBlocks() - mem_base);
25235	    test_ret++;
25236            printf(" %d", n_buf);
25237            printf(" %d", n_content);
25238            printf(" %d", n_englob);
25239            printf("\n");
25240        }
25241    }
25242    }
25243    }
25244    function_tests++;
25245#endif
25246#endif
25247
25248    return(test_ret);
25249}
25250
25251
25252static int
25253test_xmlValidBuildContentModel(void) {
25254    int test_ret = 0;
25255
25256#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25257    int mem_base;
25258    int ret_val;
25259    xmlValidCtxtPtr ctxt; /* a validation context */
25260    int n_ctxt;
25261    xmlElementPtr elem; /* an element declaration node */
25262    int n_elem;
25263
25264    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25265    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25266        mem_base = xmlMemBlocks();
25267        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25268        elem = gen_xmlElementPtr(n_elem, 1);
25269
25270        ret_val = xmlValidBuildContentModel(ctxt, elem);
25271        desret_int(ret_val);
25272        call_tests++;
25273        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25274        des_xmlElementPtr(n_elem, elem, 1);
25275        xmlResetLastError();
25276        if (mem_base != xmlMemBlocks()) {
25277            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25278	           xmlMemBlocks() - mem_base);
25279	    test_ret++;
25280            printf(" %d", n_ctxt);
25281            printf(" %d", n_elem);
25282            printf("\n");
25283        }
25284    }
25285    }
25286    function_tests++;
25287#endif
25288
25289    return(test_ret);
25290}
25291
25292
25293static int
25294test_xmlValidCtxtNormalizeAttributeValue(void) {
25295    int test_ret = 0;
25296
25297#if defined(LIBXML_VALID_ENABLED)
25298    int mem_base;
25299    xmlChar * ret_val;
25300    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25301    int n_ctxt;
25302    xmlDocPtr doc; /* the document */
25303    int n_doc;
25304    xmlNodePtr elem; /* the parent */
25305    int n_elem;
25306    xmlChar * name; /* the attribute name */
25307    int n_name;
25308    xmlChar * value; /* the attribute value */
25309    int n_value;
25310
25311    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25312    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25313    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25314    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25315    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25316        mem_base = xmlMemBlocks();
25317        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25318        doc = gen_xmlDocPtr(n_doc, 1);
25319        elem = gen_xmlNodePtr(n_elem, 2);
25320        name = gen_const_xmlChar_ptr(n_name, 3);
25321        value = gen_const_xmlChar_ptr(n_value, 4);
25322
25323        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25324        desret_xmlChar_ptr(ret_val);
25325        call_tests++;
25326        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25327        des_xmlDocPtr(n_doc, doc, 1);
25328        des_xmlNodePtr(n_elem, elem, 2);
25329        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25330        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25331        xmlResetLastError();
25332        if (mem_base != xmlMemBlocks()) {
25333            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25334	           xmlMemBlocks() - mem_base);
25335	    test_ret++;
25336            printf(" %d", n_ctxt);
25337            printf(" %d", n_doc);
25338            printf(" %d", n_elem);
25339            printf(" %d", n_name);
25340            printf(" %d", n_value);
25341            printf("\n");
25342        }
25343    }
25344    }
25345    }
25346    }
25347    }
25348    function_tests++;
25349#endif
25350
25351    return(test_ret);
25352}
25353
25354
25355#define gen_nb_xmlElementContent_ptr 1
25356static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25357    return(NULL);
25358}
25359static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25360}
25361
25362static int
25363test_xmlValidGetPotentialChildren(void) {
25364    int test_ret = 0;
25365
25366#if defined(LIBXML_VALID_ENABLED)
25367#ifdef LIBXML_VALID_ENABLED
25368    int mem_base;
25369    int ret_val;
25370    xmlElementContent * ctree; /* an element content tree */
25371    int n_ctree;
25372    xmlChar ** list; /* an array to store the list of child names */
25373    int n_list;
25374    int * len; /* a pointer to the number of element in the list */
25375    int n_len;
25376    int max; /* the size of the array */
25377    int n_max;
25378
25379    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25380    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
25381    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25382    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25383        mem_base = xmlMemBlocks();
25384        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25385        list = gen_const_xmlChar_ptr_ptr(n_list, 1);
25386        len = gen_int_ptr(n_len, 2);
25387        max = gen_int(n_max, 3);
25388
25389        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)list, len, max);
25390        desret_int(ret_val);
25391        call_tests++;
25392        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25393        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 1);
25394        des_int_ptr(n_len, len, 2);
25395        des_int(n_max, max, 3);
25396        xmlResetLastError();
25397        if (mem_base != xmlMemBlocks()) {
25398            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25399	           xmlMemBlocks() - mem_base);
25400	    test_ret++;
25401            printf(" %d", n_ctree);
25402            printf(" %d", n_list);
25403            printf(" %d", n_len);
25404            printf(" %d", n_max);
25405            printf("\n");
25406        }
25407    }
25408    }
25409    }
25410    }
25411    function_tests++;
25412#endif
25413#endif
25414
25415    return(test_ret);
25416}
25417
25418
25419static int
25420test_xmlValidGetValidElements(void) {
25421    int test_ret = 0;
25422
25423#if defined(LIBXML_VALID_ENABLED)
25424#ifdef LIBXML_VALID_ENABLED
25425    int mem_base;
25426    int ret_val;
25427    xmlNode * prev; /* an element to insert after */
25428    int n_prev;
25429    xmlNode * next; /* an element to insert next */
25430    int n_next;
25431    xmlChar ** names; /* an array to store the list of child names */
25432    int n_names;
25433    int max; /* the size of the array */
25434    int n_max;
25435
25436    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25437    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25438    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25439    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25440        mem_base = xmlMemBlocks();
25441        prev = gen_xmlNodePtr(n_prev, 0);
25442        next = gen_xmlNodePtr(n_next, 1);
25443        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25444        max = gen_int(n_max, 3);
25445
25446        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25447        desret_int(ret_val);
25448        call_tests++;
25449        des_xmlNodePtr(n_prev, prev, 0);
25450        des_xmlNodePtr(n_next, next, 1);
25451        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25452        des_int(n_max, max, 3);
25453        xmlResetLastError();
25454        if (mem_base != xmlMemBlocks()) {
25455            printf("Leak of %d blocks found in xmlValidGetValidElements",
25456	           xmlMemBlocks() - mem_base);
25457	    test_ret++;
25458            printf(" %d", n_prev);
25459            printf(" %d", n_next);
25460            printf(" %d", n_names);
25461            printf(" %d", n_max);
25462            printf("\n");
25463        }
25464    }
25465    }
25466    }
25467    }
25468    function_tests++;
25469#endif
25470#endif
25471
25472    return(test_ret);
25473}
25474
25475
25476static int
25477test_xmlValidNormalizeAttributeValue(void) {
25478    int test_ret = 0;
25479
25480#if defined(LIBXML_VALID_ENABLED)
25481    int mem_base;
25482    xmlChar * ret_val;
25483    xmlDocPtr doc; /* the document */
25484    int n_doc;
25485    xmlNodePtr elem; /* the parent */
25486    int n_elem;
25487    xmlChar * name; /* the attribute name */
25488    int n_name;
25489    xmlChar * value; /* the attribute value */
25490    int n_value;
25491
25492    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25493    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25494    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25495    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25496        mem_base = xmlMemBlocks();
25497        doc = gen_xmlDocPtr(n_doc, 0);
25498        elem = gen_xmlNodePtr(n_elem, 1);
25499        name = gen_const_xmlChar_ptr(n_name, 2);
25500        value = gen_const_xmlChar_ptr(n_value, 3);
25501
25502        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25503        desret_xmlChar_ptr(ret_val);
25504        call_tests++;
25505        des_xmlDocPtr(n_doc, doc, 0);
25506        des_xmlNodePtr(n_elem, elem, 1);
25507        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25508        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25509        xmlResetLastError();
25510        if (mem_base != xmlMemBlocks()) {
25511            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25512	           xmlMemBlocks() - mem_base);
25513	    test_ret++;
25514            printf(" %d", n_doc);
25515            printf(" %d", n_elem);
25516            printf(" %d", n_name);
25517            printf(" %d", n_value);
25518            printf("\n");
25519        }
25520    }
25521    }
25522    }
25523    }
25524    function_tests++;
25525#endif
25526
25527    return(test_ret);
25528}
25529
25530
25531static int
25532test_xmlValidateAttributeDecl(void) {
25533    int test_ret = 0;
25534
25535#if defined(LIBXML_VALID_ENABLED)
25536    int mem_base;
25537    int ret_val;
25538    xmlValidCtxtPtr ctxt; /* the validation context */
25539    int n_ctxt;
25540    xmlDocPtr doc; /* a document instance */
25541    int n_doc;
25542    xmlAttributePtr attr; /* an attribute definition */
25543    int n_attr;
25544
25545    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25546    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25547    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25548        mem_base = xmlMemBlocks();
25549        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25550        doc = gen_xmlDocPtr(n_doc, 1);
25551        attr = gen_xmlAttributePtr(n_attr, 2);
25552
25553        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25554        desret_int(ret_val);
25555        call_tests++;
25556        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25557        des_xmlDocPtr(n_doc, doc, 1);
25558        des_xmlAttributePtr(n_attr, attr, 2);
25559        xmlResetLastError();
25560        if (mem_base != xmlMemBlocks()) {
25561            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25562	           xmlMemBlocks() - mem_base);
25563	    test_ret++;
25564            printf(" %d", n_ctxt);
25565            printf(" %d", n_doc);
25566            printf(" %d", n_attr);
25567            printf("\n");
25568        }
25569    }
25570    }
25571    }
25572    function_tests++;
25573#endif
25574
25575    return(test_ret);
25576}
25577
25578
25579static int
25580test_xmlValidateAttributeValue(void) {
25581    int test_ret = 0;
25582
25583#if defined(LIBXML_VALID_ENABLED)
25584    int mem_base;
25585    int ret_val;
25586    xmlAttributeType type; /* an attribute type */
25587    int n_type;
25588    xmlChar * value; /* an attribute value */
25589    int n_value;
25590
25591    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25592    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25593        mem_base = xmlMemBlocks();
25594        type = gen_xmlAttributeType(n_type, 0);
25595        value = gen_const_xmlChar_ptr(n_value, 1);
25596
25597        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25598        desret_int(ret_val);
25599        call_tests++;
25600        des_xmlAttributeType(n_type, type, 0);
25601        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25602        xmlResetLastError();
25603        if (mem_base != xmlMemBlocks()) {
25604            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25605	           xmlMemBlocks() - mem_base);
25606	    test_ret++;
25607            printf(" %d", n_type);
25608            printf(" %d", n_value);
25609            printf("\n");
25610        }
25611    }
25612    }
25613    function_tests++;
25614#endif
25615
25616    return(test_ret);
25617}
25618
25619
25620static int
25621test_xmlValidateDocument(void) {
25622    int test_ret = 0;
25623
25624#if defined(LIBXML_VALID_ENABLED)
25625    int mem_base;
25626    int ret_val;
25627    xmlValidCtxtPtr ctxt; /* the validation context */
25628    int n_ctxt;
25629    xmlDocPtr doc; /* a document instance */
25630    int n_doc;
25631
25632    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25633    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25634        mem_base = xmlMemBlocks();
25635        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25636        doc = gen_xmlDocPtr(n_doc, 1);
25637
25638        ret_val = xmlValidateDocument(ctxt, doc);
25639        desret_int(ret_val);
25640        call_tests++;
25641        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25642        des_xmlDocPtr(n_doc, doc, 1);
25643        xmlResetLastError();
25644        if (mem_base != xmlMemBlocks()) {
25645            printf("Leak of %d blocks found in xmlValidateDocument",
25646	           xmlMemBlocks() - mem_base);
25647	    test_ret++;
25648            printf(" %d", n_ctxt);
25649            printf(" %d", n_doc);
25650            printf("\n");
25651        }
25652    }
25653    }
25654    function_tests++;
25655#endif
25656
25657    return(test_ret);
25658}
25659
25660
25661static int
25662test_xmlValidateDocumentFinal(void) {
25663    int test_ret = 0;
25664
25665#if defined(LIBXML_VALID_ENABLED)
25666    int mem_base;
25667    int ret_val;
25668    xmlValidCtxtPtr ctxt; /* the validation context */
25669    int n_ctxt;
25670    xmlDocPtr doc; /* a document instance */
25671    int n_doc;
25672
25673    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25674    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25675        mem_base = xmlMemBlocks();
25676        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25677        doc = gen_xmlDocPtr(n_doc, 1);
25678
25679        ret_val = xmlValidateDocumentFinal(ctxt, doc);
25680        desret_int(ret_val);
25681        call_tests++;
25682        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25683        des_xmlDocPtr(n_doc, doc, 1);
25684        xmlResetLastError();
25685        if (mem_base != xmlMemBlocks()) {
25686            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
25687	           xmlMemBlocks() - mem_base);
25688	    test_ret++;
25689            printf(" %d", n_ctxt);
25690            printf(" %d", n_doc);
25691            printf("\n");
25692        }
25693    }
25694    }
25695    function_tests++;
25696#endif
25697
25698    return(test_ret);
25699}
25700
25701
25702static int
25703test_xmlValidateDtd(void) {
25704    int test_ret = 0;
25705
25706#if defined(LIBXML_VALID_ENABLED)
25707    int mem_base;
25708    int ret_val;
25709    xmlValidCtxtPtr ctxt; /* the validation context */
25710    int n_ctxt;
25711    xmlDocPtr doc; /* a document instance */
25712    int n_doc;
25713    xmlDtdPtr dtd; /* a dtd instance */
25714    int n_dtd;
25715
25716    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25717    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25718    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25719        mem_base = xmlMemBlocks();
25720        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25721        doc = gen_xmlDocPtr(n_doc, 1);
25722        dtd = gen_xmlDtdPtr(n_dtd, 2);
25723
25724        ret_val = xmlValidateDtd(ctxt, doc, dtd);
25725        desret_int(ret_val);
25726        call_tests++;
25727        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25728        des_xmlDocPtr(n_doc, doc, 1);
25729        des_xmlDtdPtr(n_dtd, dtd, 2);
25730        xmlResetLastError();
25731        if (mem_base != xmlMemBlocks()) {
25732            printf("Leak of %d blocks found in xmlValidateDtd",
25733	           xmlMemBlocks() - mem_base);
25734	    test_ret++;
25735            printf(" %d", n_ctxt);
25736            printf(" %d", n_doc);
25737            printf(" %d", n_dtd);
25738            printf("\n");
25739        }
25740    }
25741    }
25742    }
25743    function_tests++;
25744#endif
25745
25746    return(test_ret);
25747}
25748
25749
25750static int
25751test_xmlValidateDtdFinal(void) {
25752    int test_ret = 0;
25753
25754#if defined(LIBXML_VALID_ENABLED)
25755    int mem_base;
25756    int ret_val;
25757    xmlValidCtxtPtr ctxt; /* the validation context */
25758    int n_ctxt;
25759    xmlDocPtr doc; /* a document instance */
25760    int n_doc;
25761
25762    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25763    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25764        mem_base = xmlMemBlocks();
25765        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25766        doc = gen_xmlDocPtr(n_doc, 1);
25767
25768        ret_val = xmlValidateDtdFinal(ctxt, doc);
25769        desret_int(ret_val);
25770        call_tests++;
25771        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25772        des_xmlDocPtr(n_doc, doc, 1);
25773        xmlResetLastError();
25774        if (mem_base != xmlMemBlocks()) {
25775            printf("Leak of %d blocks found in xmlValidateDtdFinal",
25776	           xmlMemBlocks() - mem_base);
25777	    test_ret++;
25778            printf(" %d", n_ctxt);
25779            printf(" %d", n_doc);
25780            printf("\n");
25781        }
25782    }
25783    }
25784    function_tests++;
25785#endif
25786
25787    return(test_ret);
25788}
25789
25790
25791static int
25792test_xmlValidateElement(void) {
25793    int test_ret = 0;
25794
25795#if defined(LIBXML_VALID_ENABLED)
25796    int mem_base;
25797    int ret_val;
25798    xmlValidCtxtPtr ctxt; /* the validation context */
25799    int n_ctxt;
25800    xmlDocPtr doc; /* a document instance */
25801    int n_doc;
25802    xmlNodePtr elem; /* an element instance */
25803    int n_elem;
25804
25805    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25806    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25807    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25808        mem_base = xmlMemBlocks();
25809        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25810        doc = gen_xmlDocPtr(n_doc, 1);
25811        elem = gen_xmlNodePtr(n_elem, 2);
25812
25813        ret_val = xmlValidateElement(ctxt, doc, elem);
25814        desret_int(ret_val);
25815        call_tests++;
25816        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25817        des_xmlDocPtr(n_doc, doc, 1);
25818        des_xmlNodePtr(n_elem, elem, 2);
25819        xmlResetLastError();
25820        if (mem_base != xmlMemBlocks()) {
25821            printf("Leak of %d blocks found in xmlValidateElement",
25822	           xmlMemBlocks() - mem_base);
25823	    test_ret++;
25824            printf(" %d", n_ctxt);
25825            printf(" %d", n_doc);
25826            printf(" %d", n_elem);
25827            printf("\n");
25828        }
25829    }
25830    }
25831    }
25832    function_tests++;
25833#endif
25834
25835    return(test_ret);
25836}
25837
25838
25839static int
25840test_xmlValidateElementDecl(void) {
25841    int test_ret = 0;
25842
25843#if defined(LIBXML_VALID_ENABLED)
25844    int mem_base;
25845    int ret_val;
25846    xmlValidCtxtPtr ctxt; /* the validation context */
25847    int n_ctxt;
25848    xmlDocPtr doc; /* a document instance */
25849    int n_doc;
25850    xmlElementPtr elem; /* an element definition */
25851    int n_elem;
25852
25853    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25854    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25855    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25856        mem_base = xmlMemBlocks();
25857        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25858        doc = gen_xmlDocPtr(n_doc, 1);
25859        elem = gen_xmlElementPtr(n_elem, 2);
25860
25861        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
25862        desret_int(ret_val);
25863        call_tests++;
25864        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25865        des_xmlDocPtr(n_doc, doc, 1);
25866        des_xmlElementPtr(n_elem, elem, 2);
25867        xmlResetLastError();
25868        if (mem_base != xmlMemBlocks()) {
25869            printf("Leak of %d blocks found in xmlValidateElementDecl",
25870	           xmlMemBlocks() - mem_base);
25871	    test_ret++;
25872            printf(" %d", n_ctxt);
25873            printf(" %d", n_doc);
25874            printf(" %d", n_elem);
25875            printf("\n");
25876        }
25877    }
25878    }
25879    }
25880    function_tests++;
25881#endif
25882
25883    return(test_ret);
25884}
25885
25886
25887static int
25888test_xmlValidateNameValue(void) {
25889    int test_ret = 0;
25890
25891#if defined(LIBXML_VALID_ENABLED)
25892    int mem_base;
25893    int ret_val;
25894    xmlChar * value; /* an Name value */
25895    int n_value;
25896
25897    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25898        mem_base = xmlMemBlocks();
25899        value = gen_const_xmlChar_ptr(n_value, 0);
25900
25901        ret_val = xmlValidateNameValue((const xmlChar *)value);
25902        desret_int(ret_val);
25903        call_tests++;
25904        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25905        xmlResetLastError();
25906        if (mem_base != xmlMemBlocks()) {
25907            printf("Leak of %d blocks found in xmlValidateNameValue",
25908	           xmlMemBlocks() - mem_base);
25909	    test_ret++;
25910            printf(" %d", n_value);
25911            printf("\n");
25912        }
25913    }
25914    function_tests++;
25915#endif
25916
25917    return(test_ret);
25918}
25919
25920
25921static int
25922test_xmlValidateNamesValue(void) {
25923    int test_ret = 0;
25924
25925#if defined(LIBXML_VALID_ENABLED)
25926    int mem_base;
25927    int ret_val;
25928    xmlChar * value; /* an Names value */
25929    int n_value;
25930
25931    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25932        mem_base = xmlMemBlocks();
25933        value = gen_const_xmlChar_ptr(n_value, 0);
25934
25935        ret_val = xmlValidateNamesValue((const xmlChar *)value);
25936        desret_int(ret_val);
25937        call_tests++;
25938        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25939        xmlResetLastError();
25940        if (mem_base != xmlMemBlocks()) {
25941            printf("Leak of %d blocks found in xmlValidateNamesValue",
25942	           xmlMemBlocks() - mem_base);
25943	    test_ret++;
25944            printf(" %d", n_value);
25945            printf("\n");
25946        }
25947    }
25948    function_tests++;
25949#endif
25950
25951    return(test_ret);
25952}
25953
25954
25955static int
25956test_xmlValidateNmtokenValue(void) {
25957    int test_ret = 0;
25958
25959#if defined(LIBXML_VALID_ENABLED)
25960    int mem_base;
25961    int ret_val;
25962    xmlChar * value; /* an Nmtoken value */
25963    int n_value;
25964
25965    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25966        mem_base = xmlMemBlocks();
25967        value = gen_const_xmlChar_ptr(n_value, 0);
25968
25969        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
25970        desret_int(ret_val);
25971        call_tests++;
25972        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25973        xmlResetLastError();
25974        if (mem_base != xmlMemBlocks()) {
25975            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
25976	           xmlMemBlocks() - mem_base);
25977	    test_ret++;
25978            printf(" %d", n_value);
25979            printf("\n");
25980        }
25981    }
25982    function_tests++;
25983#endif
25984
25985    return(test_ret);
25986}
25987
25988
25989static int
25990test_xmlValidateNmtokensValue(void) {
25991    int test_ret = 0;
25992
25993#if defined(LIBXML_VALID_ENABLED)
25994    int mem_base;
25995    int ret_val;
25996    xmlChar * value; /* an Nmtokens value */
25997    int n_value;
25998
25999    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26000        mem_base = xmlMemBlocks();
26001        value = gen_const_xmlChar_ptr(n_value, 0);
26002
26003        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26004        desret_int(ret_val);
26005        call_tests++;
26006        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26007        xmlResetLastError();
26008        if (mem_base != xmlMemBlocks()) {
26009            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26010	           xmlMemBlocks() - mem_base);
26011	    test_ret++;
26012            printf(" %d", n_value);
26013            printf("\n");
26014        }
26015    }
26016    function_tests++;
26017#endif
26018
26019    return(test_ret);
26020}
26021
26022
26023static int
26024test_xmlValidateNotationDecl(void) {
26025    int test_ret = 0;
26026
26027#if defined(LIBXML_VALID_ENABLED)
26028    int mem_base;
26029    int ret_val;
26030    xmlValidCtxtPtr ctxt; /* the validation context */
26031    int n_ctxt;
26032    xmlDocPtr doc; /* a document instance */
26033    int n_doc;
26034    xmlNotationPtr nota; /* a notation definition */
26035    int n_nota;
26036
26037    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26038    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26039    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26040        mem_base = xmlMemBlocks();
26041        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26042        doc = gen_xmlDocPtr(n_doc, 1);
26043        nota = gen_xmlNotationPtr(n_nota, 2);
26044
26045        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26046        desret_int(ret_val);
26047        call_tests++;
26048        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26049        des_xmlDocPtr(n_doc, doc, 1);
26050        des_xmlNotationPtr(n_nota, nota, 2);
26051        xmlResetLastError();
26052        if (mem_base != xmlMemBlocks()) {
26053            printf("Leak of %d blocks found in xmlValidateNotationDecl",
26054	           xmlMemBlocks() - mem_base);
26055	    test_ret++;
26056            printf(" %d", n_ctxt);
26057            printf(" %d", n_doc);
26058            printf(" %d", n_nota);
26059            printf("\n");
26060        }
26061    }
26062    }
26063    }
26064    function_tests++;
26065#endif
26066
26067    return(test_ret);
26068}
26069
26070
26071static int
26072test_xmlValidateNotationUse(void) {
26073    int test_ret = 0;
26074
26075#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26076    int mem_base;
26077    int ret_val;
26078    xmlValidCtxtPtr ctxt; /* the validation context */
26079    int n_ctxt;
26080    xmlDocPtr doc; /* the document */
26081    int n_doc;
26082    xmlChar * notationName; /* the notation name to check */
26083    int n_notationName;
26084
26085    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26086    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26087    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26088        mem_base = xmlMemBlocks();
26089        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26090        doc = gen_xmlDocPtr(n_doc, 1);
26091        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26092
26093        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26094        desret_int(ret_val);
26095        call_tests++;
26096        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26097        des_xmlDocPtr(n_doc, doc, 1);
26098        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26099        xmlResetLastError();
26100        if (mem_base != xmlMemBlocks()) {
26101            printf("Leak of %d blocks found in xmlValidateNotationUse",
26102	           xmlMemBlocks() - mem_base);
26103	    test_ret++;
26104            printf(" %d", n_ctxt);
26105            printf(" %d", n_doc);
26106            printf(" %d", n_notationName);
26107            printf("\n");
26108        }
26109    }
26110    }
26111    }
26112    function_tests++;
26113#endif
26114
26115    return(test_ret);
26116}
26117
26118
26119static int
26120test_xmlValidateOneAttribute(void) {
26121    int test_ret = 0;
26122
26123#if defined(LIBXML_VALID_ENABLED)
26124    int mem_base;
26125    int ret_val;
26126    xmlValidCtxtPtr ctxt; /* the validation context */
26127    int n_ctxt;
26128    xmlDocPtr doc; /* a document instance */
26129    int n_doc;
26130    xmlNodePtr elem; /* an element instance */
26131    int n_elem;
26132    xmlAttrPtr attr; /* an attribute instance */
26133    int n_attr;
26134    xmlChar * value; /* the attribute value (without entities processing) */
26135    int n_value;
26136
26137    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26138    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26139    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26140    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26141    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26142        mem_base = xmlMemBlocks();
26143        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26144        doc = gen_xmlDocPtr(n_doc, 1);
26145        elem = gen_xmlNodePtr(n_elem, 2);
26146        attr = gen_xmlAttrPtr(n_attr, 3);
26147        value = gen_const_xmlChar_ptr(n_value, 4);
26148
26149        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26150        desret_int(ret_val);
26151        call_tests++;
26152        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26153        des_xmlDocPtr(n_doc, doc, 1);
26154        des_xmlNodePtr(n_elem, elem, 2);
26155        des_xmlAttrPtr(n_attr, attr, 3);
26156        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26157        xmlResetLastError();
26158        if (mem_base != xmlMemBlocks()) {
26159            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26160	           xmlMemBlocks() - mem_base);
26161	    test_ret++;
26162            printf(" %d", n_ctxt);
26163            printf(" %d", n_doc);
26164            printf(" %d", n_elem);
26165            printf(" %d", n_attr);
26166            printf(" %d", n_value);
26167            printf("\n");
26168        }
26169    }
26170    }
26171    }
26172    }
26173    }
26174    function_tests++;
26175#endif
26176
26177    return(test_ret);
26178}
26179
26180
26181static int
26182test_xmlValidateOneElement(void) {
26183    int test_ret = 0;
26184
26185#if defined(LIBXML_VALID_ENABLED)
26186    int mem_base;
26187    int ret_val;
26188    xmlValidCtxtPtr ctxt; /* the validation context */
26189    int n_ctxt;
26190    xmlDocPtr doc; /* a document instance */
26191    int n_doc;
26192    xmlNodePtr elem; /* an element instance */
26193    int n_elem;
26194
26195    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26196    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26197    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26198        mem_base = xmlMemBlocks();
26199        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26200        doc = gen_xmlDocPtr(n_doc, 1);
26201        elem = gen_xmlNodePtr(n_elem, 2);
26202
26203        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26204        desret_int(ret_val);
26205        call_tests++;
26206        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26207        des_xmlDocPtr(n_doc, doc, 1);
26208        des_xmlNodePtr(n_elem, elem, 2);
26209        xmlResetLastError();
26210        if (mem_base != xmlMemBlocks()) {
26211            printf("Leak of %d blocks found in xmlValidateOneElement",
26212	           xmlMemBlocks() - mem_base);
26213	    test_ret++;
26214            printf(" %d", n_ctxt);
26215            printf(" %d", n_doc);
26216            printf(" %d", n_elem);
26217            printf("\n");
26218        }
26219    }
26220    }
26221    }
26222    function_tests++;
26223#endif
26224
26225    return(test_ret);
26226}
26227
26228
26229static int
26230test_xmlValidateOneNamespace(void) {
26231    int test_ret = 0;
26232
26233#if defined(LIBXML_VALID_ENABLED)
26234    int mem_base;
26235    int ret_val;
26236    xmlValidCtxtPtr ctxt; /* the validation context */
26237    int n_ctxt;
26238    xmlDocPtr doc; /* a document instance */
26239    int n_doc;
26240    xmlNodePtr elem; /* an element instance */
26241    int n_elem;
26242    xmlChar * prefix; /* the namespace prefix */
26243    int n_prefix;
26244    xmlNsPtr ns; /* an namespace declaration instance */
26245    int n_ns;
26246    xmlChar * value; /* the attribute value (without entities processing) */
26247    int n_value;
26248
26249    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26250    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26251    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26252    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26253    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26254    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26255        mem_base = xmlMemBlocks();
26256        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26257        doc = gen_xmlDocPtr(n_doc, 1);
26258        elem = gen_xmlNodePtr(n_elem, 2);
26259        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26260        ns = gen_xmlNsPtr(n_ns, 4);
26261        value = gen_const_xmlChar_ptr(n_value, 5);
26262
26263        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26264        desret_int(ret_val);
26265        call_tests++;
26266        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26267        des_xmlDocPtr(n_doc, doc, 1);
26268        des_xmlNodePtr(n_elem, elem, 2);
26269        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26270        des_xmlNsPtr(n_ns, ns, 4);
26271        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26272        xmlResetLastError();
26273        if (mem_base != xmlMemBlocks()) {
26274            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26275	           xmlMemBlocks() - mem_base);
26276	    test_ret++;
26277            printf(" %d", n_ctxt);
26278            printf(" %d", n_doc);
26279            printf(" %d", n_elem);
26280            printf(" %d", n_prefix);
26281            printf(" %d", n_ns);
26282            printf(" %d", n_value);
26283            printf("\n");
26284        }
26285    }
26286    }
26287    }
26288    }
26289    }
26290    }
26291    function_tests++;
26292#endif
26293
26294    return(test_ret);
26295}
26296
26297
26298static int
26299test_xmlValidatePopElement(void) {
26300    int test_ret = 0;
26301
26302#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26303    int mem_base;
26304    int ret_val;
26305    xmlValidCtxtPtr ctxt; /* the validation context */
26306    int n_ctxt;
26307    xmlDocPtr doc; /* a document instance */
26308    int n_doc;
26309    xmlNodePtr elem; /* an element instance */
26310    int n_elem;
26311    xmlChar * qname; /* the qualified name as appearing in the serialization */
26312    int n_qname;
26313
26314    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26315    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26316    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26317    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26318        mem_base = xmlMemBlocks();
26319        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26320        doc = gen_xmlDocPtr(n_doc, 1);
26321        elem = gen_xmlNodePtr(n_elem, 2);
26322        qname = gen_const_xmlChar_ptr(n_qname, 3);
26323
26324        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26325        desret_int(ret_val);
26326        call_tests++;
26327        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26328        des_xmlDocPtr(n_doc, doc, 1);
26329        des_xmlNodePtr(n_elem, elem, 2);
26330        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26331        xmlResetLastError();
26332        if (mem_base != xmlMemBlocks()) {
26333            printf("Leak of %d blocks found in xmlValidatePopElement",
26334	           xmlMemBlocks() - mem_base);
26335	    test_ret++;
26336            printf(" %d", n_ctxt);
26337            printf(" %d", n_doc);
26338            printf(" %d", n_elem);
26339            printf(" %d", n_qname);
26340            printf("\n");
26341        }
26342    }
26343    }
26344    }
26345    }
26346    function_tests++;
26347#endif
26348
26349    return(test_ret);
26350}
26351
26352
26353static int
26354test_xmlValidatePushCData(void) {
26355    int test_ret = 0;
26356
26357#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26358    int mem_base;
26359    int ret_val;
26360    xmlValidCtxtPtr ctxt; /* the validation context */
26361    int n_ctxt;
26362    xmlChar * data; /* some character data read */
26363    int n_data;
26364    int len; /* the lenght of the data */
26365    int n_len;
26366
26367    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26368    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26369    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26370        mem_base = xmlMemBlocks();
26371        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26372        data = gen_const_xmlChar_ptr(n_data, 1);
26373        len = gen_int(n_len, 2);
26374
26375        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26376        desret_int(ret_val);
26377        call_tests++;
26378        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26379        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26380        des_int(n_len, len, 2);
26381        xmlResetLastError();
26382        if (mem_base != xmlMemBlocks()) {
26383            printf("Leak of %d blocks found in xmlValidatePushCData",
26384	           xmlMemBlocks() - mem_base);
26385	    test_ret++;
26386            printf(" %d", n_ctxt);
26387            printf(" %d", n_data);
26388            printf(" %d", n_len);
26389            printf("\n");
26390        }
26391    }
26392    }
26393    }
26394    function_tests++;
26395#endif
26396
26397    return(test_ret);
26398}
26399
26400
26401static int
26402test_xmlValidatePushElement(void) {
26403    int test_ret = 0;
26404
26405#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26406    int mem_base;
26407    int ret_val;
26408    xmlValidCtxtPtr ctxt; /* the validation context */
26409    int n_ctxt;
26410    xmlDocPtr doc; /* a document instance */
26411    int n_doc;
26412    xmlNodePtr elem; /* an element instance */
26413    int n_elem;
26414    xmlChar * qname; /* the qualified name as appearing in the serialization */
26415    int n_qname;
26416
26417    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26418    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26419    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26420    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26421        mem_base = xmlMemBlocks();
26422        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26423        doc = gen_xmlDocPtr(n_doc, 1);
26424        elem = gen_xmlNodePtr(n_elem, 2);
26425        qname = gen_const_xmlChar_ptr(n_qname, 3);
26426
26427        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26428        desret_int(ret_val);
26429        call_tests++;
26430        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26431        des_xmlDocPtr(n_doc, doc, 1);
26432        des_xmlNodePtr(n_elem, elem, 2);
26433        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26434        xmlResetLastError();
26435        if (mem_base != xmlMemBlocks()) {
26436            printf("Leak of %d blocks found in xmlValidatePushElement",
26437	           xmlMemBlocks() - mem_base);
26438	    test_ret++;
26439            printf(" %d", n_ctxt);
26440            printf(" %d", n_doc);
26441            printf(" %d", n_elem);
26442            printf(" %d", n_qname);
26443            printf("\n");
26444        }
26445    }
26446    }
26447    }
26448    }
26449    function_tests++;
26450#endif
26451
26452    return(test_ret);
26453}
26454
26455
26456static int
26457test_xmlValidateRoot(void) {
26458    int test_ret = 0;
26459
26460#if defined(LIBXML_VALID_ENABLED)
26461    int mem_base;
26462    int ret_val;
26463    xmlValidCtxtPtr ctxt; /* the validation context */
26464    int n_ctxt;
26465    xmlDocPtr doc; /* a document instance */
26466    int n_doc;
26467
26468    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26469    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26470        mem_base = xmlMemBlocks();
26471        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26472        doc = gen_xmlDocPtr(n_doc, 1);
26473
26474        ret_val = xmlValidateRoot(ctxt, doc);
26475        desret_int(ret_val);
26476        call_tests++;
26477        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26478        des_xmlDocPtr(n_doc, doc, 1);
26479        xmlResetLastError();
26480        if (mem_base != xmlMemBlocks()) {
26481            printf("Leak of %d blocks found in xmlValidateRoot",
26482	           xmlMemBlocks() - mem_base);
26483	    test_ret++;
26484            printf(" %d", n_ctxt);
26485            printf(" %d", n_doc);
26486            printf("\n");
26487        }
26488    }
26489    }
26490    function_tests++;
26491#endif
26492
26493    return(test_ret);
26494}
26495
26496static int
26497test_valid(void) {
26498    int test_ret = 0;
26499
26500    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26501    test_ret += test_xmlAddAttributeDecl();
26502    test_ret += test_xmlAddElementDecl();
26503    test_ret += test_xmlAddID();
26504    test_ret += test_xmlAddNotationDecl();
26505    test_ret += test_xmlAddRef();
26506    test_ret += test_xmlCopyAttributeTable();
26507    test_ret += test_xmlCopyDocElementContent();
26508    test_ret += test_xmlCopyElementContent();
26509    test_ret += test_xmlCopyElementTable();
26510    test_ret += test_xmlCopyEnumeration();
26511    test_ret += test_xmlCopyNotationTable();
26512    test_ret += test_xmlCreateEnumeration();
26513    test_ret += test_xmlDumpAttributeDecl();
26514    test_ret += test_xmlDumpAttributeTable();
26515    test_ret += test_xmlDumpElementDecl();
26516    test_ret += test_xmlDumpElementTable();
26517    test_ret += test_xmlDumpNotationDecl();
26518    test_ret += test_xmlDumpNotationTable();
26519    test_ret += test_xmlGetDtdAttrDesc();
26520    test_ret += test_xmlGetDtdElementDesc();
26521    test_ret += test_xmlGetDtdNotationDesc();
26522    test_ret += test_xmlGetDtdQAttrDesc();
26523    test_ret += test_xmlGetDtdQElementDesc();
26524    test_ret += test_xmlGetID();
26525    test_ret += test_xmlGetRefs();
26526    test_ret += test_xmlIsID();
26527    test_ret += test_xmlIsMixedElement();
26528    test_ret += test_xmlIsRef();
26529    test_ret += test_xmlNewDocElementContent();
26530    test_ret += test_xmlNewElementContent();
26531    test_ret += test_xmlNewValidCtxt();
26532    test_ret += test_xmlRemoveID();
26533    test_ret += test_xmlRemoveRef();
26534    test_ret += test_xmlSnprintfElementContent();
26535    test_ret += test_xmlSprintfElementContent();
26536    test_ret += test_xmlValidBuildContentModel();
26537    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26538    test_ret += test_xmlValidGetPotentialChildren();
26539    test_ret += test_xmlValidGetValidElements();
26540    test_ret += test_xmlValidNormalizeAttributeValue();
26541    test_ret += test_xmlValidateAttributeDecl();
26542    test_ret += test_xmlValidateAttributeValue();
26543    test_ret += test_xmlValidateDocument();
26544    test_ret += test_xmlValidateDocumentFinal();
26545    test_ret += test_xmlValidateDtd();
26546    test_ret += test_xmlValidateDtdFinal();
26547    test_ret += test_xmlValidateElement();
26548    test_ret += test_xmlValidateElementDecl();
26549    test_ret += test_xmlValidateNameValue();
26550    test_ret += test_xmlValidateNamesValue();
26551    test_ret += test_xmlValidateNmtokenValue();
26552    test_ret += test_xmlValidateNmtokensValue();
26553    test_ret += test_xmlValidateNotationDecl();
26554    test_ret += test_xmlValidateNotationUse();
26555    test_ret += test_xmlValidateOneAttribute();
26556    test_ret += test_xmlValidateOneElement();
26557    test_ret += test_xmlValidateOneNamespace();
26558    test_ret += test_xmlValidatePopElement();
26559    test_ret += test_xmlValidatePushCData();
26560    test_ret += test_xmlValidatePushElement();
26561    test_ret += test_xmlValidateRoot();
26562
26563    if (test_ret != 0)
26564	printf("Module valid: %d errors\n", test_ret);
26565    return(test_ret);
26566}
26567
26568static int
26569test_xmlXIncludeNewContext(void) {
26570    int test_ret = 0;
26571
26572
26573    /* missing type support */
26574    return(test_ret);
26575}
26576
26577
26578static int
26579test_xmlXIncludeProcess(void) {
26580    int test_ret = 0;
26581
26582#if defined(LIBXML_XINCLUDE_ENABLED)
26583    int mem_base;
26584    int ret_val;
26585    xmlDocPtr doc; /* an XML document */
26586    int n_doc;
26587
26588    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26589        mem_base = xmlMemBlocks();
26590        doc = gen_xmlDocPtr(n_doc, 0);
26591
26592        ret_val = xmlXIncludeProcess(doc);
26593        desret_int(ret_val);
26594        call_tests++;
26595        des_xmlDocPtr(n_doc, doc, 0);
26596        xmlResetLastError();
26597        if (mem_base != xmlMemBlocks()) {
26598            printf("Leak of %d blocks found in xmlXIncludeProcess",
26599	           xmlMemBlocks() - mem_base);
26600	    test_ret++;
26601            printf(" %d", n_doc);
26602            printf("\n");
26603        }
26604    }
26605    function_tests++;
26606#endif
26607
26608    return(test_ret);
26609}
26610
26611
26612static int
26613test_xmlXIncludeProcessFlags(void) {
26614    int test_ret = 0;
26615
26616#if defined(LIBXML_XINCLUDE_ENABLED)
26617    int mem_base;
26618    int ret_val;
26619    xmlDocPtr doc; /* an XML document */
26620    int n_doc;
26621    int flags; /* a set of xmlParserOption used for parsing XML includes */
26622    int n_flags;
26623
26624    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26625    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26626        mem_base = xmlMemBlocks();
26627        doc = gen_xmlDocPtr(n_doc, 0);
26628        flags = gen_int(n_flags, 1);
26629
26630        ret_val = xmlXIncludeProcessFlags(doc, flags);
26631        desret_int(ret_val);
26632        call_tests++;
26633        des_xmlDocPtr(n_doc, doc, 0);
26634        des_int(n_flags, flags, 1);
26635        xmlResetLastError();
26636        if (mem_base != xmlMemBlocks()) {
26637            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
26638	           xmlMemBlocks() - mem_base);
26639	    test_ret++;
26640            printf(" %d", n_doc);
26641            printf(" %d", n_flags);
26642            printf("\n");
26643        }
26644    }
26645    }
26646    function_tests++;
26647#endif
26648
26649    return(test_ret);
26650}
26651
26652#ifdef LIBXML_XINCLUDE_ENABLED
26653
26654#define gen_nb_xmlXIncludeCtxtPtr 1
26655static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26656    return(NULL);
26657}
26658static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26659}
26660#endif
26661
26662
26663static int
26664test_xmlXIncludeProcessNode(void) {
26665    int test_ret = 0;
26666
26667#if defined(LIBXML_XINCLUDE_ENABLED)
26668    int mem_base;
26669    int ret_val;
26670    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
26671    int n_ctxt;
26672    xmlNodePtr node; /* a node in an XML document */
26673    int n_node;
26674
26675    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26676    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
26677        mem_base = xmlMemBlocks();
26678        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26679        node = gen_xmlNodePtr(n_node, 1);
26680
26681        ret_val = xmlXIncludeProcessNode(ctxt, node);
26682        desret_int(ret_val);
26683        call_tests++;
26684        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26685        des_xmlNodePtr(n_node, node, 1);
26686        xmlResetLastError();
26687        if (mem_base != xmlMemBlocks()) {
26688            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
26689	           xmlMemBlocks() - mem_base);
26690	    test_ret++;
26691            printf(" %d", n_ctxt);
26692            printf(" %d", n_node);
26693            printf("\n");
26694        }
26695    }
26696    }
26697    function_tests++;
26698#endif
26699
26700    return(test_ret);
26701}
26702
26703
26704static int
26705test_xmlXIncludeProcessTree(void) {
26706    int test_ret = 0;
26707
26708#if defined(LIBXML_XINCLUDE_ENABLED)
26709    int mem_base;
26710    int ret_val;
26711    xmlNodePtr tree; /* a node in an XML document */
26712    int n_tree;
26713
26714    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26715        mem_base = xmlMemBlocks();
26716        tree = gen_xmlNodePtr(n_tree, 0);
26717
26718        ret_val = xmlXIncludeProcessTree(tree);
26719        desret_int(ret_val);
26720        call_tests++;
26721        des_xmlNodePtr(n_tree, tree, 0);
26722        xmlResetLastError();
26723        if (mem_base != xmlMemBlocks()) {
26724            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
26725	           xmlMemBlocks() - mem_base);
26726	    test_ret++;
26727            printf(" %d", n_tree);
26728            printf("\n");
26729        }
26730    }
26731    function_tests++;
26732#endif
26733
26734    return(test_ret);
26735}
26736
26737
26738static int
26739test_xmlXIncludeProcessTreeFlags(void) {
26740    int test_ret = 0;
26741
26742#if defined(LIBXML_XINCLUDE_ENABLED)
26743    int mem_base;
26744    int ret_val;
26745    xmlNodePtr tree; /* a node in an XML document */
26746    int n_tree;
26747    int flags; /* a set of xmlParserOption used for parsing XML includes */
26748    int n_flags;
26749
26750    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26751    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26752        mem_base = xmlMemBlocks();
26753        tree = gen_xmlNodePtr(n_tree, 0);
26754        flags = gen_int(n_flags, 1);
26755
26756        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
26757        desret_int(ret_val);
26758        call_tests++;
26759        des_xmlNodePtr(n_tree, tree, 0);
26760        des_int(n_flags, flags, 1);
26761        xmlResetLastError();
26762        if (mem_base != xmlMemBlocks()) {
26763            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
26764	           xmlMemBlocks() - mem_base);
26765	    test_ret++;
26766            printf(" %d", n_tree);
26767            printf(" %d", n_flags);
26768            printf("\n");
26769        }
26770    }
26771    }
26772    function_tests++;
26773#endif
26774
26775    return(test_ret);
26776}
26777
26778
26779static int
26780test_xmlXIncludeSetFlags(void) {
26781    int test_ret = 0;
26782
26783#if defined(LIBXML_XINCLUDE_ENABLED)
26784    int mem_base;
26785    int ret_val;
26786    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
26787    int n_ctxt;
26788    int flags; /* a set of xmlParserOption used for parsing XML includes */
26789    int n_flags;
26790
26791    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26792    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26793        mem_base = xmlMemBlocks();
26794        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26795        flags = gen_int(n_flags, 1);
26796
26797        ret_val = xmlXIncludeSetFlags(ctxt, flags);
26798        desret_int(ret_val);
26799        call_tests++;
26800        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26801        des_int(n_flags, flags, 1);
26802        xmlResetLastError();
26803        if (mem_base != xmlMemBlocks()) {
26804            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
26805	           xmlMemBlocks() - mem_base);
26806	    test_ret++;
26807            printf(" %d", n_ctxt);
26808            printf(" %d", n_flags);
26809            printf("\n");
26810        }
26811    }
26812    }
26813    function_tests++;
26814#endif
26815
26816    return(test_ret);
26817}
26818
26819static int
26820test_xinclude(void) {
26821    int test_ret = 0;
26822
26823    if (quiet == 0) printf("Testing xinclude : 6 of 8 functions ...\n");
26824    test_ret += test_xmlXIncludeNewContext();
26825    test_ret += test_xmlXIncludeProcess();
26826    test_ret += test_xmlXIncludeProcessFlags();
26827    test_ret += test_xmlXIncludeProcessNode();
26828    test_ret += test_xmlXIncludeProcessTree();
26829    test_ret += test_xmlXIncludeProcessTreeFlags();
26830    test_ret += test_xmlXIncludeSetFlags();
26831
26832    if (test_ret != 0)
26833	printf("Module xinclude: %d errors\n", test_ret);
26834    return(test_ret);
26835}
26836
26837static int
26838test_xmlAllocOutputBuffer(void) {
26839    int test_ret = 0;
26840
26841#if defined(LIBXML_OUTPUT_ENABLED)
26842    int mem_base;
26843    xmlOutputBufferPtr ret_val;
26844    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26845    int n_encoder;
26846
26847    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26848        mem_base = xmlMemBlocks();
26849        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
26850
26851        ret_val = xmlAllocOutputBuffer(encoder);
26852        desret_xmlOutputBufferPtr(ret_val);
26853        call_tests++;
26854        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
26855        xmlResetLastError();
26856        if (mem_base != xmlMemBlocks()) {
26857            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
26858	           xmlMemBlocks() - mem_base);
26859	    test_ret++;
26860            printf(" %d", n_encoder);
26861            printf("\n");
26862        }
26863    }
26864    function_tests++;
26865#endif
26866
26867    return(test_ret);
26868}
26869
26870
26871static int
26872test_xmlAllocParserInputBuffer(void) {
26873    int test_ret = 0;
26874
26875    int mem_base;
26876    xmlParserInputBufferPtr ret_val;
26877    xmlCharEncoding enc; /* the charset encoding if known */
26878    int n_enc;
26879
26880    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26881        mem_base = xmlMemBlocks();
26882        enc = gen_xmlCharEncoding(n_enc, 0);
26883
26884        ret_val = xmlAllocParserInputBuffer(enc);
26885        desret_xmlParserInputBufferPtr(ret_val);
26886        call_tests++;
26887        des_xmlCharEncoding(n_enc, enc, 0);
26888        xmlResetLastError();
26889        if (mem_base != xmlMemBlocks()) {
26890            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
26891	           xmlMemBlocks() - mem_base);
26892	    test_ret++;
26893            printf(" %d", n_enc);
26894            printf("\n");
26895        }
26896    }
26897    function_tests++;
26898
26899    return(test_ret);
26900}
26901
26902
26903static int
26904test_xmlCheckFilename(void) {
26905    int test_ret = 0;
26906
26907    int mem_base;
26908    int ret_val;
26909    char * path; /* the path to check */
26910    int n_path;
26911
26912    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
26913        mem_base = xmlMemBlocks();
26914        path = gen_const_char_ptr(n_path, 0);
26915
26916        ret_val = xmlCheckFilename((const char *)path);
26917        desret_int(ret_val);
26918        call_tests++;
26919        des_const_char_ptr(n_path, (const char *)path, 0);
26920        xmlResetLastError();
26921        if (mem_base != xmlMemBlocks()) {
26922            printf("Leak of %d blocks found in xmlCheckFilename",
26923	           xmlMemBlocks() - mem_base);
26924	    test_ret++;
26925            printf(" %d", n_path);
26926            printf("\n");
26927        }
26928    }
26929    function_tests++;
26930
26931    return(test_ret);
26932}
26933
26934
26935static int
26936test_xmlCheckHTTPInput(void) {
26937    int test_ret = 0;
26938
26939    int mem_base;
26940    xmlParserInputPtr ret_val;
26941    xmlParserCtxtPtr ctxt; /* an XML parser context */
26942    int n_ctxt;
26943    xmlParserInputPtr ret; /* an XML parser input */
26944    int n_ret;
26945
26946    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
26947    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
26948        mem_base = xmlMemBlocks();
26949        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
26950        ret = gen_xmlParserInputPtr(n_ret, 1);
26951
26952        ret_val = xmlCheckHTTPInput(ctxt, ret);
26953        desret_xmlParserInputPtr(ret_val);
26954        call_tests++;
26955        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
26956        des_xmlParserInputPtr(n_ret, ret, 1);
26957        xmlResetLastError();
26958        if (mem_base != xmlMemBlocks()) {
26959            printf("Leak of %d blocks found in xmlCheckHTTPInput",
26960	           xmlMemBlocks() - mem_base);
26961	    test_ret++;
26962            printf(" %d", n_ctxt);
26963            printf(" %d", n_ret);
26964            printf("\n");
26965        }
26966    }
26967    }
26968    function_tests++;
26969
26970    return(test_ret);
26971}
26972
26973
26974static int
26975test_xmlCleanupInputCallbacks(void) {
26976    int test_ret = 0;
26977
26978    int mem_base;
26979
26980        mem_base = xmlMemBlocks();
26981
26982        xmlCleanupInputCallbacks();
26983        call_tests++;
26984        xmlResetLastError();
26985        if (mem_base != xmlMemBlocks()) {
26986            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
26987	           xmlMemBlocks() - mem_base);
26988	    test_ret++;
26989            printf("\n");
26990        }
26991    function_tests++;
26992
26993    return(test_ret);
26994}
26995
26996
26997static int
26998test_xmlCleanupOutputCallbacks(void) {
26999    int test_ret = 0;
27000
27001#if defined(LIBXML_OUTPUT_ENABLED)
27002    int mem_base;
27003
27004        mem_base = xmlMemBlocks();
27005
27006        xmlCleanupOutputCallbacks();
27007        call_tests++;
27008        xmlResetLastError();
27009        if (mem_base != xmlMemBlocks()) {
27010            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27011	           xmlMemBlocks() - mem_base);
27012	    test_ret++;
27013            printf("\n");
27014        }
27015    function_tests++;
27016#endif
27017
27018    return(test_ret);
27019}
27020
27021
27022static int
27023test_xmlFileClose(void) {
27024    int test_ret = 0;
27025
27026    int mem_base;
27027    int ret_val;
27028    void * context; /* the I/O context */
27029    int n_context;
27030
27031    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27032        mem_base = xmlMemBlocks();
27033        context = gen_void_ptr(n_context, 0);
27034
27035        ret_val = xmlFileClose(context);
27036        desret_int(ret_val);
27037        call_tests++;
27038        des_void_ptr(n_context, context, 0);
27039        xmlResetLastError();
27040        if (mem_base != xmlMemBlocks()) {
27041            printf("Leak of %d blocks found in xmlFileClose",
27042	           xmlMemBlocks() - mem_base);
27043	    test_ret++;
27044            printf(" %d", n_context);
27045            printf("\n");
27046        }
27047    }
27048    function_tests++;
27049
27050    return(test_ret);
27051}
27052
27053
27054static int
27055test_xmlFileMatch(void) {
27056    int test_ret = 0;
27057
27058    int mem_base;
27059    int ret_val;
27060    const char * filename; /* the URI for matching */
27061    int n_filename;
27062
27063    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27064        mem_base = xmlMemBlocks();
27065        filename = gen_filepath(n_filename, 0);
27066
27067        ret_val = xmlFileMatch(filename);
27068        desret_int(ret_val);
27069        call_tests++;
27070        des_filepath(n_filename, filename, 0);
27071        xmlResetLastError();
27072        if (mem_base != xmlMemBlocks()) {
27073            printf("Leak of %d blocks found in xmlFileMatch",
27074	           xmlMemBlocks() - mem_base);
27075	    test_ret++;
27076            printf(" %d", n_filename);
27077            printf("\n");
27078        }
27079    }
27080    function_tests++;
27081
27082    return(test_ret);
27083}
27084
27085
27086static int
27087test_xmlFileOpen(void) {
27088    int test_ret = 0;
27089
27090    int mem_base;
27091    void * ret_val;
27092    const char * filename; /* the URI for matching */
27093    int n_filename;
27094
27095    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27096        mem_base = xmlMemBlocks();
27097        filename = gen_filepath(n_filename, 0);
27098
27099        ret_val = xmlFileOpen(filename);
27100        desret_void_ptr(ret_val);
27101        call_tests++;
27102        des_filepath(n_filename, filename, 0);
27103        xmlResetLastError();
27104        if (mem_base != xmlMemBlocks()) {
27105            printf("Leak of %d blocks found in xmlFileOpen",
27106	           xmlMemBlocks() - mem_base);
27107	    test_ret++;
27108            printf(" %d", n_filename);
27109            printf("\n");
27110        }
27111    }
27112    function_tests++;
27113
27114    return(test_ret);
27115}
27116
27117
27118static int
27119test_xmlFileRead(void) {
27120    int test_ret = 0;
27121
27122    int mem_base;
27123    int ret_val;
27124    void * context; /* the I/O context */
27125    int n_context;
27126    char * buffer; /* where to drop data */
27127    int n_buffer;
27128    int len; /* number of bytes to write */
27129    int n_len;
27130
27131    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27132    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27133    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27134        mem_base = xmlMemBlocks();
27135        context = gen_void_ptr(n_context, 0);
27136        buffer = gen_char_ptr(n_buffer, 1);
27137        len = gen_int(n_len, 2);
27138
27139        ret_val = xmlFileRead(context, buffer, len);
27140        desret_int(ret_val);
27141        call_tests++;
27142        des_void_ptr(n_context, context, 0);
27143        des_char_ptr(n_buffer, buffer, 1);
27144        des_int(n_len, len, 2);
27145        xmlResetLastError();
27146        if (mem_base != xmlMemBlocks()) {
27147            printf("Leak of %d blocks found in xmlFileRead",
27148	           xmlMemBlocks() - mem_base);
27149	    test_ret++;
27150            printf(" %d", n_context);
27151            printf(" %d", n_buffer);
27152            printf(" %d", n_len);
27153            printf("\n");
27154        }
27155    }
27156    }
27157    }
27158    function_tests++;
27159
27160    return(test_ret);
27161}
27162
27163
27164static int
27165test_xmlIOFTPClose(void) {
27166    int test_ret = 0;
27167
27168#if defined(LIBXML_FTP_ENABLED)
27169    int mem_base;
27170    int ret_val;
27171    void * context; /* the I/O context */
27172    int n_context;
27173
27174    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27175        mem_base = xmlMemBlocks();
27176        context = gen_void_ptr(n_context, 0);
27177
27178        ret_val = xmlIOFTPClose(context);
27179        desret_int(ret_val);
27180        call_tests++;
27181        des_void_ptr(n_context, context, 0);
27182        xmlResetLastError();
27183        if (mem_base != xmlMemBlocks()) {
27184            printf("Leak of %d blocks found in xmlIOFTPClose",
27185	           xmlMemBlocks() - mem_base);
27186	    test_ret++;
27187            printf(" %d", n_context);
27188            printf("\n");
27189        }
27190    }
27191    function_tests++;
27192#endif
27193
27194    return(test_ret);
27195}
27196
27197
27198static int
27199test_xmlIOFTPMatch(void) {
27200    int test_ret = 0;
27201
27202#if defined(LIBXML_FTP_ENABLED)
27203    int mem_base;
27204    int ret_val;
27205    const char * filename; /* the URI for matching */
27206    int n_filename;
27207
27208    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27209        mem_base = xmlMemBlocks();
27210        filename = gen_filepath(n_filename, 0);
27211
27212        ret_val = xmlIOFTPMatch(filename);
27213        desret_int(ret_val);
27214        call_tests++;
27215        des_filepath(n_filename, filename, 0);
27216        xmlResetLastError();
27217        if (mem_base != xmlMemBlocks()) {
27218            printf("Leak of %d blocks found in xmlIOFTPMatch",
27219	           xmlMemBlocks() - mem_base);
27220	    test_ret++;
27221            printf(" %d", n_filename);
27222            printf("\n");
27223        }
27224    }
27225    function_tests++;
27226#endif
27227
27228    return(test_ret);
27229}
27230
27231
27232static int
27233test_xmlIOFTPOpen(void) {
27234    int test_ret = 0;
27235
27236#if defined(LIBXML_FTP_ENABLED)
27237    int mem_base;
27238    void * ret_val;
27239    const char * filename; /* the URI for matching */
27240    int n_filename;
27241
27242    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27243        mem_base = xmlMemBlocks();
27244        filename = gen_filepath(n_filename, 0);
27245
27246        ret_val = xmlIOFTPOpen(filename);
27247        desret_void_ptr(ret_val);
27248        call_tests++;
27249        des_filepath(n_filename, filename, 0);
27250        xmlResetLastError();
27251        if (mem_base != xmlMemBlocks()) {
27252            printf("Leak of %d blocks found in xmlIOFTPOpen",
27253	           xmlMemBlocks() - mem_base);
27254	    test_ret++;
27255            printf(" %d", n_filename);
27256            printf("\n");
27257        }
27258    }
27259    function_tests++;
27260#endif
27261
27262    return(test_ret);
27263}
27264
27265
27266static int
27267test_xmlIOFTPRead(void) {
27268    int test_ret = 0;
27269
27270#if defined(LIBXML_FTP_ENABLED)
27271    int mem_base;
27272    int ret_val;
27273    void * context; /* the I/O context */
27274    int n_context;
27275    char * buffer; /* where to drop data */
27276    int n_buffer;
27277    int len; /* number of bytes to write */
27278    int n_len;
27279
27280    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27281    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27282    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27283        mem_base = xmlMemBlocks();
27284        context = gen_void_ptr(n_context, 0);
27285        buffer = gen_char_ptr(n_buffer, 1);
27286        len = gen_int(n_len, 2);
27287
27288        ret_val = xmlIOFTPRead(context, buffer, len);
27289        desret_int(ret_val);
27290        call_tests++;
27291        des_void_ptr(n_context, context, 0);
27292        des_char_ptr(n_buffer, buffer, 1);
27293        des_int(n_len, len, 2);
27294        xmlResetLastError();
27295        if (mem_base != xmlMemBlocks()) {
27296            printf("Leak of %d blocks found in xmlIOFTPRead",
27297	           xmlMemBlocks() - mem_base);
27298	    test_ret++;
27299            printf(" %d", n_context);
27300            printf(" %d", n_buffer);
27301            printf(" %d", n_len);
27302            printf("\n");
27303        }
27304    }
27305    }
27306    }
27307    function_tests++;
27308#endif
27309
27310    return(test_ret);
27311}
27312
27313
27314static int
27315test_xmlIOHTTPClose(void) {
27316    int test_ret = 0;
27317
27318#if defined(LIBXML_HTTP_ENABLED)
27319    int mem_base;
27320    int ret_val;
27321    void * context; /* the I/O context */
27322    int n_context;
27323
27324    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27325        mem_base = xmlMemBlocks();
27326        context = gen_void_ptr(n_context, 0);
27327
27328        ret_val = xmlIOHTTPClose(context);
27329        desret_int(ret_val);
27330        call_tests++;
27331        des_void_ptr(n_context, context, 0);
27332        xmlResetLastError();
27333        if (mem_base != xmlMemBlocks()) {
27334            printf("Leak of %d blocks found in xmlIOHTTPClose",
27335	           xmlMemBlocks() - mem_base);
27336	    test_ret++;
27337            printf(" %d", n_context);
27338            printf("\n");
27339        }
27340    }
27341    function_tests++;
27342#endif
27343
27344    return(test_ret);
27345}
27346
27347
27348static int
27349test_xmlIOHTTPMatch(void) {
27350    int test_ret = 0;
27351
27352#if defined(LIBXML_HTTP_ENABLED)
27353    int mem_base;
27354    int ret_val;
27355    const char * filename; /* the URI for matching */
27356    int n_filename;
27357
27358    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27359        mem_base = xmlMemBlocks();
27360        filename = gen_filepath(n_filename, 0);
27361
27362        ret_val = xmlIOHTTPMatch(filename);
27363        desret_int(ret_val);
27364        call_tests++;
27365        des_filepath(n_filename, filename, 0);
27366        xmlResetLastError();
27367        if (mem_base != xmlMemBlocks()) {
27368            printf("Leak of %d blocks found in xmlIOHTTPMatch",
27369	           xmlMemBlocks() - mem_base);
27370	    test_ret++;
27371            printf(" %d", n_filename);
27372            printf("\n");
27373        }
27374    }
27375    function_tests++;
27376#endif
27377
27378    return(test_ret);
27379}
27380
27381
27382static int
27383test_xmlIOHTTPOpen(void) {
27384    int test_ret = 0;
27385
27386#if defined(LIBXML_HTTP_ENABLED)
27387    int mem_base;
27388    void * ret_val;
27389    const char * filename; /* the URI for matching */
27390    int n_filename;
27391
27392    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27393        mem_base = xmlMemBlocks();
27394        filename = gen_filepath(n_filename, 0);
27395
27396        ret_val = xmlIOHTTPOpen(filename);
27397        desret_xmlNanoHTTPCtxtPtr(ret_val);
27398        call_tests++;
27399        des_filepath(n_filename, filename, 0);
27400        xmlResetLastError();
27401        if (mem_base != xmlMemBlocks()) {
27402            printf("Leak of %d blocks found in xmlIOHTTPOpen",
27403	           xmlMemBlocks() - mem_base);
27404	    test_ret++;
27405            printf(" %d", n_filename);
27406            printf("\n");
27407        }
27408    }
27409    function_tests++;
27410#endif
27411
27412    return(test_ret);
27413}
27414
27415
27416static int
27417test_xmlIOHTTPRead(void) {
27418    int test_ret = 0;
27419
27420#if defined(LIBXML_HTTP_ENABLED)
27421    int mem_base;
27422    int ret_val;
27423    void * context; /* the I/O context */
27424    int n_context;
27425    char * buffer; /* where to drop data */
27426    int n_buffer;
27427    int len; /* number of bytes to write */
27428    int n_len;
27429
27430    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27431    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27432    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27433        mem_base = xmlMemBlocks();
27434        context = gen_void_ptr(n_context, 0);
27435        buffer = gen_char_ptr(n_buffer, 1);
27436        len = gen_int(n_len, 2);
27437
27438        ret_val = xmlIOHTTPRead(context, buffer, len);
27439        desret_int(ret_val);
27440        call_tests++;
27441        des_void_ptr(n_context, context, 0);
27442        des_char_ptr(n_buffer, buffer, 1);
27443        des_int(n_len, len, 2);
27444        xmlResetLastError();
27445        if (mem_base != xmlMemBlocks()) {
27446            printf("Leak of %d blocks found in xmlIOHTTPRead",
27447	           xmlMemBlocks() - mem_base);
27448	    test_ret++;
27449            printf(" %d", n_context);
27450            printf(" %d", n_buffer);
27451            printf(" %d", n_len);
27452            printf("\n");
27453        }
27454    }
27455    }
27456    }
27457    function_tests++;
27458#endif
27459
27460    return(test_ret);
27461}
27462
27463
27464static int
27465test_xmlNoNetExternalEntityLoader(void) {
27466    int test_ret = 0;
27467
27468    int mem_base;
27469    xmlParserInputPtr ret_val;
27470    const char * URL; /* the URL for the entity to load */
27471    int n_URL;
27472    char * ID; /* the System ID for the entity to load */
27473    int n_ID;
27474    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27475    int n_ctxt;
27476
27477    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27478    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27479    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27480        mem_base = xmlMemBlocks();
27481        URL = gen_filepath(n_URL, 0);
27482        ID = gen_const_char_ptr(n_ID, 1);
27483        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27484
27485        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27486        desret_xmlParserInputPtr(ret_val);
27487        call_tests++;
27488        des_filepath(n_URL, URL, 0);
27489        des_const_char_ptr(n_ID, (const char *)ID, 1);
27490        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27491        xmlResetLastError();
27492        if (mem_base != xmlMemBlocks()) {
27493            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27494	           xmlMemBlocks() - mem_base);
27495	    test_ret++;
27496            printf(" %d", n_URL);
27497            printf(" %d", n_ID);
27498            printf(" %d", n_ctxt);
27499            printf("\n");
27500        }
27501    }
27502    }
27503    }
27504    function_tests++;
27505
27506    return(test_ret);
27507}
27508
27509
27510static int
27511test_xmlNormalizeWindowsPath(void) {
27512    int test_ret = 0;
27513
27514    int mem_base;
27515    xmlChar * ret_val;
27516    xmlChar * path; /* the input file path */
27517    int n_path;
27518
27519    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27520        mem_base = xmlMemBlocks();
27521        path = gen_const_xmlChar_ptr(n_path, 0);
27522
27523        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27524        desret_xmlChar_ptr(ret_val);
27525        call_tests++;
27526        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27527        xmlResetLastError();
27528        if (mem_base != xmlMemBlocks()) {
27529            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27530	           xmlMemBlocks() - mem_base);
27531	    test_ret++;
27532            printf(" %d", n_path);
27533            printf("\n");
27534        }
27535    }
27536    function_tests++;
27537
27538    return(test_ret);
27539}
27540
27541
27542static int
27543test_xmlOutputBufferCreateFd(void) {
27544    int test_ret = 0;
27545
27546#if defined(LIBXML_OUTPUT_ENABLED)
27547    int mem_base;
27548    xmlOutputBufferPtr ret_val;
27549    int fd; /* a file descriptor number */
27550    int n_fd;
27551    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27552    int n_encoder;
27553
27554    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27555    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27556        mem_base = xmlMemBlocks();
27557        fd = gen_int(n_fd, 0);
27558        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27559
27560        ret_val = xmlOutputBufferCreateFd(fd, encoder);
27561        desret_xmlOutputBufferPtr(ret_val);
27562        call_tests++;
27563        des_int(n_fd, fd, 0);
27564        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27565        xmlResetLastError();
27566        if (mem_base != xmlMemBlocks()) {
27567            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
27568	           xmlMemBlocks() - mem_base);
27569	    test_ret++;
27570            printf(" %d", n_fd);
27571            printf(" %d", n_encoder);
27572            printf("\n");
27573        }
27574    }
27575    }
27576    function_tests++;
27577#endif
27578
27579    return(test_ret);
27580}
27581
27582
27583static int
27584test_xmlOutputBufferCreateFile(void) {
27585    int test_ret = 0;
27586
27587#if defined(LIBXML_OUTPUT_ENABLED)
27588    int mem_base;
27589    xmlOutputBufferPtr ret_val;
27590    FILE * file; /* a FILE* */
27591    int n_file;
27592    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27593    int n_encoder;
27594
27595    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27596    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27597        mem_base = xmlMemBlocks();
27598        file = gen_FILE_ptr(n_file, 0);
27599        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27600
27601        ret_val = xmlOutputBufferCreateFile(file, encoder);
27602        desret_xmlOutputBufferPtr(ret_val);
27603        call_tests++;
27604        des_FILE_ptr(n_file, file, 0);
27605        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27606        xmlResetLastError();
27607        if (mem_base != xmlMemBlocks()) {
27608            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
27609	           xmlMemBlocks() - mem_base);
27610	    test_ret++;
27611            printf(" %d", n_file);
27612            printf(" %d", n_encoder);
27613            printf("\n");
27614        }
27615    }
27616    }
27617    function_tests++;
27618#endif
27619
27620    return(test_ret);
27621}
27622
27623
27624static int
27625test_xmlOutputBufferCreateFilename(void) {
27626    int test_ret = 0;
27627
27628#if defined(LIBXML_OUTPUT_ENABLED)
27629    int mem_base;
27630    xmlOutputBufferPtr ret_val;
27631    const char * URI; /* a C string containing the URI or filename */
27632    int n_URI;
27633    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27634    int n_encoder;
27635    int compression; /* the compression ration (0 none, 9 max). */
27636    int n_compression;
27637
27638    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27639    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27640    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
27641        mem_base = xmlMemBlocks();
27642        URI = gen_fileoutput(n_URI, 0);
27643        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27644        compression = gen_int(n_compression, 2);
27645
27646        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
27647        desret_xmlOutputBufferPtr(ret_val);
27648        call_tests++;
27649        des_fileoutput(n_URI, URI, 0);
27650        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27651        des_int(n_compression, compression, 2);
27652        xmlResetLastError();
27653        if (mem_base != xmlMemBlocks()) {
27654            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
27655	           xmlMemBlocks() - mem_base);
27656	    test_ret++;
27657            printf(" %d", n_URI);
27658            printf(" %d", n_encoder);
27659            printf(" %d", n_compression);
27660            printf("\n");
27661        }
27662    }
27663    }
27664    }
27665    function_tests++;
27666#endif
27667
27668    return(test_ret);
27669}
27670
27671
27672static int
27673test_xmlOutputBufferFlush(void) {
27674    int test_ret = 0;
27675
27676#if defined(LIBXML_OUTPUT_ENABLED)
27677    int mem_base;
27678    int ret_val;
27679    xmlOutputBufferPtr out; /* a buffered output */
27680    int n_out;
27681
27682    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27683        mem_base = xmlMemBlocks();
27684        out = gen_xmlOutputBufferPtr(n_out, 0);
27685
27686        ret_val = xmlOutputBufferFlush(out);
27687        desret_int(ret_val);
27688        call_tests++;
27689        des_xmlOutputBufferPtr(n_out, out, 0);
27690        xmlResetLastError();
27691        if (mem_base != xmlMemBlocks()) {
27692            printf("Leak of %d blocks found in xmlOutputBufferFlush",
27693	           xmlMemBlocks() - mem_base);
27694	    test_ret++;
27695            printf(" %d", n_out);
27696            printf("\n");
27697        }
27698    }
27699    function_tests++;
27700#endif
27701
27702    return(test_ret);
27703}
27704
27705
27706static int
27707test_xmlOutputBufferWrite(void) {
27708    int test_ret = 0;
27709
27710#if defined(LIBXML_OUTPUT_ENABLED)
27711    int mem_base;
27712    int ret_val;
27713    xmlOutputBufferPtr out; /* a buffered parser output */
27714    int n_out;
27715    int len; /* the size in bytes of the array. */
27716    int n_len;
27717    char * buf; /* an char array */
27718    int n_buf;
27719
27720    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27721    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27722    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27723        mem_base = xmlMemBlocks();
27724        out = gen_xmlOutputBufferPtr(n_out, 0);
27725        len = gen_int(n_len, 1);
27726        buf = gen_const_char_ptr(n_buf, 2);
27727
27728        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
27729        desret_int(ret_val);
27730        call_tests++;
27731        des_xmlOutputBufferPtr(n_out, out, 0);
27732        des_int(n_len, len, 1);
27733        des_const_char_ptr(n_buf, (const char *)buf, 2);
27734        xmlResetLastError();
27735        if (mem_base != xmlMemBlocks()) {
27736            printf("Leak of %d blocks found in xmlOutputBufferWrite",
27737	           xmlMemBlocks() - mem_base);
27738	    test_ret++;
27739            printf(" %d", n_out);
27740            printf(" %d", n_len);
27741            printf(" %d", n_buf);
27742            printf("\n");
27743        }
27744    }
27745    }
27746    }
27747    function_tests++;
27748#endif
27749
27750    return(test_ret);
27751}
27752
27753
27754static int
27755test_xmlOutputBufferWriteEscape(void) {
27756    int test_ret = 0;
27757
27758
27759    /* missing type support */
27760    return(test_ret);
27761}
27762
27763
27764static int
27765test_xmlOutputBufferWriteString(void) {
27766    int test_ret = 0;
27767
27768#if defined(LIBXML_OUTPUT_ENABLED)
27769    int mem_base;
27770    int ret_val;
27771    xmlOutputBufferPtr out; /* a buffered parser output */
27772    int n_out;
27773    char * str; /* a zero terminated C string */
27774    int n_str;
27775
27776    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27777    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
27778        mem_base = xmlMemBlocks();
27779        out = gen_xmlOutputBufferPtr(n_out, 0);
27780        str = gen_const_char_ptr(n_str, 1);
27781
27782        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
27783        desret_int(ret_val);
27784        call_tests++;
27785        des_xmlOutputBufferPtr(n_out, out, 0);
27786        des_const_char_ptr(n_str, (const char *)str, 1);
27787        xmlResetLastError();
27788        if (mem_base != xmlMemBlocks()) {
27789            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
27790	           xmlMemBlocks() - mem_base);
27791	    test_ret++;
27792            printf(" %d", n_out);
27793            printf(" %d", n_str);
27794            printf("\n");
27795        }
27796    }
27797    }
27798    function_tests++;
27799#endif
27800
27801    return(test_ret);
27802}
27803
27804
27805static int
27806test_xmlParserGetDirectory(void) {
27807    int test_ret = 0;
27808
27809
27810    /* missing type support */
27811    return(test_ret);
27812}
27813
27814
27815static int
27816test_xmlParserInputBufferCreateFd(void) {
27817    int test_ret = 0;
27818
27819    int mem_base;
27820    xmlParserInputBufferPtr ret_val;
27821    int fd; /* a file descriptor number */
27822    int n_fd;
27823    xmlCharEncoding enc; /* the charset encoding if known */
27824    int n_enc;
27825
27826    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27827    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27828        mem_base = xmlMemBlocks();
27829        fd = gen_int(n_fd, 0);
27830        enc = gen_xmlCharEncoding(n_enc, 1);
27831        if (fd >= 0) fd = -1;
27832
27833        ret_val = xmlParserInputBufferCreateFd(fd, enc);
27834        desret_xmlParserInputBufferPtr(ret_val);
27835        call_tests++;
27836        des_int(n_fd, fd, 0);
27837        des_xmlCharEncoding(n_enc, enc, 1);
27838        xmlResetLastError();
27839        if (mem_base != xmlMemBlocks()) {
27840            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
27841	           xmlMemBlocks() - mem_base);
27842	    test_ret++;
27843            printf(" %d", n_fd);
27844            printf(" %d", n_enc);
27845            printf("\n");
27846        }
27847    }
27848    }
27849    function_tests++;
27850
27851    return(test_ret);
27852}
27853
27854
27855static int
27856test_xmlParserInputBufferCreateFile(void) {
27857    int test_ret = 0;
27858
27859    int mem_base;
27860    xmlParserInputBufferPtr ret_val;
27861    FILE * file; /* a FILE* */
27862    int n_file;
27863    xmlCharEncoding enc; /* the charset encoding if known */
27864    int n_enc;
27865
27866    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27867    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27868        mem_base = xmlMemBlocks();
27869        file = gen_FILE_ptr(n_file, 0);
27870        enc = gen_xmlCharEncoding(n_enc, 1);
27871
27872        ret_val = xmlParserInputBufferCreateFile(file, enc);
27873        desret_xmlParserInputBufferPtr(ret_val);
27874        call_tests++;
27875        des_FILE_ptr(n_file, file, 0);
27876        des_xmlCharEncoding(n_enc, enc, 1);
27877        xmlResetLastError();
27878        if (mem_base != xmlMemBlocks()) {
27879            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
27880	           xmlMemBlocks() - mem_base);
27881	    test_ret++;
27882            printf(" %d", n_file);
27883            printf(" %d", n_enc);
27884            printf("\n");
27885        }
27886    }
27887    }
27888    function_tests++;
27889
27890    return(test_ret);
27891}
27892
27893
27894static int
27895test_xmlParserInputBufferCreateFilename(void) {
27896    int test_ret = 0;
27897
27898    int mem_base;
27899    xmlParserInputBufferPtr ret_val;
27900    const char * URI; /* a C string containing the URI or filename */
27901    int n_URI;
27902    xmlCharEncoding enc; /* the charset encoding if known */
27903    int n_enc;
27904
27905    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27906    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27907        mem_base = xmlMemBlocks();
27908        URI = gen_fileoutput(n_URI, 0);
27909        enc = gen_xmlCharEncoding(n_enc, 1);
27910
27911        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
27912        desret_xmlParserInputBufferPtr(ret_val);
27913        call_tests++;
27914        des_fileoutput(n_URI, URI, 0);
27915        des_xmlCharEncoding(n_enc, enc, 1);
27916        xmlResetLastError();
27917        if (mem_base != xmlMemBlocks()) {
27918            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
27919	           xmlMemBlocks() - mem_base);
27920	    test_ret++;
27921            printf(" %d", n_URI);
27922            printf(" %d", n_enc);
27923            printf("\n");
27924        }
27925    }
27926    }
27927    function_tests++;
27928
27929    return(test_ret);
27930}
27931
27932
27933static int
27934test_xmlParserInputBufferCreateMem(void) {
27935    int test_ret = 0;
27936
27937    int mem_base;
27938    xmlParserInputBufferPtr ret_val;
27939    char * mem; /* the memory input */
27940    int n_mem;
27941    int size; /* the length of the memory block */
27942    int n_size;
27943    xmlCharEncoding enc; /* the charset encoding if known */
27944    int n_enc;
27945
27946    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27947    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27948    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27949        mem_base = xmlMemBlocks();
27950        mem = gen_const_char_ptr(n_mem, 0);
27951        size = gen_int(n_size, 1);
27952        enc = gen_xmlCharEncoding(n_enc, 2);
27953
27954        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
27955        desret_xmlParserInputBufferPtr(ret_val);
27956        call_tests++;
27957        des_const_char_ptr(n_mem, (const char *)mem, 0);
27958        des_int(n_size, size, 1);
27959        des_xmlCharEncoding(n_enc, enc, 2);
27960        xmlResetLastError();
27961        if (mem_base != xmlMemBlocks()) {
27962            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
27963	           xmlMemBlocks() - mem_base);
27964	    test_ret++;
27965            printf(" %d", n_mem);
27966            printf(" %d", n_size);
27967            printf(" %d", n_enc);
27968            printf("\n");
27969        }
27970    }
27971    }
27972    }
27973    function_tests++;
27974
27975    return(test_ret);
27976}
27977
27978
27979static int
27980test_xmlParserInputBufferCreateStatic(void) {
27981    int test_ret = 0;
27982
27983    int mem_base;
27984    xmlParserInputBufferPtr ret_val;
27985    char * mem; /* the memory input */
27986    int n_mem;
27987    int size; /* the length of the memory block */
27988    int n_size;
27989    xmlCharEncoding enc; /* the charset encoding if known */
27990    int n_enc;
27991
27992    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27993    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27994    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27995        mem_base = xmlMemBlocks();
27996        mem = gen_const_char_ptr(n_mem, 0);
27997        size = gen_int(n_size, 1);
27998        enc = gen_xmlCharEncoding(n_enc, 2);
27999
28000        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28001        desret_xmlParserInputBufferPtr(ret_val);
28002        call_tests++;
28003        des_const_char_ptr(n_mem, (const char *)mem, 0);
28004        des_int(n_size, size, 1);
28005        des_xmlCharEncoding(n_enc, enc, 2);
28006        xmlResetLastError();
28007        if (mem_base != xmlMemBlocks()) {
28008            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28009	           xmlMemBlocks() - mem_base);
28010	    test_ret++;
28011            printf(" %d", n_mem);
28012            printf(" %d", n_size);
28013            printf(" %d", n_enc);
28014            printf("\n");
28015        }
28016    }
28017    }
28018    }
28019    function_tests++;
28020
28021    return(test_ret);
28022}
28023
28024
28025static int
28026test_xmlParserInputBufferGrow(void) {
28027    int test_ret = 0;
28028
28029    int mem_base;
28030    int ret_val;
28031    xmlParserInputBufferPtr in; /* a buffered parser input */
28032    int n_in;
28033    int len; /* indicative value of the amount of chars to read */
28034    int n_len;
28035
28036    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28037    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28038        mem_base = xmlMemBlocks();
28039        in = gen_xmlParserInputBufferPtr(n_in, 0);
28040        len = gen_int(n_len, 1);
28041
28042        ret_val = xmlParserInputBufferGrow(in, len);
28043        desret_int(ret_val);
28044        call_tests++;
28045        des_xmlParserInputBufferPtr(n_in, in, 0);
28046        des_int(n_len, len, 1);
28047        xmlResetLastError();
28048        if (mem_base != xmlMemBlocks()) {
28049            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28050	           xmlMemBlocks() - mem_base);
28051	    test_ret++;
28052            printf(" %d", n_in);
28053            printf(" %d", n_len);
28054            printf("\n");
28055        }
28056    }
28057    }
28058    function_tests++;
28059
28060    return(test_ret);
28061}
28062
28063
28064static int
28065test_xmlParserInputBufferPush(void) {
28066    int test_ret = 0;
28067
28068    int mem_base;
28069    int ret_val;
28070    xmlParserInputBufferPtr in; /* a buffered parser input */
28071    int n_in;
28072    int len; /* the size in bytes of the array. */
28073    int n_len;
28074    char * buf; /* an char array */
28075    int n_buf;
28076
28077    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28078    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28079    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28080        mem_base = xmlMemBlocks();
28081        in = gen_xmlParserInputBufferPtr(n_in, 0);
28082        len = gen_int(n_len, 1);
28083        buf = gen_const_char_ptr(n_buf, 2);
28084
28085        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28086        desret_int(ret_val);
28087        call_tests++;
28088        des_xmlParserInputBufferPtr(n_in, in, 0);
28089        des_int(n_len, len, 1);
28090        des_const_char_ptr(n_buf, (const char *)buf, 2);
28091        xmlResetLastError();
28092        if (mem_base != xmlMemBlocks()) {
28093            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28094	           xmlMemBlocks() - mem_base);
28095	    test_ret++;
28096            printf(" %d", n_in);
28097            printf(" %d", n_len);
28098            printf(" %d", n_buf);
28099            printf("\n");
28100        }
28101    }
28102    }
28103    }
28104    function_tests++;
28105
28106    return(test_ret);
28107}
28108
28109
28110static int
28111test_xmlParserInputBufferRead(void) {
28112    int test_ret = 0;
28113
28114    int mem_base;
28115    int ret_val;
28116    xmlParserInputBufferPtr in; /* a buffered parser input */
28117    int n_in;
28118    int len; /* indicative value of the amount of chars to read */
28119    int n_len;
28120
28121    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28122    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28123        mem_base = xmlMemBlocks();
28124        in = gen_xmlParserInputBufferPtr(n_in, 0);
28125        len = gen_int(n_len, 1);
28126
28127        ret_val = xmlParserInputBufferRead(in, len);
28128        desret_int(ret_val);
28129        call_tests++;
28130        des_xmlParserInputBufferPtr(n_in, in, 0);
28131        des_int(n_len, len, 1);
28132        xmlResetLastError();
28133        if (mem_base != xmlMemBlocks()) {
28134            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28135	           xmlMemBlocks() - mem_base);
28136	    test_ret++;
28137            printf(" %d", n_in);
28138            printf(" %d", n_len);
28139            printf("\n");
28140        }
28141    }
28142    }
28143    function_tests++;
28144
28145    return(test_ret);
28146}
28147
28148
28149static int
28150test_xmlPopInputCallbacks(void) {
28151    int test_ret = 0;
28152
28153    int mem_base;
28154    int ret_val;
28155
28156        mem_base = xmlMemBlocks();
28157
28158        ret_val = xmlPopInputCallbacks();
28159        desret_int(ret_val);
28160        call_tests++;
28161        xmlResetLastError();
28162        if (mem_base != xmlMemBlocks()) {
28163            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28164	           xmlMemBlocks() - mem_base);
28165	    test_ret++;
28166            printf("\n");
28167        }
28168    function_tests++;
28169
28170    return(test_ret);
28171}
28172
28173
28174static int
28175test_xmlRegisterDefaultInputCallbacks(void) {
28176    int test_ret = 0;
28177
28178    int mem_base;
28179
28180        mem_base = xmlMemBlocks();
28181
28182        xmlRegisterDefaultInputCallbacks();
28183        call_tests++;
28184        xmlResetLastError();
28185        if (mem_base != xmlMemBlocks()) {
28186            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28187	           xmlMemBlocks() - mem_base);
28188	    test_ret++;
28189            printf("\n");
28190        }
28191    function_tests++;
28192
28193    return(test_ret);
28194}
28195
28196
28197static int
28198test_xmlRegisterDefaultOutputCallbacks(void) {
28199    int test_ret = 0;
28200
28201#if defined(LIBXML_OUTPUT_ENABLED)
28202    int mem_base;
28203
28204        mem_base = xmlMemBlocks();
28205
28206        xmlRegisterDefaultOutputCallbacks();
28207        call_tests++;
28208        xmlResetLastError();
28209        if (mem_base != xmlMemBlocks()) {
28210            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28211	           xmlMemBlocks() - mem_base);
28212	    test_ret++;
28213            printf("\n");
28214        }
28215    function_tests++;
28216#endif
28217
28218    return(test_ret);
28219}
28220
28221
28222static int
28223test_xmlRegisterHTTPPostCallbacks(void) {
28224    int test_ret = 0;
28225
28226#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28227    int mem_base;
28228
28229        mem_base = xmlMemBlocks();
28230
28231        xmlRegisterHTTPPostCallbacks();
28232        call_tests++;
28233        xmlResetLastError();
28234        if (mem_base != xmlMemBlocks()) {
28235            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28236	           xmlMemBlocks() - mem_base);
28237	    test_ret++;
28238            printf("\n");
28239        }
28240    function_tests++;
28241#endif
28242
28243    return(test_ret);
28244}
28245
28246static int
28247test_xmlIO(void) {
28248    int test_ret = 0;
28249
28250    if (quiet == 0) printf("Testing xmlIO : 38 of 47 functions ...\n");
28251    test_ret += test_xmlAllocOutputBuffer();
28252    test_ret += test_xmlAllocParserInputBuffer();
28253    test_ret += test_xmlCheckFilename();
28254    test_ret += test_xmlCheckHTTPInput();
28255    test_ret += test_xmlCleanupInputCallbacks();
28256    test_ret += test_xmlCleanupOutputCallbacks();
28257    test_ret += test_xmlFileClose();
28258    test_ret += test_xmlFileMatch();
28259    test_ret += test_xmlFileOpen();
28260    test_ret += test_xmlFileRead();
28261    test_ret += test_xmlIOFTPClose();
28262    test_ret += test_xmlIOFTPMatch();
28263    test_ret += test_xmlIOFTPOpen();
28264    test_ret += test_xmlIOFTPRead();
28265    test_ret += test_xmlIOHTTPClose();
28266    test_ret += test_xmlIOHTTPMatch();
28267    test_ret += test_xmlIOHTTPOpen();
28268    test_ret += test_xmlIOHTTPRead();
28269    test_ret += test_xmlNoNetExternalEntityLoader();
28270    test_ret += test_xmlNormalizeWindowsPath();
28271    test_ret += test_xmlOutputBufferCreateFd();
28272    test_ret += test_xmlOutputBufferCreateFile();
28273    test_ret += test_xmlOutputBufferCreateFilename();
28274    test_ret += test_xmlOutputBufferFlush();
28275    test_ret += test_xmlOutputBufferWrite();
28276    test_ret += test_xmlOutputBufferWriteEscape();
28277    test_ret += test_xmlOutputBufferWriteString();
28278    test_ret += test_xmlParserGetDirectory();
28279    test_ret += test_xmlParserInputBufferCreateFd();
28280    test_ret += test_xmlParserInputBufferCreateFile();
28281    test_ret += test_xmlParserInputBufferCreateFilename();
28282    test_ret += test_xmlParserInputBufferCreateMem();
28283    test_ret += test_xmlParserInputBufferCreateStatic();
28284    test_ret += test_xmlParserInputBufferGrow();
28285    test_ret += test_xmlParserInputBufferPush();
28286    test_ret += test_xmlParserInputBufferRead();
28287    test_ret += test_xmlPopInputCallbacks();
28288    test_ret += test_xmlRegisterDefaultInputCallbacks();
28289    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28290    test_ret += test_xmlRegisterHTTPPostCallbacks();
28291
28292    if (test_ret != 0)
28293	printf("Module xmlIO: %d errors\n", test_ret);
28294    return(test_ret);
28295}
28296#ifdef LIBXML_AUTOMATA_ENABLED
28297
28298#define gen_nb_xmlAutomataPtr 1
28299static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28300    return(NULL);
28301}
28302static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28303}
28304#endif
28305
28306
28307static int
28308test_xmlAutomataCompile(void) {
28309    int test_ret = 0;
28310
28311
28312    /* missing type support */
28313    return(test_ret);
28314}
28315
28316
28317static int
28318test_xmlAutomataGetInitState(void) {
28319    int test_ret = 0;
28320
28321
28322    /* missing type support */
28323    return(test_ret);
28324}
28325
28326
28327static int
28328test_xmlAutomataIsDeterminist(void) {
28329    int test_ret = 0;
28330
28331#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28332    int mem_base;
28333    int ret_val;
28334    xmlAutomataPtr am; /* an automata */
28335    int n_am;
28336
28337    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28338        mem_base = xmlMemBlocks();
28339        am = gen_xmlAutomataPtr(n_am, 0);
28340
28341        ret_val = xmlAutomataIsDeterminist(am);
28342        desret_int(ret_val);
28343        call_tests++;
28344        des_xmlAutomataPtr(n_am, am, 0);
28345        xmlResetLastError();
28346        if (mem_base != xmlMemBlocks()) {
28347            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28348	           xmlMemBlocks() - mem_base);
28349	    test_ret++;
28350            printf(" %d", n_am);
28351            printf("\n");
28352        }
28353    }
28354    function_tests++;
28355#endif
28356
28357    return(test_ret);
28358}
28359
28360#ifdef LIBXML_AUTOMATA_ENABLED
28361
28362#define gen_nb_xmlAutomataStatePtr 1
28363static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28364    return(NULL);
28365}
28366static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28367}
28368#endif
28369
28370
28371static int
28372test_xmlAutomataNewAllTrans(void) {
28373    int test_ret = 0;
28374
28375
28376    /* missing type support */
28377    return(test_ret);
28378}
28379
28380
28381static int
28382test_xmlAutomataNewCountTrans(void) {
28383    int test_ret = 0;
28384
28385
28386    /* missing type support */
28387    return(test_ret);
28388}
28389
28390
28391static int
28392test_xmlAutomataNewCountTrans2(void) {
28393    int test_ret = 0;
28394
28395
28396    /* missing type support */
28397    return(test_ret);
28398}
28399
28400
28401static int
28402test_xmlAutomataNewCountedTrans(void) {
28403    int test_ret = 0;
28404
28405
28406    /* missing type support */
28407    return(test_ret);
28408}
28409
28410
28411static int
28412test_xmlAutomataNewCounter(void) {
28413    int test_ret = 0;
28414
28415#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28416    int mem_base;
28417    int ret_val;
28418    xmlAutomataPtr am; /* an automata */
28419    int n_am;
28420    int min; /* the minimal value on the counter */
28421    int n_min;
28422    int max; /* the maximal value on the counter */
28423    int n_max;
28424
28425    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28426    for (n_min = 0;n_min < gen_nb_int;n_min++) {
28427    for (n_max = 0;n_max < gen_nb_int;n_max++) {
28428        mem_base = xmlMemBlocks();
28429        am = gen_xmlAutomataPtr(n_am, 0);
28430        min = gen_int(n_min, 1);
28431        max = gen_int(n_max, 2);
28432
28433        ret_val = xmlAutomataNewCounter(am, min, max);
28434        desret_int(ret_val);
28435        call_tests++;
28436        des_xmlAutomataPtr(n_am, am, 0);
28437        des_int(n_min, min, 1);
28438        des_int(n_max, max, 2);
28439        xmlResetLastError();
28440        if (mem_base != xmlMemBlocks()) {
28441            printf("Leak of %d blocks found in xmlAutomataNewCounter",
28442	           xmlMemBlocks() - mem_base);
28443	    test_ret++;
28444            printf(" %d", n_am);
28445            printf(" %d", n_min);
28446            printf(" %d", n_max);
28447            printf("\n");
28448        }
28449    }
28450    }
28451    }
28452    function_tests++;
28453#endif
28454
28455    return(test_ret);
28456}
28457
28458
28459static int
28460test_xmlAutomataNewCounterTrans(void) {
28461    int test_ret = 0;
28462
28463
28464    /* missing type support */
28465    return(test_ret);
28466}
28467
28468
28469static int
28470test_xmlAutomataNewEpsilon(void) {
28471    int test_ret = 0;
28472
28473
28474    /* missing type support */
28475    return(test_ret);
28476}
28477
28478
28479static int
28480test_xmlAutomataNewNegTrans(void) {
28481    int test_ret = 0;
28482
28483
28484    /* missing type support */
28485    return(test_ret);
28486}
28487
28488
28489static int
28490test_xmlAutomataNewOnceTrans(void) {
28491    int test_ret = 0;
28492
28493
28494    /* missing type support */
28495    return(test_ret);
28496}
28497
28498
28499static int
28500test_xmlAutomataNewOnceTrans2(void) {
28501    int test_ret = 0;
28502
28503
28504    /* missing type support */
28505    return(test_ret);
28506}
28507
28508
28509static int
28510test_xmlAutomataNewState(void) {
28511    int test_ret = 0;
28512
28513
28514    /* missing type support */
28515    return(test_ret);
28516}
28517
28518
28519static int
28520test_xmlAutomataNewTransition(void) {
28521    int test_ret = 0;
28522
28523
28524    /* missing type support */
28525    return(test_ret);
28526}
28527
28528
28529static int
28530test_xmlAutomataNewTransition2(void) {
28531    int test_ret = 0;
28532
28533
28534    /* missing type support */
28535    return(test_ret);
28536}
28537
28538
28539static int
28540test_xmlAutomataSetFinalState(void) {
28541    int test_ret = 0;
28542
28543#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28544    int mem_base;
28545    int ret_val;
28546    xmlAutomataPtr am; /* an automata */
28547    int n_am;
28548    xmlAutomataStatePtr state; /* a state in this automata */
28549    int n_state;
28550
28551    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28552    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
28553        mem_base = xmlMemBlocks();
28554        am = gen_xmlAutomataPtr(n_am, 0);
28555        state = gen_xmlAutomataStatePtr(n_state, 1);
28556
28557        ret_val = xmlAutomataSetFinalState(am, state);
28558        desret_int(ret_val);
28559        call_tests++;
28560        des_xmlAutomataPtr(n_am, am, 0);
28561        des_xmlAutomataStatePtr(n_state, state, 1);
28562        xmlResetLastError();
28563        if (mem_base != xmlMemBlocks()) {
28564            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
28565	           xmlMemBlocks() - mem_base);
28566	    test_ret++;
28567            printf(" %d", n_am);
28568            printf(" %d", n_state);
28569            printf("\n");
28570        }
28571    }
28572    }
28573    function_tests++;
28574#endif
28575
28576    return(test_ret);
28577}
28578
28579
28580static int
28581test_xmlNewAutomata(void) {
28582    int test_ret = 0;
28583
28584
28585    /* missing type support */
28586    return(test_ret);
28587}
28588
28589static int
28590test_xmlautomata(void) {
28591    int test_ret = 0;
28592
28593    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
28594    test_ret += test_xmlAutomataCompile();
28595    test_ret += test_xmlAutomataGetInitState();
28596    test_ret += test_xmlAutomataIsDeterminist();
28597    test_ret += test_xmlAutomataNewAllTrans();
28598    test_ret += test_xmlAutomataNewCountTrans();
28599    test_ret += test_xmlAutomataNewCountTrans2();
28600    test_ret += test_xmlAutomataNewCountedTrans();
28601    test_ret += test_xmlAutomataNewCounter();
28602    test_ret += test_xmlAutomataNewCounterTrans();
28603    test_ret += test_xmlAutomataNewEpsilon();
28604    test_ret += test_xmlAutomataNewNegTrans();
28605    test_ret += test_xmlAutomataNewOnceTrans();
28606    test_ret += test_xmlAutomataNewOnceTrans2();
28607    test_ret += test_xmlAutomataNewState();
28608    test_ret += test_xmlAutomataNewTransition();
28609    test_ret += test_xmlAutomataNewTransition2();
28610    test_ret += test_xmlAutomataSetFinalState();
28611    test_ret += test_xmlNewAutomata();
28612
28613    if (test_ret != 0)
28614	printf("Module xmlautomata: %d errors\n", test_ret);
28615    return(test_ret);
28616}
28617
28618#define gen_nb_xmlGenericErrorFunc_ptr 1
28619static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28620    return(NULL);
28621}
28622static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28623}
28624
28625static int
28626test_initGenericErrorDefaultFunc(void) {
28627    int test_ret = 0;
28628
28629    int mem_base;
28630    xmlGenericErrorFunc * handler; /* the handler */
28631    int n_handler;
28632
28633    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
28634        mem_base = xmlMemBlocks();
28635        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
28636
28637        initGenericErrorDefaultFunc(handler);
28638        call_tests++;
28639        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
28640        xmlResetLastError();
28641        if (mem_base != xmlMemBlocks()) {
28642            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
28643	           xmlMemBlocks() - mem_base);
28644	    test_ret++;
28645            printf(" %d", n_handler);
28646            printf("\n");
28647        }
28648    }
28649    function_tests++;
28650
28651    return(test_ret);
28652}
28653
28654
28655#define gen_nb_xmlErrorPtr 1
28656static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28657    return(NULL);
28658}
28659static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28660}
28661
28662static int
28663test_xmlCopyError(void) {
28664    int test_ret = 0;
28665
28666    int mem_base;
28667    int ret_val;
28668    xmlErrorPtr from; /* a source error */
28669    int n_from;
28670    xmlErrorPtr to; /* a target error */
28671    int n_to;
28672
28673    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
28674    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
28675        mem_base = xmlMemBlocks();
28676        from = gen_xmlErrorPtr(n_from, 0);
28677        to = gen_xmlErrorPtr(n_to, 1);
28678
28679        ret_val = xmlCopyError(from, to);
28680        desret_int(ret_val);
28681        call_tests++;
28682        des_xmlErrorPtr(n_from, from, 0);
28683        des_xmlErrorPtr(n_to, to, 1);
28684        xmlResetLastError();
28685        if (mem_base != xmlMemBlocks()) {
28686            printf("Leak of %d blocks found in xmlCopyError",
28687	           xmlMemBlocks() - mem_base);
28688	    test_ret++;
28689            printf(" %d", n_from);
28690            printf(" %d", n_to);
28691            printf("\n");
28692        }
28693    }
28694    }
28695    function_tests++;
28696
28697    return(test_ret);
28698}
28699
28700
28701static int
28702test_xmlCtxtGetLastError(void) {
28703    int test_ret = 0;
28704
28705
28706    /* missing type support */
28707    return(test_ret);
28708}
28709
28710
28711static int
28712test_xmlCtxtResetLastError(void) {
28713    int test_ret = 0;
28714
28715    int mem_base;
28716    void * ctx; /* an XML parser context */
28717    int n_ctx;
28718
28719    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
28720        mem_base = xmlMemBlocks();
28721        ctx = gen_void_ptr(n_ctx, 0);
28722
28723        xmlCtxtResetLastError(ctx);
28724        call_tests++;
28725        des_void_ptr(n_ctx, ctx, 0);
28726        xmlResetLastError();
28727        if (mem_base != xmlMemBlocks()) {
28728            printf("Leak of %d blocks found in xmlCtxtResetLastError",
28729	           xmlMemBlocks() - mem_base);
28730	    test_ret++;
28731            printf(" %d", n_ctx);
28732            printf("\n");
28733        }
28734    }
28735    function_tests++;
28736
28737    return(test_ret);
28738}
28739
28740
28741static int
28742test_xmlGetLastError(void) {
28743    int test_ret = 0;
28744
28745
28746    /* missing type support */
28747    return(test_ret);
28748}
28749
28750
28751static int
28752test_xmlParserError(void) {
28753    int test_ret = 0;
28754
28755
28756    /* missing type support */
28757    return(test_ret);
28758}
28759
28760
28761static int
28762test_xmlParserPrintFileContext(void) {
28763    int test_ret = 0;
28764
28765    int mem_base;
28766    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28767    int n_input;
28768
28769    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28770        mem_base = xmlMemBlocks();
28771        input = gen_xmlParserInputPtr(n_input, 0);
28772
28773        xmlParserPrintFileContext(input);
28774        call_tests++;
28775        des_xmlParserInputPtr(n_input, input, 0);
28776        xmlResetLastError();
28777        if (mem_base != xmlMemBlocks()) {
28778            printf("Leak of %d blocks found in xmlParserPrintFileContext",
28779	           xmlMemBlocks() - mem_base);
28780	    test_ret++;
28781            printf(" %d", n_input);
28782            printf("\n");
28783        }
28784    }
28785    function_tests++;
28786
28787    return(test_ret);
28788}
28789
28790
28791static int
28792test_xmlParserPrintFileInfo(void) {
28793    int test_ret = 0;
28794
28795    int mem_base;
28796    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28797    int n_input;
28798
28799    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28800        mem_base = xmlMemBlocks();
28801        input = gen_xmlParserInputPtr(n_input, 0);
28802
28803        xmlParserPrintFileInfo(input);
28804        call_tests++;
28805        des_xmlParserInputPtr(n_input, input, 0);
28806        xmlResetLastError();
28807        if (mem_base != xmlMemBlocks()) {
28808            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
28809	           xmlMemBlocks() - mem_base);
28810	    test_ret++;
28811            printf(" %d", n_input);
28812            printf("\n");
28813        }
28814    }
28815    function_tests++;
28816
28817    return(test_ret);
28818}
28819
28820
28821static int
28822test_xmlParserValidityError(void) {
28823    int test_ret = 0;
28824
28825
28826    /* missing type support */
28827    return(test_ret);
28828}
28829
28830
28831static int
28832test_xmlParserValidityWarning(void) {
28833    int test_ret = 0;
28834
28835
28836    /* missing type support */
28837    return(test_ret);
28838}
28839
28840
28841static int
28842test_xmlParserWarning(void) {
28843    int test_ret = 0;
28844
28845
28846    /* missing type support */
28847    return(test_ret);
28848}
28849
28850
28851static int
28852test_xmlResetError(void) {
28853    int test_ret = 0;
28854
28855    int mem_base;
28856    xmlErrorPtr err; /* pointer to the error. */
28857    int n_err;
28858
28859    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
28860        mem_base = xmlMemBlocks();
28861        err = gen_xmlErrorPtr(n_err, 0);
28862
28863        xmlResetError(err);
28864        call_tests++;
28865        des_xmlErrorPtr(n_err, err, 0);
28866        xmlResetLastError();
28867        if (mem_base != xmlMemBlocks()) {
28868            printf("Leak of %d blocks found in xmlResetError",
28869	           xmlMemBlocks() - mem_base);
28870	    test_ret++;
28871            printf(" %d", n_err);
28872            printf("\n");
28873        }
28874    }
28875    function_tests++;
28876
28877    return(test_ret);
28878}
28879
28880
28881static int
28882test_xmlResetLastError(void) {
28883    int test_ret = 0;
28884
28885
28886
28887        xmlResetLastError();
28888        call_tests++;
28889        xmlResetLastError();
28890    function_tests++;
28891
28892    return(test_ret);
28893}
28894
28895
28896static int
28897test_xmlSetGenericErrorFunc(void) {
28898    int test_ret = 0;
28899
28900
28901    /* missing type support */
28902    return(test_ret);
28903}
28904
28905
28906static int
28907test_xmlSetStructuredErrorFunc(void) {
28908    int test_ret = 0;
28909
28910
28911    /* missing type support */
28912    return(test_ret);
28913}
28914
28915static int
28916test_xmlerror(void) {
28917    int test_ret = 0;
28918
28919    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
28920    test_ret += test_initGenericErrorDefaultFunc();
28921    test_ret += test_xmlCopyError();
28922    test_ret += test_xmlCtxtGetLastError();
28923    test_ret += test_xmlCtxtResetLastError();
28924    test_ret += test_xmlGetLastError();
28925    test_ret += test_xmlParserError();
28926    test_ret += test_xmlParserPrintFileContext();
28927    test_ret += test_xmlParserPrintFileInfo();
28928    test_ret += test_xmlParserValidityError();
28929    test_ret += test_xmlParserValidityWarning();
28930    test_ret += test_xmlParserWarning();
28931    test_ret += test_xmlResetError();
28932    test_ret += test_xmlResetLastError();
28933    test_ret += test_xmlSetGenericErrorFunc();
28934    test_ret += test_xmlSetStructuredErrorFunc();
28935
28936    if (test_ret != 0)
28937	printf("Module xmlerror: %d errors\n", test_ret);
28938    return(test_ret);
28939}
28940#ifdef LIBXML_MODULES_ENABLED
28941
28942#define gen_nb_xmlModulePtr 1
28943static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28944    return(NULL);
28945}
28946static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28947}
28948#endif
28949
28950
28951static int
28952test_xmlModuleClose(void) {
28953    int test_ret = 0;
28954
28955#if defined(LIBXML_MODULES_ENABLED)
28956    int mem_base;
28957    int ret_val;
28958    xmlModulePtr module; /* the module handle */
28959    int n_module;
28960
28961    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
28962        mem_base = xmlMemBlocks();
28963        module = gen_xmlModulePtr(n_module, 0);
28964
28965        ret_val = xmlModuleClose(module);
28966        desret_int(ret_val);
28967        call_tests++;
28968        des_xmlModulePtr(n_module, module, 0);
28969        xmlResetLastError();
28970        if (mem_base != xmlMemBlocks()) {
28971            printf("Leak of %d blocks found in xmlModuleClose",
28972	           xmlMemBlocks() - mem_base);
28973	    test_ret++;
28974            printf(" %d", n_module);
28975            printf("\n");
28976        }
28977    }
28978    function_tests++;
28979#endif
28980
28981    return(test_ret);
28982}
28983
28984
28985static int
28986test_xmlModuleOpen(void) {
28987    int test_ret = 0;
28988
28989
28990    /* missing type support */
28991    return(test_ret);
28992}
28993
28994
28995static int
28996test_xmlModuleSymbol(void) {
28997    int test_ret = 0;
28998
28999#if defined(LIBXML_MODULES_ENABLED)
29000    int mem_base;
29001    int ret_val;
29002    xmlModulePtr module; /* the module */
29003    int n_module;
29004    char * name; /* the name of the symbol */
29005    int n_name;
29006    void ** symbol; /* the resulting symbol address */
29007    int n_symbol;
29008
29009    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29010    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29011    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29012        mem_base = xmlMemBlocks();
29013        module = gen_xmlModulePtr(n_module, 0);
29014        name = gen_const_char_ptr(n_name, 1);
29015        symbol = gen_void_ptr_ptr(n_symbol, 2);
29016
29017        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29018        desret_int(ret_val);
29019        call_tests++;
29020        des_xmlModulePtr(n_module, module, 0);
29021        des_const_char_ptr(n_name, (const char *)name, 1);
29022        des_void_ptr_ptr(n_symbol, symbol, 2);
29023        xmlResetLastError();
29024        if (mem_base != xmlMemBlocks()) {
29025            printf("Leak of %d blocks found in xmlModuleSymbol",
29026	           xmlMemBlocks() - mem_base);
29027	    test_ret++;
29028            printf(" %d", n_module);
29029            printf(" %d", n_name);
29030            printf(" %d", n_symbol);
29031            printf("\n");
29032        }
29033    }
29034    }
29035    }
29036    function_tests++;
29037#endif
29038
29039    return(test_ret);
29040}
29041
29042static int
29043test_xmlmodule(void) {
29044    int test_ret = 0;
29045
29046    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29047    test_ret += test_xmlModuleClose();
29048    test_ret += test_xmlModuleOpen();
29049    test_ret += test_xmlModuleSymbol();
29050
29051    if (test_ret != 0)
29052	printf("Module xmlmodule: %d errors\n", test_ret);
29053    return(test_ret);
29054}
29055
29056static int
29057test_xmlNewTextReader(void) {
29058    int test_ret = 0;
29059
29060#if defined(LIBXML_READER_ENABLED)
29061    int mem_base;
29062    xmlTextReaderPtr ret_val;
29063    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29064    int n_input;
29065    const char * URI; /* the URI information for the source if available */
29066    int n_URI;
29067
29068    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29069    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29070        mem_base = xmlMemBlocks();
29071        input = gen_xmlParserInputBufferPtr(n_input, 0);
29072        URI = gen_filepath(n_URI, 1);
29073
29074        ret_val = xmlNewTextReader(input, URI);
29075        desret_xmlTextReaderPtr(ret_val);
29076        call_tests++;
29077        des_xmlParserInputBufferPtr(n_input, input, 0);
29078        des_filepath(n_URI, URI, 1);
29079        xmlResetLastError();
29080        if (mem_base != xmlMemBlocks()) {
29081            printf("Leak of %d blocks found in xmlNewTextReader",
29082	           xmlMemBlocks() - mem_base);
29083	    test_ret++;
29084            printf(" %d", n_input);
29085            printf(" %d", n_URI);
29086            printf("\n");
29087        }
29088    }
29089    }
29090    function_tests++;
29091#endif
29092
29093    return(test_ret);
29094}
29095
29096
29097static int
29098test_xmlNewTextReaderFilename(void) {
29099    int test_ret = 0;
29100
29101#if defined(LIBXML_READER_ENABLED)
29102    int mem_base;
29103    xmlTextReaderPtr ret_val;
29104    const char * URI; /* the URI of the resource to process */
29105    int n_URI;
29106
29107    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29108        mem_base = xmlMemBlocks();
29109        URI = gen_filepath(n_URI, 0);
29110
29111        ret_val = xmlNewTextReaderFilename(URI);
29112        desret_xmlTextReaderPtr(ret_val);
29113        call_tests++;
29114        des_filepath(n_URI, URI, 0);
29115        xmlResetLastError();
29116        if (mem_base != xmlMemBlocks()) {
29117            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29118	           xmlMemBlocks() - mem_base);
29119	    test_ret++;
29120            printf(" %d", n_URI);
29121            printf("\n");
29122        }
29123    }
29124    function_tests++;
29125#endif
29126
29127    return(test_ret);
29128}
29129
29130
29131static int
29132test_xmlReaderForDoc(void) {
29133    int test_ret = 0;
29134
29135#if defined(LIBXML_READER_ENABLED)
29136    int mem_base;
29137    xmlTextReaderPtr ret_val;
29138    xmlChar * cur; /* a pointer to a zero terminated string */
29139    int n_cur;
29140    const char * URL; /* the base URL to use for the document */
29141    int n_URL;
29142    char * encoding; /* the document encoding, or NULL */
29143    int n_encoding;
29144    int options; /* a combination of xmlParserOption */
29145    int n_options;
29146
29147    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29148    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29149    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29150    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29151        mem_base = xmlMemBlocks();
29152        cur = gen_const_xmlChar_ptr(n_cur, 0);
29153        URL = gen_filepath(n_URL, 1);
29154        encoding = gen_const_char_ptr(n_encoding, 2);
29155        options = gen_parseroptions(n_options, 3);
29156
29157        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29158        desret_xmlTextReaderPtr(ret_val);
29159        call_tests++;
29160        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29161        des_filepath(n_URL, URL, 1);
29162        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29163        des_parseroptions(n_options, options, 3);
29164        xmlResetLastError();
29165        if (mem_base != xmlMemBlocks()) {
29166            printf("Leak of %d blocks found in xmlReaderForDoc",
29167	           xmlMemBlocks() - mem_base);
29168	    test_ret++;
29169            printf(" %d", n_cur);
29170            printf(" %d", n_URL);
29171            printf(" %d", n_encoding);
29172            printf(" %d", n_options);
29173            printf("\n");
29174        }
29175    }
29176    }
29177    }
29178    }
29179    function_tests++;
29180#endif
29181
29182    return(test_ret);
29183}
29184
29185
29186static int
29187test_xmlReaderForFile(void) {
29188    int test_ret = 0;
29189
29190#if defined(LIBXML_READER_ENABLED)
29191    int mem_base;
29192    xmlTextReaderPtr ret_val;
29193    const char * filename; /* a file or URL */
29194    int n_filename;
29195    char * encoding; /* the document encoding, or NULL */
29196    int n_encoding;
29197    int options; /* a combination of xmlParserOption */
29198    int n_options;
29199
29200    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29201    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29202    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29203        mem_base = xmlMemBlocks();
29204        filename = gen_filepath(n_filename, 0);
29205        encoding = gen_const_char_ptr(n_encoding, 1);
29206        options = gen_parseroptions(n_options, 2);
29207
29208        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29209        desret_xmlTextReaderPtr(ret_val);
29210        call_tests++;
29211        des_filepath(n_filename, filename, 0);
29212        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29213        des_parseroptions(n_options, options, 2);
29214        xmlResetLastError();
29215        if (mem_base != xmlMemBlocks()) {
29216            printf("Leak of %d blocks found in xmlReaderForFile",
29217	           xmlMemBlocks() - mem_base);
29218	    test_ret++;
29219            printf(" %d", n_filename);
29220            printf(" %d", n_encoding);
29221            printf(" %d", n_options);
29222            printf("\n");
29223        }
29224    }
29225    }
29226    }
29227    function_tests++;
29228#endif
29229
29230    return(test_ret);
29231}
29232
29233
29234static int
29235test_xmlReaderForMemory(void) {
29236    int test_ret = 0;
29237
29238#if defined(LIBXML_READER_ENABLED)
29239    int mem_base;
29240    xmlTextReaderPtr ret_val;
29241    char * buffer; /* a pointer to a char array */
29242    int n_buffer;
29243    int size; /* the size of the array */
29244    int n_size;
29245    const char * URL; /* the base URL to use for the document */
29246    int n_URL;
29247    char * encoding; /* the document encoding, or NULL */
29248    int n_encoding;
29249    int options; /* a combination of xmlParserOption */
29250    int n_options;
29251
29252    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29253    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29254    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29255    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29256    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29257        mem_base = xmlMemBlocks();
29258        buffer = gen_const_char_ptr(n_buffer, 0);
29259        size = gen_int(n_size, 1);
29260        URL = gen_filepath(n_URL, 2);
29261        encoding = gen_const_char_ptr(n_encoding, 3);
29262        options = gen_parseroptions(n_options, 4);
29263
29264        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29265        desret_xmlTextReaderPtr(ret_val);
29266        call_tests++;
29267        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29268        des_int(n_size, size, 1);
29269        des_filepath(n_URL, URL, 2);
29270        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29271        des_parseroptions(n_options, options, 4);
29272        xmlResetLastError();
29273        if (mem_base != xmlMemBlocks()) {
29274            printf("Leak of %d blocks found in xmlReaderForMemory",
29275	           xmlMemBlocks() - mem_base);
29276	    test_ret++;
29277            printf(" %d", n_buffer);
29278            printf(" %d", n_size);
29279            printf(" %d", n_URL);
29280            printf(" %d", n_encoding);
29281            printf(" %d", n_options);
29282            printf("\n");
29283        }
29284    }
29285    }
29286    }
29287    }
29288    }
29289    function_tests++;
29290#endif
29291
29292    return(test_ret);
29293}
29294
29295
29296static int
29297test_xmlReaderNewDoc(void) {
29298    int test_ret = 0;
29299
29300#if defined(LIBXML_READER_ENABLED)
29301    int mem_base;
29302    int ret_val;
29303    xmlTextReaderPtr reader; /* an XML reader */
29304    int n_reader;
29305    xmlChar * cur; /* a pointer to a zero terminated string */
29306    int n_cur;
29307    const char * URL; /* the base URL to use for the document */
29308    int n_URL;
29309    char * encoding; /* the document encoding, or NULL */
29310    int n_encoding;
29311    int options; /* a combination of xmlParserOption */
29312    int n_options;
29313
29314    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29315    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29316    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29317    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29318    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29319        mem_base = xmlMemBlocks();
29320        reader = gen_xmlTextReaderPtr(n_reader, 0);
29321        cur = gen_const_xmlChar_ptr(n_cur, 1);
29322        URL = gen_filepath(n_URL, 2);
29323        encoding = gen_const_char_ptr(n_encoding, 3);
29324        options = gen_parseroptions(n_options, 4);
29325
29326        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29327        desret_int(ret_val);
29328        call_tests++;
29329        des_xmlTextReaderPtr(n_reader, reader, 0);
29330        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29331        des_filepath(n_URL, URL, 2);
29332        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29333        des_parseroptions(n_options, options, 4);
29334        xmlResetLastError();
29335        if (mem_base != xmlMemBlocks()) {
29336            printf("Leak of %d blocks found in xmlReaderNewDoc",
29337	           xmlMemBlocks() - mem_base);
29338	    test_ret++;
29339            printf(" %d", n_reader);
29340            printf(" %d", n_cur);
29341            printf(" %d", n_URL);
29342            printf(" %d", n_encoding);
29343            printf(" %d", n_options);
29344            printf("\n");
29345        }
29346    }
29347    }
29348    }
29349    }
29350    }
29351    function_tests++;
29352#endif
29353
29354    return(test_ret);
29355}
29356
29357
29358static int
29359test_xmlReaderNewFile(void) {
29360    int test_ret = 0;
29361
29362#if defined(LIBXML_READER_ENABLED)
29363    int mem_base;
29364    int ret_val;
29365    xmlTextReaderPtr reader; /* an XML reader */
29366    int n_reader;
29367    const char * filename; /* a file or URL */
29368    int n_filename;
29369    char * encoding; /* the document encoding, or NULL */
29370    int n_encoding;
29371    int options; /* a combination of xmlParserOption */
29372    int n_options;
29373
29374    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29375    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29376    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29377    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29378        mem_base = xmlMemBlocks();
29379        reader = gen_xmlTextReaderPtr(n_reader, 0);
29380        filename = gen_filepath(n_filename, 1);
29381        encoding = gen_const_char_ptr(n_encoding, 2);
29382        options = gen_parseroptions(n_options, 3);
29383
29384        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29385        desret_int(ret_val);
29386        call_tests++;
29387        des_xmlTextReaderPtr(n_reader, reader, 0);
29388        des_filepath(n_filename, filename, 1);
29389        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29390        des_parseroptions(n_options, options, 3);
29391        xmlResetLastError();
29392        if (mem_base != xmlMemBlocks()) {
29393            printf("Leak of %d blocks found in xmlReaderNewFile",
29394	           xmlMemBlocks() - mem_base);
29395	    test_ret++;
29396            printf(" %d", n_reader);
29397            printf(" %d", n_filename);
29398            printf(" %d", n_encoding);
29399            printf(" %d", n_options);
29400            printf("\n");
29401        }
29402    }
29403    }
29404    }
29405    }
29406    function_tests++;
29407#endif
29408
29409    return(test_ret);
29410}
29411
29412
29413static int
29414test_xmlReaderNewMemory(void) {
29415    int test_ret = 0;
29416
29417#if defined(LIBXML_READER_ENABLED)
29418    int mem_base;
29419    int ret_val;
29420    xmlTextReaderPtr reader; /* an XML reader */
29421    int n_reader;
29422    char * buffer; /* a pointer to a char array */
29423    int n_buffer;
29424    int size; /* the size of the array */
29425    int n_size;
29426    const char * URL; /* the base URL to use for the document */
29427    int n_URL;
29428    char * encoding; /* the document encoding, or NULL */
29429    int n_encoding;
29430    int options; /* a combination of xmlParserOption */
29431    int n_options;
29432
29433    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29434    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29435    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29436    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29437    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29438    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29439        mem_base = xmlMemBlocks();
29440        reader = gen_xmlTextReaderPtr(n_reader, 0);
29441        buffer = gen_const_char_ptr(n_buffer, 1);
29442        size = gen_int(n_size, 2);
29443        URL = gen_filepath(n_URL, 3);
29444        encoding = gen_const_char_ptr(n_encoding, 4);
29445        options = gen_parseroptions(n_options, 5);
29446
29447        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29448        desret_int(ret_val);
29449        call_tests++;
29450        des_xmlTextReaderPtr(n_reader, reader, 0);
29451        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29452        des_int(n_size, size, 2);
29453        des_filepath(n_URL, URL, 3);
29454        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29455        des_parseroptions(n_options, options, 5);
29456        xmlResetLastError();
29457        if (mem_base != xmlMemBlocks()) {
29458            printf("Leak of %d blocks found in xmlReaderNewMemory",
29459	           xmlMemBlocks() - mem_base);
29460	    test_ret++;
29461            printf(" %d", n_reader);
29462            printf(" %d", n_buffer);
29463            printf(" %d", n_size);
29464            printf(" %d", n_URL);
29465            printf(" %d", n_encoding);
29466            printf(" %d", n_options);
29467            printf("\n");
29468        }
29469    }
29470    }
29471    }
29472    }
29473    }
29474    }
29475    function_tests++;
29476#endif
29477
29478    return(test_ret);
29479}
29480
29481
29482static int
29483test_xmlReaderNewWalker(void) {
29484    int test_ret = 0;
29485
29486#if defined(LIBXML_READER_ENABLED)
29487    int mem_base;
29488    int ret_val;
29489    xmlTextReaderPtr reader; /* an XML reader */
29490    int n_reader;
29491    xmlDocPtr doc; /* a preparsed document */
29492    int n_doc;
29493
29494    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29495    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29496        mem_base = xmlMemBlocks();
29497        reader = gen_xmlTextReaderPtr(n_reader, 0);
29498        doc = gen_xmlDocPtr(n_doc, 1);
29499
29500        ret_val = xmlReaderNewWalker(reader, doc);
29501        desret_int(ret_val);
29502        call_tests++;
29503        des_xmlTextReaderPtr(n_reader, reader, 0);
29504        des_xmlDocPtr(n_doc, doc, 1);
29505        xmlResetLastError();
29506        if (mem_base != xmlMemBlocks()) {
29507            printf("Leak of %d blocks found in xmlReaderNewWalker",
29508	           xmlMemBlocks() - mem_base);
29509	    test_ret++;
29510            printf(" %d", n_reader);
29511            printf(" %d", n_doc);
29512            printf("\n");
29513        }
29514    }
29515    }
29516    function_tests++;
29517#endif
29518
29519    return(test_ret);
29520}
29521
29522
29523static int
29524test_xmlReaderWalker(void) {
29525    int test_ret = 0;
29526
29527#if defined(LIBXML_READER_ENABLED)
29528    int mem_base;
29529    xmlTextReaderPtr ret_val;
29530    xmlDocPtr doc; /* a preparsed document */
29531    int n_doc;
29532
29533    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29534        mem_base = xmlMemBlocks();
29535        doc = gen_xmlDocPtr(n_doc, 0);
29536
29537        ret_val = xmlReaderWalker(doc);
29538        desret_xmlTextReaderPtr(ret_val);
29539        call_tests++;
29540        des_xmlDocPtr(n_doc, doc, 0);
29541        xmlResetLastError();
29542        if (mem_base != xmlMemBlocks()) {
29543            printf("Leak of %d blocks found in xmlReaderWalker",
29544	           xmlMemBlocks() - mem_base);
29545	    test_ret++;
29546            printf(" %d", n_doc);
29547            printf("\n");
29548        }
29549    }
29550    function_tests++;
29551#endif
29552
29553    return(test_ret);
29554}
29555
29556
29557static int
29558test_xmlTextReaderAttributeCount(void) {
29559    int test_ret = 0;
29560
29561#if defined(LIBXML_READER_ENABLED)
29562    int mem_base;
29563    int ret_val;
29564    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29565    int n_reader;
29566
29567    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29568        mem_base = xmlMemBlocks();
29569        reader = gen_xmlTextReaderPtr(n_reader, 0);
29570
29571        ret_val = xmlTextReaderAttributeCount(reader);
29572        desret_int(ret_val);
29573        call_tests++;
29574        des_xmlTextReaderPtr(n_reader, reader, 0);
29575        xmlResetLastError();
29576        if (mem_base != xmlMemBlocks()) {
29577            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
29578	           xmlMemBlocks() - mem_base);
29579	    test_ret++;
29580            printf(" %d", n_reader);
29581            printf("\n");
29582        }
29583    }
29584    function_tests++;
29585#endif
29586
29587    return(test_ret);
29588}
29589
29590
29591static int
29592test_xmlTextReaderBaseUri(void) {
29593    int test_ret = 0;
29594
29595#if defined(LIBXML_READER_ENABLED)
29596    int mem_base;
29597    xmlChar * ret_val;
29598    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29599    int n_reader;
29600
29601    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29602        mem_base = xmlMemBlocks();
29603        reader = gen_xmlTextReaderPtr(n_reader, 0);
29604
29605        ret_val = xmlTextReaderBaseUri(reader);
29606        desret_xmlChar_ptr(ret_val);
29607        call_tests++;
29608        des_xmlTextReaderPtr(n_reader, reader, 0);
29609        xmlResetLastError();
29610        if (mem_base != xmlMemBlocks()) {
29611            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
29612	           xmlMemBlocks() - mem_base);
29613	    test_ret++;
29614            printf(" %d", n_reader);
29615            printf("\n");
29616        }
29617    }
29618    function_tests++;
29619#endif
29620
29621    return(test_ret);
29622}
29623
29624
29625static int
29626test_xmlTextReaderByteConsumed(void) {
29627    int test_ret = 0;
29628
29629#if defined(LIBXML_READER_ENABLED)
29630    int mem_base;
29631    long ret_val;
29632    xmlTextReaderPtr reader; /* an XML reader */
29633    int n_reader;
29634
29635    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29636        mem_base = xmlMemBlocks();
29637        reader = gen_xmlTextReaderPtr(n_reader, 0);
29638
29639        ret_val = xmlTextReaderByteConsumed(reader);
29640        desret_long(ret_val);
29641        call_tests++;
29642        des_xmlTextReaderPtr(n_reader, reader, 0);
29643        xmlResetLastError();
29644        if (mem_base != xmlMemBlocks()) {
29645            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
29646	           xmlMemBlocks() - mem_base);
29647	    test_ret++;
29648            printf(" %d", n_reader);
29649            printf("\n");
29650        }
29651    }
29652    function_tests++;
29653#endif
29654
29655    return(test_ret);
29656}
29657
29658
29659static int
29660test_xmlTextReaderClose(void) {
29661    int test_ret = 0;
29662
29663#if defined(LIBXML_READER_ENABLED)
29664    int mem_base;
29665    int ret_val;
29666    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29667    int n_reader;
29668
29669    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29670        mem_base = xmlMemBlocks();
29671        reader = gen_xmlTextReaderPtr(n_reader, 0);
29672
29673        ret_val = xmlTextReaderClose(reader);
29674        desret_int(ret_val);
29675        call_tests++;
29676        des_xmlTextReaderPtr(n_reader, reader, 0);
29677        xmlResetLastError();
29678        if (mem_base != xmlMemBlocks()) {
29679            printf("Leak of %d blocks found in xmlTextReaderClose",
29680	           xmlMemBlocks() - mem_base);
29681	    test_ret++;
29682            printf(" %d", n_reader);
29683            printf("\n");
29684        }
29685    }
29686    function_tests++;
29687#endif
29688
29689    return(test_ret);
29690}
29691
29692
29693static int
29694test_xmlTextReaderConstBaseUri(void) {
29695    int test_ret = 0;
29696
29697#if defined(LIBXML_READER_ENABLED)
29698    int mem_base;
29699    const xmlChar * ret_val;
29700    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29701    int n_reader;
29702
29703    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29704        mem_base = xmlMemBlocks();
29705        reader = gen_xmlTextReaderPtr(n_reader, 0);
29706
29707        ret_val = xmlTextReaderConstBaseUri(reader);
29708        desret_const_xmlChar_ptr(ret_val);
29709        call_tests++;
29710        des_xmlTextReaderPtr(n_reader, reader, 0);
29711        xmlResetLastError();
29712        if (mem_base != xmlMemBlocks()) {
29713            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
29714	           xmlMemBlocks() - mem_base);
29715	    test_ret++;
29716            printf(" %d", n_reader);
29717            printf("\n");
29718        }
29719    }
29720    function_tests++;
29721#endif
29722
29723    return(test_ret);
29724}
29725
29726
29727static int
29728test_xmlTextReaderConstEncoding(void) {
29729    int test_ret = 0;
29730
29731#if defined(LIBXML_READER_ENABLED)
29732    int mem_base;
29733    const xmlChar * ret_val;
29734    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29735    int n_reader;
29736
29737    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29738        mem_base = xmlMemBlocks();
29739        reader = gen_xmlTextReaderPtr(n_reader, 0);
29740
29741        ret_val = xmlTextReaderConstEncoding(reader);
29742        desret_const_xmlChar_ptr(ret_val);
29743        call_tests++;
29744        des_xmlTextReaderPtr(n_reader, reader, 0);
29745        xmlResetLastError();
29746        if (mem_base != xmlMemBlocks()) {
29747            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
29748	           xmlMemBlocks() - mem_base);
29749	    test_ret++;
29750            printf(" %d", n_reader);
29751            printf("\n");
29752        }
29753    }
29754    function_tests++;
29755#endif
29756
29757    return(test_ret);
29758}
29759
29760
29761static int
29762test_xmlTextReaderConstLocalName(void) {
29763    int test_ret = 0;
29764
29765#if defined(LIBXML_READER_ENABLED)
29766    int mem_base;
29767    const xmlChar * ret_val;
29768    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29769    int n_reader;
29770
29771    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29772        mem_base = xmlMemBlocks();
29773        reader = gen_xmlTextReaderPtr(n_reader, 0);
29774
29775        ret_val = xmlTextReaderConstLocalName(reader);
29776        desret_const_xmlChar_ptr(ret_val);
29777        call_tests++;
29778        des_xmlTextReaderPtr(n_reader, reader, 0);
29779        xmlResetLastError();
29780        if (mem_base != xmlMemBlocks()) {
29781            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
29782	           xmlMemBlocks() - mem_base);
29783	    test_ret++;
29784            printf(" %d", n_reader);
29785            printf("\n");
29786        }
29787    }
29788    function_tests++;
29789#endif
29790
29791    return(test_ret);
29792}
29793
29794
29795static int
29796test_xmlTextReaderConstName(void) {
29797    int test_ret = 0;
29798
29799#if defined(LIBXML_READER_ENABLED)
29800    int mem_base;
29801    const xmlChar * ret_val;
29802    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29803    int n_reader;
29804
29805    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29806        mem_base = xmlMemBlocks();
29807        reader = gen_xmlTextReaderPtr(n_reader, 0);
29808
29809        ret_val = xmlTextReaderConstName(reader);
29810        desret_const_xmlChar_ptr(ret_val);
29811        call_tests++;
29812        des_xmlTextReaderPtr(n_reader, reader, 0);
29813        xmlResetLastError();
29814        if (mem_base != xmlMemBlocks()) {
29815            printf("Leak of %d blocks found in xmlTextReaderConstName",
29816	           xmlMemBlocks() - mem_base);
29817	    test_ret++;
29818            printf(" %d", n_reader);
29819            printf("\n");
29820        }
29821    }
29822    function_tests++;
29823#endif
29824
29825    return(test_ret);
29826}
29827
29828
29829static int
29830test_xmlTextReaderConstNamespaceUri(void) {
29831    int test_ret = 0;
29832
29833#if defined(LIBXML_READER_ENABLED)
29834    int mem_base;
29835    const xmlChar * ret_val;
29836    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29837    int n_reader;
29838
29839    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29840        mem_base = xmlMemBlocks();
29841        reader = gen_xmlTextReaderPtr(n_reader, 0);
29842
29843        ret_val = xmlTextReaderConstNamespaceUri(reader);
29844        desret_const_xmlChar_ptr(ret_val);
29845        call_tests++;
29846        des_xmlTextReaderPtr(n_reader, reader, 0);
29847        xmlResetLastError();
29848        if (mem_base != xmlMemBlocks()) {
29849            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
29850	           xmlMemBlocks() - mem_base);
29851	    test_ret++;
29852            printf(" %d", n_reader);
29853            printf("\n");
29854        }
29855    }
29856    function_tests++;
29857#endif
29858
29859    return(test_ret);
29860}
29861
29862
29863static int
29864test_xmlTextReaderConstPrefix(void) {
29865    int test_ret = 0;
29866
29867#if defined(LIBXML_READER_ENABLED)
29868    int mem_base;
29869    const xmlChar * ret_val;
29870    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29871    int n_reader;
29872
29873    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29874        mem_base = xmlMemBlocks();
29875        reader = gen_xmlTextReaderPtr(n_reader, 0);
29876
29877        ret_val = xmlTextReaderConstPrefix(reader);
29878        desret_const_xmlChar_ptr(ret_val);
29879        call_tests++;
29880        des_xmlTextReaderPtr(n_reader, reader, 0);
29881        xmlResetLastError();
29882        if (mem_base != xmlMemBlocks()) {
29883            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
29884	           xmlMemBlocks() - mem_base);
29885	    test_ret++;
29886            printf(" %d", n_reader);
29887            printf("\n");
29888        }
29889    }
29890    function_tests++;
29891#endif
29892
29893    return(test_ret);
29894}
29895
29896
29897static int
29898test_xmlTextReaderConstString(void) {
29899    int test_ret = 0;
29900
29901#if defined(LIBXML_READER_ENABLED)
29902    int mem_base;
29903    const xmlChar * ret_val;
29904    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29905    int n_reader;
29906    xmlChar * str; /* the string to intern. */
29907    int n_str;
29908
29909    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29910    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
29911        mem_base = xmlMemBlocks();
29912        reader = gen_xmlTextReaderPtr(n_reader, 0);
29913        str = gen_const_xmlChar_ptr(n_str, 1);
29914
29915        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
29916        desret_const_xmlChar_ptr(ret_val);
29917        call_tests++;
29918        des_xmlTextReaderPtr(n_reader, reader, 0);
29919        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
29920        xmlResetLastError();
29921        if (mem_base != xmlMemBlocks()) {
29922            printf("Leak of %d blocks found in xmlTextReaderConstString",
29923	           xmlMemBlocks() - mem_base);
29924	    test_ret++;
29925            printf(" %d", n_reader);
29926            printf(" %d", n_str);
29927            printf("\n");
29928        }
29929    }
29930    }
29931    function_tests++;
29932#endif
29933
29934    return(test_ret);
29935}
29936
29937
29938static int
29939test_xmlTextReaderConstValue(void) {
29940    int test_ret = 0;
29941
29942#if defined(LIBXML_READER_ENABLED)
29943    int mem_base;
29944    const xmlChar * ret_val;
29945    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29946    int n_reader;
29947
29948    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29949        mem_base = xmlMemBlocks();
29950        reader = gen_xmlTextReaderPtr(n_reader, 0);
29951
29952        ret_val = xmlTextReaderConstValue(reader);
29953        desret_const_xmlChar_ptr(ret_val);
29954        call_tests++;
29955        des_xmlTextReaderPtr(n_reader, reader, 0);
29956        xmlResetLastError();
29957        if (mem_base != xmlMemBlocks()) {
29958            printf("Leak of %d blocks found in xmlTextReaderConstValue",
29959	           xmlMemBlocks() - mem_base);
29960	    test_ret++;
29961            printf(" %d", n_reader);
29962            printf("\n");
29963        }
29964    }
29965    function_tests++;
29966#endif
29967
29968    return(test_ret);
29969}
29970
29971
29972static int
29973test_xmlTextReaderConstXmlLang(void) {
29974    int test_ret = 0;
29975
29976#if defined(LIBXML_READER_ENABLED)
29977    int mem_base;
29978    const xmlChar * ret_val;
29979    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29980    int n_reader;
29981
29982    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29983        mem_base = xmlMemBlocks();
29984        reader = gen_xmlTextReaderPtr(n_reader, 0);
29985
29986        ret_val = xmlTextReaderConstXmlLang(reader);
29987        desret_const_xmlChar_ptr(ret_val);
29988        call_tests++;
29989        des_xmlTextReaderPtr(n_reader, reader, 0);
29990        xmlResetLastError();
29991        if (mem_base != xmlMemBlocks()) {
29992            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
29993	           xmlMemBlocks() - mem_base);
29994	    test_ret++;
29995            printf(" %d", n_reader);
29996            printf("\n");
29997        }
29998    }
29999    function_tests++;
30000#endif
30001
30002    return(test_ret);
30003}
30004
30005
30006static int
30007test_xmlTextReaderConstXmlVersion(void) {
30008    int test_ret = 0;
30009
30010#if defined(LIBXML_READER_ENABLED)
30011    int mem_base;
30012    const xmlChar * ret_val;
30013    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30014    int n_reader;
30015
30016    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30017        mem_base = xmlMemBlocks();
30018        reader = gen_xmlTextReaderPtr(n_reader, 0);
30019
30020        ret_val = xmlTextReaderConstXmlVersion(reader);
30021        desret_const_xmlChar_ptr(ret_val);
30022        call_tests++;
30023        des_xmlTextReaderPtr(n_reader, reader, 0);
30024        xmlResetLastError();
30025        if (mem_base != xmlMemBlocks()) {
30026            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30027	           xmlMemBlocks() - mem_base);
30028	    test_ret++;
30029            printf(" %d", n_reader);
30030            printf("\n");
30031        }
30032    }
30033    function_tests++;
30034#endif
30035
30036    return(test_ret);
30037}
30038
30039
30040static int
30041test_xmlTextReaderCurrentDoc(void) {
30042    int test_ret = 0;
30043
30044#if defined(LIBXML_READER_ENABLED)
30045    int mem_base;
30046    xmlDocPtr ret_val;
30047    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30048    int n_reader;
30049
30050    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30051        mem_base = xmlMemBlocks();
30052        reader = gen_xmlTextReaderPtr(n_reader, 0);
30053
30054        ret_val = xmlTextReaderCurrentDoc(reader);
30055        desret_xmlDocPtr(ret_val);
30056        call_tests++;
30057        des_xmlTextReaderPtr(n_reader, reader, 0);
30058        xmlResetLastError();
30059        if (mem_base != xmlMemBlocks()) {
30060            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30061	           xmlMemBlocks() - mem_base);
30062	    test_ret++;
30063            printf(" %d", n_reader);
30064            printf("\n");
30065        }
30066    }
30067    function_tests++;
30068#endif
30069
30070    return(test_ret);
30071}
30072
30073
30074static int
30075test_xmlTextReaderCurrentNode(void) {
30076    int test_ret = 0;
30077
30078#if defined(LIBXML_READER_ENABLED)
30079    int mem_base;
30080    xmlNodePtr ret_val;
30081    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30082    int n_reader;
30083
30084    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30085        mem_base = xmlMemBlocks();
30086        reader = gen_xmlTextReaderPtr(n_reader, 0);
30087
30088        ret_val = xmlTextReaderCurrentNode(reader);
30089        desret_xmlNodePtr(ret_val);
30090        call_tests++;
30091        des_xmlTextReaderPtr(n_reader, reader, 0);
30092        xmlResetLastError();
30093        if (mem_base != xmlMemBlocks()) {
30094            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30095	           xmlMemBlocks() - mem_base);
30096	    test_ret++;
30097            printf(" %d", n_reader);
30098            printf("\n");
30099        }
30100    }
30101    function_tests++;
30102#endif
30103
30104    return(test_ret);
30105}
30106
30107
30108static int
30109test_xmlTextReaderDepth(void) {
30110    int test_ret = 0;
30111
30112#if defined(LIBXML_READER_ENABLED)
30113    int mem_base;
30114    int ret_val;
30115    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30116    int n_reader;
30117
30118    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30119        mem_base = xmlMemBlocks();
30120        reader = gen_xmlTextReaderPtr(n_reader, 0);
30121
30122        ret_val = xmlTextReaderDepth(reader);
30123        desret_int(ret_val);
30124        call_tests++;
30125        des_xmlTextReaderPtr(n_reader, reader, 0);
30126        xmlResetLastError();
30127        if (mem_base != xmlMemBlocks()) {
30128            printf("Leak of %d blocks found in xmlTextReaderDepth",
30129	           xmlMemBlocks() - mem_base);
30130	    test_ret++;
30131            printf(" %d", n_reader);
30132            printf("\n");
30133        }
30134    }
30135    function_tests++;
30136#endif
30137
30138    return(test_ret);
30139}
30140
30141
30142static int
30143test_xmlTextReaderExpand(void) {
30144    int test_ret = 0;
30145
30146#if defined(LIBXML_READER_ENABLED)
30147    int mem_base;
30148    xmlNodePtr ret_val;
30149    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30150    int n_reader;
30151
30152    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30153        mem_base = xmlMemBlocks();
30154        reader = gen_xmlTextReaderPtr(n_reader, 0);
30155
30156        ret_val = xmlTextReaderExpand(reader);
30157        desret_xmlNodePtr(ret_val);
30158        call_tests++;
30159        des_xmlTextReaderPtr(n_reader, reader, 0);
30160        xmlResetLastError();
30161        if (mem_base != xmlMemBlocks()) {
30162            printf("Leak of %d blocks found in xmlTextReaderExpand",
30163	           xmlMemBlocks() - mem_base);
30164	    test_ret++;
30165            printf(" %d", n_reader);
30166            printf("\n");
30167        }
30168    }
30169    function_tests++;
30170#endif
30171
30172    return(test_ret);
30173}
30174
30175
30176static int
30177test_xmlTextReaderGetAttribute(void) {
30178    int test_ret = 0;
30179
30180#if defined(LIBXML_READER_ENABLED)
30181    int mem_base;
30182    xmlChar * ret_val;
30183    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30184    int n_reader;
30185    xmlChar * name; /* the qualified name of the attribute. */
30186    int n_name;
30187
30188    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30189    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30190        mem_base = xmlMemBlocks();
30191        reader = gen_xmlTextReaderPtr(n_reader, 0);
30192        name = gen_const_xmlChar_ptr(n_name, 1);
30193
30194        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30195        desret_xmlChar_ptr(ret_val);
30196        call_tests++;
30197        des_xmlTextReaderPtr(n_reader, reader, 0);
30198        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30199        xmlResetLastError();
30200        if (mem_base != xmlMemBlocks()) {
30201            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30202	           xmlMemBlocks() - mem_base);
30203	    test_ret++;
30204            printf(" %d", n_reader);
30205            printf(" %d", n_name);
30206            printf("\n");
30207        }
30208    }
30209    }
30210    function_tests++;
30211#endif
30212
30213    return(test_ret);
30214}
30215
30216
30217static int
30218test_xmlTextReaderGetAttributeNo(void) {
30219    int test_ret = 0;
30220
30221#if defined(LIBXML_READER_ENABLED)
30222    int mem_base;
30223    xmlChar * ret_val;
30224    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30225    int n_reader;
30226    int no; /* the zero-based index of the attribute relative to the containing element */
30227    int n_no;
30228
30229    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30230    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30231        mem_base = xmlMemBlocks();
30232        reader = gen_xmlTextReaderPtr(n_reader, 0);
30233        no = gen_int(n_no, 1);
30234
30235        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30236        desret_xmlChar_ptr(ret_val);
30237        call_tests++;
30238        des_xmlTextReaderPtr(n_reader, reader, 0);
30239        des_int(n_no, no, 1);
30240        xmlResetLastError();
30241        if (mem_base != xmlMemBlocks()) {
30242            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30243	           xmlMemBlocks() - mem_base);
30244	    test_ret++;
30245            printf(" %d", n_reader);
30246            printf(" %d", n_no);
30247            printf("\n");
30248        }
30249    }
30250    }
30251    function_tests++;
30252#endif
30253
30254    return(test_ret);
30255}
30256
30257
30258static int
30259test_xmlTextReaderGetAttributeNs(void) {
30260    int test_ret = 0;
30261
30262#if defined(LIBXML_READER_ENABLED)
30263    int mem_base;
30264    xmlChar * ret_val;
30265    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30266    int n_reader;
30267    xmlChar * localName; /* the local name of the attribute. */
30268    int n_localName;
30269    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30270    int n_namespaceURI;
30271
30272    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30273    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30274    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30275        mem_base = xmlMemBlocks();
30276        reader = gen_xmlTextReaderPtr(n_reader, 0);
30277        localName = gen_const_xmlChar_ptr(n_localName, 1);
30278        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30279
30280        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30281        desret_xmlChar_ptr(ret_val);
30282        call_tests++;
30283        des_xmlTextReaderPtr(n_reader, reader, 0);
30284        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30285        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30286        xmlResetLastError();
30287        if (mem_base != xmlMemBlocks()) {
30288            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30289	           xmlMemBlocks() - mem_base);
30290	    test_ret++;
30291            printf(" %d", n_reader);
30292            printf(" %d", n_localName);
30293            printf(" %d", n_namespaceURI);
30294            printf("\n");
30295        }
30296    }
30297    }
30298    }
30299    function_tests++;
30300#endif
30301
30302    return(test_ret);
30303}
30304
30305#ifdef LIBXML_READER_ENABLED
30306
30307#define gen_nb_xmlTextReaderErrorFunc_ptr 1
30308static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30309    return(NULL);
30310}
30311static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30312}
30313#endif
30314
30315
30316static int
30317test_xmlTextReaderGetErrorHandler(void) {
30318    int test_ret = 0;
30319
30320#if defined(LIBXML_READER_ENABLED)
30321    int mem_base;
30322    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30323    int n_reader;
30324    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30325    int n_f;
30326    void ** arg; /* a user argument */
30327    int n_arg;
30328
30329    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30330    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30331    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30332        mem_base = xmlMemBlocks();
30333        reader = gen_xmlTextReaderPtr(n_reader, 0);
30334        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30335        arg = gen_void_ptr_ptr(n_arg, 2);
30336
30337        xmlTextReaderGetErrorHandler(reader, f, arg);
30338        call_tests++;
30339        des_xmlTextReaderPtr(n_reader, reader, 0);
30340        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30341        des_void_ptr_ptr(n_arg, arg, 2);
30342        xmlResetLastError();
30343        if (mem_base != xmlMemBlocks()) {
30344            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30345	           xmlMemBlocks() - mem_base);
30346	    test_ret++;
30347            printf(" %d", n_reader);
30348            printf(" %d", n_f);
30349            printf(" %d", n_arg);
30350            printf("\n");
30351        }
30352    }
30353    }
30354    }
30355    function_tests++;
30356#endif
30357
30358    return(test_ret);
30359}
30360
30361
30362static int
30363test_xmlTextReaderGetParserColumnNumber(void) {
30364    int test_ret = 0;
30365
30366#if defined(LIBXML_READER_ENABLED)
30367    int mem_base;
30368    int ret_val;
30369    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30370    int n_reader;
30371
30372    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30373        mem_base = xmlMemBlocks();
30374        reader = gen_xmlTextReaderPtr(n_reader, 0);
30375
30376        ret_val = xmlTextReaderGetParserColumnNumber(reader);
30377        desret_int(ret_val);
30378        call_tests++;
30379        des_xmlTextReaderPtr(n_reader, reader, 0);
30380        xmlResetLastError();
30381        if (mem_base != xmlMemBlocks()) {
30382            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30383	           xmlMemBlocks() - mem_base);
30384	    test_ret++;
30385            printf(" %d", n_reader);
30386            printf("\n");
30387        }
30388    }
30389    function_tests++;
30390#endif
30391
30392    return(test_ret);
30393}
30394
30395
30396static int
30397test_xmlTextReaderGetParserLineNumber(void) {
30398    int test_ret = 0;
30399
30400#if defined(LIBXML_READER_ENABLED)
30401    int mem_base;
30402    int ret_val;
30403    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30404    int n_reader;
30405
30406    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30407        mem_base = xmlMemBlocks();
30408        reader = gen_xmlTextReaderPtr(n_reader, 0);
30409
30410        ret_val = xmlTextReaderGetParserLineNumber(reader);
30411        desret_int(ret_val);
30412        call_tests++;
30413        des_xmlTextReaderPtr(n_reader, reader, 0);
30414        xmlResetLastError();
30415        if (mem_base != xmlMemBlocks()) {
30416            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30417	           xmlMemBlocks() - mem_base);
30418	    test_ret++;
30419            printf(" %d", n_reader);
30420            printf("\n");
30421        }
30422    }
30423    function_tests++;
30424#endif
30425
30426    return(test_ret);
30427}
30428
30429
30430static int
30431test_xmlTextReaderGetParserProp(void) {
30432    int test_ret = 0;
30433
30434#if defined(LIBXML_READER_ENABLED)
30435    int mem_base;
30436    int ret_val;
30437    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30438    int n_reader;
30439    int prop; /* the xmlParserProperties to get */
30440    int n_prop;
30441
30442    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30443    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30444        mem_base = xmlMemBlocks();
30445        reader = gen_xmlTextReaderPtr(n_reader, 0);
30446        prop = gen_int(n_prop, 1);
30447
30448        ret_val = xmlTextReaderGetParserProp(reader, prop);
30449        desret_int(ret_val);
30450        call_tests++;
30451        des_xmlTextReaderPtr(n_reader, reader, 0);
30452        des_int(n_prop, prop, 1);
30453        xmlResetLastError();
30454        if (mem_base != xmlMemBlocks()) {
30455            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30456	           xmlMemBlocks() - mem_base);
30457	    test_ret++;
30458            printf(" %d", n_reader);
30459            printf(" %d", n_prop);
30460            printf("\n");
30461        }
30462    }
30463    }
30464    function_tests++;
30465#endif
30466
30467    return(test_ret);
30468}
30469
30470
30471static int
30472test_xmlTextReaderGetRemainder(void) {
30473    int test_ret = 0;
30474
30475#if defined(LIBXML_READER_ENABLED)
30476    int mem_base;
30477    xmlParserInputBufferPtr ret_val;
30478    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30479    int n_reader;
30480
30481    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30482        mem_base = xmlMemBlocks();
30483        reader = gen_xmlTextReaderPtr(n_reader, 0);
30484
30485        ret_val = xmlTextReaderGetRemainder(reader);
30486        desret_xmlParserInputBufferPtr(ret_val);
30487        call_tests++;
30488        des_xmlTextReaderPtr(n_reader, reader, 0);
30489        xmlResetLastError();
30490        if (mem_base != xmlMemBlocks()) {
30491            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30492	           xmlMemBlocks() - mem_base);
30493	    test_ret++;
30494            printf(" %d", n_reader);
30495            printf("\n");
30496        }
30497    }
30498    function_tests++;
30499#endif
30500
30501    return(test_ret);
30502}
30503
30504
30505static int
30506test_xmlTextReaderHasAttributes(void) {
30507    int test_ret = 0;
30508
30509#if defined(LIBXML_READER_ENABLED)
30510    int mem_base;
30511    int ret_val;
30512    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30513    int n_reader;
30514
30515    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30516        mem_base = xmlMemBlocks();
30517        reader = gen_xmlTextReaderPtr(n_reader, 0);
30518
30519        ret_val = xmlTextReaderHasAttributes(reader);
30520        desret_int(ret_val);
30521        call_tests++;
30522        des_xmlTextReaderPtr(n_reader, reader, 0);
30523        xmlResetLastError();
30524        if (mem_base != xmlMemBlocks()) {
30525            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
30526	           xmlMemBlocks() - mem_base);
30527	    test_ret++;
30528            printf(" %d", n_reader);
30529            printf("\n");
30530        }
30531    }
30532    function_tests++;
30533#endif
30534
30535    return(test_ret);
30536}
30537
30538
30539static int
30540test_xmlTextReaderHasValue(void) {
30541    int test_ret = 0;
30542
30543#if defined(LIBXML_READER_ENABLED)
30544    int mem_base;
30545    int ret_val;
30546    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30547    int n_reader;
30548
30549    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30550        mem_base = xmlMemBlocks();
30551        reader = gen_xmlTextReaderPtr(n_reader, 0);
30552
30553        ret_val = xmlTextReaderHasValue(reader);
30554        desret_int(ret_val);
30555        call_tests++;
30556        des_xmlTextReaderPtr(n_reader, reader, 0);
30557        xmlResetLastError();
30558        if (mem_base != xmlMemBlocks()) {
30559            printf("Leak of %d blocks found in xmlTextReaderHasValue",
30560	           xmlMemBlocks() - mem_base);
30561	    test_ret++;
30562            printf(" %d", n_reader);
30563            printf("\n");
30564        }
30565    }
30566    function_tests++;
30567#endif
30568
30569    return(test_ret);
30570}
30571
30572
30573static int
30574test_xmlTextReaderIsDefault(void) {
30575    int test_ret = 0;
30576
30577#if defined(LIBXML_READER_ENABLED)
30578    int mem_base;
30579    int ret_val;
30580    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30581    int n_reader;
30582
30583    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30584        mem_base = xmlMemBlocks();
30585        reader = gen_xmlTextReaderPtr(n_reader, 0);
30586
30587        ret_val = xmlTextReaderIsDefault(reader);
30588        desret_int(ret_val);
30589        call_tests++;
30590        des_xmlTextReaderPtr(n_reader, reader, 0);
30591        xmlResetLastError();
30592        if (mem_base != xmlMemBlocks()) {
30593            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
30594	           xmlMemBlocks() - mem_base);
30595	    test_ret++;
30596            printf(" %d", n_reader);
30597            printf("\n");
30598        }
30599    }
30600    function_tests++;
30601#endif
30602
30603    return(test_ret);
30604}
30605
30606
30607static int
30608test_xmlTextReaderIsEmptyElement(void) {
30609    int test_ret = 0;
30610
30611#if defined(LIBXML_READER_ENABLED)
30612    int mem_base;
30613    int ret_val;
30614    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30615    int n_reader;
30616
30617    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30618        mem_base = xmlMemBlocks();
30619        reader = gen_xmlTextReaderPtr(n_reader, 0);
30620
30621        ret_val = xmlTextReaderIsEmptyElement(reader);
30622        desret_int(ret_val);
30623        call_tests++;
30624        des_xmlTextReaderPtr(n_reader, reader, 0);
30625        xmlResetLastError();
30626        if (mem_base != xmlMemBlocks()) {
30627            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
30628	           xmlMemBlocks() - mem_base);
30629	    test_ret++;
30630            printf(" %d", n_reader);
30631            printf("\n");
30632        }
30633    }
30634    function_tests++;
30635#endif
30636
30637    return(test_ret);
30638}
30639
30640
30641static int
30642test_xmlTextReaderIsNamespaceDecl(void) {
30643    int test_ret = 0;
30644
30645#if defined(LIBXML_READER_ENABLED)
30646    int mem_base;
30647    int ret_val;
30648    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30649    int n_reader;
30650
30651    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30652        mem_base = xmlMemBlocks();
30653        reader = gen_xmlTextReaderPtr(n_reader, 0);
30654
30655        ret_val = xmlTextReaderIsNamespaceDecl(reader);
30656        desret_int(ret_val);
30657        call_tests++;
30658        des_xmlTextReaderPtr(n_reader, reader, 0);
30659        xmlResetLastError();
30660        if (mem_base != xmlMemBlocks()) {
30661            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
30662	           xmlMemBlocks() - mem_base);
30663	    test_ret++;
30664            printf(" %d", n_reader);
30665            printf("\n");
30666        }
30667    }
30668    function_tests++;
30669#endif
30670
30671    return(test_ret);
30672}
30673
30674
30675static int
30676test_xmlTextReaderIsValid(void) {
30677    int test_ret = 0;
30678
30679#if defined(LIBXML_READER_ENABLED)
30680    int mem_base;
30681    int ret_val;
30682    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30683    int n_reader;
30684
30685    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30686        mem_base = xmlMemBlocks();
30687        reader = gen_xmlTextReaderPtr(n_reader, 0);
30688
30689        ret_val = xmlTextReaderIsValid(reader);
30690        desret_int(ret_val);
30691        call_tests++;
30692        des_xmlTextReaderPtr(n_reader, reader, 0);
30693        xmlResetLastError();
30694        if (mem_base != xmlMemBlocks()) {
30695            printf("Leak of %d blocks found in xmlTextReaderIsValid",
30696	           xmlMemBlocks() - mem_base);
30697	    test_ret++;
30698            printf(" %d", n_reader);
30699            printf("\n");
30700        }
30701    }
30702    function_tests++;
30703#endif
30704
30705    return(test_ret);
30706}
30707
30708
30709static int
30710test_xmlTextReaderLocalName(void) {
30711    int test_ret = 0;
30712
30713#if defined(LIBXML_READER_ENABLED)
30714    int mem_base;
30715    xmlChar * ret_val;
30716    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30717    int n_reader;
30718
30719    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30720        mem_base = xmlMemBlocks();
30721        reader = gen_xmlTextReaderPtr(n_reader, 0);
30722
30723        ret_val = xmlTextReaderLocalName(reader);
30724        desret_xmlChar_ptr(ret_val);
30725        call_tests++;
30726        des_xmlTextReaderPtr(n_reader, reader, 0);
30727        xmlResetLastError();
30728        if (mem_base != xmlMemBlocks()) {
30729            printf("Leak of %d blocks found in xmlTextReaderLocalName",
30730	           xmlMemBlocks() - mem_base);
30731	    test_ret++;
30732            printf(" %d", n_reader);
30733            printf("\n");
30734        }
30735    }
30736    function_tests++;
30737#endif
30738
30739    return(test_ret);
30740}
30741
30742#ifdef LIBXML_READER_ENABLED
30743
30744#define gen_nb_xmlTextReaderLocatorPtr 1
30745static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30746    return(NULL);
30747}
30748static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30749}
30750#endif
30751
30752
30753static int
30754test_xmlTextReaderLocatorBaseURI(void) {
30755    int test_ret = 0;
30756
30757#if defined(LIBXML_READER_ENABLED)
30758    int mem_base;
30759    xmlChar * ret_val;
30760    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30761    int n_locator;
30762
30763    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30764        mem_base = xmlMemBlocks();
30765        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30766
30767        ret_val = xmlTextReaderLocatorBaseURI(locator);
30768        desret_xmlChar_ptr(ret_val);
30769        call_tests++;
30770        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30771        xmlResetLastError();
30772        if (mem_base != xmlMemBlocks()) {
30773            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
30774	           xmlMemBlocks() - mem_base);
30775	    test_ret++;
30776            printf(" %d", n_locator);
30777            printf("\n");
30778        }
30779    }
30780    function_tests++;
30781#endif
30782
30783    return(test_ret);
30784}
30785
30786
30787static int
30788test_xmlTextReaderLocatorLineNumber(void) {
30789    int test_ret = 0;
30790
30791#if defined(LIBXML_READER_ENABLED)
30792    int mem_base;
30793    int ret_val;
30794    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30795    int n_locator;
30796
30797    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30798        mem_base = xmlMemBlocks();
30799        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30800
30801        ret_val = xmlTextReaderLocatorLineNumber(locator);
30802        desret_int(ret_val);
30803        call_tests++;
30804        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30805        xmlResetLastError();
30806        if (mem_base != xmlMemBlocks()) {
30807            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
30808	           xmlMemBlocks() - mem_base);
30809	    test_ret++;
30810            printf(" %d", n_locator);
30811            printf("\n");
30812        }
30813    }
30814    function_tests++;
30815#endif
30816
30817    return(test_ret);
30818}
30819
30820
30821static int
30822test_xmlTextReaderLookupNamespace(void) {
30823    int test_ret = 0;
30824
30825#if defined(LIBXML_READER_ENABLED)
30826    int mem_base;
30827    xmlChar * ret_val;
30828    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30829    int n_reader;
30830    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
30831    int n_prefix;
30832
30833    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30834    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
30835        mem_base = xmlMemBlocks();
30836        reader = gen_xmlTextReaderPtr(n_reader, 0);
30837        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
30838
30839        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
30840        desret_xmlChar_ptr(ret_val);
30841        call_tests++;
30842        des_xmlTextReaderPtr(n_reader, reader, 0);
30843        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
30844        xmlResetLastError();
30845        if (mem_base != xmlMemBlocks()) {
30846            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
30847	           xmlMemBlocks() - mem_base);
30848	    test_ret++;
30849            printf(" %d", n_reader);
30850            printf(" %d", n_prefix);
30851            printf("\n");
30852        }
30853    }
30854    }
30855    function_tests++;
30856#endif
30857
30858    return(test_ret);
30859}
30860
30861
30862static int
30863test_xmlTextReaderMoveToAttribute(void) {
30864    int test_ret = 0;
30865
30866#if defined(LIBXML_READER_ENABLED)
30867    int mem_base;
30868    int ret_val;
30869    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30870    int n_reader;
30871    xmlChar * name; /* the qualified name of the attribute. */
30872    int n_name;
30873
30874    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30875    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30876        mem_base = xmlMemBlocks();
30877        reader = gen_xmlTextReaderPtr(n_reader, 0);
30878        name = gen_const_xmlChar_ptr(n_name, 1);
30879
30880        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
30881        desret_int(ret_val);
30882        call_tests++;
30883        des_xmlTextReaderPtr(n_reader, reader, 0);
30884        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30885        xmlResetLastError();
30886        if (mem_base != xmlMemBlocks()) {
30887            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
30888	           xmlMemBlocks() - mem_base);
30889	    test_ret++;
30890            printf(" %d", n_reader);
30891            printf(" %d", n_name);
30892            printf("\n");
30893        }
30894    }
30895    }
30896    function_tests++;
30897#endif
30898
30899    return(test_ret);
30900}
30901
30902
30903static int
30904test_xmlTextReaderMoveToAttributeNo(void) {
30905    int test_ret = 0;
30906
30907#if defined(LIBXML_READER_ENABLED)
30908    int mem_base;
30909    int ret_val;
30910    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30911    int n_reader;
30912    int no; /* the zero-based index of the attribute relative to the containing element. */
30913    int n_no;
30914
30915    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30916    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30917        mem_base = xmlMemBlocks();
30918        reader = gen_xmlTextReaderPtr(n_reader, 0);
30919        no = gen_int(n_no, 1);
30920
30921        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
30922        desret_int(ret_val);
30923        call_tests++;
30924        des_xmlTextReaderPtr(n_reader, reader, 0);
30925        des_int(n_no, no, 1);
30926        xmlResetLastError();
30927        if (mem_base != xmlMemBlocks()) {
30928            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
30929	           xmlMemBlocks() - mem_base);
30930	    test_ret++;
30931            printf(" %d", n_reader);
30932            printf(" %d", n_no);
30933            printf("\n");
30934        }
30935    }
30936    }
30937    function_tests++;
30938#endif
30939
30940    return(test_ret);
30941}
30942
30943
30944static int
30945test_xmlTextReaderMoveToAttributeNs(void) {
30946    int test_ret = 0;
30947
30948#if defined(LIBXML_READER_ENABLED)
30949    int mem_base;
30950    int ret_val;
30951    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30952    int n_reader;
30953    xmlChar * localName; /* the local name of the attribute. */
30954    int n_localName;
30955    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30956    int n_namespaceURI;
30957
30958    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30959    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30960    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30961        mem_base = xmlMemBlocks();
30962        reader = gen_xmlTextReaderPtr(n_reader, 0);
30963        localName = gen_const_xmlChar_ptr(n_localName, 1);
30964        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30965
30966        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30967        desret_int(ret_val);
30968        call_tests++;
30969        des_xmlTextReaderPtr(n_reader, reader, 0);
30970        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30971        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30972        xmlResetLastError();
30973        if (mem_base != xmlMemBlocks()) {
30974            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
30975	           xmlMemBlocks() - mem_base);
30976	    test_ret++;
30977            printf(" %d", n_reader);
30978            printf(" %d", n_localName);
30979            printf(" %d", n_namespaceURI);
30980            printf("\n");
30981        }
30982    }
30983    }
30984    }
30985    function_tests++;
30986#endif
30987
30988    return(test_ret);
30989}
30990
30991
30992static int
30993test_xmlTextReaderMoveToElement(void) {
30994    int test_ret = 0;
30995
30996#if defined(LIBXML_READER_ENABLED)
30997    int mem_base;
30998    int ret_val;
30999    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31000    int n_reader;
31001
31002    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31003        mem_base = xmlMemBlocks();
31004        reader = gen_xmlTextReaderPtr(n_reader, 0);
31005
31006        ret_val = xmlTextReaderMoveToElement(reader);
31007        desret_int(ret_val);
31008        call_tests++;
31009        des_xmlTextReaderPtr(n_reader, reader, 0);
31010        xmlResetLastError();
31011        if (mem_base != xmlMemBlocks()) {
31012            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31013	           xmlMemBlocks() - mem_base);
31014	    test_ret++;
31015            printf(" %d", n_reader);
31016            printf("\n");
31017        }
31018    }
31019    function_tests++;
31020#endif
31021
31022    return(test_ret);
31023}
31024
31025
31026static int
31027test_xmlTextReaderMoveToFirstAttribute(void) {
31028    int test_ret = 0;
31029
31030#if defined(LIBXML_READER_ENABLED)
31031    int mem_base;
31032    int ret_val;
31033    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31034    int n_reader;
31035
31036    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31037        mem_base = xmlMemBlocks();
31038        reader = gen_xmlTextReaderPtr(n_reader, 0);
31039
31040        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31041        desret_int(ret_val);
31042        call_tests++;
31043        des_xmlTextReaderPtr(n_reader, reader, 0);
31044        xmlResetLastError();
31045        if (mem_base != xmlMemBlocks()) {
31046            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31047	           xmlMemBlocks() - mem_base);
31048	    test_ret++;
31049            printf(" %d", n_reader);
31050            printf("\n");
31051        }
31052    }
31053    function_tests++;
31054#endif
31055
31056    return(test_ret);
31057}
31058
31059
31060static int
31061test_xmlTextReaderMoveToNextAttribute(void) {
31062    int test_ret = 0;
31063
31064#if defined(LIBXML_READER_ENABLED)
31065    int mem_base;
31066    int ret_val;
31067    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31068    int n_reader;
31069
31070    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31071        mem_base = xmlMemBlocks();
31072        reader = gen_xmlTextReaderPtr(n_reader, 0);
31073
31074        ret_val = xmlTextReaderMoveToNextAttribute(reader);
31075        desret_int(ret_val);
31076        call_tests++;
31077        des_xmlTextReaderPtr(n_reader, reader, 0);
31078        xmlResetLastError();
31079        if (mem_base != xmlMemBlocks()) {
31080            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31081	           xmlMemBlocks() - mem_base);
31082	    test_ret++;
31083            printf(" %d", n_reader);
31084            printf("\n");
31085        }
31086    }
31087    function_tests++;
31088#endif
31089
31090    return(test_ret);
31091}
31092
31093
31094static int
31095test_xmlTextReaderName(void) {
31096    int test_ret = 0;
31097
31098#if defined(LIBXML_READER_ENABLED)
31099    int mem_base;
31100    xmlChar * ret_val;
31101    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31102    int n_reader;
31103
31104    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31105        mem_base = xmlMemBlocks();
31106        reader = gen_xmlTextReaderPtr(n_reader, 0);
31107
31108        ret_val = xmlTextReaderName(reader);
31109        desret_xmlChar_ptr(ret_val);
31110        call_tests++;
31111        des_xmlTextReaderPtr(n_reader, reader, 0);
31112        xmlResetLastError();
31113        if (mem_base != xmlMemBlocks()) {
31114            printf("Leak of %d blocks found in xmlTextReaderName",
31115	           xmlMemBlocks() - mem_base);
31116	    test_ret++;
31117            printf(" %d", n_reader);
31118            printf("\n");
31119        }
31120    }
31121    function_tests++;
31122#endif
31123
31124    return(test_ret);
31125}
31126
31127
31128static int
31129test_xmlTextReaderNamespaceUri(void) {
31130    int test_ret = 0;
31131
31132#if defined(LIBXML_READER_ENABLED)
31133    int mem_base;
31134    xmlChar * ret_val;
31135    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31136    int n_reader;
31137
31138    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31139        mem_base = xmlMemBlocks();
31140        reader = gen_xmlTextReaderPtr(n_reader, 0);
31141
31142        ret_val = xmlTextReaderNamespaceUri(reader);
31143        desret_xmlChar_ptr(ret_val);
31144        call_tests++;
31145        des_xmlTextReaderPtr(n_reader, reader, 0);
31146        xmlResetLastError();
31147        if (mem_base != xmlMemBlocks()) {
31148            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31149	           xmlMemBlocks() - mem_base);
31150	    test_ret++;
31151            printf(" %d", n_reader);
31152            printf("\n");
31153        }
31154    }
31155    function_tests++;
31156#endif
31157
31158    return(test_ret);
31159}
31160
31161
31162static int
31163test_xmlTextReaderNext(void) {
31164    int test_ret = 0;
31165
31166#if defined(LIBXML_READER_ENABLED)
31167    int mem_base;
31168    int ret_val;
31169    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31170    int n_reader;
31171
31172    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31173        mem_base = xmlMemBlocks();
31174        reader = gen_xmlTextReaderPtr(n_reader, 0);
31175
31176        ret_val = xmlTextReaderNext(reader);
31177        desret_int(ret_val);
31178        call_tests++;
31179        des_xmlTextReaderPtr(n_reader, reader, 0);
31180        xmlResetLastError();
31181        if (mem_base != xmlMemBlocks()) {
31182            printf("Leak of %d blocks found in xmlTextReaderNext",
31183	           xmlMemBlocks() - mem_base);
31184	    test_ret++;
31185            printf(" %d", n_reader);
31186            printf("\n");
31187        }
31188    }
31189    function_tests++;
31190#endif
31191
31192    return(test_ret);
31193}
31194
31195
31196static int
31197test_xmlTextReaderNextSibling(void) {
31198    int test_ret = 0;
31199
31200#if defined(LIBXML_READER_ENABLED)
31201    int mem_base;
31202    int ret_val;
31203    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31204    int n_reader;
31205
31206    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31207        mem_base = xmlMemBlocks();
31208        reader = gen_xmlTextReaderPtr(n_reader, 0);
31209
31210        ret_val = xmlTextReaderNextSibling(reader);
31211        desret_int(ret_val);
31212        call_tests++;
31213        des_xmlTextReaderPtr(n_reader, reader, 0);
31214        xmlResetLastError();
31215        if (mem_base != xmlMemBlocks()) {
31216            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31217	           xmlMemBlocks() - mem_base);
31218	    test_ret++;
31219            printf(" %d", n_reader);
31220            printf("\n");
31221        }
31222    }
31223    function_tests++;
31224#endif
31225
31226    return(test_ret);
31227}
31228
31229
31230static int
31231test_xmlTextReaderNodeType(void) {
31232    int test_ret = 0;
31233
31234#if defined(LIBXML_READER_ENABLED)
31235    int mem_base;
31236    int ret_val;
31237    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31238    int n_reader;
31239
31240    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31241        mem_base = xmlMemBlocks();
31242        reader = gen_xmlTextReaderPtr(n_reader, 0);
31243
31244        ret_val = xmlTextReaderNodeType(reader);
31245        desret_int(ret_val);
31246        call_tests++;
31247        des_xmlTextReaderPtr(n_reader, reader, 0);
31248        xmlResetLastError();
31249        if (mem_base != xmlMemBlocks()) {
31250            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31251	           xmlMemBlocks() - mem_base);
31252	    test_ret++;
31253            printf(" %d", n_reader);
31254            printf("\n");
31255        }
31256    }
31257    function_tests++;
31258#endif
31259
31260    return(test_ret);
31261}
31262
31263
31264static int
31265test_xmlTextReaderNormalization(void) {
31266    int test_ret = 0;
31267
31268#if defined(LIBXML_READER_ENABLED)
31269    int mem_base;
31270    int ret_val;
31271    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31272    int n_reader;
31273
31274    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31275        mem_base = xmlMemBlocks();
31276        reader = gen_xmlTextReaderPtr(n_reader, 0);
31277
31278        ret_val = xmlTextReaderNormalization(reader);
31279        desret_int(ret_val);
31280        call_tests++;
31281        des_xmlTextReaderPtr(n_reader, reader, 0);
31282        xmlResetLastError();
31283        if (mem_base != xmlMemBlocks()) {
31284            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31285	           xmlMemBlocks() - mem_base);
31286	    test_ret++;
31287            printf(" %d", n_reader);
31288            printf("\n");
31289        }
31290    }
31291    function_tests++;
31292#endif
31293
31294    return(test_ret);
31295}
31296
31297
31298static int
31299test_xmlTextReaderPrefix(void) {
31300    int test_ret = 0;
31301
31302#if defined(LIBXML_READER_ENABLED)
31303    int mem_base;
31304    xmlChar * ret_val;
31305    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31306    int n_reader;
31307
31308    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31309        mem_base = xmlMemBlocks();
31310        reader = gen_xmlTextReaderPtr(n_reader, 0);
31311
31312        ret_val = xmlTextReaderPrefix(reader);
31313        desret_xmlChar_ptr(ret_val);
31314        call_tests++;
31315        des_xmlTextReaderPtr(n_reader, reader, 0);
31316        xmlResetLastError();
31317        if (mem_base != xmlMemBlocks()) {
31318            printf("Leak of %d blocks found in xmlTextReaderPrefix",
31319	           xmlMemBlocks() - mem_base);
31320	    test_ret++;
31321            printf(" %d", n_reader);
31322            printf("\n");
31323        }
31324    }
31325    function_tests++;
31326#endif
31327
31328    return(test_ret);
31329}
31330
31331
31332static int
31333test_xmlTextReaderPreserve(void) {
31334    int test_ret = 0;
31335
31336#if defined(LIBXML_READER_ENABLED)
31337    int mem_base;
31338    xmlNodePtr ret_val;
31339    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31340    int n_reader;
31341
31342    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31343        mem_base = xmlMemBlocks();
31344        reader = gen_xmlTextReaderPtr(n_reader, 0);
31345
31346        ret_val = xmlTextReaderPreserve(reader);
31347        desret_xmlNodePtr(ret_val);
31348        call_tests++;
31349        des_xmlTextReaderPtr(n_reader, reader, 0);
31350        xmlResetLastError();
31351        if (mem_base != xmlMemBlocks()) {
31352            printf("Leak of %d blocks found in xmlTextReaderPreserve",
31353	           xmlMemBlocks() - mem_base);
31354	    test_ret++;
31355            printf(" %d", n_reader);
31356            printf("\n");
31357        }
31358    }
31359    function_tests++;
31360#endif
31361
31362    return(test_ret);
31363}
31364
31365
31366static int
31367test_xmlTextReaderPreservePattern(void) {
31368    int test_ret = 0;
31369
31370#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31371#ifdef LIBXML_PATTERN_ENABLED
31372    int mem_base;
31373    int ret_val;
31374    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31375    int n_reader;
31376    xmlChar * pattern; /* an XPath subset pattern */
31377    int n_pattern;
31378    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31379    int n_namespaces;
31380
31381    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31382    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31383    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31384        mem_base = xmlMemBlocks();
31385        reader = gen_xmlTextReaderPtr(n_reader, 0);
31386        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31387        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31388
31389        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31390        desret_int(ret_val);
31391        call_tests++;
31392        des_xmlTextReaderPtr(n_reader, reader, 0);
31393        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31394        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31395        xmlResetLastError();
31396        if (mem_base != xmlMemBlocks()) {
31397            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31398	           xmlMemBlocks() - mem_base);
31399	    test_ret++;
31400            printf(" %d", n_reader);
31401            printf(" %d", n_pattern);
31402            printf(" %d", n_namespaces);
31403            printf("\n");
31404        }
31405    }
31406    }
31407    }
31408    function_tests++;
31409#endif
31410#endif
31411
31412    return(test_ret);
31413}
31414
31415
31416static int
31417test_xmlTextReaderQuoteChar(void) {
31418    int test_ret = 0;
31419
31420#if defined(LIBXML_READER_ENABLED)
31421    int mem_base;
31422    int ret_val;
31423    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31424    int n_reader;
31425
31426    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31427        mem_base = xmlMemBlocks();
31428        reader = gen_xmlTextReaderPtr(n_reader, 0);
31429
31430        ret_val = xmlTextReaderQuoteChar(reader);
31431        desret_int(ret_val);
31432        call_tests++;
31433        des_xmlTextReaderPtr(n_reader, reader, 0);
31434        xmlResetLastError();
31435        if (mem_base != xmlMemBlocks()) {
31436            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31437	           xmlMemBlocks() - mem_base);
31438	    test_ret++;
31439            printf(" %d", n_reader);
31440            printf("\n");
31441        }
31442    }
31443    function_tests++;
31444#endif
31445
31446    return(test_ret);
31447}
31448
31449
31450static int
31451test_xmlTextReaderRead(void) {
31452    int test_ret = 0;
31453
31454#if defined(LIBXML_READER_ENABLED)
31455    int mem_base;
31456    int ret_val;
31457    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31458    int n_reader;
31459
31460    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31461        mem_base = xmlMemBlocks();
31462        reader = gen_xmlTextReaderPtr(n_reader, 0);
31463
31464        ret_val = xmlTextReaderRead(reader);
31465        desret_int(ret_val);
31466        call_tests++;
31467        des_xmlTextReaderPtr(n_reader, reader, 0);
31468        xmlResetLastError();
31469        if (mem_base != xmlMemBlocks()) {
31470            printf("Leak of %d blocks found in xmlTextReaderRead",
31471	           xmlMemBlocks() - mem_base);
31472	    test_ret++;
31473            printf(" %d", n_reader);
31474            printf("\n");
31475        }
31476    }
31477    function_tests++;
31478#endif
31479
31480    return(test_ret);
31481}
31482
31483
31484static int
31485test_xmlTextReaderReadAttributeValue(void) {
31486    int test_ret = 0;
31487
31488#if defined(LIBXML_READER_ENABLED)
31489    int mem_base;
31490    int ret_val;
31491    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31492    int n_reader;
31493
31494    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31495        mem_base = xmlMemBlocks();
31496        reader = gen_xmlTextReaderPtr(n_reader, 0);
31497
31498        ret_val = xmlTextReaderReadAttributeValue(reader);
31499        desret_int(ret_val);
31500        call_tests++;
31501        des_xmlTextReaderPtr(n_reader, reader, 0);
31502        xmlResetLastError();
31503        if (mem_base != xmlMemBlocks()) {
31504            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31505	           xmlMemBlocks() - mem_base);
31506	    test_ret++;
31507            printf(" %d", n_reader);
31508            printf("\n");
31509        }
31510    }
31511    function_tests++;
31512#endif
31513
31514    return(test_ret);
31515}
31516
31517
31518static int
31519test_xmlTextReaderReadState(void) {
31520    int test_ret = 0;
31521
31522#if defined(LIBXML_READER_ENABLED)
31523    int mem_base;
31524    int ret_val;
31525    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31526    int n_reader;
31527
31528    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31529        mem_base = xmlMemBlocks();
31530        reader = gen_xmlTextReaderPtr(n_reader, 0);
31531
31532        ret_val = xmlTextReaderReadState(reader);
31533        desret_int(ret_val);
31534        call_tests++;
31535        des_xmlTextReaderPtr(n_reader, reader, 0);
31536        xmlResetLastError();
31537        if (mem_base != xmlMemBlocks()) {
31538            printf("Leak of %d blocks found in xmlTextReaderReadState",
31539	           xmlMemBlocks() - mem_base);
31540	    test_ret++;
31541            printf(" %d", n_reader);
31542            printf("\n");
31543        }
31544    }
31545    function_tests++;
31546#endif
31547
31548    return(test_ret);
31549}
31550
31551
31552static int
31553test_xmlTextReaderRelaxNGSetSchema(void) {
31554    int test_ret = 0;
31555
31556#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31557    int mem_base;
31558    int ret_val;
31559    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31560    int n_reader;
31561    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
31562    int n_schema;
31563
31564    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31565    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
31566        mem_base = xmlMemBlocks();
31567        reader = gen_xmlTextReaderPtr(n_reader, 0);
31568        schema = gen_xmlRelaxNGPtr(n_schema, 1);
31569
31570        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
31571        desret_int(ret_val);
31572        call_tests++;
31573        des_xmlTextReaderPtr(n_reader, reader, 0);
31574        des_xmlRelaxNGPtr(n_schema, schema, 1);
31575        xmlResetLastError();
31576        if (mem_base != xmlMemBlocks()) {
31577            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
31578	           xmlMemBlocks() - mem_base);
31579	    test_ret++;
31580            printf(" %d", n_reader);
31581            printf(" %d", n_schema);
31582            printf("\n");
31583        }
31584    }
31585    }
31586    function_tests++;
31587#endif
31588
31589    return(test_ret);
31590}
31591
31592
31593static int
31594test_xmlTextReaderRelaxNGValidate(void) {
31595    int test_ret = 0;
31596
31597#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31598    int mem_base;
31599    int ret_val;
31600    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31601    int n_reader;
31602    char * rng; /* the path to a RelaxNG schema or NULL */
31603    int n_rng;
31604
31605    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31606    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
31607        mem_base = xmlMemBlocks();
31608        reader = gen_xmlTextReaderPtr(n_reader, 0);
31609        rng = gen_const_char_ptr(n_rng, 1);
31610
31611        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
31612        desret_int(ret_val);
31613        call_tests++;
31614        des_xmlTextReaderPtr(n_reader, reader, 0);
31615        des_const_char_ptr(n_rng, (const char *)rng, 1);
31616        xmlResetLastError();
31617        if (mem_base != xmlMemBlocks()) {
31618            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
31619	           xmlMemBlocks() - mem_base);
31620	    test_ret++;
31621            printf(" %d", n_reader);
31622            printf(" %d", n_rng);
31623            printf("\n");
31624        }
31625    }
31626    }
31627    function_tests++;
31628#endif
31629
31630    return(test_ret);
31631}
31632
31633
31634static int
31635test_xmlTextReaderSchemaValidate(void) {
31636    int test_ret = 0;
31637
31638#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31639    int ret_val;
31640    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31641    int n_reader;
31642    char * xsd; /* the path to a W3C XSD schema or NULL */
31643    int n_xsd;
31644
31645    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31646    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
31647        reader = gen_xmlTextReaderPtr(n_reader, 0);
31648        xsd = gen_const_char_ptr(n_xsd, 1);
31649
31650        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
31651        desret_int(ret_val);
31652        call_tests++;
31653        des_xmlTextReaderPtr(n_reader, reader, 0);
31654        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
31655        xmlResetLastError();
31656    }
31657    }
31658    function_tests++;
31659#endif
31660
31661    return(test_ret);
31662}
31663
31664
31665static int
31666test_xmlTextReaderSetErrorHandler(void) {
31667    int test_ret = 0;
31668
31669
31670    /* missing type support */
31671    return(test_ret);
31672}
31673
31674
31675static int
31676test_xmlTextReaderSetParserProp(void) {
31677    int test_ret = 0;
31678
31679#if defined(LIBXML_READER_ENABLED)
31680    int mem_base;
31681    int ret_val;
31682    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31683    int n_reader;
31684    int prop; /* the xmlParserProperties to set */
31685    int n_prop;
31686    int value; /* usually 0 or 1 to (de)activate it */
31687    int n_value;
31688
31689    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31690    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31691    for (n_value = 0;n_value < gen_nb_int;n_value++) {
31692        mem_base = xmlMemBlocks();
31693        reader = gen_xmlTextReaderPtr(n_reader, 0);
31694        prop = gen_int(n_prop, 1);
31695        value = gen_int(n_value, 2);
31696
31697        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
31698        desret_int(ret_val);
31699        call_tests++;
31700        des_xmlTextReaderPtr(n_reader, reader, 0);
31701        des_int(n_prop, prop, 1);
31702        des_int(n_value, value, 2);
31703        xmlResetLastError();
31704        if (mem_base != xmlMemBlocks()) {
31705            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
31706	           xmlMemBlocks() - mem_base);
31707	    test_ret++;
31708            printf(" %d", n_reader);
31709            printf(" %d", n_prop);
31710            printf(" %d", n_value);
31711            printf("\n");
31712        }
31713    }
31714    }
31715    }
31716    function_tests++;
31717#endif
31718
31719    return(test_ret);
31720}
31721
31722#ifdef LIBXML_READER_ENABLED
31723
31724#define gen_nb_xmlSchemaPtr 1
31725static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31726    return(NULL);
31727}
31728static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31729}
31730#endif
31731
31732
31733static int
31734test_xmlTextReaderSetSchema(void) {
31735    int test_ret = 0;
31736
31737#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31738    int mem_base;
31739    int ret_val;
31740    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31741    int n_reader;
31742    xmlSchemaPtr schema; /* a precompiled Schema schema */
31743    int n_schema;
31744
31745    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31746    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
31747        mem_base = xmlMemBlocks();
31748        reader = gen_xmlTextReaderPtr(n_reader, 0);
31749        schema = gen_xmlSchemaPtr(n_schema, 1);
31750
31751        ret_val = xmlTextReaderSetSchema(reader, schema);
31752        desret_int(ret_val);
31753        call_tests++;
31754        des_xmlTextReaderPtr(n_reader, reader, 0);
31755        des_xmlSchemaPtr(n_schema, schema, 1);
31756        xmlResetLastError();
31757        if (mem_base != xmlMemBlocks()) {
31758            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
31759	           xmlMemBlocks() - mem_base);
31760	    test_ret++;
31761            printf(" %d", n_reader);
31762            printf(" %d", n_schema);
31763            printf("\n");
31764        }
31765    }
31766    }
31767    function_tests++;
31768#endif
31769
31770    return(test_ret);
31771}
31772
31773
31774static int
31775test_xmlTextReaderSetStructuredErrorHandler(void) {
31776    int test_ret = 0;
31777
31778
31779    /* missing type support */
31780    return(test_ret);
31781}
31782
31783
31784static int
31785test_xmlTextReaderStandalone(void) {
31786    int test_ret = 0;
31787
31788#if defined(LIBXML_READER_ENABLED)
31789    int mem_base;
31790    int ret_val;
31791    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31792    int n_reader;
31793
31794    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31795        mem_base = xmlMemBlocks();
31796        reader = gen_xmlTextReaderPtr(n_reader, 0);
31797
31798        ret_val = xmlTextReaderStandalone(reader);
31799        desret_int(ret_val);
31800        call_tests++;
31801        des_xmlTextReaderPtr(n_reader, reader, 0);
31802        xmlResetLastError();
31803        if (mem_base != xmlMemBlocks()) {
31804            printf("Leak of %d blocks found in xmlTextReaderStandalone",
31805	           xmlMemBlocks() - mem_base);
31806	    test_ret++;
31807            printf(" %d", n_reader);
31808            printf("\n");
31809        }
31810    }
31811    function_tests++;
31812#endif
31813
31814    return(test_ret);
31815}
31816
31817
31818static int
31819test_xmlTextReaderValue(void) {
31820    int test_ret = 0;
31821
31822#if defined(LIBXML_READER_ENABLED)
31823    int mem_base;
31824    xmlChar * ret_val;
31825    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31826    int n_reader;
31827
31828    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31829        mem_base = xmlMemBlocks();
31830        reader = gen_xmlTextReaderPtr(n_reader, 0);
31831
31832        ret_val = xmlTextReaderValue(reader);
31833        desret_xmlChar_ptr(ret_val);
31834        call_tests++;
31835        des_xmlTextReaderPtr(n_reader, reader, 0);
31836        xmlResetLastError();
31837        if (mem_base != xmlMemBlocks()) {
31838            printf("Leak of %d blocks found in xmlTextReaderValue",
31839	           xmlMemBlocks() - mem_base);
31840	    test_ret++;
31841            printf(" %d", n_reader);
31842            printf("\n");
31843        }
31844    }
31845    function_tests++;
31846#endif
31847
31848    return(test_ret);
31849}
31850
31851
31852static int
31853test_xmlTextReaderXmlLang(void) {
31854    int test_ret = 0;
31855
31856#if defined(LIBXML_READER_ENABLED)
31857    int mem_base;
31858    xmlChar * ret_val;
31859    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31860    int n_reader;
31861
31862    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31863        mem_base = xmlMemBlocks();
31864        reader = gen_xmlTextReaderPtr(n_reader, 0);
31865
31866        ret_val = xmlTextReaderXmlLang(reader);
31867        desret_xmlChar_ptr(ret_val);
31868        call_tests++;
31869        des_xmlTextReaderPtr(n_reader, reader, 0);
31870        xmlResetLastError();
31871        if (mem_base != xmlMemBlocks()) {
31872            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
31873	           xmlMemBlocks() - mem_base);
31874	    test_ret++;
31875            printf(" %d", n_reader);
31876            printf("\n");
31877        }
31878    }
31879    function_tests++;
31880#endif
31881
31882    return(test_ret);
31883}
31884
31885static int
31886test_xmlreader(void) {
31887    int test_ret = 0;
31888
31889    if (quiet == 0) printf("Testing xmlreader : 73 of 83 functions ...\n");
31890    test_ret += test_xmlNewTextReader();
31891    test_ret += test_xmlNewTextReaderFilename();
31892    test_ret += test_xmlReaderForDoc();
31893    test_ret += test_xmlReaderForFile();
31894    test_ret += test_xmlReaderForMemory();
31895    test_ret += test_xmlReaderNewDoc();
31896    test_ret += test_xmlReaderNewFile();
31897    test_ret += test_xmlReaderNewMemory();
31898    test_ret += test_xmlReaderNewWalker();
31899    test_ret += test_xmlReaderWalker();
31900    test_ret += test_xmlTextReaderAttributeCount();
31901    test_ret += test_xmlTextReaderBaseUri();
31902    test_ret += test_xmlTextReaderByteConsumed();
31903    test_ret += test_xmlTextReaderClose();
31904    test_ret += test_xmlTextReaderConstBaseUri();
31905    test_ret += test_xmlTextReaderConstEncoding();
31906    test_ret += test_xmlTextReaderConstLocalName();
31907    test_ret += test_xmlTextReaderConstName();
31908    test_ret += test_xmlTextReaderConstNamespaceUri();
31909    test_ret += test_xmlTextReaderConstPrefix();
31910    test_ret += test_xmlTextReaderConstString();
31911    test_ret += test_xmlTextReaderConstValue();
31912    test_ret += test_xmlTextReaderConstXmlLang();
31913    test_ret += test_xmlTextReaderConstXmlVersion();
31914    test_ret += test_xmlTextReaderCurrentDoc();
31915    test_ret += test_xmlTextReaderCurrentNode();
31916    test_ret += test_xmlTextReaderDepth();
31917    test_ret += test_xmlTextReaderExpand();
31918    test_ret += test_xmlTextReaderGetAttribute();
31919    test_ret += test_xmlTextReaderGetAttributeNo();
31920    test_ret += test_xmlTextReaderGetAttributeNs();
31921    test_ret += test_xmlTextReaderGetErrorHandler();
31922    test_ret += test_xmlTextReaderGetParserColumnNumber();
31923    test_ret += test_xmlTextReaderGetParserLineNumber();
31924    test_ret += test_xmlTextReaderGetParserProp();
31925    test_ret += test_xmlTextReaderGetRemainder();
31926    test_ret += test_xmlTextReaderHasAttributes();
31927    test_ret += test_xmlTextReaderHasValue();
31928    test_ret += test_xmlTextReaderIsDefault();
31929    test_ret += test_xmlTextReaderIsEmptyElement();
31930    test_ret += test_xmlTextReaderIsNamespaceDecl();
31931    test_ret += test_xmlTextReaderIsValid();
31932    test_ret += test_xmlTextReaderLocalName();
31933    test_ret += test_xmlTextReaderLocatorBaseURI();
31934    test_ret += test_xmlTextReaderLocatorLineNumber();
31935    test_ret += test_xmlTextReaderLookupNamespace();
31936    test_ret += test_xmlTextReaderMoveToAttribute();
31937    test_ret += test_xmlTextReaderMoveToAttributeNo();
31938    test_ret += test_xmlTextReaderMoveToAttributeNs();
31939    test_ret += test_xmlTextReaderMoveToElement();
31940    test_ret += test_xmlTextReaderMoveToFirstAttribute();
31941    test_ret += test_xmlTextReaderMoveToNextAttribute();
31942    test_ret += test_xmlTextReaderName();
31943    test_ret += test_xmlTextReaderNamespaceUri();
31944    test_ret += test_xmlTextReaderNext();
31945    test_ret += test_xmlTextReaderNextSibling();
31946    test_ret += test_xmlTextReaderNodeType();
31947    test_ret += test_xmlTextReaderNormalization();
31948    test_ret += test_xmlTextReaderPrefix();
31949    test_ret += test_xmlTextReaderPreserve();
31950    test_ret += test_xmlTextReaderPreservePattern();
31951    test_ret += test_xmlTextReaderQuoteChar();
31952    test_ret += test_xmlTextReaderRead();
31953    test_ret += test_xmlTextReaderReadAttributeValue();
31954    test_ret += test_xmlTextReaderReadState();
31955    test_ret += test_xmlTextReaderRelaxNGSetSchema();
31956    test_ret += test_xmlTextReaderRelaxNGValidate();
31957    test_ret += test_xmlTextReaderSchemaValidate();
31958    test_ret += test_xmlTextReaderSetErrorHandler();
31959    test_ret += test_xmlTextReaderSetParserProp();
31960    test_ret += test_xmlTextReaderSetSchema();
31961    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
31962    test_ret += test_xmlTextReaderStandalone();
31963    test_ret += test_xmlTextReaderValue();
31964    test_ret += test_xmlTextReaderXmlLang();
31965
31966    if (test_ret != 0)
31967	printf("Module xmlreader: %d errors\n", test_ret);
31968    return(test_ret);
31969}
31970
31971static int
31972test_xmlExpCtxtNbCons(void) {
31973    int test_ret = 0;
31974
31975#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
31976    int mem_base;
31977    int ret_val;
31978    xmlExpCtxtPtr ctxt; /* an expression context */
31979    int n_ctxt;
31980
31981    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
31982        mem_base = xmlMemBlocks();
31983        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
31984
31985        ret_val = xmlExpCtxtNbCons(ctxt);
31986        desret_int(ret_val);
31987        call_tests++;
31988        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
31989        xmlResetLastError();
31990        if (mem_base != xmlMemBlocks()) {
31991            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
31992	           xmlMemBlocks() - mem_base);
31993	    test_ret++;
31994            printf(" %d", n_ctxt);
31995            printf("\n");
31996        }
31997    }
31998    function_tests++;
31999#endif
32000
32001    return(test_ret);
32002}
32003
32004
32005static int
32006test_xmlExpCtxtNbNodes(void) {
32007    int test_ret = 0;
32008
32009#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32010    int mem_base;
32011    int ret_val;
32012    xmlExpCtxtPtr ctxt; /* an expression context */
32013    int n_ctxt;
32014
32015    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32016        mem_base = xmlMemBlocks();
32017        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32018
32019        ret_val = xmlExpCtxtNbNodes(ctxt);
32020        desret_int(ret_val);
32021        call_tests++;
32022        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32023        xmlResetLastError();
32024        if (mem_base != xmlMemBlocks()) {
32025            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32026	           xmlMemBlocks() - mem_base);
32027	    test_ret++;
32028            printf(" %d", n_ctxt);
32029            printf("\n");
32030        }
32031    }
32032    function_tests++;
32033#endif
32034
32035    return(test_ret);
32036}
32037
32038
32039static int
32040test_xmlExpDump(void) {
32041    int test_ret = 0;
32042
32043#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32044    int mem_base;
32045    xmlBufferPtr buf; /* a buffer to receive the output */
32046    int n_buf;
32047    xmlExpNodePtr expr; /* the compiled expression */
32048    int n_expr;
32049
32050    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32051    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32052        mem_base = xmlMemBlocks();
32053        buf = gen_xmlBufferPtr(n_buf, 0);
32054        expr = gen_xmlExpNodePtr(n_expr, 1);
32055
32056        xmlExpDump(buf, expr);
32057        call_tests++;
32058        des_xmlBufferPtr(n_buf, buf, 0);
32059        des_xmlExpNodePtr(n_expr, expr, 1);
32060        xmlResetLastError();
32061        if (mem_base != xmlMemBlocks()) {
32062            printf("Leak of %d blocks found in xmlExpDump",
32063	           xmlMemBlocks() - mem_base);
32064	    test_ret++;
32065            printf(" %d", n_buf);
32066            printf(" %d", n_expr);
32067            printf("\n");
32068        }
32069    }
32070    }
32071    function_tests++;
32072#endif
32073
32074    return(test_ret);
32075}
32076
32077
32078static int
32079test_xmlExpExpDerive(void) {
32080    int test_ret = 0;
32081
32082
32083    /* missing type support */
32084    return(test_ret);
32085}
32086
32087
32088static int
32089test_xmlExpGetLanguage(void) {
32090    int test_ret = 0;
32091
32092#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32093    int mem_base;
32094    int ret_val;
32095    xmlExpCtxtPtr ctxt; /* the expression context */
32096    int n_ctxt;
32097    xmlExpNodePtr exp; /* the expression */
32098    int n_exp;
32099    xmlChar ** list; /* where to store the tokens */
32100    int n_list;
32101    int len; /* the allocated lenght of @list */
32102    int n_len;
32103
32104    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32105    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32106    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
32107    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32108        mem_base = xmlMemBlocks();
32109        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32110        exp = gen_xmlExpNodePtr(n_exp, 1);
32111        list = gen_const_xmlChar_ptr_ptr(n_list, 2);
32112        len = gen_int(n_len, 3);
32113
32114        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)list, len);
32115        desret_int(ret_val);
32116        call_tests++;
32117        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32118        des_xmlExpNodePtr(n_exp, exp, 1);
32119        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2);
32120        des_int(n_len, len, 3);
32121        xmlResetLastError();
32122        if (mem_base != xmlMemBlocks()) {
32123            printf("Leak of %d blocks found in xmlExpGetLanguage",
32124	           xmlMemBlocks() - mem_base);
32125	    test_ret++;
32126            printf(" %d", n_ctxt);
32127            printf(" %d", n_exp);
32128            printf(" %d", n_list);
32129            printf(" %d", n_len);
32130            printf("\n");
32131        }
32132    }
32133    }
32134    }
32135    }
32136    function_tests++;
32137#endif
32138
32139    return(test_ret);
32140}
32141
32142
32143static int
32144test_xmlExpGetStart(void) {
32145    int test_ret = 0;
32146
32147#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32148    int mem_base;
32149    int ret_val;
32150    xmlExpCtxtPtr ctxt; /* the expression context */
32151    int n_ctxt;
32152    xmlExpNodePtr exp; /* the expression */
32153    int n_exp;
32154    xmlChar ** list; /* where to store the tokens */
32155    int n_list;
32156    int len; /* the allocated lenght of @list */
32157    int n_len;
32158
32159    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32160    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32161    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
32162    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32163        mem_base = xmlMemBlocks();
32164        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32165        exp = gen_xmlExpNodePtr(n_exp, 1);
32166        list = gen_const_xmlChar_ptr_ptr(n_list, 2);
32167        len = gen_int(n_len, 3);
32168
32169        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)list, len);
32170        desret_int(ret_val);
32171        call_tests++;
32172        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32173        des_xmlExpNodePtr(n_exp, exp, 1);
32174        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2);
32175        des_int(n_len, len, 3);
32176        xmlResetLastError();
32177        if (mem_base != xmlMemBlocks()) {
32178            printf("Leak of %d blocks found in xmlExpGetStart",
32179	           xmlMemBlocks() - mem_base);
32180	    test_ret++;
32181            printf(" %d", n_ctxt);
32182            printf(" %d", n_exp);
32183            printf(" %d", n_list);
32184            printf(" %d", n_len);
32185            printf("\n");
32186        }
32187    }
32188    }
32189    }
32190    }
32191    function_tests++;
32192#endif
32193
32194    return(test_ret);
32195}
32196
32197
32198static int
32199test_xmlExpIsNillable(void) {
32200    int test_ret = 0;
32201
32202#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32203    int mem_base;
32204    int ret_val;
32205    xmlExpNodePtr exp; /* the expression */
32206    int n_exp;
32207
32208    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32209        mem_base = xmlMemBlocks();
32210        exp = gen_xmlExpNodePtr(n_exp, 0);
32211
32212        ret_val = xmlExpIsNillable(exp);
32213        desret_int(ret_val);
32214        call_tests++;
32215        des_xmlExpNodePtr(n_exp, exp, 0);
32216        xmlResetLastError();
32217        if (mem_base != xmlMemBlocks()) {
32218            printf("Leak of %d blocks found in xmlExpIsNillable",
32219	           xmlMemBlocks() - mem_base);
32220	    test_ret++;
32221            printf(" %d", n_exp);
32222            printf("\n");
32223        }
32224    }
32225    function_tests++;
32226#endif
32227
32228    return(test_ret);
32229}
32230
32231
32232static int
32233test_xmlExpMaxToken(void) {
32234    int test_ret = 0;
32235
32236#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32237    int mem_base;
32238    int ret_val;
32239    xmlExpNodePtr expr; /* a compiled expression */
32240    int n_expr;
32241
32242    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32243        mem_base = xmlMemBlocks();
32244        expr = gen_xmlExpNodePtr(n_expr, 0);
32245
32246        ret_val = xmlExpMaxToken(expr);
32247        desret_int(ret_val);
32248        call_tests++;
32249        des_xmlExpNodePtr(n_expr, expr, 0);
32250        xmlResetLastError();
32251        if (mem_base != xmlMemBlocks()) {
32252            printf("Leak of %d blocks found in xmlExpMaxToken",
32253	           xmlMemBlocks() - mem_base);
32254	    test_ret++;
32255            printf(" %d", n_expr);
32256            printf("\n");
32257        }
32258    }
32259    function_tests++;
32260#endif
32261
32262    return(test_ret);
32263}
32264
32265
32266static int
32267test_xmlExpNewAtom(void) {
32268    int test_ret = 0;
32269
32270
32271    /* missing type support */
32272    return(test_ret);
32273}
32274
32275
32276static int
32277test_xmlExpNewCtxt(void) {
32278    int test_ret = 0;
32279
32280
32281    /* missing type support */
32282    return(test_ret);
32283}
32284
32285
32286static int
32287test_xmlExpNewOr(void) {
32288    int test_ret = 0;
32289
32290
32291    /* missing type support */
32292    return(test_ret);
32293}
32294
32295
32296static int
32297test_xmlExpNewRange(void) {
32298    int test_ret = 0;
32299
32300
32301    /* missing type support */
32302    return(test_ret);
32303}
32304
32305
32306static int
32307test_xmlExpNewSeq(void) {
32308    int test_ret = 0;
32309
32310
32311    /* missing type support */
32312    return(test_ret);
32313}
32314
32315
32316static int
32317test_xmlExpParse(void) {
32318    int test_ret = 0;
32319
32320
32321    /* missing type support */
32322    return(test_ret);
32323}
32324
32325
32326static int
32327test_xmlExpRef(void) {
32328    int test_ret = 0;
32329
32330#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32331    int mem_base;
32332    xmlExpNodePtr exp; /* the expression */
32333    int n_exp;
32334
32335    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32336        mem_base = xmlMemBlocks();
32337        exp = gen_xmlExpNodePtr(n_exp, 0);
32338
32339        xmlExpRef(exp);
32340        call_tests++;
32341        des_xmlExpNodePtr(n_exp, exp, 0);
32342        xmlResetLastError();
32343        if (mem_base != xmlMemBlocks()) {
32344            printf("Leak of %d blocks found in xmlExpRef",
32345	           xmlMemBlocks() - mem_base);
32346	    test_ret++;
32347            printf(" %d", n_exp);
32348            printf("\n");
32349        }
32350    }
32351    function_tests++;
32352#endif
32353
32354    return(test_ret);
32355}
32356
32357
32358static int
32359test_xmlExpStringDerive(void) {
32360    int test_ret = 0;
32361
32362
32363    /* missing type support */
32364    return(test_ret);
32365}
32366
32367
32368static int
32369test_xmlExpSubsume(void) {
32370    int test_ret = 0;
32371
32372#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32373    int mem_base;
32374    int ret_val;
32375    xmlExpCtxtPtr ctxt; /* the expressions context */
32376    int n_ctxt;
32377    xmlExpNodePtr exp; /* the englobing expression */
32378    int n_exp;
32379    xmlExpNodePtr sub; /* the subexpression */
32380    int n_sub;
32381
32382    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32383    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32384    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32385        mem_base = xmlMemBlocks();
32386        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32387        exp = gen_xmlExpNodePtr(n_exp, 1);
32388        sub = gen_xmlExpNodePtr(n_sub, 2);
32389
32390        ret_val = xmlExpSubsume(ctxt, exp, sub);
32391        desret_int(ret_val);
32392        call_tests++;
32393        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32394        des_xmlExpNodePtr(n_exp, exp, 1);
32395        des_xmlExpNodePtr(n_sub, sub, 2);
32396        xmlResetLastError();
32397        if (mem_base != xmlMemBlocks()) {
32398            printf("Leak of %d blocks found in xmlExpSubsume",
32399	           xmlMemBlocks() - mem_base);
32400	    test_ret++;
32401            printf(" %d", n_ctxt);
32402            printf(" %d", n_exp);
32403            printf(" %d", n_sub);
32404            printf("\n");
32405        }
32406    }
32407    }
32408    }
32409    function_tests++;
32410#endif
32411
32412    return(test_ret);
32413}
32414
32415#ifdef LIBXML_REGEXP_ENABLED
32416
32417#define gen_nb_xmlRegExecCtxtPtr 1
32418static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32419    return(NULL);
32420}
32421static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32422}
32423#endif
32424
32425
32426static int
32427test_xmlRegExecErrInfo(void) {
32428    int test_ret = 0;
32429
32430#if defined(LIBXML_REGEXP_ENABLED)
32431    int mem_base;
32432    int ret_val;
32433    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
32434    int n_exec;
32435    xmlChar ** string; /* return value for the error string */
32436    int n_string;
32437    int * nbval; /* pointer to the number of accepted values IN/OUT */
32438    int n_nbval;
32439    int * nbneg; /* return number of negative transitions */
32440    int n_nbneg;
32441    xmlChar ** values; /* pointer to the array of acceptable values */
32442    int n_values;
32443    int * terminal; /* return value if this was a terminal state */
32444    int n_terminal;
32445
32446    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32447    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
32448    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
32449    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
32450    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
32451    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
32452        mem_base = xmlMemBlocks();
32453        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32454        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
32455        nbval = gen_int_ptr(n_nbval, 2);
32456        nbneg = gen_int_ptr(n_nbneg, 3);
32457        values = gen_xmlChar_ptr_ptr(n_values, 4);
32458        terminal = gen_int_ptr(n_terminal, 5);
32459
32460        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
32461        desret_int(ret_val);
32462        call_tests++;
32463        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32464        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
32465        des_int_ptr(n_nbval, nbval, 2);
32466        des_int_ptr(n_nbneg, nbneg, 3);
32467        des_xmlChar_ptr_ptr(n_values, values, 4);
32468        des_int_ptr(n_terminal, terminal, 5);
32469        xmlResetLastError();
32470        if (mem_base != xmlMemBlocks()) {
32471            printf("Leak of %d blocks found in xmlRegExecErrInfo",
32472	           xmlMemBlocks() - mem_base);
32473	    test_ret++;
32474            printf(" %d", n_exec);
32475            printf(" %d", n_string);
32476            printf(" %d", n_nbval);
32477            printf(" %d", n_nbneg);
32478            printf(" %d", n_values);
32479            printf(" %d", n_terminal);
32480            printf("\n");
32481        }
32482    }
32483    }
32484    }
32485    }
32486    }
32487    }
32488    function_tests++;
32489#endif
32490
32491    return(test_ret);
32492}
32493
32494
32495static int
32496test_xmlRegExecNextValues(void) {
32497    int test_ret = 0;
32498
32499#if defined(LIBXML_REGEXP_ENABLED)
32500    int mem_base;
32501    int ret_val;
32502    xmlRegExecCtxtPtr exec; /* a regexp execution context */
32503    int n_exec;
32504    int * nbval; /* pointer to the number of accepted values IN/OUT */
32505    int n_nbval;
32506    int * nbneg; /* return number of negative transitions */
32507    int n_nbneg;
32508    xmlChar ** values; /* pointer to the array of acceptable values */
32509    int n_values;
32510    int * terminal; /* return value if this was a terminal state */
32511    int n_terminal;
32512
32513    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32514    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
32515    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
32516    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
32517    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
32518        mem_base = xmlMemBlocks();
32519        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32520        nbval = gen_int_ptr(n_nbval, 1);
32521        nbneg = gen_int_ptr(n_nbneg, 2);
32522        values = gen_xmlChar_ptr_ptr(n_values, 3);
32523        terminal = gen_int_ptr(n_terminal, 4);
32524
32525        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
32526        desret_int(ret_val);
32527        call_tests++;
32528        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32529        des_int_ptr(n_nbval, nbval, 1);
32530        des_int_ptr(n_nbneg, nbneg, 2);
32531        des_xmlChar_ptr_ptr(n_values, values, 3);
32532        des_int_ptr(n_terminal, terminal, 4);
32533        xmlResetLastError();
32534        if (mem_base != xmlMemBlocks()) {
32535            printf("Leak of %d blocks found in xmlRegExecNextValues",
32536	           xmlMemBlocks() - mem_base);
32537	    test_ret++;
32538            printf(" %d", n_exec);
32539            printf(" %d", n_nbval);
32540            printf(" %d", n_nbneg);
32541            printf(" %d", n_values);
32542            printf(" %d", n_terminal);
32543            printf("\n");
32544        }
32545    }
32546    }
32547    }
32548    }
32549    }
32550    function_tests++;
32551#endif
32552
32553    return(test_ret);
32554}
32555
32556
32557static int
32558test_xmlRegExecPushString(void) {
32559    int test_ret = 0;
32560
32561#if defined(LIBXML_REGEXP_ENABLED)
32562    int mem_base;
32563    int ret_val;
32564    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
32565    int n_exec;
32566    xmlChar * value; /* a string token input */
32567    int n_value;
32568    void * data; /* data associated to the token to reuse in callbacks */
32569    int n_data;
32570
32571    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32572    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32573    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
32574        mem_base = xmlMemBlocks();
32575        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32576        value = gen_const_xmlChar_ptr(n_value, 1);
32577        data = gen_userdata(n_data, 2);
32578
32579        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
32580        desret_int(ret_val);
32581        call_tests++;
32582        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32583        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32584        des_userdata(n_data, data, 2);
32585        xmlResetLastError();
32586        if (mem_base != xmlMemBlocks()) {
32587            printf("Leak of %d blocks found in xmlRegExecPushString",
32588	           xmlMemBlocks() - mem_base);
32589	    test_ret++;
32590            printf(" %d", n_exec);
32591            printf(" %d", n_value);
32592            printf(" %d", n_data);
32593            printf("\n");
32594        }
32595    }
32596    }
32597    }
32598    function_tests++;
32599#endif
32600
32601    return(test_ret);
32602}
32603
32604
32605static int
32606test_xmlRegExecPushString2(void) {
32607    int test_ret = 0;
32608
32609#if defined(LIBXML_REGEXP_ENABLED)
32610    int mem_base;
32611    int ret_val;
32612    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
32613    int n_exec;
32614    xmlChar * value; /* the first string token input */
32615    int n_value;
32616    xmlChar * value2; /* the second string token input */
32617    int n_value2;
32618    void * data; /* data associated to the token to reuse in callbacks */
32619    int n_data;
32620
32621    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32622    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32623    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
32624    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
32625        mem_base = xmlMemBlocks();
32626        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32627        value = gen_const_xmlChar_ptr(n_value, 1);
32628        value2 = gen_const_xmlChar_ptr(n_value2, 2);
32629        data = gen_userdata(n_data, 3);
32630
32631        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
32632        desret_int(ret_val);
32633        call_tests++;
32634        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32635        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32636        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
32637        des_userdata(n_data, data, 3);
32638        xmlResetLastError();
32639        if (mem_base != xmlMemBlocks()) {
32640            printf("Leak of %d blocks found in xmlRegExecPushString2",
32641	           xmlMemBlocks() - mem_base);
32642	    test_ret++;
32643            printf(" %d", n_exec);
32644            printf(" %d", n_value);
32645            printf(" %d", n_value2);
32646            printf(" %d", n_data);
32647            printf("\n");
32648        }
32649    }
32650    }
32651    }
32652    }
32653    function_tests++;
32654#endif
32655
32656    return(test_ret);
32657}
32658
32659#ifdef LIBXML_REGEXP_ENABLED
32660
32661#define gen_nb_xmlRegexpPtr 1
32662static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32663    return(NULL);
32664}
32665static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32666}
32667#endif
32668
32669
32670static int
32671test_xmlRegNewExecCtxt(void) {
32672    int test_ret = 0;
32673
32674
32675    /* missing type support */
32676    return(test_ret);
32677}
32678
32679
32680static int
32681test_xmlRegexpCompile(void) {
32682    int test_ret = 0;
32683
32684
32685    /* missing type support */
32686    return(test_ret);
32687}
32688
32689
32690static int
32691test_xmlRegexpExec(void) {
32692    int test_ret = 0;
32693
32694#if defined(LIBXML_REGEXP_ENABLED)
32695    int mem_base;
32696    int ret_val;
32697    xmlRegexpPtr comp; /* the compiled regular expression */
32698    int n_comp;
32699    xmlChar * content; /* the value to check against the regular expression */
32700    int n_content;
32701
32702    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
32703    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
32704        mem_base = xmlMemBlocks();
32705        comp = gen_xmlRegexpPtr(n_comp, 0);
32706        content = gen_const_xmlChar_ptr(n_content, 1);
32707
32708        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
32709        desret_int(ret_val);
32710        call_tests++;
32711        des_xmlRegexpPtr(n_comp, comp, 0);
32712        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
32713        xmlResetLastError();
32714        if (mem_base != xmlMemBlocks()) {
32715            printf("Leak of %d blocks found in xmlRegexpExec",
32716	           xmlMemBlocks() - mem_base);
32717	    test_ret++;
32718            printf(" %d", n_comp);
32719            printf(" %d", n_content);
32720            printf("\n");
32721        }
32722    }
32723    }
32724    function_tests++;
32725#endif
32726
32727    return(test_ret);
32728}
32729
32730
32731static int
32732test_xmlRegexpIsDeterminist(void) {
32733    int test_ret = 0;
32734
32735#if defined(LIBXML_REGEXP_ENABLED)
32736    int mem_base;
32737    int ret_val;
32738    xmlRegexpPtr comp; /* the compiled regular expression */
32739    int n_comp;
32740
32741    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
32742        mem_base = xmlMemBlocks();
32743        comp = gen_xmlRegexpPtr(n_comp, 0);
32744
32745        ret_val = xmlRegexpIsDeterminist(comp);
32746        desret_int(ret_val);
32747        call_tests++;
32748        des_xmlRegexpPtr(n_comp, comp, 0);
32749        xmlResetLastError();
32750        if (mem_base != xmlMemBlocks()) {
32751            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
32752	           xmlMemBlocks() - mem_base);
32753	    test_ret++;
32754            printf(" %d", n_comp);
32755            printf("\n");
32756        }
32757    }
32758    function_tests++;
32759#endif
32760
32761    return(test_ret);
32762}
32763
32764
32765static int
32766test_xmlRegexpPrint(void) {
32767    int test_ret = 0;
32768
32769#if defined(LIBXML_REGEXP_ENABLED)
32770    int mem_base;
32771    FILE * output; /* the file for the output debug */
32772    int n_output;
32773    xmlRegexpPtr regexp; /* the compiled regexp */
32774    int n_regexp;
32775
32776    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
32777    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
32778        mem_base = xmlMemBlocks();
32779        output = gen_FILE_ptr(n_output, 0);
32780        regexp = gen_xmlRegexpPtr(n_regexp, 1);
32781
32782        xmlRegexpPrint(output, regexp);
32783        call_tests++;
32784        des_FILE_ptr(n_output, output, 0);
32785        des_xmlRegexpPtr(n_regexp, regexp, 1);
32786        xmlResetLastError();
32787        if (mem_base != xmlMemBlocks()) {
32788            printf("Leak of %d blocks found in xmlRegexpPrint",
32789	           xmlMemBlocks() - mem_base);
32790	    test_ret++;
32791            printf(" %d", n_output);
32792            printf(" %d", n_regexp);
32793            printf("\n");
32794        }
32795    }
32796    }
32797    function_tests++;
32798#endif
32799
32800    return(test_ret);
32801}
32802
32803static int
32804test_xmlregexp(void) {
32805    int test_ret = 0;
32806
32807    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
32808    test_ret += test_xmlExpCtxtNbCons();
32809    test_ret += test_xmlExpCtxtNbNodes();
32810    test_ret += test_xmlExpDump();
32811    test_ret += test_xmlExpExpDerive();
32812    test_ret += test_xmlExpGetLanguage();
32813    test_ret += test_xmlExpGetStart();
32814    test_ret += test_xmlExpIsNillable();
32815    test_ret += test_xmlExpMaxToken();
32816    test_ret += test_xmlExpNewAtom();
32817    test_ret += test_xmlExpNewCtxt();
32818    test_ret += test_xmlExpNewOr();
32819    test_ret += test_xmlExpNewRange();
32820    test_ret += test_xmlExpNewSeq();
32821    test_ret += test_xmlExpParse();
32822    test_ret += test_xmlExpRef();
32823    test_ret += test_xmlExpStringDerive();
32824    test_ret += test_xmlExpSubsume();
32825    test_ret += test_xmlRegExecErrInfo();
32826    test_ret += test_xmlRegExecNextValues();
32827    test_ret += test_xmlRegExecPushString();
32828    test_ret += test_xmlRegExecPushString2();
32829    test_ret += test_xmlRegNewExecCtxt();
32830    test_ret += test_xmlRegexpCompile();
32831    test_ret += test_xmlRegexpExec();
32832    test_ret += test_xmlRegexpIsDeterminist();
32833    test_ret += test_xmlRegexpPrint();
32834
32835    if (test_ret != 0)
32836	printf("Module xmlregexp: %d errors\n", test_ret);
32837    return(test_ret);
32838}
32839#ifdef LIBXML_OUTPUT_ENABLED
32840
32841#define gen_nb_xmlSaveCtxtPtr 1
32842static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32843    return(NULL);
32844}
32845static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32846}
32847#endif
32848
32849
32850static int
32851test_xmlSaveClose(void) {
32852    int test_ret = 0;
32853
32854#if defined(LIBXML_OUTPUT_ENABLED)
32855    int mem_base;
32856    int ret_val;
32857    xmlSaveCtxtPtr ctxt; /* a document saving context */
32858    int n_ctxt;
32859
32860    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32861        mem_base = xmlMemBlocks();
32862        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32863
32864        ret_val = xmlSaveClose(ctxt);
32865        desret_int(ret_val);
32866        call_tests++;
32867        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32868        xmlResetLastError();
32869        if (mem_base != xmlMemBlocks()) {
32870            printf("Leak of %d blocks found in xmlSaveClose",
32871	           xmlMemBlocks() - mem_base);
32872	    test_ret++;
32873            printf(" %d", n_ctxt);
32874            printf("\n");
32875        }
32876    }
32877    function_tests++;
32878#endif
32879
32880    return(test_ret);
32881}
32882
32883
32884static int
32885test_xmlSaveDoc(void) {
32886    int test_ret = 0;
32887
32888#if defined(LIBXML_OUTPUT_ENABLED)
32889    int mem_base;
32890    long ret_val;
32891    xmlSaveCtxtPtr ctxt; /* a document saving context */
32892    int n_ctxt;
32893    xmlDocPtr doc; /* a document */
32894    int n_doc;
32895
32896    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32897    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
32898        mem_base = xmlMemBlocks();
32899        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32900        doc = gen_xmlDocPtr(n_doc, 1);
32901
32902        ret_val = xmlSaveDoc(ctxt, doc);
32903        desret_long(ret_val);
32904        call_tests++;
32905        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32906        des_xmlDocPtr(n_doc, doc, 1);
32907        xmlResetLastError();
32908        if (mem_base != xmlMemBlocks()) {
32909            printf("Leak of %d blocks found in xmlSaveDoc",
32910	           xmlMemBlocks() - mem_base);
32911	    test_ret++;
32912            printf(" %d", n_ctxt);
32913            printf(" %d", n_doc);
32914            printf("\n");
32915        }
32916    }
32917    }
32918    function_tests++;
32919#endif
32920
32921    return(test_ret);
32922}
32923
32924
32925static int
32926test_xmlSaveFlush(void) {
32927    int test_ret = 0;
32928
32929#if defined(LIBXML_OUTPUT_ENABLED)
32930    int mem_base;
32931    int ret_val;
32932    xmlSaveCtxtPtr ctxt; /* a document saving context */
32933    int n_ctxt;
32934
32935    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32936        mem_base = xmlMemBlocks();
32937        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32938
32939        ret_val = xmlSaveFlush(ctxt);
32940        desret_int(ret_val);
32941        call_tests++;
32942        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32943        xmlResetLastError();
32944        if (mem_base != xmlMemBlocks()) {
32945            printf("Leak of %d blocks found in xmlSaveFlush",
32946	           xmlMemBlocks() - mem_base);
32947	    test_ret++;
32948            printf(" %d", n_ctxt);
32949            printf("\n");
32950        }
32951    }
32952    function_tests++;
32953#endif
32954
32955    return(test_ret);
32956}
32957
32958
32959static int
32960test_xmlSaveSetAttrEscape(void) {
32961    int test_ret = 0;
32962
32963
32964    /* missing type support */
32965    return(test_ret);
32966}
32967
32968
32969static int
32970test_xmlSaveSetEscape(void) {
32971    int test_ret = 0;
32972
32973
32974    /* missing type support */
32975    return(test_ret);
32976}
32977
32978
32979static int
32980test_xmlSaveToFd(void) {
32981    int test_ret = 0;
32982
32983
32984    /* missing type support */
32985    return(test_ret);
32986}
32987
32988
32989static int
32990test_xmlSaveToFilename(void) {
32991    int test_ret = 0;
32992
32993
32994    /* missing type support */
32995    return(test_ret);
32996}
32997
32998
32999static int
33000test_xmlSaveTree(void) {
33001    int test_ret = 0;
33002
33003#if defined(LIBXML_OUTPUT_ENABLED)
33004    int mem_base;
33005    long ret_val;
33006    xmlSaveCtxtPtr ctxt; /* a document saving context */
33007    int n_ctxt;
33008    xmlNodePtr node; /* a document */
33009    int n_node;
33010
33011    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33012    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33013        mem_base = xmlMemBlocks();
33014        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33015        node = gen_xmlNodePtr(n_node, 1);
33016
33017        ret_val = xmlSaveTree(ctxt, node);
33018        desret_long(ret_val);
33019        call_tests++;
33020        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33021        des_xmlNodePtr(n_node, node, 1);
33022        xmlResetLastError();
33023        if (mem_base != xmlMemBlocks()) {
33024            printf("Leak of %d blocks found in xmlSaveTree",
33025	           xmlMemBlocks() - mem_base);
33026	    test_ret++;
33027            printf(" %d", n_ctxt);
33028            printf(" %d", n_node);
33029            printf("\n");
33030        }
33031    }
33032    }
33033    function_tests++;
33034#endif
33035
33036    return(test_ret);
33037}
33038
33039static int
33040test_xmlsave(void) {
33041    int test_ret = 0;
33042
33043    if (quiet == 0) printf("Testing xmlsave : 4 of 9 functions ...\n");
33044    test_ret += test_xmlSaveClose();
33045    test_ret += test_xmlSaveDoc();
33046    test_ret += test_xmlSaveFlush();
33047    test_ret += test_xmlSaveSetAttrEscape();
33048    test_ret += test_xmlSaveSetEscape();
33049    test_ret += test_xmlSaveToFd();
33050    test_ret += test_xmlSaveToFilename();
33051    test_ret += test_xmlSaveTree();
33052
33053    if (test_ret != 0)
33054	printf("Module xmlsave: %d errors\n", test_ret);
33055    return(test_ret);
33056}
33057
33058static int
33059test_xmlSchemaDump(void) {
33060    int test_ret = 0;
33061
33062#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33063    int mem_base;
33064    FILE * output; /* the file output */
33065    int n_output;
33066    xmlSchemaPtr schema; /* a schema structure */
33067    int n_schema;
33068
33069    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33070    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33071        mem_base = xmlMemBlocks();
33072        output = gen_FILE_ptr(n_output, 0);
33073        schema = gen_xmlSchemaPtr(n_schema, 1);
33074
33075        xmlSchemaDump(output, schema);
33076        call_tests++;
33077        des_FILE_ptr(n_output, output, 0);
33078        des_xmlSchemaPtr(n_schema, schema, 1);
33079        xmlResetLastError();
33080        if (mem_base != xmlMemBlocks()) {
33081            printf("Leak of %d blocks found in xmlSchemaDump",
33082	           xmlMemBlocks() - mem_base);
33083	    test_ret++;
33084            printf(" %d", n_output);
33085            printf(" %d", n_schema);
33086            printf("\n");
33087        }
33088    }
33089    }
33090    function_tests++;
33091#endif
33092
33093    return(test_ret);
33094}
33095
33096#ifdef LIBXML_SCHEMAS_ENABLED
33097
33098#define gen_nb_xmlSchemaParserCtxtPtr 1
33099static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33100    return(NULL);
33101}
33102static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33103}
33104#endif
33105
33106#ifdef LIBXML_SCHEMAS_ENABLED
33107
33108#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33109static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33110    return(NULL);
33111}
33112static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33113}
33114#endif
33115
33116#ifdef LIBXML_SCHEMAS_ENABLED
33117
33118#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33119static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33120    return(NULL);
33121}
33122static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33123}
33124#endif
33125
33126
33127static int
33128test_xmlSchemaGetParserErrors(void) {
33129    int test_ret = 0;
33130
33131#if defined(LIBXML_SCHEMAS_ENABLED)
33132    int mem_base;
33133    int ret_val;
33134    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33135    int n_ctxt;
33136    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33137    int n_err;
33138    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33139    int n_warn;
33140    void ** ctx; /* contextual data for the callbacks result */
33141    int n_ctx;
33142
33143    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33144    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33145    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33146    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33147        mem_base = xmlMemBlocks();
33148        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33149        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33150        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33151        ctx = gen_void_ptr_ptr(n_ctx, 3);
33152
33153        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33154        desret_int(ret_val);
33155        call_tests++;
33156        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33157        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33158        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33159        des_void_ptr_ptr(n_ctx, ctx, 3);
33160        xmlResetLastError();
33161        if (mem_base != xmlMemBlocks()) {
33162            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33163	           xmlMemBlocks() - mem_base);
33164	    test_ret++;
33165            printf(" %d", n_ctxt);
33166            printf(" %d", n_err);
33167            printf(" %d", n_warn);
33168            printf(" %d", n_ctx);
33169            printf("\n");
33170        }
33171    }
33172    }
33173    }
33174    }
33175    function_tests++;
33176#endif
33177
33178    return(test_ret);
33179}
33180
33181#ifdef LIBXML_SCHEMAS_ENABLED
33182
33183#define gen_nb_xmlSchemaValidCtxtPtr 1
33184static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33185    return(NULL);
33186}
33187static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33188}
33189#endif
33190
33191
33192static int
33193test_xmlSchemaGetValidErrors(void) {
33194    int test_ret = 0;
33195
33196#if defined(LIBXML_SCHEMAS_ENABLED)
33197    int mem_base;
33198    int ret_val;
33199    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33200    int n_ctxt;
33201    xmlSchemaValidityErrorFunc * err; /* the error function result */
33202    int n_err;
33203    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33204    int n_warn;
33205    void ** ctx; /* the functions context result */
33206    int n_ctx;
33207
33208    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33209    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33210    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33211    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33212        mem_base = xmlMemBlocks();
33213        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33214        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33215        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33216        ctx = gen_void_ptr_ptr(n_ctx, 3);
33217
33218        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33219        desret_int(ret_val);
33220        call_tests++;
33221        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33222        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33223        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33224        des_void_ptr_ptr(n_ctx, ctx, 3);
33225        xmlResetLastError();
33226        if (mem_base != xmlMemBlocks()) {
33227            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33228	           xmlMemBlocks() - mem_base);
33229	    test_ret++;
33230            printf(" %d", n_ctxt);
33231            printf(" %d", n_err);
33232            printf(" %d", n_warn);
33233            printf(" %d", n_ctx);
33234            printf("\n");
33235        }
33236    }
33237    }
33238    }
33239    }
33240    function_tests++;
33241#endif
33242
33243    return(test_ret);
33244}
33245
33246
33247static int
33248test_xmlSchemaIsValid(void) {
33249    int test_ret = 0;
33250
33251#if defined(LIBXML_SCHEMAS_ENABLED)
33252    int mem_base;
33253    int ret_val;
33254    xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
33255    int n_ctxt;
33256
33257    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33258        mem_base = xmlMemBlocks();
33259        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33260
33261        ret_val = xmlSchemaIsValid(ctxt);
33262        desret_int(ret_val);
33263        call_tests++;
33264        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33265        xmlResetLastError();
33266        if (mem_base != xmlMemBlocks()) {
33267            printf("Leak of %d blocks found in xmlSchemaIsValid",
33268	           xmlMemBlocks() - mem_base);
33269	    test_ret++;
33270            printf(" %d", n_ctxt);
33271            printf("\n");
33272        }
33273    }
33274    function_tests++;
33275#endif
33276
33277    return(test_ret);
33278}
33279
33280
33281static int
33282test_xmlSchemaNewDocParserCtxt(void) {
33283    int test_ret = 0;
33284
33285#if defined(LIBXML_SCHEMAS_ENABLED)
33286    int mem_base;
33287    xmlSchemaParserCtxtPtr ret_val;
33288    xmlDocPtr doc; /* a preparsed document tree */
33289    int n_doc;
33290
33291    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33292        mem_base = xmlMemBlocks();
33293        doc = gen_xmlDocPtr(n_doc, 0);
33294
33295        ret_val = xmlSchemaNewDocParserCtxt(doc);
33296        desret_xmlSchemaParserCtxtPtr(ret_val);
33297        call_tests++;
33298        des_xmlDocPtr(n_doc, doc, 0);
33299        xmlResetLastError();
33300        if (mem_base != xmlMemBlocks()) {
33301            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33302	           xmlMemBlocks() - mem_base);
33303	    test_ret++;
33304            printf(" %d", n_doc);
33305            printf("\n");
33306        }
33307    }
33308    function_tests++;
33309#endif
33310
33311    return(test_ret);
33312}
33313
33314
33315static int
33316test_xmlSchemaNewMemParserCtxt(void) {
33317    int test_ret = 0;
33318
33319#if defined(LIBXML_SCHEMAS_ENABLED)
33320    int mem_base;
33321    xmlSchemaParserCtxtPtr ret_val;
33322    char * buffer; /* a pointer to a char array containing the schemas */
33323    int n_buffer;
33324    int size; /* the size of the array */
33325    int n_size;
33326
33327    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33328    for (n_size = 0;n_size < gen_nb_int;n_size++) {
33329        mem_base = xmlMemBlocks();
33330        buffer = gen_const_char_ptr(n_buffer, 0);
33331        size = gen_int(n_size, 1);
33332
33333        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33334        desret_xmlSchemaParserCtxtPtr(ret_val);
33335        call_tests++;
33336        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33337        des_int(n_size, size, 1);
33338        xmlResetLastError();
33339        if (mem_base != xmlMemBlocks()) {
33340            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33341	           xmlMemBlocks() - mem_base);
33342	    test_ret++;
33343            printf(" %d", n_buffer);
33344            printf(" %d", n_size);
33345            printf("\n");
33346        }
33347    }
33348    }
33349    function_tests++;
33350#endif
33351
33352    return(test_ret);
33353}
33354
33355
33356static int
33357test_xmlSchemaNewParserCtxt(void) {
33358    int test_ret = 0;
33359
33360#if defined(LIBXML_SCHEMAS_ENABLED)
33361    int mem_base;
33362    xmlSchemaParserCtxtPtr ret_val;
33363    char * URL; /* the location of the schema */
33364    int n_URL;
33365
33366    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33367        mem_base = xmlMemBlocks();
33368        URL = gen_const_char_ptr(n_URL, 0);
33369
33370        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33371        desret_xmlSchemaParserCtxtPtr(ret_val);
33372        call_tests++;
33373        des_const_char_ptr(n_URL, (const char *)URL, 0);
33374        xmlResetLastError();
33375        if (mem_base != xmlMemBlocks()) {
33376            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33377	           xmlMemBlocks() - mem_base);
33378	    test_ret++;
33379            printf(" %d", n_URL);
33380            printf("\n");
33381        }
33382    }
33383    function_tests++;
33384#endif
33385
33386    return(test_ret);
33387}
33388
33389
33390static int
33391test_xmlSchemaNewValidCtxt(void) {
33392    int test_ret = 0;
33393
33394
33395    /* missing type support */
33396    return(test_ret);
33397}
33398
33399
33400static int
33401test_xmlSchemaParse(void) {
33402    int test_ret = 0;
33403
33404
33405    /* missing type support */
33406    return(test_ret);
33407}
33408
33409#ifdef LIBXML_SCHEMAS_ENABLED
33410
33411#define gen_nb_xmlSAXHandlerPtr_ptr 1
33412static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33413    return(NULL);
33414}
33415static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33416}
33417#endif
33418
33419
33420static int
33421test_xmlSchemaSAXPlug(void) {
33422    int test_ret = 0;
33423
33424
33425    /* missing type support */
33426    return(test_ret);
33427}
33428
33429#ifdef LIBXML_SCHEMAS_ENABLED
33430
33431#define gen_nb_xmlSchemaSAXPlugPtr 1
33432static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33433    return(NULL);
33434}
33435static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33436}
33437#endif
33438
33439
33440static int
33441test_xmlSchemaSAXUnplug(void) {
33442    int test_ret = 0;
33443
33444#if defined(LIBXML_SCHEMAS_ENABLED)
33445    int mem_base;
33446    int ret_val;
33447    xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
33448    int n_plug;
33449
33450    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
33451        mem_base = xmlMemBlocks();
33452        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
33453
33454        ret_val = xmlSchemaSAXUnplug(plug);
33455        desret_int(ret_val);
33456        call_tests++;
33457        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
33458        xmlResetLastError();
33459        if (mem_base != xmlMemBlocks()) {
33460            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
33461	           xmlMemBlocks() - mem_base);
33462	    test_ret++;
33463            printf(" %d", n_plug);
33464            printf("\n");
33465        }
33466    }
33467    function_tests++;
33468#endif
33469
33470    return(test_ret);
33471}
33472
33473
33474static int
33475test_xmlSchemaSetParserErrors(void) {
33476    int test_ret = 0;
33477
33478
33479    /* missing type support */
33480    return(test_ret);
33481}
33482
33483
33484static int
33485test_xmlSchemaSetValidErrors(void) {
33486    int test_ret = 0;
33487
33488
33489    /* missing type support */
33490    return(test_ret);
33491}
33492
33493
33494static int
33495test_xmlSchemaSetValidOptions(void) {
33496    int test_ret = 0;
33497
33498#if defined(LIBXML_SCHEMAS_ENABLED)
33499    int mem_base;
33500    int ret_val;
33501    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33502    int n_ctxt;
33503    int options; /* a combination of xmlSchemaValidOption */
33504    int n_options;
33505
33506    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33507    for (n_options = 0;n_options < gen_nb_int;n_options++) {
33508        mem_base = xmlMemBlocks();
33509        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33510        options = gen_int(n_options, 1);
33511
33512        ret_val = xmlSchemaSetValidOptions(ctxt, options);
33513        desret_int(ret_val);
33514        call_tests++;
33515        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33516        des_int(n_options, options, 1);
33517        xmlResetLastError();
33518        if (mem_base != xmlMemBlocks()) {
33519            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
33520	           xmlMemBlocks() - mem_base);
33521	    test_ret++;
33522            printf(" %d", n_ctxt);
33523            printf(" %d", n_options);
33524            printf("\n");
33525        }
33526    }
33527    }
33528    function_tests++;
33529#endif
33530
33531    return(test_ret);
33532}
33533
33534
33535static int
33536test_xmlSchemaSetValidStructuredErrors(void) {
33537    int test_ret = 0;
33538
33539
33540    /* missing type support */
33541    return(test_ret);
33542}
33543
33544
33545static int
33546test_xmlSchemaValidCtxtGetOptions(void) {
33547    int test_ret = 0;
33548
33549#if defined(LIBXML_SCHEMAS_ENABLED)
33550    int mem_base;
33551    int ret_val;
33552    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33553    int n_ctxt;
33554
33555    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33556        mem_base = xmlMemBlocks();
33557        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33558
33559        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
33560        desret_int(ret_val);
33561        call_tests++;
33562        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33563        xmlResetLastError();
33564        if (mem_base != xmlMemBlocks()) {
33565            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
33566	           xmlMemBlocks() - mem_base);
33567	    test_ret++;
33568            printf(" %d", n_ctxt);
33569            printf("\n");
33570        }
33571    }
33572    function_tests++;
33573#endif
33574
33575    return(test_ret);
33576}
33577
33578
33579static int
33580test_xmlSchemaValidateDoc(void) {
33581    int test_ret = 0;
33582
33583#if defined(LIBXML_SCHEMAS_ENABLED)
33584    int mem_base;
33585    int ret_val;
33586    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33587    int n_ctxt;
33588    xmlDocPtr doc; /* a parsed document tree */
33589    int n_doc;
33590
33591    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33592    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33593        mem_base = xmlMemBlocks();
33594        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33595        doc = gen_xmlDocPtr(n_doc, 1);
33596
33597        ret_val = xmlSchemaValidateDoc(ctxt, doc);
33598        desret_int(ret_val);
33599        call_tests++;
33600        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33601        des_xmlDocPtr(n_doc, doc, 1);
33602        xmlResetLastError();
33603        if (mem_base != xmlMemBlocks()) {
33604            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
33605	           xmlMemBlocks() - mem_base);
33606	    test_ret++;
33607            printf(" %d", n_ctxt);
33608            printf(" %d", n_doc);
33609            printf("\n");
33610        }
33611    }
33612    }
33613    function_tests++;
33614#endif
33615
33616    return(test_ret);
33617}
33618
33619
33620static int
33621test_xmlSchemaValidateFile(void) {
33622    int test_ret = 0;
33623
33624#if defined(LIBXML_SCHEMAS_ENABLED)
33625    int mem_base;
33626    int ret_val;
33627    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33628    int n_ctxt;
33629    const char * filename; /* the URI of the instance */
33630    int n_filename;
33631    int options; /* a future set of options, currently unused */
33632    int n_options;
33633
33634    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33635    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
33636    for (n_options = 0;n_options < gen_nb_int;n_options++) {
33637        mem_base = xmlMemBlocks();
33638        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33639        filename = gen_filepath(n_filename, 1);
33640        options = gen_int(n_options, 2);
33641
33642        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
33643        desret_int(ret_val);
33644        call_tests++;
33645        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33646        des_filepath(n_filename, filename, 1);
33647        des_int(n_options, options, 2);
33648        xmlResetLastError();
33649        if (mem_base != xmlMemBlocks()) {
33650            printf("Leak of %d blocks found in xmlSchemaValidateFile",
33651	           xmlMemBlocks() - mem_base);
33652	    test_ret++;
33653            printf(" %d", n_ctxt);
33654            printf(" %d", n_filename);
33655            printf(" %d", n_options);
33656            printf("\n");
33657        }
33658    }
33659    }
33660    }
33661    function_tests++;
33662#endif
33663
33664    return(test_ret);
33665}
33666
33667
33668static int
33669test_xmlSchemaValidateOneElement(void) {
33670    int test_ret = 0;
33671
33672#if defined(LIBXML_SCHEMAS_ENABLED)
33673    int mem_base;
33674    int ret_val;
33675    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33676    int n_ctxt;
33677    xmlNodePtr elem; /* an element node */
33678    int n_elem;
33679
33680    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33681    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
33682        mem_base = xmlMemBlocks();
33683        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33684        elem = gen_xmlNodePtr(n_elem, 1);
33685
33686        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
33687        desret_int(ret_val);
33688        call_tests++;
33689        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33690        des_xmlNodePtr(n_elem, elem, 1);
33691        xmlResetLastError();
33692        if (mem_base != xmlMemBlocks()) {
33693            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
33694	           xmlMemBlocks() - mem_base);
33695	    test_ret++;
33696            printf(" %d", n_ctxt);
33697            printf(" %d", n_elem);
33698            printf("\n");
33699        }
33700    }
33701    }
33702    function_tests++;
33703#endif
33704
33705    return(test_ret);
33706}
33707
33708
33709static int
33710test_xmlSchemaValidateStream(void) {
33711    int test_ret = 0;
33712
33713#if defined(LIBXML_SCHEMAS_ENABLED)
33714    int mem_base;
33715    int ret_val;
33716    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
33717    int n_ctxt;
33718    xmlParserInputBufferPtr input; /* the input to use for reading the data */
33719    int n_input;
33720    xmlCharEncoding enc; /* an optional encoding information */
33721    int n_enc;
33722    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
33723    int n_sax;
33724    void * user_data; /* the context to provide to the SAX handler. */
33725    int n_user_data;
33726
33727    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33728    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
33729    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
33730    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
33731    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
33732        mem_base = xmlMemBlocks();
33733        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33734        input = gen_xmlParserInputBufferPtr(n_input, 1);
33735        enc = gen_xmlCharEncoding(n_enc, 2);
33736        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
33737        user_data = gen_userdata(n_user_data, 4);
33738
33739        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
33740        desret_int(ret_val);
33741        call_tests++;
33742        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33743        des_xmlParserInputBufferPtr(n_input, input, 1);
33744        des_xmlCharEncoding(n_enc, enc, 2);
33745        des_xmlSAXHandlerPtr(n_sax, sax, 3);
33746        des_userdata(n_user_data, user_data, 4);
33747        xmlResetLastError();
33748        if (mem_base != xmlMemBlocks()) {
33749            printf("Leak of %d blocks found in xmlSchemaValidateStream",
33750	           xmlMemBlocks() - mem_base);
33751	    test_ret++;
33752            printf(" %d", n_ctxt);
33753            printf(" %d", n_input);
33754            printf(" %d", n_enc);
33755            printf(" %d", n_sax);
33756            printf(" %d", n_user_data);
33757            printf("\n");
33758        }
33759    }
33760    }
33761    }
33762    }
33763    }
33764    function_tests++;
33765#endif
33766
33767    return(test_ret);
33768}
33769
33770static int
33771test_xmlschemas(void) {
33772    int test_ret = 0;
33773
33774    if (quiet == 0) printf("Testing xmlschemas : 14 of 23 functions ...\n");
33775    test_ret += test_xmlSchemaDump();
33776    test_ret += test_xmlSchemaGetParserErrors();
33777    test_ret += test_xmlSchemaGetValidErrors();
33778    test_ret += test_xmlSchemaIsValid();
33779    test_ret += test_xmlSchemaNewDocParserCtxt();
33780    test_ret += test_xmlSchemaNewMemParserCtxt();
33781    test_ret += test_xmlSchemaNewParserCtxt();
33782    test_ret += test_xmlSchemaNewValidCtxt();
33783    test_ret += test_xmlSchemaParse();
33784    test_ret += test_xmlSchemaSAXPlug();
33785    test_ret += test_xmlSchemaSAXUnplug();
33786    test_ret += test_xmlSchemaSetParserErrors();
33787    test_ret += test_xmlSchemaSetValidErrors();
33788    test_ret += test_xmlSchemaSetValidOptions();
33789    test_ret += test_xmlSchemaSetValidStructuredErrors();
33790    test_ret += test_xmlSchemaValidCtxtGetOptions();
33791    test_ret += test_xmlSchemaValidateDoc();
33792    test_ret += test_xmlSchemaValidateFile();
33793    test_ret += test_xmlSchemaValidateOneElement();
33794    test_ret += test_xmlSchemaValidateStream();
33795
33796    if (test_ret != 0)
33797	printf("Module xmlschemas: %d errors\n", test_ret);
33798    return(test_ret);
33799}
33800#ifdef LIBXML_SCHEMAS_ENABLED
33801
33802#define gen_nb_xmlSchemaFacetPtr 1
33803static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33804    return(NULL);
33805}
33806static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33807}
33808#endif
33809
33810#ifdef LIBXML_SCHEMAS_ENABLED
33811
33812#define gen_nb_xmlSchemaTypePtr 1
33813static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33814    return(NULL);
33815}
33816static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33817}
33818#endif
33819
33820
33821static int
33822test_xmlSchemaCheckFacet(void) {
33823    int test_ret = 0;
33824
33825#if defined(LIBXML_SCHEMAS_ENABLED)
33826    int mem_base;
33827    int ret_val;
33828    xmlSchemaFacetPtr facet; /* the facet */
33829    int n_facet;
33830    xmlSchemaTypePtr typeDecl; /* the schema type definition */
33831    int n_typeDecl;
33832    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
33833    int n_pctxt;
33834    xmlChar * name; /* the optional name of the type */
33835    int n_name;
33836
33837    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33838    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
33839    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
33840    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
33841        mem_base = xmlMemBlocks();
33842        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33843        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
33844        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
33845        name = gen_const_xmlChar_ptr(n_name, 3);
33846
33847        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
33848        desret_int(ret_val);
33849        call_tests++;
33850        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33851        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
33852        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
33853        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
33854        xmlResetLastError();
33855        if (mem_base != xmlMemBlocks()) {
33856            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
33857	           xmlMemBlocks() - mem_base);
33858	    test_ret++;
33859            printf(" %d", n_facet);
33860            printf(" %d", n_typeDecl);
33861            printf(" %d", n_pctxt);
33862            printf(" %d", n_name);
33863            printf("\n");
33864        }
33865    }
33866    }
33867    }
33868    }
33869    function_tests++;
33870#endif
33871
33872    return(test_ret);
33873}
33874
33875
33876static int
33877test_xmlSchemaCleanupTypes(void) {
33878    int test_ret = 0;
33879
33880#if defined(LIBXML_SCHEMAS_ENABLED)
33881
33882
33883        xmlSchemaCleanupTypes();
33884        call_tests++;
33885        xmlResetLastError();
33886    function_tests++;
33887#endif
33888
33889    return(test_ret);
33890}
33891
33892
33893static int
33894test_xmlSchemaCollapseString(void) {
33895    int test_ret = 0;
33896
33897#if defined(LIBXML_SCHEMAS_ENABLED)
33898    int mem_base;
33899    xmlChar * ret_val;
33900    xmlChar * value; /* a value */
33901    int n_value;
33902
33903    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33904        mem_base = xmlMemBlocks();
33905        value = gen_const_xmlChar_ptr(n_value, 0);
33906
33907        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
33908        desret_xmlChar_ptr(ret_val);
33909        call_tests++;
33910        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
33911        xmlResetLastError();
33912        if (mem_base != xmlMemBlocks()) {
33913            printf("Leak of %d blocks found in xmlSchemaCollapseString",
33914	           xmlMemBlocks() - mem_base);
33915	    test_ret++;
33916            printf(" %d", n_value);
33917            printf("\n");
33918        }
33919    }
33920    function_tests++;
33921#endif
33922
33923    return(test_ret);
33924}
33925
33926#ifdef LIBXML_SCHEMAS_ENABLED
33927
33928#define gen_nb_xmlSchemaValPtr 1
33929static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33930    return(NULL);
33931}
33932static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33933}
33934#endif
33935
33936
33937static int
33938test_xmlSchemaCompareValues(void) {
33939    int test_ret = 0;
33940
33941#if defined(LIBXML_SCHEMAS_ENABLED)
33942    int mem_base;
33943    int ret_val;
33944    xmlSchemaValPtr x; /* a first value */
33945    int n_x;
33946    xmlSchemaValPtr y; /* a second value */
33947    int n_y;
33948
33949    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
33950    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
33951        mem_base = xmlMemBlocks();
33952        x = gen_xmlSchemaValPtr(n_x, 0);
33953        y = gen_xmlSchemaValPtr(n_y, 1);
33954
33955        ret_val = xmlSchemaCompareValues(x, y);
33956        desret_int(ret_val);
33957        call_tests++;
33958        des_xmlSchemaValPtr(n_x, x, 0);
33959        des_xmlSchemaValPtr(n_y, y, 1);
33960        xmlResetLastError();
33961        if (mem_base != xmlMemBlocks()) {
33962            printf("Leak of %d blocks found in xmlSchemaCompareValues",
33963	           xmlMemBlocks() - mem_base);
33964	    test_ret++;
33965            printf(" %d", n_x);
33966            printf(" %d", n_y);
33967            printf("\n");
33968        }
33969    }
33970    }
33971    function_tests++;
33972#endif
33973
33974    return(test_ret);
33975}
33976
33977
33978static int
33979test_xmlSchemaCompareValuesWhtsp(void) {
33980    int test_ret = 0;
33981
33982#if defined(LIBXML_SCHEMAS_ENABLED)
33983    int mem_base;
33984    int ret_val;
33985    xmlSchemaValPtr x; /* a first value */
33986    int n_x;
33987    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
33988    int n_xws;
33989    xmlSchemaValPtr y; /* a second value */
33990    int n_y;
33991    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
33992    int n_yws;
33993
33994    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
33995    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
33996    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
33997    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
33998        mem_base = xmlMemBlocks();
33999        x = gen_xmlSchemaValPtr(n_x, 0);
34000        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34001        y = gen_xmlSchemaValPtr(n_y, 2);
34002        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34003
34004        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34005        desret_int(ret_val);
34006        call_tests++;
34007        des_xmlSchemaValPtr(n_x, x, 0);
34008        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34009        des_xmlSchemaValPtr(n_y, y, 2);
34010        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34011        xmlResetLastError();
34012        if (mem_base != xmlMemBlocks()) {
34013            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34014	           xmlMemBlocks() - mem_base);
34015	    test_ret++;
34016            printf(" %d", n_x);
34017            printf(" %d", n_xws);
34018            printf(" %d", n_y);
34019            printf(" %d", n_yws);
34020            printf("\n");
34021        }
34022    }
34023    }
34024    }
34025    }
34026    function_tests++;
34027#endif
34028
34029    return(test_ret);
34030}
34031
34032
34033static int
34034test_xmlSchemaCopyValue(void) {
34035    int test_ret = 0;
34036
34037
34038    /* missing type support */
34039    return(test_ret);
34040}
34041
34042
34043static int
34044test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34045    int test_ret = 0;
34046
34047#if defined(LIBXML_SCHEMAS_ENABLED)
34048    int mem_base;
34049    xmlSchemaTypePtr ret_val;
34050    xmlSchemaTypePtr type; /* the built-in simple type. */
34051    int n_type;
34052
34053    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34054        mem_base = xmlMemBlocks();
34055        type = gen_xmlSchemaTypePtr(n_type, 0);
34056
34057        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34058        desret_xmlSchemaTypePtr(ret_val);
34059        call_tests++;
34060        des_xmlSchemaTypePtr(n_type, type, 0);
34061        xmlResetLastError();
34062        if (mem_base != xmlMemBlocks()) {
34063            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34064	           xmlMemBlocks() - mem_base);
34065	    test_ret++;
34066            printf(" %d", n_type);
34067            printf("\n");
34068        }
34069    }
34070    function_tests++;
34071#endif
34072
34073    return(test_ret);
34074}
34075
34076
34077static int
34078test_xmlSchemaGetBuiltInType(void) {
34079    int test_ret = 0;
34080
34081#if defined(LIBXML_SCHEMAS_ENABLED)
34082    xmlSchemaTypePtr ret_val;
34083    xmlSchemaValType type; /* the type of the built in type */
34084    int n_type;
34085
34086    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34087        type = gen_xmlSchemaValType(n_type, 0);
34088
34089        ret_val = xmlSchemaGetBuiltInType(type);
34090        desret_xmlSchemaTypePtr(ret_val);
34091        call_tests++;
34092        des_xmlSchemaValType(n_type, type, 0);
34093        xmlResetLastError();
34094    }
34095    function_tests++;
34096#endif
34097
34098    return(test_ret);
34099}
34100
34101
34102static int
34103test_xmlSchemaGetCanonValue(void) {
34104    int test_ret = 0;
34105
34106#if defined(LIBXML_SCHEMAS_ENABLED)
34107    int mem_base;
34108    int ret_val;
34109    xmlSchemaValPtr val; /* the precomputed value */
34110    int n_val;
34111    xmlChar ** retValue; /* the returned value */
34112    int n_retValue;
34113
34114    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34115    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34116        mem_base = xmlMemBlocks();
34117        val = gen_xmlSchemaValPtr(n_val, 0);
34118        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34119
34120        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34121        desret_int(ret_val);
34122        call_tests++;
34123        des_xmlSchemaValPtr(n_val, val, 0);
34124        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34125        xmlResetLastError();
34126        if (mem_base != xmlMemBlocks()) {
34127            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34128	           xmlMemBlocks() - mem_base);
34129	    test_ret++;
34130            printf(" %d", n_val);
34131            printf(" %d", n_retValue);
34132            printf("\n");
34133        }
34134    }
34135    }
34136    function_tests++;
34137#endif
34138
34139    return(test_ret);
34140}
34141
34142
34143static int
34144test_xmlSchemaGetCanonValueWhtsp(void) {
34145    int test_ret = 0;
34146
34147#if defined(LIBXML_SCHEMAS_ENABLED)
34148    int mem_base;
34149    int ret_val;
34150    xmlSchemaValPtr val; /* the precomputed value */
34151    int n_val;
34152    xmlChar ** retValue; /* the returned value */
34153    int n_retValue;
34154    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34155    int n_ws;
34156
34157    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34158    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34159    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34160        mem_base = xmlMemBlocks();
34161        val = gen_xmlSchemaValPtr(n_val, 0);
34162        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34163        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34164
34165        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34166        desret_int(ret_val);
34167        call_tests++;
34168        des_xmlSchemaValPtr(n_val, val, 0);
34169        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34170        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34171        xmlResetLastError();
34172        if (mem_base != xmlMemBlocks()) {
34173            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34174	           xmlMemBlocks() - mem_base);
34175	    test_ret++;
34176            printf(" %d", n_val);
34177            printf(" %d", n_retValue);
34178            printf(" %d", n_ws);
34179            printf("\n");
34180        }
34181    }
34182    }
34183    }
34184    function_tests++;
34185#endif
34186
34187    return(test_ret);
34188}
34189
34190
34191static int
34192test_xmlSchemaGetFacetValueAsULong(void) {
34193    int test_ret = 0;
34194
34195#if defined(LIBXML_SCHEMAS_ENABLED)
34196    int mem_base;
34197    unsigned long ret_val;
34198    xmlSchemaFacetPtr facet; /* an schemas type facet */
34199    int n_facet;
34200
34201    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34202        mem_base = xmlMemBlocks();
34203        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34204
34205        ret_val = xmlSchemaGetFacetValueAsULong(facet);
34206        desret_unsigned_long(ret_val);
34207        call_tests++;
34208        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34209        xmlResetLastError();
34210        if (mem_base != xmlMemBlocks()) {
34211            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34212	           xmlMemBlocks() - mem_base);
34213	    test_ret++;
34214            printf(" %d", n_facet);
34215            printf("\n");
34216        }
34217    }
34218    function_tests++;
34219#endif
34220
34221    return(test_ret);
34222}
34223
34224
34225static int
34226test_xmlSchemaGetPredefinedType(void) {
34227    int test_ret = 0;
34228
34229#if defined(LIBXML_SCHEMAS_ENABLED)
34230    int mem_base;
34231    xmlSchemaTypePtr ret_val;
34232    xmlChar * name; /* the type name */
34233    int n_name;
34234    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34235    int n_ns;
34236
34237    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34238    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34239        mem_base = xmlMemBlocks();
34240        name = gen_const_xmlChar_ptr(n_name, 0);
34241        ns = gen_const_xmlChar_ptr(n_ns, 1);
34242
34243        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34244        desret_xmlSchemaTypePtr(ret_val);
34245        call_tests++;
34246        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34247        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34248        xmlResetLastError();
34249        if (mem_base != xmlMemBlocks()) {
34250            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34251	           xmlMemBlocks() - mem_base);
34252	    test_ret++;
34253            printf(" %d", n_name);
34254            printf(" %d", n_ns);
34255            printf("\n");
34256        }
34257    }
34258    }
34259    function_tests++;
34260#endif
34261
34262    return(test_ret);
34263}
34264
34265
34266static int
34267test_xmlSchemaGetValType(void) {
34268    int test_ret = 0;
34269
34270#if defined(LIBXML_SCHEMAS_ENABLED)
34271    int mem_base;
34272    xmlSchemaValType ret_val;
34273    xmlSchemaValPtr val; /* a schemas value */
34274    int n_val;
34275
34276    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34277        mem_base = xmlMemBlocks();
34278        val = gen_xmlSchemaValPtr(n_val, 0);
34279
34280        ret_val = xmlSchemaGetValType(val);
34281        desret_xmlSchemaValType(ret_val);
34282        call_tests++;
34283        des_xmlSchemaValPtr(n_val, val, 0);
34284        xmlResetLastError();
34285        if (mem_base != xmlMemBlocks()) {
34286            printf("Leak of %d blocks found in xmlSchemaGetValType",
34287	           xmlMemBlocks() - mem_base);
34288	    test_ret++;
34289            printf(" %d", n_val);
34290            printf("\n");
34291        }
34292    }
34293    function_tests++;
34294#endif
34295
34296    return(test_ret);
34297}
34298
34299
34300static int
34301test_xmlSchemaInitTypes(void) {
34302    int test_ret = 0;
34303
34304#if defined(LIBXML_SCHEMAS_ENABLED)
34305
34306
34307        xmlSchemaInitTypes();
34308        call_tests++;
34309        xmlResetLastError();
34310    function_tests++;
34311#endif
34312
34313    return(test_ret);
34314}
34315
34316
34317static int
34318test_xmlSchemaIsBuiltInTypeFacet(void) {
34319    int test_ret = 0;
34320
34321#if defined(LIBXML_SCHEMAS_ENABLED)
34322    int mem_base;
34323    int ret_val;
34324    xmlSchemaTypePtr type; /* the built-in type */
34325    int n_type;
34326    int facetType; /* the facet type */
34327    int n_facetType;
34328
34329    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34330    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34331        mem_base = xmlMemBlocks();
34332        type = gen_xmlSchemaTypePtr(n_type, 0);
34333        facetType = gen_int(n_facetType, 1);
34334
34335        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34336        desret_int(ret_val);
34337        call_tests++;
34338        des_xmlSchemaTypePtr(n_type, type, 0);
34339        des_int(n_facetType, facetType, 1);
34340        xmlResetLastError();
34341        if (mem_base != xmlMemBlocks()) {
34342            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34343	           xmlMemBlocks() - mem_base);
34344	    test_ret++;
34345            printf(" %d", n_type);
34346            printf(" %d", n_facetType);
34347            printf("\n");
34348        }
34349    }
34350    }
34351    function_tests++;
34352#endif
34353
34354    return(test_ret);
34355}
34356
34357
34358static int
34359test_xmlSchemaNewFacet(void) {
34360    int test_ret = 0;
34361
34362
34363    /* missing type support */
34364    return(test_ret);
34365}
34366
34367
34368static int
34369test_xmlSchemaNewNOTATIONValue(void) {
34370    int test_ret = 0;
34371
34372
34373    /* missing type support */
34374    return(test_ret);
34375}
34376
34377
34378static int
34379test_xmlSchemaNewQNameValue(void) {
34380    int test_ret = 0;
34381
34382
34383    /* missing type support */
34384    return(test_ret);
34385}
34386
34387
34388static int
34389test_xmlSchemaNewStringValue(void) {
34390    int test_ret = 0;
34391
34392
34393    /* missing type support */
34394    return(test_ret);
34395}
34396
34397#ifdef LIBXML_SCHEMAS_ENABLED
34398
34399#define gen_nb_xmlSchemaValPtr_ptr 1
34400static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34401    return(NULL);
34402}
34403static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34404}
34405#endif
34406
34407
34408static int
34409test_xmlSchemaValPredefTypeNode(void) {
34410    int test_ret = 0;
34411
34412#if defined(LIBXML_SCHEMAS_ENABLED)
34413    int mem_base;
34414    int ret_val;
34415    xmlSchemaTypePtr type; /* the predefined type */
34416    int n_type;
34417    xmlChar * value; /* the value to check */
34418    int n_value;
34419    xmlSchemaValPtr * val; /* the return computed value */
34420    int n_val;
34421    xmlNodePtr node; /* the node containing the value */
34422    int n_node;
34423
34424    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34425    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34426    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34427    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34428        mem_base = xmlMemBlocks();
34429        type = gen_xmlSchemaTypePtr(n_type, 0);
34430        value = gen_const_xmlChar_ptr(n_value, 1);
34431        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34432        node = gen_xmlNodePtr(n_node, 3);
34433
34434        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
34435        desret_int(ret_val);
34436        call_tests++;
34437        des_xmlSchemaTypePtr(n_type, type, 0);
34438        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34439        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34440        des_xmlNodePtr(n_node, node, 3);
34441        xmlResetLastError();
34442        if (mem_base != xmlMemBlocks()) {
34443            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
34444	           xmlMemBlocks() - mem_base);
34445	    test_ret++;
34446            printf(" %d", n_type);
34447            printf(" %d", n_value);
34448            printf(" %d", n_val);
34449            printf(" %d", n_node);
34450            printf("\n");
34451        }
34452    }
34453    }
34454    }
34455    }
34456    function_tests++;
34457#endif
34458
34459    return(test_ret);
34460}
34461
34462
34463static int
34464test_xmlSchemaValPredefTypeNodeNoNorm(void) {
34465    int test_ret = 0;
34466
34467#if defined(LIBXML_SCHEMAS_ENABLED)
34468    int mem_base;
34469    int ret_val;
34470    xmlSchemaTypePtr type; /* the predefined type */
34471    int n_type;
34472    xmlChar * value; /* the value to check */
34473    int n_value;
34474    xmlSchemaValPtr * val; /* the return computed value */
34475    int n_val;
34476    xmlNodePtr node; /* the node containing the value */
34477    int n_node;
34478
34479    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34480    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34481    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34482    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34483        mem_base = xmlMemBlocks();
34484        type = gen_xmlSchemaTypePtr(n_type, 0);
34485        value = gen_const_xmlChar_ptr(n_value, 1);
34486        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34487        node = gen_xmlNodePtr(n_node, 3);
34488
34489        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
34490        desret_int(ret_val);
34491        call_tests++;
34492        des_xmlSchemaTypePtr(n_type, type, 0);
34493        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34494        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34495        des_xmlNodePtr(n_node, node, 3);
34496        xmlResetLastError();
34497        if (mem_base != xmlMemBlocks()) {
34498            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
34499	           xmlMemBlocks() - mem_base);
34500	    test_ret++;
34501            printf(" %d", n_type);
34502            printf(" %d", n_value);
34503            printf(" %d", n_val);
34504            printf(" %d", n_node);
34505            printf("\n");
34506        }
34507    }
34508    }
34509    }
34510    }
34511    function_tests++;
34512#endif
34513
34514    return(test_ret);
34515}
34516
34517
34518static int
34519test_xmlSchemaValidateFacet(void) {
34520    int test_ret = 0;
34521
34522#if defined(LIBXML_SCHEMAS_ENABLED)
34523    int mem_base;
34524    int ret_val;
34525    xmlSchemaTypePtr base; /* the base type */
34526    int n_base;
34527    xmlSchemaFacetPtr facet; /* the facet to check */
34528    int n_facet;
34529    xmlChar * value; /* the lexical repr of the value to validate */
34530    int n_value;
34531    xmlSchemaValPtr val; /* the precomputed value */
34532    int n_val;
34533
34534    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
34535    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34536    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34537    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34538        mem_base = xmlMemBlocks();
34539        base = gen_xmlSchemaTypePtr(n_base, 0);
34540        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
34541        value = gen_const_xmlChar_ptr(n_value, 2);
34542        val = gen_xmlSchemaValPtr(n_val, 3);
34543
34544        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
34545        desret_int(ret_val);
34546        call_tests++;
34547        des_xmlSchemaTypePtr(n_base, base, 0);
34548        des_xmlSchemaFacetPtr(n_facet, facet, 1);
34549        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
34550        des_xmlSchemaValPtr(n_val, val, 3);
34551        xmlResetLastError();
34552        if (mem_base != xmlMemBlocks()) {
34553            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
34554	           xmlMemBlocks() - mem_base);
34555	    test_ret++;
34556            printf(" %d", n_base);
34557            printf(" %d", n_facet);
34558            printf(" %d", n_value);
34559            printf(" %d", n_val);
34560            printf("\n");
34561        }
34562    }
34563    }
34564    }
34565    }
34566    function_tests++;
34567#endif
34568
34569    return(test_ret);
34570}
34571
34572
34573static int
34574test_xmlSchemaValidateFacetWhtsp(void) {
34575    int test_ret = 0;
34576
34577#if defined(LIBXML_SCHEMAS_ENABLED)
34578    int mem_base;
34579    int ret_val;
34580    xmlSchemaFacetPtr facet; /* the facet to check */
34581    int n_facet;
34582    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
34583    int n_fws;
34584    xmlSchemaValType valType; /* the built-in type of the value */
34585    int n_valType;
34586    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
34587    int n_value;
34588    xmlSchemaValPtr val; /* the precomputed value */
34589    int n_val;
34590    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34591    int n_ws;
34592
34593    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34594    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
34595    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
34596    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34597    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34598    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34599        mem_base = xmlMemBlocks();
34600        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34601        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
34602        valType = gen_xmlSchemaValType(n_valType, 2);
34603        value = gen_const_xmlChar_ptr(n_value, 3);
34604        val = gen_xmlSchemaValPtr(n_val, 4);
34605        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
34606
34607        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
34608        desret_int(ret_val);
34609        call_tests++;
34610        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34611        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
34612        des_xmlSchemaValType(n_valType, valType, 2);
34613        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
34614        des_xmlSchemaValPtr(n_val, val, 4);
34615        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
34616        xmlResetLastError();
34617        if (mem_base != xmlMemBlocks()) {
34618            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
34619	           xmlMemBlocks() - mem_base);
34620	    test_ret++;
34621            printf(" %d", n_facet);
34622            printf(" %d", n_fws);
34623            printf(" %d", n_valType);
34624            printf(" %d", n_value);
34625            printf(" %d", n_val);
34626            printf(" %d", n_ws);
34627            printf("\n");
34628        }
34629    }
34630    }
34631    }
34632    }
34633    }
34634    }
34635    function_tests++;
34636#endif
34637
34638    return(test_ret);
34639}
34640
34641
34642static int
34643test_xmlSchemaValidateLengthFacet(void) {
34644    int test_ret = 0;
34645
34646#if defined(LIBXML_SCHEMAS_ENABLED)
34647    int mem_base;
34648    int ret_val;
34649    xmlSchemaTypePtr type; /* the built-in type */
34650    int n_type;
34651    xmlSchemaFacetPtr facet; /* the facet to check */
34652    int n_facet;
34653    xmlChar * value; /* the lexical repr. of the value to be validated */
34654    int n_value;
34655    xmlSchemaValPtr val; /* the precomputed value */
34656    int n_val;
34657    unsigned long * length; /* the actual length of the value */
34658    int n_length;
34659
34660    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34661    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34662    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34663    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34664    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
34665        mem_base = xmlMemBlocks();
34666        type = gen_xmlSchemaTypePtr(n_type, 0);
34667        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
34668        value = gen_const_xmlChar_ptr(n_value, 2);
34669        val = gen_xmlSchemaValPtr(n_val, 3);
34670        length = gen_unsigned_long_ptr(n_length, 4);
34671
34672        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
34673        desret_int(ret_val);
34674        call_tests++;
34675        des_xmlSchemaTypePtr(n_type, type, 0);
34676        des_xmlSchemaFacetPtr(n_facet, facet, 1);
34677        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
34678        des_xmlSchemaValPtr(n_val, val, 3);
34679        des_unsigned_long_ptr(n_length, length, 4);
34680        xmlResetLastError();
34681        if (mem_base != xmlMemBlocks()) {
34682            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
34683	           xmlMemBlocks() - mem_base);
34684	    test_ret++;
34685            printf(" %d", n_type);
34686            printf(" %d", n_facet);
34687            printf(" %d", n_value);
34688            printf(" %d", n_val);
34689            printf(" %d", n_length);
34690            printf("\n");
34691        }
34692    }
34693    }
34694    }
34695    }
34696    }
34697    function_tests++;
34698#endif
34699
34700    return(test_ret);
34701}
34702
34703
34704static int
34705test_xmlSchemaValidateLengthFacetWhtsp(void) {
34706    int test_ret = 0;
34707
34708#if defined(LIBXML_SCHEMAS_ENABLED)
34709    int mem_base;
34710    int ret_val;
34711    xmlSchemaFacetPtr facet; /* the facet to check */
34712    int n_facet;
34713    xmlSchemaValType valType; /* the built-in type */
34714    int n_valType;
34715    xmlChar * value; /* the lexical repr. of the value to be validated */
34716    int n_value;
34717    xmlSchemaValPtr val; /* the precomputed value */
34718    int n_val;
34719    unsigned long * length; /* the actual length of the value */
34720    int n_length;
34721    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34722    int n_ws;
34723
34724    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34725    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
34726    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34727    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34728    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
34729    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34730        mem_base = xmlMemBlocks();
34731        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34732        valType = gen_xmlSchemaValType(n_valType, 1);
34733        value = gen_const_xmlChar_ptr(n_value, 2);
34734        val = gen_xmlSchemaValPtr(n_val, 3);
34735        length = gen_unsigned_long_ptr(n_length, 4);
34736        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
34737
34738        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
34739        desret_int(ret_val);
34740        call_tests++;
34741        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34742        des_xmlSchemaValType(n_valType, valType, 1);
34743        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
34744        des_xmlSchemaValPtr(n_val, val, 3);
34745        des_unsigned_long_ptr(n_length, length, 4);
34746        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
34747        xmlResetLastError();
34748        if (mem_base != xmlMemBlocks()) {
34749            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
34750	           xmlMemBlocks() - mem_base);
34751	    test_ret++;
34752            printf(" %d", n_facet);
34753            printf(" %d", n_valType);
34754            printf(" %d", n_value);
34755            printf(" %d", n_val);
34756            printf(" %d", n_length);
34757            printf(" %d", n_ws);
34758            printf("\n");
34759        }
34760    }
34761    }
34762    }
34763    }
34764    }
34765    }
34766    function_tests++;
34767#endif
34768
34769    return(test_ret);
34770}
34771
34772
34773static int
34774test_xmlSchemaValidateListSimpleTypeFacet(void) {
34775    int test_ret = 0;
34776
34777#if defined(LIBXML_SCHEMAS_ENABLED)
34778    int mem_base;
34779    int ret_val;
34780    xmlSchemaFacetPtr facet; /* the facet to check */
34781    int n_facet;
34782    xmlChar * value; /* the lexical repr of the value to validate */
34783    int n_value;
34784    unsigned long actualLen; /* the number of list items */
34785    int n_actualLen;
34786    unsigned long * expectedLen; /* the resulting expected number of list items */
34787    int n_expectedLen;
34788
34789    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34790    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34791    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
34792    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
34793        mem_base = xmlMemBlocks();
34794        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34795        value = gen_const_xmlChar_ptr(n_value, 1);
34796        actualLen = gen_unsigned_long(n_actualLen, 2);
34797        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
34798
34799        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
34800        desret_int(ret_val);
34801        call_tests++;
34802        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34803        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34804        des_unsigned_long(n_actualLen, actualLen, 2);
34805        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
34806        xmlResetLastError();
34807        if (mem_base != xmlMemBlocks()) {
34808            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
34809	           xmlMemBlocks() - mem_base);
34810	    test_ret++;
34811            printf(" %d", n_facet);
34812            printf(" %d", n_value);
34813            printf(" %d", n_actualLen);
34814            printf(" %d", n_expectedLen);
34815            printf("\n");
34816        }
34817    }
34818    }
34819    }
34820    }
34821    function_tests++;
34822#endif
34823
34824    return(test_ret);
34825}
34826
34827
34828static int
34829test_xmlSchemaValidatePredefinedType(void) {
34830    int test_ret = 0;
34831
34832#if defined(LIBXML_SCHEMAS_ENABLED)
34833    int mem_base;
34834    int ret_val;
34835    xmlSchemaTypePtr type; /* the predefined type */
34836    int n_type;
34837    xmlChar * value; /* the value to check */
34838    int n_value;
34839    xmlSchemaValPtr * val; /* the return computed value */
34840    int n_val;
34841
34842    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34843    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34844    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34845        mem_base = xmlMemBlocks();
34846        type = gen_xmlSchemaTypePtr(n_type, 0);
34847        value = gen_const_xmlChar_ptr(n_value, 1);
34848        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34849
34850        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
34851        desret_int(ret_val);
34852        call_tests++;
34853        des_xmlSchemaTypePtr(n_type, type, 0);
34854        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34855        des_xmlSchemaValPtr_ptr(n_val, val, 2);
34856        xmlResetLastError();
34857        if (mem_base != xmlMemBlocks()) {
34858            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
34859	           xmlMemBlocks() - mem_base);
34860	    test_ret++;
34861            printf(" %d", n_type);
34862            printf(" %d", n_value);
34863            printf(" %d", n_val);
34864            printf("\n");
34865        }
34866    }
34867    }
34868    }
34869    function_tests++;
34870#endif
34871
34872    return(test_ret);
34873}
34874
34875
34876static int
34877test_xmlSchemaValueAppend(void) {
34878    int test_ret = 0;
34879
34880#if defined(LIBXML_SCHEMAS_ENABLED)
34881    int mem_base;
34882    int ret_val;
34883    xmlSchemaValPtr prev; /* the value */
34884    int n_prev;
34885    xmlSchemaValPtr cur; /* the value to be appended */
34886    int n_cur;
34887
34888    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
34889    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
34890        mem_base = xmlMemBlocks();
34891        prev = gen_xmlSchemaValPtr(n_prev, 0);
34892        cur = gen_xmlSchemaValPtr(n_cur, 1);
34893
34894        ret_val = xmlSchemaValueAppend(prev, cur);
34895        desret_int(ret_val);
34896        call_tests++;
34897        des_xmlSchemaValPtr(n_prev, prev, 0);
34898        des_xmlSchemaValPtr(n_cur, cur, 1);
34899        xmlResetLastError();
34900        if (mem_base != xmlMemBlocks()) {
34901            printf("Leak of %d blocks found in xmlSchemaValueAppend",
34902	           xmlMemBlocks() - mem_base);
34903	    test_ret++;
34904            printf(" %d", n_prev);
34905            printf(" %d", n_cur);
34906            printf("\n");
34907        }
34908    }
34909    }
34910    function_tests++;
34911#endif
34912
34913    return(test_ret);
34914}
34915
34916
34917static int
34918test_xmlSchemaValueGetAsBoolean(void) {
34919    int test_ret = 0;
34920
34921#if defined(LIBXML_SCHEMAS_ENABLED)
34922    int mem_base;
34923    int ret_val;
34924    xmlSchemaValPtr val; /* the value */
34925    int n_val;
34926
34927    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34928        mem_base = xmlMemBlocks();
34929        val = gen_xmlSchemaValPtr(n_val, 0);
34930
34931        ret_val = xmlSchemaValueGetAsBoolean(val);
34932        desret_int(ret_val);
34933        call_tests++;
34934        des_xmlSchemaValPtr(n_val, val, 0);
34935        xmlResetLastError();
34936        if (mem_base != xmlMemBlocks()) {
34937            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
34938	           xmlMemBlocks() - mem_base);
34939	    test_ret++;
34940            printf(" %d", n_val);
34941            printf("\n");
34942        }
34943    }
34944    function_tests++;
34945#endif
34946
34947    return(test_ret);
34948}
34949
34950
34951static int
34952test_xmlSchemaValueGetAsString(void) {
34953    int test_ret = 0;
34954
34955#if defined(LIBXML_SCHEMAS_ENABLED)
34956    int mem_base;
34957    const xmlChar * ret_val;
34958    xmlSchemaValPtr val; /* the value */
34959    int n_val;
34960
34961    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34962        mem_base = xmlMemBlocks();
34963        val = gen_xmlSchemaValPtr(n_val, 0);
34964
34965        ret_val = xmlSchemaValueGetAsString(val);
34966        desret_const_xmlChar_ptr(ret_val);
34967        call_tests++;
34968        des_xmlSchemaValPtr(n_val, val, 0);
34969        xmlResetLastError();
34970        if (mem_base != xmlMemBlocks()) {
34971            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
34972	           xmlMemBlocks() - mem_base);
34973	    test_ret++;
34974            printf(" %d", n_val);
34975            printf("\n");
34976        }
34977    }
34978    function_tests++;
34979#endif
34980
34981    return(test_ret);
34982}
34983
34984
34985static int
34986test_xmlSchemaValueGetNext(void) {
34987    int test_ret = 0;
34988
34989
34990    /* missing type support */
34991    return(test_ret);
34992}
34993
34994
34995static int
34996test_xmlSchemaWhiteSpaceReplace(void) {
34997    int test_ret = 0;
34998
34999#if defined(LIBXML_SCHEMAS_ENABLED)
35000    int mem_base;
35001    xmlChar * ret_val;
35002    xmlChar * value; /* a value */
35003    int n_value;
35004
35005    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35006        mem_base = xmlMemBlocks();
35007        value = gen_const_xmlChar_ptr(n_value, 0);
35008
35009        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35010        desret_xmlChar_ptr(ret_val);
35011        call_tests++;
35012        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35013        xmlResetLastError();
35014        if (mem_base != xmlMemBlocks()) {
35015            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35016	           xmlMemBlocks() - mem_base);
35017	    test_ret++;
35018            printf(" %d", n_value);
35019            printf("\n");
35020        }
35021    }
35022    function_tests++;
35023#endif
35024
35025    return(test_ret);
35026}
35027
35028static int
35029test_xmlschemastypes(void) {
35030    int test_ret = 0;
35031
35032    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35033    test_ret += test_xmlSchemaCheckFacet();
35034    test_ret += test_xmlSchemaCleanupTypes();
35035    test_ret += test_xmlSchemaCollapseString();
35036    test_ret += test_xmlSchemaCompareValues();
35037    test_ret += test_xmlSchemaCompareValuesWhtsp();
35038    test_ret += test_xmlSchemaCopyValue();
35039    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35040    test_ret += test_xmlSchemaGetBuiltInType();
35041    test_ret += test_xmlSchemaGetCanonValue();
35042    test_ret += test_xmlSchemaGetCanonValueWhtsp();
35043    test_ret += test_xmlSchemaGetFacetValueAsULong();
35044    test_ret += test_xmlSchemaGetPredefinedType();
35045    test_ret += test_xmlSchemaGetValType();
35046    test_ret += test_xmlSchemaInitTypes();
35047    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35048    test_ret += test_xmlSchemaNewFacet();
35049    test_ret += test_xmlSchemaNewNOTATIONValue();
35050    test_ret += test_xmlSchemaNewQNameValue();
35051    test_ret += test_xmlSchemaNewStringValue();
35052    test_ret += test_xmlSchemaValPredefTypeNode();
35053    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35054    test_ret += test_xmlSchemaValidateFacet();
35055    test_ret += test_xmlSchemaValidateFacetWhtsp();
35056    test_ret += test_xmlSchemaValidateLengthFacet();
35057    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35058    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35059    test_ret += test_xmlSchemaValidatePredefinedType();
35060    test_ret += test_xmlSchemaValueAppend();
35061    test_ret += test_xmlSchemaValueGetAsBoolean();
35062    test_ret += test_xmlSchemaValueGetAsString();
35063    test_ret += test_xmlSchemaValueGetNext();
35064    test_ret += test_xmlSchemaWhiteSpaceReplace();
35065
35066    if (test_ret != 0)
35067	printf("Module xmlschemastypes: %d errors\n", test_ret);
35068    return(test_ret);
35069}
35070
35071static int
35072test_xmlCharStrdup(void) {
35073    int test_ret = 0;
35074
35075    int mem_base;
35076    xmlChar * ret_val;
35077    char * cur; /* the input char * */
35078    int n_cur;
35079
35080    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35081        mem_base = xmlMemBlocks();
35082        cur = gen_const_char_ptr(n_cur, 0);
35083
35084        ret_val = xmlCharStrdup((const char *)cur);
35085        desret_xmlChar_ptr(ret_val);
35086        call_tests++;
35087        des_const_char_ptr(n_cur, (const char *)cur, 0);
35088        xmlResetLastError();
35089        if (mem_base != xmlMemBlocks()) {
35090            printf("Leak of %d blocks found in xmlCharStrdup",
35091	           xmlMemBlocks() - mem_base);
35092	    test_ret++;
35093            printf(" %d", n_cur);
35094            printf("\n");
35095        }
35096    }
35097    function_tests++;
35098
35099    return(test_ret);
35100}
35101
35102
35103static int
35104test_xmlCharStrndup(void) {
35105    int test_ret = 0;
35106
35107    int mem_base;
35108    xmlChar * ret_val;
35109    char * cur; /* the input char * */
35110    int n_cur;
35111    int len; /* the len of @cur */
35112    int n_len;
35113
35114    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35115    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35116        mem_base = xmlMemBlocks();
35117        cur = gen_const_char_ptr(n_cur, 0);
35118        len = gen_int(n_len, 1);
35119
35120        ret_val = xmlCharStrndup((const char *)cur, len);
35121        desret_xmlChar_ptr(ret_val);
35122        call_tests++;
35123        des_const_char_ptr(n_cur, (const char *)cur, 0);
35124        des_int(n_len, len, 1);
35125        xmlResetLastError();
35126        if (mem_base != xmlMemBlocks()) {
35127            printf("Leak of %d blocks found in xmlCharStrndup",
35128	           xmlMemBlocks() - mem_base);
35129	    test_ret++;
35130            printf(" %d", n_cur);
35131            printf(" %d", n_len);
35132            printf("\n");
35133        }
35134    }
35135    }
35136    function_tests++;
35137
35138    return(test_ret);
35139}
35140
35141
35142static int
35143test_xmlCheckUTF8(void) {
35144    int test_ret = 0;
35145
35146    int mem_base;
35147    int ret_val;
35148    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35149    int n_utf;
35150
35151    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35152        mem_base = xmlMemBlocks();
35153        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35154
35155        ret_val = xmlCheckUTF8((const unsigned char *)utf);
35156        desret_int(ret_val);
35157        call_tests++;
35158        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35159        xmlResetLastError();
35160        if (mem_base != xmlMemBlocks()) {
35161            printf("Leak of %d blocks found in xmlCheckUTF8",
35162	           xmlMemBlocks() - mem_base);
35163	    test_ret++;
35164            printf(" %d", n_utf);
35165            printf("\n");
35166        }
35167    }
35168    function_tests++;
35169
35170    return(test_ret);
35171}
35172
35173
35174static int
35175test_xmlGetUTF8Char(void) {
35176    int test_ret = 0;
35177
35178    int mem_base;
35179    int ret_val;
35180    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35181    int n_utf;
35182    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. */
35183    int n_len;
35184
35185    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35186    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35187        mem_base = xmlMemBlocks();
35188        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35189        len = gen_int_ptr(n_len, 1);
35190
35191        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35192        desret_int(ret_val);
35193        call_tests++;
35194        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35195        des_int_ptr(n_len, len, 1);
35196        xmlResetLastError();
35197        if (mem_base != xmlMemBlocks()) {
35198            printf("Leak of %d blocks found in xmlGetUTF8Char",
35199	           xmlMemBlocks() - mem_base);
35200	    test_ret++;
35201            printf(" %d", n_utf);
35202            printf(" %d", n_len);
35203            printf("\n");
35204        }
35205    }
35206    }
35207    function_tests++;
35208
35209    return(test_ret);
35210}
35211
35212
35213static int
35214test_xmlStrEqual(void) {
35215    int test_ret = 0;
35216
35217    int mem_base;
35218    int ret_val;
35219    xmlChar * str1; /* the first xmlChar * */
35220    int n_str1;
35221    xmlChar * str2; /* the second xmlChar * */
35222    int n_str2;
35223
35224    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35225    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35226        mem_base = xmlMemBlocks();
35227        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35228        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35229
35230        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35231        desret_int(ret_val);
35232        call_tests++;
35233        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35234        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35235        xmlResetLastError();
35236        if (mem_base != xmlMemBlocks()) {
35237            printf("Leak of %d blocks found in xmlStrEqual",
35238	           xmlMemBlocks() - mem_base);
35239	    test_ret++;
35240            printf(" %d", n_str1);
35241            printf(" %d", n_str2);
35242            printf("\n");
35243        }
35244    }
35245    }
35246    function_tests++;
35247
35248    return(test_ret);
35249}
35250
35251
35252static int
35253test_xmlStrPrintf(void) {
35254    int test_ret = 0;
35255
35256
35257    /* missing type support */
35258    return(test_ret);
35259}
35260
35261
35262static int
35263test_xmlStrQEqual(void) {
35264    int test_ret = 0;
35265
35266    int mem_base;
35267    int ret_val;
35268    xmlChar * pref; /* the prefix of the QName */
35269    int n_pref;
35270    xmlChar * name; /* the localname of the QName */
35271    int n_name;
35272    xmlChar * str; /* the second xmlChar * */
35273    int n_str;
35274
35275    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35276    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35277    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35278        mem_base = xmlMemBlocks();
35279        pref = gen_const_xmlChar_ptr(n_pref, 0);
35280        name = gen_const_xmlChar_ptr(n_name, 1);
35281        str = gen_const_xmlChar_ptr(n_str, 2);
35282
35283        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35284        desret_int(ret_val);
35285        call_tests++;
35286        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35287        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35288        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35289        xmlResetLastError();
35290        if (mem_base != xmlMemBlocks()) {
35291            printf("Leak of %d blocks found in xmlStrQEqual",
35292	           xmlMemBlocks() - mem_base);
35293	    test_ret++;
35294            printf(" %d", n_pref);
35295            printf(" %d", n_name);
35296            printf(" %d", n_str);
35297            printf("\n");
35298        }
35299    }
35300    }
35301    }
35302    function_tests++;
35303
35304    return(test_ret);
35305}
35306
35307
35308static int
35309test_xmlStrVPrintf(void) {
35310    int test_ret = 0;
35311
35312
35313    /* missing type support */
35314    return(test_ret);
35315}
35316
35317
35318static int
35319test_xmlStrcasecmp(void) {
35320    int test_ret = 0;
35321
35322    int mem_base;
35323    int ret_val;
35324    xmlChar * str1; /* the first xmlChar * */
35325    int n_str1;
35326    xmlChar * str2; /* the second xmlChar * */
35327    int n_str2;
35328
35329    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35330    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35331        mem_base = xmlMemBlocks();
35332        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35333        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35334
35335        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35336        desret_int(ret_val);
35337        call_tests++;
35338        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35339        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35340        xmlResetLastError();
35341        if (mem_base != xmlMemBlocks()) {
35342            printf("Leak of %d blocks found in xmlStrcasecmp",
35343	           xmlMemBlocks() - mem_base);
35344	    test_ret++;
35345            printf(" %d", n_str1);
35346            printf(" %d", n_str2);
35347            printf("\n");
35348        }
35349    }
35350    }
35351    function_tests++;
35352
35353    return(test_ret);
35354}
35355
35356
35357static int
35358test_xmlStrcasestr(void) {
35359    int test_ret = 0;
35360
35361    int mem_base;
35362    const xmlChar * ret_val;
35363    xmlChar * str; /* the xmlChar * array (haystack) */
35364    int n_str;
35365    xmlChar * val; /* the xmlChar to search (needle) */
35366    int n_val;
35367
35368    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35369    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35370        mem_base = xmlMemBlocks();
35371        str = gen_const_xmlChar_ptr(n_str, 0);
35372        val = gen_xmlChar_ptr(n_val, 1);
35373
35374        ret_val = xmlStrcasestr((const xmlChar *)str, val);
35375        desret_const_xmlChar_ptr(ret_val);
35376        call_tests++;
35377        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35378        des_xmlChar_ptr(n_val, val, 1);
35379        xmlResetLastError();
35380        if (mem_base != xmlMemBlocks()) {
35381            printf("Leak of %d blocks found in xmlStrcasestr",
35382	           xmlMemBlocks() - mem_base);
35383	    test_ret++;
35384            printf(" %d", n_str);
35385            printf(" %d", n_val);
35386            printf("\n");
35387        }
35388    }
35389    }
35390    function_tests++;
35391
35392    return(test_ret);
35393}
35394
35395
35396static int
35397test_xmlStrchr(void) {
35398    int test_ret = 0;
35399
35400    int mem_base;
35401    const xmlChar * ret_val;
35402    xmlChar * str; /* the xmlChar * array */
35403    int n_str;
35404    xmlChar val; /* the xmlChar to search */
35405    int n_val;
35406
35407    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35408    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
35409        mem_base = xmlMemBlocks();
35410        str = gen_const_xmlChar_ptr(n_str, 0);
35411        val = gen_xmlChar(n_val, 1);
35412
35413        ret_val = xmlStrchr((const xmlChar *)str, val);
35414        desret_const_xmlChar_ptr(ret_val);
35415        call_tests++;
35416        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35417        des_xmlChar(n_val, val, 1);
35418        xmlResetLastError();
35419        if (mem_base != xmlMemBlocks()) {
35420            printf("Leak of %d blocks found in xmlStrchr",
35421	           xmlMemBlocks() - mem_base);
35422	    test_ret++;
35423            printf(" %d", n_str);
35424            printf(" %d", n_val);
35425            printf("\n");
35426        }
35427    }
35428    }
35429    function_tests++;
35430
35431    return(test_ret);
35432}
35433
35434
35435static int
35436test_xmlStrcmp(void) {
35437    int test_ret = 0;
35438
35439    int mem_base;
35440    int ret_val;
35441    xmlChar * str1; /* the first xmlChar * */
35442    int n_str1;
35443    xmlChar * str2; /* the second xmlChar * */
35444    int n_str2;
35445
35446    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35447    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35448        mem_base = xmlMemBlocks();
35449        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35450        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35451
35452        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
35453        desret_int(ret_val);
35454        call_tests++;
35455        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35456        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35457        xmlResetLastError();
35458        if (mem_base != xmlMemBlocks()) {
35459            printf("Leak of %d blocks found in xmlStrcmp",
35460	           xmlMemBlocks() - mem_base);
35461	    test_ret++;
35462            printf(" %d", n_str1);
35463            printf(" %d", n_str2);
35464            printf("\n");
35465        }
35466    }
35467    }
35468    function_tests++;
35469
35470    return(test_ret);
35471}
35472
35473
35474static int
35475test_xmlStrdup(void) {
35476    int test_ret = 0;
35477
35478    int mem_base;
35479    xmlChar * ret_val;
35480    xmlChar * cur; /* the input xmlChar * */
35481    int n_cur;
35482
35483    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
35484        mem_base = xmlMemBlocks();
35485        cur = gen_const_xmlChar_ptr(n_cur, 0);
35486
35487        ret_val = xmlStrdup((const xmlChar *)cur);
35488        desret_xmlChar_ptr(ret_val);
35489        call_tests++;
35490        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
35491        xmlResetLastError();
35492        if (mem_base != xmlMemBlocks()) {
35493            printf("Leak of %d blocks found in xmlStrdup",
35494	           xmlMemBlocks() - mem_base);
35495	    test_ret++;
35496            printf(" %d", n_cur);
35497            printf("\n");
35498        }
35499    }
35500    function_tests++;
35501
35502    return(test_ret);
35503}
35504
35505
35506static int
35507test_xmlStrlen(void) {
35508    int test_ret = 0;
35509
35510    int mem_base;
35511    int ret_val;
35512    xmlChar * str; /* the xmlChar * array */
35513    int n_str;
35514
35515    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35516        mem_base = xmlMemBlocks();
35517        str = gen_const_xmlChar_ptr(n_str, 0);
35518
35519        ret_val = xmlStrlen((const xmlChar *)str);
35520        desret_int(ret_val);
35521        call_tests++;
35522        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35523        xmlResetLastError();
35524        if (mem_base != xmlMemBlocks()) {
35525            printf("Leak of %d blocks found in xmlStrlen",
35526	           xmlMemBlocks() - mem_base);
35527	    test_ret++;
35528            printf(" %d", n_str);
35529            printf("\n");
35530        }
35531    }
35532    function_tests++;
35533
35534    return(test_ret);
35535}
35536
35537
35538static int
35539test_xmlStrncasecmp(void) {
35540    int test_ret = 0;
35541
35542    int mem_base;
35543    int ret_val;
35544    xmlChar * str1; /* the first xmlChar * */
35545    int n_str1;
35546    xmlChar * str2; /* the second xmlChar * */
35547    int n_str2;
35548    int len; /* the max comparison length */
35549    int n_len;
35550
35551    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35552    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35553    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35554        mem_base = xmlMemBlocks();
35555        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35556        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35557        len = gen_int(n_len, 2);
35558
35559        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
35560        desret_int(ret_val);
35561        call_tests++;
35562        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35563        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35564        des_int(n_len, len, 2);
35565        xmlResetLastError();
35566        if (mem_base != xmlMemBlocks()) {
35567            printf("Leak of %d blocks found in xmlStrncasecmp",
35568	           xmlMemBlocks() - mem_base);
35569	    test_ret++;
35570            printf(" %d", n_str1);
35571            printf(" %d", n_str2);
35572            printf(" %d", n_len);
35573            printf("\n");
35574        }
35575    }
35576    }
35577    }
35578    function_tests++;
35579
35580    return(test_ret);
35581}
35582
35583
35584static int
35585test_xmlStrncatNew(void) {
35586    int test_ret = 0;
35587
35588    int mem_base;
35589    xmlChar * ret_val;
35590    xmlChar * str1; /* first xmlChar string */
35591    int n_str1;
35592    xmlChar * str2; /* second xmlChar string */
35593    int n_str2;
35594    int len; /* the len of @str2 */
35595    int n_len;
35596
35597    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35598    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35599    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35600        mem_base = xmlMemBlocks();
35601        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35602        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35603        len = gen_int(n_len, 2);
35604
35605        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
35606        desret_xmlChar_ptr(ret_val);
35607        call_tests++;
35608        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35609        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35610        des_int(n_len, len, 2);
35611        xmlResetLastError();
35612        if (mem_base != xmlMemBlocks()) {
35613            printf("Leak of %d blocks found in xmlStrncatNew",
35614	           xmlMemBlocks() - mem_base);
35615	    test_ret++;
35616            printf(" %d", n_str1);
35617            printf(" %d", n_str2);
35618            printf(" %d", n_len);
35619            printf("\n");
35620        }
35621    }
35622    }
35623    }
35624    function_tests++;
35625
35626    return(test_ret);
35627}
35628
35629
35630static int
35631test_xmlStrncmp(void) {
35632    int test_ret = 0;
35633
35634    int mem_base;
35635    int ret_val;
35636    xmlChar * str1; /* the first xmlChar * */
35637    int n_str1;
35638    xmlChar * str2; /* the second xmlChar * */
35639    int n_str2;
35640    int len; /* the max comparison length */
35641    int n_len;
35642
35643    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35644    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35645    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35646        mem_base = xmlMemBlocks();
35647        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35648        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35649        len = gen_int(n_len, 2);
35650
35651        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
35652        desret_int(ret_val);
35653        call_tests++;
35654        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35655        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35656        des_int(n_len, len, 2);
35657        xmlResetLastError();
35658        if (mem_base != xmlMemBlocks()) {
35659            printf("Leak of %d blocks found in xmlStrncmp",
35660	           xmlMemBlocks() - mem_base);
35661	    test_ret++;
35662            printf(" %d", n_str1);
35663            printf(" %d", n_str2);
35664            printf(" %d", n_len);
35665            printf("\n");
35666        }
35667    }
35668    }
35669    }
35670    function_tests++;
35671
35672    return(test_ret);
35673}
35674
35675
35676static int
35677test_xmlStrndup(void) {
35678    int test_ret = 0;
35679
35680    int mem_base;
35681    xmlChar * ret_val;
35682    xmlChar * cur; /* the input xmlChar * */
35683    int n_cur;
35684    int len; /* the len of @cur */
35685    int n_len;
35686
35687    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
35688    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35689        mem_base = xmlMemBlocks();
35690        cur = gen_const_xmlChar_ptr(n_cur, 0);
35691        len = gen_int(n_len, 1);
35692
35693        ret_val = xmlStrndup((const xmlChar *)cur, len);
35694        desret_xmlChar_ptr(ret_val);
35695        call_tests++;
35696        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
35697        des_int(n_len, len, 1);
35698        xmlResetLastError();
35699        if (mem_base != xmlMemBlocks()) {
35700            printf("Leak of %d blocks found in xmlStrndup",
35701	           xmlMemBlocks() - mem_base);
35702	    test_ret++;
35703            printf(" %d", n_cur);
35704            printf(" %d", n_len);
35705            printf("\n");
35706        }
35707    }
35708    }
35709    function_tests++;
35710
35711    return(test_ret);
35712}
35713
35714
35715static int
35716test_xmlStrstr(void) {
35717    int test_ret = 0;
35718
35719    int mem_base;
35720    const xmlChar * ret_val;
35721    xmlChar * str; /* the xmlChar * array (haystack) */
35722    int n_str;
35723    xmlChar * val; /* the xmlChar to search (needle) */
35724    int n_val;
35725
35726    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35727    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
35728        mem_base = xmlMemBlocks();
35729        str = gen_const_xmlChar_ptr(n_str, 0);
35730        val = gen_const_xmlChar_ptr(n_val, 1);
35731
35732        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
35733        desret_const_xmlChar_ptr(ret_val);
35734        call_tests++;
35735        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35736        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
35737        xmlResetLastError();
35738        if (mem_base != xmlMemBlocks()) {
35739            printf("Leak of %d blocks found in xmlStrstr",
35740	           xmlMemBlocks() - mem_base);
35741	    test_ret++;
35742            printf(" %d", n_str);
35743            printf(" %d", n_val);
35744            printf("\n");
35745        }
35746    }
35747    }
35748    function_tests++;
35749
35750    return(test_ret);
35751}
35752
35753
35754static int
35755test_xmlStrsub(void) {
35756    int test_ret = 0;
35757
35758    int mem_base;
35759    xmlChar * ret_val;
35760    xmlChar * str; /* the xmlChar * array (haystack) */
35761    int n_str;
35762    int start; /* the index of the first char (zero based) */
35763    int n_start;
35764    int len; /* the length of the substring */
35765    int n_len;
35766
35767    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35768    for (n_start = 0;n_start < gen_nb_int;n_start++) {
35769    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35770        mem_base = xmlMemBlocks();
35771        str = gen_const_xmlChar_ptr(n_str, 0);
35772        start = gen_int(n_start, 1);
35773        len = gen_int(n_len, 2);
35774
35775        ret_val = xmlStrsub((const xmlChar *)str, start, len);
35776        desret_xmlChar_ptr(ret_val);
35777        call_tests++;
35778        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35779        des_int(n_start, start, 1);
35780        des_int(n_len, len, 2);
35781        xmlResetLastError();
35782        if (mem_base != xmlMemBlocks()) {
35783            printf("Leak of %d blocks found in xmlStrsub",
35784	           xmlMemBlocks() - mem_base);
35785	    test_ret++;
35786            printf(" %d", n_str);
35787            printf(" %d", n_start);
35788            printf(" %d", n_len);
35789            printf("\n");
35790        }
35791    }
35792    }
35793    }
35794    function_tests++;
35795
35796    return(test_ret);
35797}
35798
35799
35800static int
35801test_xmlUTF8Charcmp(void) {
35802    int test_ret = 0;
35803
35804    int mem_base;
35805    int ret_val;
35806    xmlChar * utf1; /* pointer to first UTF8 char */
35807    int n_utf1;
35808    xmlChar * utf2; /* pointer to second UTF8 char */
35809    int n_utf2;
35810
35811    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
35812    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
35813        mem_base = xmlMemBlocks();
35814        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
35815        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
35816
35817        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
35818        desret_int(ret_val);
35819        call_tests++;
35820        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
35821        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
35822        xmlResetLastError();
35823        if (mem_base != xmlMemBlocks()) {
35824            printf("Leak of %d blocks found in xmlUTF8Charcmp",
35825	           xmlMemBlocks() - mem_base);
35826	    test_ret++;
35827            printf(" %d", n_utf1);
35828            printf(" %d", n_utf2);
35829            printf("\n");
35830        }
35831    }
35832    }
35833    function_tests++;
35834
35835    return(test_ret);
35836}
35837
35838
35839static int
35840test_xmlUTF8Size(void) {
35841    int test_ret = 0;
35842
35843    int mem_base;
35844    int ret_val;
35845    xmlChar * utf; /* pointer to the UTF8 character */
35846    int n_utf;
35847
35848    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35849        mem_base = xmlMemBlocks();
35850        utf = gen_const_xmlChar_ptr(n_utf, 0);
35851
35852        ret_val = xmlUTF8Size((const xmlChar *)utf);
35853        desret_int(ret_val);
35854        call_tests++;
35855        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35856        xmlResetLastError();
35857        if (mem_base != xmlMemBlocks()) {
35858            printf("Leak of %d blocks found in xmlUTF8Size",
35859	           xmlMemBlocks() - mem_base);
35860	    test_ret++;
35861            printf(" %d", n_utf);
35862            printf("\n");
35863        }
35864    }
35865    function_tests++;
35866
35867    return(test_ret);
35868}
35869
35870
35871static int
35872test_xmlUTF8Strlen(void) {
35873    int test_ret = 0;
35874
35875    int mem_base;
35876    int ret_val;
35877    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
35878    int n_utf;
35879
35880    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35881        mem_base = xmlMemBlocks();
35882        utf = gen_const_xmlChar_ptr(n_utf, 0);
35883
35884        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
35885        desret_int(ret_val);
35886        call_tests++;
35887        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35888        xmlResetLastError();
35889        if (mem_base != xmlMemBlocks()) {
35890            printf("Leak of %d blocks found in xmlUTF8Strlen",
35891	           xmlMemBlocks() - mem_base);
35892	    test_ret++;
35893            printf(" %d", n_utf);
35894            printf("\n");
35895        }
35896    }
35897    function_tests++;
35898
35899    return(test_ret);
35900}
35901
35902
35903static int
35904test_xmlUTF8Strloc(void) {
35905    int test_ret = 0;
35906
35907    int mem_base;
35908    int ret_val;
35909    xmlChar * utf; /* the input UTF8 * */
35910    int n_utf;
35911    xmlChar * utfchar; /* the UTF8 character to be found */
35912    int n_utfchar;
35913
35914    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35915    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
35916        mem_base = xmlMemBlocks();
35917        utf = gen_const_xmlChar_ptr(n_utf, 0);
35918        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
35919
35920        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
35921        desret_int(ret_val);
35922        call_tests++;
35923        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35924        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
35925        xmlResetLastError();
35926        if (mem_base != xmlMemBlocks()) {
35927            printf("Leak of %d blocks found in xmlUTF8Strloc",
35928	           xmlMemBlocks() - mem_base);
35929	    test_ret++;
35930            printf(" %d", n_utf);
35931            printf(" %d", n_utfchar);
35932            printf("\n");
35933        }
35934    }
35935    }
35936    function_tests++;
35937
35938    return(test_ret);
35939}
35940
35941
35942static int
35943test_xmlUTF8Strndup(void) {
35944    int test_ret = 0;
35945
35946    int mem_base;
35947    xmlChar * ret_val;
35948    xmlChar * utf; /* the input UTF8 * */
35949    int n_utf;
35950    int len; /* the len of @utf (in chars) */
35951    int n_len;
35952
35953    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35954    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35955        mem_base = xmlMemBlocks();
35956        utf = gen_const_xmlChar_ptr(n_utf, 0);
35957        len = gen_int(n_len, 1);
35958
35959        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
35960        desret_xmlChar_ptr(ret_val);
35961        call_tests++;
35962        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
35963        des_int(n_len, len, 1);
35964        xmlResetLastError();
35965        if (mem_base != xmlMemBlocks()) {
35966            printf("Leak of %d blocks found in xmlUTF8Strndup",
35967	           xmlMemBlocks() - mem_base);
35968	    test_ret++;
35969            printf(" %d", n_utf);
35970            printf(" %d", n_len);
35971            printf("\n");
35972        }
35973    }
35974    }
35975    function_tests++;
35976
35977    return(test_ret);
35978}
35979
35980
35981static int
35982test_xmlUTF8Strpos(void) {
35983    int test_ret = 0;
35984
35985    int mem_base;
35986    const xmlChar * ret_val;
35987    xmlChar * utf; /* the input UTF8 * */
35988    int n_utf;
35989    int pos; /* the position of the desired UTF8 char (in chars) */
35990    int n_pos;
35991
35992    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
35993    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
35994        mem_base = xmlMemBlocks();
35995        utf = gen_const_xmlChar_ptr(n_utf, 0);
35996        pos = gen_int(n_pos, 1);
35997
35998        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
35999        desret_const_xmlChar_ptr(ret_val);
36000        call_tests++;
36001        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36002        des_int(n_pos, pos, 1);
36003        xmlResetLastError();
36004        if (mem_base != xmlMemBlocks()) {
36005            printf("Leak of %d blocks found in xmlUTF8Strpos",
36006	           xmlMemBlocks() - mem_base);
36007	    test_ret++;
36008            printf(" %d", n_utf);
36009            printf(" %d", n_pos);
36010            printf("\n");
36011        }
36012    }
36013    }
36014    function_tests++;
36015
36016    return(test_ret);
36017}
36018
36019
36020static int
36021test_xmlUTF8Strsize(void) {
36022    int test_ret = 0;
36023
36024    int mem_base;
36025    int ret_val;
36026    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36027    int n_utf;
36028    int len; /* the number of characters in the array */
36029    int n_len;
36030
36031    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36032    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36033        mem_base = xmlMemBlocks();
36034        utf = gen_const_xmlChar_ptr(n_utf, 0);
36035        len = gen_int(n_len, 1);
36036
36037        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36038        desret_int(ret_val);
36039        call_tests++;
36040        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36041        des_int(n_len, len, 1);
36042        xmlResetLastError();
36043        if (mem_base != xmlMemBlocks()) {
36044            printf("Leak of %d blocks found in xmlUTF8Strsize",
36045	           xmlMemBlocks() - mem_base);
36046	    test_ret++;
36047            printf(" %d", n_utf);
36048            printf(" %d", n_len);
36049            printf("\n");
36050        }
36051    }
36052    }
36053    function_tests++;
36054
36055    return(test_ret);
36056}
36057
36058
36059static int
36060test_xmlUTF8Strsub(void) {
36061    int test_ret = 0;
36062
36063    int mem_base;
36064    xmlChar * ret_val;
36065    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36066    int n_utf;
36067    int start; /* relative pos of first char */
36068    int n_start;
36069    int len; /* total number to copy */
36070    int n_len;
36071
36072    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36073    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36074    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36075        mem_base = xmlMemBlocks();
36076        utf = gen_const_xmlChar_ptr(n_utf, 0);
36077        start = gen_int(n_start, 1);
36078        len = gen_int(n_len, 2);
36079
36080        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36081        desret_xmlChar_ptr(ret_val);
36082        call_tests++;
36083        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36084        des_int(n_start, start, 1);
36085        des_int(n_len, len, 2);
36086        xmlResetLastError();
36087        if (mem_base != xmlMemBlocks()) {
36088            printf("Leak of %d blocks found in xmlUTF8Strsub",
36089	           xmlMemBlocks() - mem_base);
36090	    test_ret++;
36091            printf(" %d", n_utf);
36092            printf(" %d", n_start);
36093            printf(" %d", n_len);
36094            printf("\n");
36095        }
36096    }
36097    }
36098    }
36099    function_tests++;
36100
36101    return(test_ret);
36102}
36103
36104static int
36105test_xmlstring(void) {
36106    int test_ret = 0;
36107
36108    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36109    test_ret += test_xmlCharStrdup();
36110    test_ret += test_xmlCharStrndup();
36111    test_ret += test_xmlCheckUTF8();
36112    test_ret += test_xmlGetUTF8Char();
36113    test_ret += test_xmlStrEqual();
36114    test_ret += test_xmlStrPrintf();
36115    test_ret += test_xmlStrQEqual();
36116    test_ret += test_xmlStrVPrintf();
36117    test_ret += test_xmlStrcasecmp();
36118    test_ret += test_xmlStrcasestr();
36119    test_ret += test_xmlStrchr();
36120    test_ret += test_xmlStrcmp();
36121    test_ret += test_xmlStrdup();
36122    test_ret += test_xmlStrlen();
36123    test_ret += test_xmlStrncasecmp();
36124    test_ret += test_xmlStrncatNew();
36125    test_ret += test_xmlStrncmp();
36126    test_ret += test_xmlStrndup();
36127    test_ret += test_xmlStrstr();
36128    test_ret += test_xmlStrsub();
36129    test_ret += test_xmlUTF8Charcmp();
36130    test_ret += test_xmlUTF8Size();
36131    test_ret += test_xmlUTF8Strlen();
36132    test_ret += test_xmlUTF8Strloc();
36133    test_ret += test_xmlUTF8Strndup();
36134    test_ret += test_xmlUTF8Strpos();
36135    test_ret += test_xmlUTF8Strsize();
36136    test_ret += test_xmlUTF8Strsub();
36137
36138    if (test_ret != 0)
36139	printf("Module xmlstring: %d errors\n", test_ret);
36140    return(test_ret);
36141}
36142
36143static int
36144test_xmlUCSIsAegeanNumbers(void) {
36145    int test_ret = 0;
36146
36147#if defined(LIBXML_UNICODE_ENABLED)
36148    int mem_base;
36149    int ret_val;
36150    int code; /* UCS code point */
36151    int n_code;
36152
36153    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36154        mem_base = xmlMemBlocks();
36155        code = gen_int(n_code, 0);
36156
36157        ret_val = xmlUCSIsAegeanNumbers(code);
36158        desret_int(ret_val);
36159        call_tests++;
36160        des_int(n_code, code, 0);
36161        xmlResetLastError();
36162        if (mem_base != xmlMemBlocks()) {
36163            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36164	           xmlMemBlocks() - mem_base);
36165	    test_ret++;
36166            printf(" %d", n_code);
36167            printf("\n");
36168        }
36169    }
36170    function_tests++;
36171#endif
36172
36173    return(test_ret);
36174}
36175
36176
36177static int
36178test_xmlUCSIsAlphabeticPresentationForms(void) {
36179    int test_ret = 0;
36180
36181#if defined(LIBXML_UNICODE_ENABLED)
36182    int mem_base;
36183    int ret_val;
36184    int code; /* UCS code point */
36185    int n_code;
36186
36187    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36188        mem_base = xmlMemBlocks();
36189        code = gen_int(n_code, 0);
36190
36191        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36192        desret_int(ret_val);
36193        call_tests++;
36194        des_int(n_code, code, 0);
36195        xmlResetLastError();
36196        if (mem_base != xmlMemBlocks()) {
36197            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36198	           xmlMemBlocks() - mem_base);
36199	    test_ret++;
36200            printf(" %d", n_code);
36201            printf("\n");
36202        }
36203    }
36204    function_tests++;
36205#endif
36206
36207    return(test_ret);
36208}
36209
36210
36211static int
36212test_xmlUCSIsArabic(void) {
36213    int test_ret = 0;
36214
36215#if defined(LIBXML_UNICODE_ENABLED)
36216    int mem_base;
36217    int ret_val;
36218    int code; /* UCS code point */
36219    int n_code;
36220
36221    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36222        mem_base = xmlMemBlocks();
36223        code = gen_int(n_code, 0);
36224
36225        ret_val = xmlUCSIsArabic(code);
36226        desret_int(ret_val);
36227        call_tests++;
36228        des_int(n_code, code, 0);
36229        xmlResetLastError();
36230        if (mem_base != xmlMemBlocks()) {
36231            printf("Leak of %d blocks found in xmlUCSIsArabic",
36232	           xmlMemBlocks() - mem_base);
36233	    test_ret++;
36234            printf(" %d", n_code);
36235            printf("\n");
36236        }
36237    }
36238    function_tests++;
36239#endif
36240
36241    return(test_ret);
36242}
36243
36244
36245static int
36246test_xmlUCSIsArabicPresentationFormsA(void) {
36247    int test_ret = 0;
36248
36249#if defined(LIBXML_UNICODE_ENABLED)
36250    int mem_base;
36251    int ret_val;
36252    int code; /* UCS code point */
36253    int n_code;
36254
36255    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36256        mem_base = xmlMemBlocks();
36257        code = gen_int(n_code, 0);
36258
36259        ret_val = xmlUCSIsArabicPresentationFormsA(code);
36260        desret_int(ret_val);
36261        call_tests++;
36262        des_int(n_code, code, 0);
36263        xmlResetLastError();
36264        if (mem_base != xmlMemBlocks()) {
36265            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36266	           xmlMemBlocks() - mem_base);
36267	    test_ret++;
36268            printf(" %d", n_code);
36269            printf("\n");
36270        }
36271    }
36272    function_tests++;
36273#endif
36274
36275    return(test_ret);
36276}
36277
36278
36279static int
36280test_xmlUCSIsArabicPresentationFormsB(void) {
36281    int test_ret = 0;
36282
36283#if defined(LIBXML_UNICODE_ENABLED)
36284    int mem_base;
36285    int ret_val;
36286    int code; /* UCS code point */
36287    int n_code;
36288
36289    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36290        mem_base = xmlMemBlocks();
36291        code = gen_int(n_code, 0);
36292
36293        ret_val = xmlUCSIsArabicPresentationFormsB(code);
36294        desret_int(ret_val);
36295        call_tests++;
36296        des_int(n_code, code, 0);
36297        xmlResetLastError();
36298        if (mem_base != xmlMemBlocks()) {
36299            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36300	           xmlMemBlocks() - mem_base);
36301	    test_ret++;
36302            printf(" %d", n_code);
36303            printf("\n");
36304        }
36305    }
36306    function_tests++;
36307#endif
36308
36309    return(test_ret);
36310}
36311
36312
36313static int
36314test_xmlUCSIsArmenian(void) {
36315    int test_ret = 0;
36316
36317#if defined(LIBXML_UNICODE_ENABLED)
36318    int mem_base;
36319    int ret_val;
36320    int code; /* UCS code point */
36321    int n_code;
36322
36323    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36324        mem_base = xmlMemBlocks();
36325        code = gen_int(n_code, 0);
36326
36327        ret_val = xmlUCSIsArmenian(code);
36328        desret_int(ret_val);
36329        call_tests++;
36330        des_int(n_code, code, 0);
36331        xmlResetLastError();
36332        if (mem_base != xmlMemBlocks()) {
36333            printf("Leak of %d blocks found in xmlUCSIsArmenian",
36334	           xmlMemBlocks() - mem_base);
36335	    test_ret++;
36336            printf(" %d", n_code);
36337            printf("\n");
36338        }
36339    }
36340    function_tests++;
36341#endif
36342
36343    return(test_ret);
36344}
36345
36346
36347static int
36348test_xmlUCSIsArrows(void) {
36349    int test_ret = 0;
36350
36351#if defined(LIBXML_UNICODE_ENABLED)
36352    int mem_base;
36353    int ret_val;
36354    int code; /* UCS code point */
36355    int n_code;
36356
36357    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36358        mem_base = xmlMemBlocks();
36359        code = gen_int(n_code, 0);
36360
36361        ret_val = xmlUCSIsArrows(code);
36362        desret_int(ret_val);
36363        call_tests++;
36364        des_int(n_code, code, 0);
36365        xmlResetLastError();
36366        if (mem_base != xmlMemBlocks()) {
36367            printf("Leak of %d blocks found in xmlUCSIsArrows",
36368	           xmlMemBlocks() - mem_base);
36369	    test_ret++;
36370            printf(" %d", n_code);
36371            printf("\n");
36372        }
36373    }
36374    function_tests++;
36375#endif
36376
36377    return(test_ret);
36378}
36379
36380
36381static int
36382test_xmlUCSIsBasicLatin(void) {
36383    int test_ret = 0;
36384
36385#if defined(LIBXML_UNICODE_ENABLED)
36386    int mem_base;
36387    int ret_val;
36388    int code; /* UCS code point */
36389    int n_code;
36390
36391    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36392        mem_base = xmlMemBlocks();
36393        code = gen_int(n_code, 0);
36394
36395        ret_val = xmlUCSIsBasicLatin(code);
36396        desret_int(ret_val);
36397        call_tests++;
36398        des_int(n_code, code, 0);
36399        xmlResetLastError();
36400        if (mem_base != xmlMemBlocks()) {
36401            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
36402	           xmlMemBlocks() - mem_base);
36403	    test_ret++;
36404            printf(" %d", n_code);
36405            printf("\n");
36406        }
36407    }
36408    function_tests++;
36409#endif
36410
36411    return(test_ret);
36412}
36413
36414
36415static int
36416test_xmlUCSIsBengali(void) {
36417    int test_ret = 0;
36418
36419#if defined(LIBXML_UNICODE_ENABLED)
36420    int mem_base;
36421    int ret_val;
36422    int code; /* UCS code point */
36423    int n_code;
36424
36425    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36426        mem_base = xmlMemBlocks();
36427        code = gen_int(n_code, 0);
36428
36429        ret_val = xmlUCSIsBengali(code);
36430        desret_int(ret_val);
36431        call_tests++;
36432        des_int(n_code, code, 0);
36433        xmlResetLastError();
36434        if (mem_base != xmlMemBlocks()) {
36435            printf("Leak of %d blocks found in xmlUCSIsBengali",
36436	           xmlMemBlocks() - mem_base);
36437	    test_ret++;
36438            printf(" %d", n_code);
36439            printf("\n");
36440        }
36441    }
36442    function_tests++;
36443#endif
36444
36445    return(test_ret);
36446}
36447
36448
36449static int
36450test_xmlUCSIsBlock(void) {
36451    int test_ret = 0;
36452
36453#if defined(LIBXML_UNICODE_ENABLED)
36454    int mem_base;
36455    int ret_val;
36456    int code; /* UCS code point */
36457    int n_code;
36458    char * block; /* UCS block name */
36459    int n_block;
36460
36461    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36462    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
36463        mem_base = xmlMemBlocks();
36464        code = gen_int(n_code, 0);
36465        block = gen_const_char_ptr(n_block, 1);
36466
36467        ret_val = xmlUCSIsBlock(code, (const char *)block);
36468        desret_int(ret_val);
36469        call_tests++;
36470        des_int(n_code, code, 0);
36471        des_const_char_ptr(n_block, (const char *)block, 1);
36472        xmlResetLastError();
36473        if (mem_base != xmlMemBlocks()) {
36474            printf("Leak of %d blocks found in xmlUCSIsBlock",
36475	           xmlMemBlocks() - mem_base);
36476	    test_ret++;
36477            printf(" %d", n_code);
36478            printf(" %d", n_block);
36479            printf("\n");
36480        }
36481    }
36482    }
36483    function_tests++;
36484#endif
36485
36486    return(test_ret);
36487}
36488
36489
36490static int
36491test_xmlUCSIsBlockElements(void) {
36492    int test_ret = 0;
36493
36494#if defined(LIBXML_UNICODE_ENABLED)
36495    int mem_base;
36496    int ret_val;
36497    int code; /* UCS code point */
36498    int n_code;
36499
36500    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36501        mem_base = xmlMemBlocks();
36502        code = gen_int(n_code, 0);
36503
36504        ret_val = xmlUCSIsBlockElements(code);
36505        desret_int(ret_val);
36506        call_tests++;
36507        des_int(n_code, code, 0);
36508        xmlResetLastError();
36509        if (mem_base != xmlMemBlocks()) {
36510            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
36511	           xmlMemBlocks() - mem_base);
36512	    test_ret++;
36513            printf(" %d", n_code);
36514            printf("\n");
36515        }
36516    }
36517    function_tests++;
36518#endif
36519
36520    return(test_ret);
36521}
36522
36523
36524static int
36525test_xmlUCSIsBopomofo(void) {
36526    int test_ret = 0;
36527
36528#if defined(LIBXML_UNICODE_ENABLED)
36529    int mem_base;
36530    int ret_val;
36531    int code; /* UCS code point */
36532    int n_code;
36533
36534    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36535        mem_base = xmlMemBlocks();
36536        code = gen_int(n_code, 0);
36537
36538        ret_val = xmlUCSIsBopomofo(code);
36539        desret_int(ret_val);
36540        call_tests++;
36541        des_int(n_code, code, 0);
36542        xmlResetLastError();
36543        if (mem_base != xmlMemBlocks()) {
36544            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
36545	           xmlMemBlocks() - mem_base);
36546	    test_ret++;
36547            printf(" %d", n_code);
36548            printf("\n");
36549        }
36550    }
36551    function_tests++;
36552#endif
36553
36554    return(test_ret);
36555}
36556
36557
36558static int
36559test_xmlUCSIsBopomofoExtended(void) {
36560    int test_ret = 0;
36561
36562#if defined(LIBXML_UNICODE_ENABLED)
36563    int mem_base;
36564    int ret_val;
36565    int code; /* UCS code point */
36566    int n_code;
36567
36568    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36569        mem_base = xmlMemBlocks();
36570        code = gen_int(n_code, 0);
36571
36572        ret_val = xmlUCSIsBopomofoExtended(code);
36573        desret_int(ret_val);
36574        call_tests++;
36575        des_int(n_code, code, 0);
36576        xmlResetLastError();
36577        if (mem_base != xmlMemBlocks()) {
36578            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
36579	           xmlMemBlocks() - mem_base);
36580	    test_ret++;
36581            printf(" %d", n_code);
36582            printf("\n");
36583        }
36584    }
36585    function_tests++;
36586#endif
36587
36588    return(test_ret);
36589}
36590
36591
36592static int
36593test_xmlUCSIsBoxDrawing(void) {
36594    int test_ret = 0;
36595
36596#if defined(LIBXML_UNICODE_ENABLED)
36597    int mem_base;
36598    int ret_val;
36599    int code; /* UCS code point */
36600    int n_code;
36601
36602    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36603        mem_base = xmlMemBlocks();
36604        code = gen_int(n_code, 0);
36605
36606        ret_val = xmlUCSIsBoxDrawing(code);
36607        desret_int(ret_val);
36608        call_tests++;
36609        des_int(n_code, code, 0);
36610        xmlResetLastError();
36611        if (mem_base != xmlMemBlocks()) {
36612            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
36613	           xmlMemBlocks() - mem_base);
36614	    test_ret++;
36615            printf(" %d", n_code);
36616            printf("\n");
36617        }
36618    }
36619    function_tests++;
36620#endif
36621
36622    return(test_ret);
36623}
36624
36625
36626static int
36627test_xmlUCSIsBraillePatterns(void) {
36628    int test_ret = 0;
36629
36630#if defined(LIBXML_UNICODE_ENABLED)
36631    int mem_base;
36632    int ret_val;
36633    int code; /* UCS code point */
36634    int n_code;
36635
36636    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36637        mem_base = xmlMemBlocks();
36638        code = gen_int(n_code, 0);
36639
36640        ret_val = xmlUCSIsBraillePatterns(code);
36641        desret_int(ret_val);
36642        call_tests++;
36643        des_int(n_code, code, 0);
36644        xmlResetLastError();
36645        if (mem_base != xmlMemBlocks()) {
36646            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
36647	           xmlMemBlocks() - mem_base);
36648	    test_ret++;
36649            printf(" %d", n_code);
36650            printf("\n");
36651        }
36652    }
36653    function_tests++;
36654#endif
36655
36656    return(test_ret);
36657}
36658
36659
36660static int
36661test_xmlUCSIsBuhid(void) {
36662    int test_ret = 0;
36663
36664#if defined(LIBXML_UNICODE_ENABLED)
36665    int mem_base;
36666    int ret_val;
36667    int code; /* UCS code point */
36668    int n_code;
36669
36670    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36671        mem_base = xmlMemBlocks();
36672        code = gen_int(n_code, 0);
36673
36674        ret_val = xmlUCSIsBuhid(code);
36675        desret_int(ret_val);
36676        call_tests++;
36677        des_int(n_code, code, 0);
36678        xmlResetLastError();
36679        if (mem_base != xmlMemBlocks()) {
36680            printf("Leak of %d blocks found in xmlUCSIsBuhid",
36681	           xmlMemBlocks() - mem_base);
36682	    test_ret++;
36683            printf(" %d", n_code);
36684            printf("\n");
36685        }
36686    }
36687    function_tests++;
36688#endif
36689
36690    return(test_ret);
36691}
36692
36693
36694static int
36695test_xmlUCSIsByzantineMusicalSymbols(void) {
36696    int test_ret = 0;
36697
36698#if defined(LIBXML_UNICODE_ENABLED)
36699    int mem_base;
36700    int ret_val;
36701    int code; /* UCS code point */
36702    int n_code;
36703
36704    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36705        mem_base = xmlMemBlocks();
36706        code = gen_int(n_code, 0);
36707
36708        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
36709        desret_int(ret_val);
36710        call_tests++;
36711        des_int(n_code, code, 0);
36712        xmlResetLastError();
36713        if (mem_base != xmlMemBlocks()) {
36714            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
36715	           xmlMemBlocks() - mem_base);
36716	    test_ret++;
36717            printf(" %d", n_code);
36718            printf("\n");
36719        }
36720    }
36721    function_tests++;
36722#endif
36723
36724    return(test_ret);
36725}
36726
36727
36728static int
36729test_xmlUCSIsCJKCompatibility(void) {
36730    int test_ret = 0;
36731
36732#if defined(LIBXML_UNICODE_ENABLED)
36733    int mem_base;
36734    int ret_val;
36735    int code; /* UCS code point */
36736    int n_code;
36737
36738    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36739        mem_base = xmlMemBlocks();
36740        code = gen_int(n_code, 0);
36741
36742        ret_val = xmlUCSIsCJKCompatibility(code);
36743        desret_int(ret_val);
36744        call_tests++;
36745        des_int(n_code, code, 0);
36746        xmlResetLastError();
36747        if (mem_base != xmlMemBlocks()) {
36748            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
36749	           xmlMemBlocks() - mem_base);
36750	    test_ret++;
36751            printf(" %d", n_code);
36752            printf("\n");
36753        }
36754    }
36755    function_tests++;
36756#endif
36757
36758    return(test_ret);
36759}
36760
36761
36762static int
36763test_xmlUCSIsCJKCompatibilityForms(void) {
36764    int test_ret = 0;
36765
36766#if defined(LIBXML_UNICODE_ENABLED)
36767    int mem_base;
36768    int ret_val;
36769    int code; /* UCS code point */
36770    int n_code;
36771
36772    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36773        mem_base = xmlMemBlocks();
36774        code = gen_int(n_code, 0);
36775
36776        ret_val = xmlUCSIsCJKCompatibilityForms(code);
36777        desret_int(ret_val);
36778        call_tests++;
36779        des_int(n_code, code, 0);
36780        xmlResetLastError();
36781        if (mem_base != xmlMemBlocks()) {
36782            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
36783	           xmlMemBlocks() - mem_base);
36784	    test_ret++;
36785            printf(" %d", n_code);
36786            printf("\n");
36787        }
36788    }
36789    function_tests++;
36790#endif
36791
36792    return(test_ret);
36793}
36794
36795
36796static int
36797test_xmlUCSIsCJKCompatibilityIdeographs(void) {
36798    int test_ret = 0;
36799
36800#if defined(LIBXML_UNICODE_ENABLED)
36801    int mem_base;
36802    int ret_val;
36803    int code; /* UCS code point */
36804    int n_code;
36805
36806    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36807        mem_base = xmlMemBlocks();
36808        code = gen_int(n_code, 0);
36809
36810        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
36811        desret_int(ret_val);
36812        call_tests++;
36813        des_int(n_code, code, 0);
36814        xmlResetLastError();
36815        if (mem_base != xmlMemBlocks()) {
36816            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
36817	           xmlMemBlocks() - mem_base);
36818	    test_ret++;
36819            printf(" %d", n_code);
36820            printf("\n");
36821        }
36822    }
36823    function_tests++;
36824#endif
36825
36826    return(test_ret);
36827}
36828
36829
36830static int
36831test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
36832    int test_ret = 0;
36833
36834#if defined(LIBXML_UNICODE_ENABLED)
36835    int mem_base;
36836    int ret_val;
36837    int code; /* UCS code point */
36838    int n_code;
36839
36840    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36841        mem_base = xmlMemBlocks();
36842        code = gen_int(n_code, 0);
36843
36844        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
36845        desret_int(ret_val);
36846        call_tests++;
36847        des_int(n_code, code, 0);
36848        xmlResetLastError();
36849        if (mem_base != xmlMemBlocks()) {
36850            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
36851	           xmlMemBlocks() - mem_base);
36852	    test_ret++;
36853            printf(" %d", n_code);
36854            printf("\n");
36855        }
36856    }
36857    function_tests++;
36858#endif
36859
36860    return(test_ret);
36861}
36862
36863
36864static int
36865test_xmlUCSIsCJKRadicalsSupplement(void) {
36866    int test_ret = 0;
36867
36868#if defined(LIBXML_UNICODE_ENABLED)
36869    int mem_base;
36870    int ret_val;
36871    int code; /* UCS code point */
36872    int n_code;
36873
36874    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36875        mem_base = xmlMemBlocks();
36876        code = gen_int(n_code, 0);
36877
36878        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
36879        desret_int(ret_val);
36880        call_tests++;
36881        des_int(n_code, code, 0);
36882        xmlResetLastError();
36883        if (mem_base != xmlMemBlocks()) {
36884            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
36885	           xmlMemBlocks() - mem_base);
36886	    test_ret++;
36887            printf(" %d", n_code);
36888            printf("\n");
36889        }
36890    }
36891    function_tests++;
36892#endif
36893
36894    return(test_ret);
36895}
36896
36897
36898static int
36899test_xmlUCSIsCJKSymbolsandPunctuation(void) {
36900    int test_ret = 0;
36901
36902#if defined(LIBXML_UNICODE_ENABLED)
36903    int mem_base;
36904    int ret_val;
36905    int code; /* UCS code point */
36906    int n_code;
36907
36908    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36909        mem_base = xmlMemBlocks();
36910        code = gen_int(n_code, 0);
36911
36912        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
36913        desret_int(ret_val);
36914        call_tests++;
36915        des_int(n_code, code, 0);
36916        xmlResetLastError();
36917        if (mem_base != xmlMemBlocks()) {
36918            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
36919	           xmlMemBlocks() - mem_base);
36920	    test_ret++;
36921            printf(" %d", n_code);
36922            printf("\n");
36923        }
36924    }
36925    function_tests++;
36926#endif
36927
36928    return(test_ret);
36929}
36930
36931
36932static int
36933test_xmlUCSIsCJKUnifiedIdeographs(void) {
36934    int test_ret = 0;
36935
36936#if defined(LIBXML_UNICODE_ENABLED)
36937    int mem_base;
36938    int ret_val;
36939    int code; /* UCS code point */
36940    int n_code;
36941
36942    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36943        mem_base = xmlMemBlocks();
36944        code = gen_int(n_code, 0);
36945
36946        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
36947        desret_int(ret_val);
36948        call_tests++;
36949        des_int(n_code, code, 0);
36950        xmlResetLastError();
36951        if (mem_base != xmlMemBlocks()) {
36952            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
36953	           xmlMemBlocks() - mem_base);
36954	    test_ret++;
36955            printf(" %d", n_code);
36956            printf("\n");
36957        }
36958    }
36959    function_tests++;
36960#endif
36961
36962    return(test_ret);
36963}
36964
36965
36966static int
36967test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
36968    int test_ret = 0;
36969
36970#if defined(LIBXML_UNICODE_ENABLED)
36971    int mem_base;
36972    int ret_val;
36973    int code; /* UCS code point */
36974    int n_code;
36975
36976    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36977        mem_base = xmlMemBlocks();
36978        code = gen_int(n_code, 0);
36979
36980        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
36981        desret_int(ret_val);
36982        call_tests++;
36983        des_int(n_code, code, 0);
36984        xmlResetLastError();
36985        if (mem_base != xmlMemBlocks()) {
36986            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
36987	           xmlMemBlocks() - mem_base);
36988	    test_ret++;
36989            printf(" %d", n_code);
36990            printf("\n");
36991        }
36992    }
36993    function_tests++;
36994#endif
36995
36996    return(test_ret);
36997}
36998
36999
37000static int
37001test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37002    int test_ret = 0;
37003
37004#if defined(LIBXML_UNICODE_ENABLED)
37005    int mem_base;
37006    int ret_val;
37007    int code; /* UCS code point */
37008    int n_code;
37009
37010    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37011        mem_base = xmlMemBlocks();
37012        code = gen_int(n_code, 0);
37013
37014        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37015        desret_int(ret_val);
37016        call_tests++;
37017        des_int(n_code, code, 0);
37018        xmlResetLastError();
37019        if (mem_base != xmlMemBlocks()) {
37020            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37021	           xmlMemBlocks() - mem_base);
37022	    test_ret++;
37023            printf(" %d", n_code);
37024            printf("\n");
37025        }
37026    }
37027    function_tests++;
37028#endif
37029
37030    return(test_ret);
37031}
37032
37033
37034static int
37035test_xmlUCSIsCat(void) {
37036    int test_ret = 0;
37037
37038#if defined(LIBXML_UNICODE_ENABLED)
37039    int mem_base;
37040    int ret_val;
37041    int code; /* UCS code point */
37042    int n_code;
37043    char * cat; /* UCS Category name */
37044    int n_cat;
37045
37046    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37047    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37048        mem_base = xmlMemBlocks();
37049        code = gen_int(n_code, 0);
37050        cat = gen_const_char_ptr(n_cat, 1);
37051
37052        ret_val = xmlUCSIsCat(code, (const char *)cat);
37053        desret_int(ret_val);
37054        call_tests++;
37055        des_int(n_code, code, 0);
37056        des_const_char_ptr(n_cat, (const char *)cat, 1);
37057        xmlResetLastError();
37058        if (mem_base != xmlMemBlocks()) {
37059            printf("Leak of %d blocks found in xmlUCSIsCat",
37060	           xmlMemBlocks() - mem_base);
37061	    test_ret++;
37062            printf(" %d", n_code);
37063            printf(" %d", n_cat);
37064            printf("\n");
37065        }
37066    }
37067    }
37068    function_tests++;
37069#endif
37070
37071    return(test_ret);
37072}
37073
37074
37075static int
37076test_xmlUCSIsCatC(void) {
37077    int test_ret = 0;
37078
37079#if defined(LIBXML_UNICODE_ENABLED)
37080    int mem_base;
37081    int ret_val;
37082    int code; /* UCS code point */
37083    int n_code;
37084
37085    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37086        mem_base = xmlMemBlocks();
37087        code = gen_int(n_code, 0);
37088
37089        ret_val = xmlUCSIsCatC(code);
37090        desret_int(ret_val);
37091        call_tests++;
37092        des_int(n_code, code, 0);
37093        xmlResetLastError();
37094        if (mem_base != xmlMemBlocks()) {
37095            printf("Leak of %d blocks found in xmlUCSIsCatC",
37096	           xmlMemBlocks() - mem_base);
37097	    test_ret++;
37098            printf(" %d", n_code);
37099            printf("\n");
37100        }
37101    }
37102    function_tests++;
37103#endif
37104
37105    return(test_ret);
37106}
37107
37108
37109static int
37110test_xmlUCSIsCatCc(void) {
37111    int test_ret = 0;
37112
37113#if defined(LIBXML_UNICODE_ENABLED)
37114    int mem_base;
37115    int ret_val;
37116    int code; /* UCS code point */
37117    int n_code;
37118
37119    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37120        mem_base = xmlMemBlocks();
37121        code = gen_int(n_code, 0);
37122
37123        ret_val = xmlUCSIsCatCc(code);
37124        desret_int(ret_val);
37125        call_tests++;
37126        des_int(n_code, code, 0);
37127        xmlResetLastError();
37128        if (mem_base != xmlMemBlocks()) {
37129            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37130	           xmlMemBlocks() - mem_base);
37131	    test_ret++;
37132            printf(" %d", n_code);
37133            printf("\n");
37134        }
37135    }
37136    function_tests++;
37137#endif
37138
37139    return(test_ret);
37140}
37141
37142
37143static int
37144test_xmlUCSIsCatCf(void) {
37145    int test_ret = 0;
37146
37147#if defined(LIBXML_UNICODE_ENABLED)
37148    int mem_base;
37149    int ret_val;
37150    int code; /* UCS code point */
37151    int n_code;
37152
37153    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37154        mem_base = xmlMemBlocks();
37155        code = gen_int(n_code, 0);
37156
37157        ret_val = xmlUCSIsCatCf(code);
37158        desret_int(ret_val);
37159        call_tests++;
37160        des_int(n_code, code, 0);
37161        xmlResetLastError();
37162        if (mem_base != xmlMemBlocks()) {
37163            printf("Leak of %d blocks found in xmlUCSIsCatCf",
37164	           xmlMemBlocks() - mem_base);
37165	    test_ret++;
37166            printf(" %d", n_code);
37167            printf("\n");
37168        }
37169    }
37170    function_tests++;
37171#endif
37172
37173    return(test_ret);
37174}
37175
37176
37177static int
37178test_xmlUCSIsCatCo(void) {
37179    int test_ret = 0;
37180
37181#if defined(LIBXML_UNICODE_ENABLED)
37182    int mem_base;
37183    int ret_val;
37184    int code; /* UCS code point */
37185    int n_code;
37186
37187    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37188        mem_base = xmlMemBlocks();
37189        code = gen_int(n_code, 0);
37190
37191        ret_val = xmlUCSIsCatCo(code);
37192        desret_int(ret_val);
37193        call_tests++;
37194        des_int(n_code, code, 0);
37195        xmlResetLastError();
37196        if (mem_base != xmlMemBlocks()) {
37197            printf("Leak of %d blocks found in xmlUCSIsCatCo",
37198	           xmlMemBlocks() - mem_base);
37199	    test_ret++;
37200            printf(" %d", n_code);
37201            printf("\n");
37202        }
37203    }
37204    function_tests++;
37205#endif
37206
37207    return(test_ret);
37208}
37209
37210
37211static int
37212test_xmlUCSIsCatCs(void) {
37213    int test_ret = 0;
37214
37215#if defined(LIBXML_UNICODE_ENABLED)
37216    int mem_base;
37217    int ret_val;
37218    int code; /* UCS code point */
37219    int n_code;
37220
37221    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37222        mem_base = xmlMemBlocks();
37223        code = gen_int(n_code, 0);
37224
37225        ret_val = xmlUCSIsCatCs(code);
37226        desret_int(ret_val);
37227        call_tests++;
37228        des_int(n_code, code, 0);
37229        xmlResetLastError();
37230        if (mem_base != xmlMemBlocks()) {
37231            printf("Leak of %d blocks found in xmlUCSIsCatCs",
37232	           xmlMemBlocks() - mem_base);
37233	    test_ret++;
37234            printf(" %d", n_code);
37235            printf("\n");
37236        }
37237    }
37238    function_tests++;
37239#endif
37240
37241    return(test_ret);
37242}
37243
37244
37245static int
37246test_xmlUCSIsCatL(void) {
37247    int test_ret = 0;
37248
37249#if defined(LIBXML_UNICODE_ENABLED)
37250    int mem_base;
37251    int ret_val;
37252    int code; /* UCS code point */
37253    int n_code;
37254
37255    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37256        mem_base = xmlMemBlocks();
37257        code = gen_int(n_code, 0);
37258
37259        ret_val = xmlUCSIsCatL(code);
37260        desret_int(ret_val);
37261        call_tests++;
37262        des_int(n_code, code, 0);
37263        xmlResetLastError();
37264        if (mem_base != xmlMemBlocks()) {
37265            printf("Leak of %d blocks found in xmlUCSIsCatL",
37266	           xmlMemBlocks() - mem_base);
37267	    test_ret++;
37268            printf(" %d", n_code);
37269            printf("\n");
37270        }
37271    }
37272    function_tests++;
37273#endif
37274
37275    return(test_ret);
37276}
37277
37278
37279static int
37280test_xmlUCSIsCatLl(void) {
37281    int test_ret = 0;
37282
37283#if defined(LIBXML_UNICODE_ENABLED)
37284    int mem_base;
37285    int ret_val;
37286    int code; /* UCS code point */
37287    int n_code;
37288
37289    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37290        mem_base = xmlMemBlocks();
37291        code = gen_int(n_code, 0);
37292
37293        ret_val = xmlUCSIsCatLl(code);
37294        desret_int(ret_val);
37295        call_tests++;
37296        des_int(n_code, code, 0);
37297        xmlResetLastError();
37298        if (mem_base != xmlMemBlocks()) {
37299            printf("Leak of %d blocks found in xmlUCSIsCatLl",
37300	           xmlMemBlocks() - mem_base);
37301	    test_ret++;
37302            printf(" %d", n_code);
37303            printf("\n");
37304        }
37305    }
37306    function_tests++;
37307#endif
37308
37309    return(test_ret);
37310}
37311
37312
37313static int
37314test_xmlUCSIsCatLm(void) {
37315    int test_ret = 0;
37316
37317#if defined(LIBXML_UNICODE_ENABLED)
37318    int mem_base;
37319    int ret_val;
37320    int code; /* UCS code point */
37321    int n_code;
37322
37323    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37324        mem_base = xmlMemBlocks();
37325        code = gen_int(n_code, 0);
37326
37327        ret_val = xmlUCSIsCatLm(code);
37328        desret_int(ret_val);
37329        call_tests++;
37330        des_int(n_code, code, 0);
37331        xmlResetLastError();
37332        if (mem_base != xmlMemBlocks()) {
37333            printf("Leak of %d blocks found in xmlUCSIsCatLm",
37334	           xmlMemBlocks() - mem_base);
37335	    test_ret++;
37336            printf(" %d", n_code);
37337            printf("\n");
37338        }
37339    }
37340    function_tests++;
37341#endif
37342
37343    return(test_ret);
37344}
37345
37346
37347static int
37348test_xmlUCSIsCatLo(void) {
37349    int test_ret = 0;
37350
37351#if defined(LIBXML_UNICODE_ENABLED)
37352    int mem_base;
37353    int ret_val;
37354    int code; /* UCS code point */
37355    int n_code;
37356
37357    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37358        mem_base = xmlMemBlocks();
37359        code = gen_int(n_code, 0);
37360
37361        ret_val = xmlUCSIsCatLo(code);
37362        desret_int(ret_val);
37363        call_tests++;
37364        des_int(n_code, code, 0);
37365        xmlResetLastError();
37366        if (mem_base != xmlMemBlocks()) {
37367            printf("Leak of %d blocks found in xmlUCSIsCatLo",
37368	           xmlMemBlocks() - mem_base);
37369	    test_ret++;
37370            printf(" %d", n_code);
37371            printf("\n");
37372        }
37373    }
37374    function_tests++;
37375#endif
37376
37377    return(test_ret);
37378}
37379
37380
37381static int
37382test_xmlUCSIsCatLt(void) {
37383    int test_ret = 0;
37384
37385#if defined(LIBXML_UNICODE_ENABLED)
37386    int mem_base;
37387    int ret_val;
37388    int code; /* UCS code point */
37389    int n_code;
37390
37391    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37392        mem_base = xmlMemBlocks();
37393        code = gen_int(n_code, 0);
37394
37395        ret_val = xmlUCSIsCatLt(code);
37396        desret_int(ret_val);
37397        call_tests++;
37398        des_int(n_code, code, 0);
37399        xmlResetLastError();
37400        if (mem_base != xmlMemBlocks()) {
37401            printf("Leak of %d blocks found in xmlUCSIsCatLt",
37402	           xmlMemBlocks() - mem_base);
37403	    test_ret++;
37404            printf(" %d", n_code);
37405            printf("\n");
37406        }
37407    }
37408    function_tests++;
37409#endif
37410
37411    return(test_ret);
37412}
37413
37414
37415static int
37416test_xmlUCSIsCatLu(void) {
37417    int test_ret = 0;
37418
37419#if defined(LIBXML_UNICODE_ENABLED)
37420    int mem_base;
37421    int ret_val;
37422    int code; /* UCS code point */
37423    int n_code;
37424
37425    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37426        mem_base = xmlMemBlocks();
37427        code = gen_int(n_code, 0);
37428
37429        ret_val = xmlUCSIsCatLu(code);
37430        desret_int(ret_val);
37431        call_tests++;
37432        des_int(n_code, code, 0);
37433        xmlResetLastError();
37434        if (mem_base != xmlMemBlocks()) {
37435            printf("Leak of %d blocks found in xmlUCSIsCatLu",
37436	           xmlMemBlocks() - mem_base);
37437	    test_ret++;
37438            printf(" %d", n_code);
37439            printf("\n");
37440        }
37441    }
37442    function_tests++;
37443#endif
37444
37445    return(test_ret);
37446}
37447
37448
37449static int
37450test_xmlUCSIsCatM(void) {
37451    int test_ret = 0;
37452
37453#if defined(LIBXML_UNICODE_ENABLED)
37454    int mem_base;
37455    int ret_val;
37456    int code; /* UCS code point */
37457    int n_code;
37458
37459    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37460        mem_base = xmlMemBlocks();
37461        code = gen_int(n_code, 0);
37462
37463        ret_val = xmlUCSIsCatM(code);
37464        desret_int(ret_val);
37465        call_tests++;
37466        des_int(n_code, code, 0);
37467        xmlResetLastError();
37468        if (mem_base != xmlMemBlocks()) {
37469            printf("Leak of %d blocks found in xmlUCSIsCatM",
37470	           xmlMemBlocks() - mem_base);
37471	    test_ret++;
37472            printf(" %d", n_code);
37473            printf("\n");
37474        }
37475    }
37476    function_tests++;
37477#endif
37478
37479    return(test_ret);
37480}
37481
37482
37483static int
37484test_xmlUCSIsCatMc(void) {
37485    int test_ret = 0;
37486
37487#if defined(LIBXML_UNICODE_ENABLED)
37488    int mem_base;
37489    int ret_val;
37490    int code; /* UCS code point */
37491    int n_code;
37492
37493    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37494        mem_base = xmlMemBlocks();
37495        code = gen_int(n_code, 0);
37496
37497        ret_val = xmlUCSIsCatMc(code);
37498        desret_int(ret_val);
37499        call_tests++;
37500        des_int(n_code, code, 0);
37501        xmlResetLastError();
37502        if (mem_base != xmlMemBlocks()) {
37503            printf("Leak of %d blocks found in xmlUCSIsCatMc",
37504	           xmlMemBlocks() - mem_base);
37505	    test_ret++;
37506            printf(" %d", n_code);
37507            printf("\n");
37508        }
37509    }
37510    function_tests++;
37511#endif
37512
37513    return(test_ret);
37514}
37515
37516
37517static int
37518test_xmlUCSIsCatMe(void) {
37519    int test_ret = 0;
37520
37521#if defined(LIBXML_UNICODE_ENABLED)
37522    int mem_base;
37523    int ret_val;
37524    int code; /* UCS code point */
37525    int n_code;
37526
37527    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37528        mem_base = xmlMemBlocks();
37529        code = gen_int(n_code, 0);
37530
37531        ret_val = xmlUCSIsCatMe(code);
37532        desret_int(ret_val);
37533        call_tests++;
37534        des_int(n_code, code, 0);
37535        xmlResetLastError();
37536        if (mem_base != xmlMemBlocks()) {
37537            printf("Leak of %d blocks found in xmlUCSIsCatMe",
37538	           xmlMemBlocks() - mem_base);
37539	    test_ret++;
37540            printf(" %d", n_code);
37541            printf("\n");
37542        }
37543    }
37544    function_tests++;
37545#endif
37546
37547    return(test_ret);
37548}
37549
37550
37551static int
37552test_xmlUCSIsCatMn(void) {
37553    int test_ret = 0;
37554
37555#if defined(LIBXML_UNICODE_ENABLED)
37556    int mem_base;
37557    int ret_val;
37558    int code; /* UCS code point */
37559    int n_code;
37560
37561    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37562        mem_base = xmlMemBlocks();
37563        code = gen_int(n_code, 0);
37564
37565        ret_val = xmlUCSIsCatMn(code);
37566        desret_int(ret_val);
37567        call_tests++;
37568        des_int(n_code, code, 0);
37569        xmlResetLastError();
37570        if (mem_base != xmlMemBlocks()) {
37571            printf("Leak of %d blocks found in xmlUCSIsCatMn",
37572	           xmlMemBlocks() - mem_base);
37573	    test_ret++;
37574            printf(" %d", n_code);
37575            printf("\n");
37576        }
37577    }
37578    function_tests++;
37579#endif
37580
37581    return(test_ret);
37582}
37583
37584
37585static int
37586test_xmlUCSIsCatN(void) {
37587    int test_ret = 0;
37588
37589#if defined(LIBXML_UNICODE_ENABLED)
37590    int mem_base;
37591    int ret_val;
37592    int code; /* UCS code point */
37593    int n_code;
37594
37595    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37596        mem_base = xmlMemBlocks();
37597        code = gen_int(n_code, 0);
37598
37599        ret_val = xmlUCSIsCatN(code);
37600        desret_int(ret_val);
37601        call_tests++;
37602        des_int(n_code, code, 0);
37603        xmlResetLastError();
37604        if (mem_base != xmlMemBlocks()) {
37605            printf("Leak of %d blocks found in xmlUCSIsCatN",
37606	           xmlMemBlocks() - mem_base);
37607	    test_ret++;
37608            printf(" %d", n_code);
37609            printf("\n");
37610        }
37611    }
37612    function_tests++;
37613#endif
37614
37615    return(test_ret);
37616}
37617
37618
37619static int
37620test_xmlUCSIsCatNd(void) {
37621    int test_ret = 0;
37622
37623#if defined(LIBXML_UNICODE_ENABLED)
37624    int mem_base;
37625    int ret_val;
37626    int code; /* UCS code point */
37627    int n_code;
37628
37629    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37630        mem_base = xmlMemBlocks();
37631        code = gen_int(n_code, 0);
37632
37633        ret_val = xmlUCSIsCatNd(code);
37634        desret_int(ret_val);
37635        call_tests++;
37636        des_int(n_code, code, 0);
37637        xmlResetLastError();
37638        if (mem_base != xmlMemBlocks()) {
37639            printf("Leak of %d blocks found in xmlUCSIsCatNd",
37640	           xmlMemBlocks() - mem_base);
37641	    test_ret++;
37642            printf(" %d", n_code);
37643            printf("\n");
37644        }
37645    }
37646    function_tests++;
37647#endif
37648
37649    return(test_ret);
37650}
37651
37652
37653static int
37654test_xmlUCSIsCatNl(void) {
37655    int test_ret = 0;
37656
37657#if defined(LIBXML_UNICODE_ENABLED)
37658    int mem_base;
37659    int ret_val;
37660    int code; /* UCS code point */
37661    int n_code;
37662
37663    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37664        mem_base = xmlMemBlocks();
37665        code = gen_int(n_code, 0);
37666
37667        ret_val = xmlUCSIsCatNl(code);
37668        desret_int(ret_val);
37669        call_tests++;
37670        des_int(n_code, code, 0);
37671        xmlResetLastError();
37672        if (mem_base != xmlMemBlocks()) {
37673            printf("Leak of %d blocks found in xmlUCSIsCatNl",
37674	           xmlMemBlocks() - mem_base);
37675	    test_ret++;
37676            printf(" %d", n_code);
37677            printf("\n");
37678        }
37679    }
37680    function_tests++;
37681#endif
37682
37683    return(test_ret);
37684}
37685
37686
37687static int
37688test_xmlUCSIsCatNo(void) {
37689    int test_ret = 0;
37690
37691#if defined(LIBXML_UNICODE_ENABLED)
37692    int mem_base;
37693    int ret_val;
37694    int code; /* UCS code point */
37695    int n_code;
37696
37697    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37698        mem_base = xmlMemBlocks();
37699        code = gen_int(n_code, 0);
37700
37701        ret_val = xmlUCSIsCatNo(code);
37702        desret_int(ret_val);
37703        call_tests++;
37704        des_int(n_code, code, 0);
37705        xmlResetLastError();
37706        if (mem_base != xmlMemBlocks()) {
37707            printf("Leak of %d blocks found in xmlUCSIsCatNo",
37708	           xmlMemBlocks() - mem_base);
37709	    test_ret++;
37710            printf(" %d", n_code);
37711            printf("\n");
37712        }
37713    }
37714    function_tests++;
37715#endif
37716
37717    return(test_ret);
37718}
37719
37720
37721static int
37722test_xmlUCSIsCatP(void) {
37723    int test_ret = 0;
37724
37725#if defined(LIBXML_UNICODE_ENABLED)
37726    int mem_base;
37727    int ret_val;
37728    int code; /* UCS code point */
37729    int n_code;
37730
37731    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37732        mem_base = xmlMemBlocks();
37733        code = gen_int(n_code, 0);
37734
37735        ret_val = xmlUCSIsCatP(code);
37736        desret_int(ret_val);
37737        call_tests++;
37738        des_int(n_code, code, 0);
37739        xmlResetLastError();
37740        if (mem_base != xmlMemBlocks()) {
37741            printf("Leak of %d blocks found in xmlUCSIsCatP",
37742	           xmlMemBlocks() - mem_base);
37743	    test_ret++;
37744            printf(" %d", n_code);
37745            printf("\n");
37746        }
37747    }
37748    function_tests++;
37749#endif
37750
37751    return(test_ret);
37752}
37753
37754
37755static int
37756test_xmlUCSIsCatPc(void) {
37757    int test_ret = 0;
37758
37759#if defined(LIBXML_UNICODE_ENABLED)
37760    int mem_base;
37761    int ret_val;
37762    int code; /* UCS code point */
37763    int n_code;
37764
37765    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37766        mem_base = xmlMemBlocks();
37767        code = gen_int(n_code, 0);
37768
37769        ret_val = xmlUCSIsCatPc(code);
37770        desret_int(ret_val);
37771        call_tests++;
37772        des_int(n_code, code, 0);
37773        xmlResetLastError();
37774        if (mem_base != xmlMemBlocks()) {
37775            printf("Leak of %d blocks found in xmlUCSIsCatPc",
37776	           xmlMemBlocks() - mem_base);
37777	    test_ret++;
37778            printf(" %d", n_code);
37779            printf("\n");
37780        }
37781    }
37782    function_tests++;
37783#endif
37784
37785    return(test_ret);
37786}
37787
37788
37789static int
37790test_xmlUCSIsCatPd(void) {
37791    int test_ret = 0;
37792
37793#if defined(LIBXML_UNICODE_ENABLED)
37794    int mem_base;
37795    int ret_val;
37796    int code; /* UCS code point */
37797    int n_code;
37798
37799    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37800        mem_base = xmlMemBlocks();
37801        code = gen_int(n_code, 0);
37802
37803        ret_val = xmlUCSIsCatPd(code);
37804        desret_int(ret_val);
37805        call_tests++;
37806        des_int(n_code, code, 0);
37807        xmlResetLastError();
37808        if (mem_base != xmlMemBlocks()) {
37809            printf("Leak of %d blocks found in xmlUCSIsCatPd",
37810	           xmlMemBlocks() - mem_base);
37811	    test_ret++;
37812            printf(" %d", n_code);
37813            printf("\n");
37814        }
37815    }
37816    function_tests++;
37817#endif
37818
37819    return(test_ret);
37820}
37821
37822
37823static int
37824test_xmlUCSIsCatPe(void) {
37825    int test_ret = 0;
37826
37827#if defined(LIBXML_UNICODE_ENABLED)
37828    int mem_base;
37829    int ret_val;
37830    int code; /* UCS code point */
37831    int n_code;
37832
37833    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37834        mem_base = xmlMemBlocks();
37835        code = gen_int(n_code, 0);
37836
37837        ret_val = xmlUCSIsCatPe(code);
37838        desret_int(ret_val);
37839        call_tests++;
37840        des_int(n_code, code, 0);
37841        xmlResetLastError();
37842        if (mem_base != xmlMemBlocks()) {
37843            printf("Leak of %d blocks found in xmlUCSIsCatPe",
37844	           xmlMemBlocks() - mem_base);
37845	    test_ret++;
37846            printf(" %d", n_code);
37847            printf("\n");
37848        }
37849    }
37850    function_tests++;
37851#endif
37852
37853    return(test_ret);
37854}
37855
37856
37857static int
37858test_xmlUCSIsCatPf(void) {
37859    int test_ret = 0;
37860
37861#if defined(LIBXML_UNICODE_ENABLED)
37862    int mem_base;
37863    int ret_val;
37864    int code; /* UCS code point */
37865    int n_code;
37866
37867    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37868        mem_base = xmlMemBlocks();
37869        code = gen_int(n_code, 0);
37870
37871        ret_val = xmlUCSIsCatPf(code);
37872        desret_int(ret_val);
37873        call_tests++;
37874        des_int(n_code, code, 0);
37875        xmlResetLastError();
37876        if (mem_base != xmlMemBlocks()) {
37877            printf("Leak of %d blocks found in xmlUCSIsCatPf",
37878	           xmlMemBlocks() - mem_base);
37879	    test_ret++;
37880            printf(" %d", n_code);
37881            printf("\n");
37882        }
37883    }
37884    function_tests++;
37885#endif
37886
37887    return(test_ret);
37888}
37889
37890
37891static int
37892test_xmlUCSIsCatPi(void) {
37893    int test_ret = 0;
37894
37895#if defined(LIBXML_UNICODE_ENABLED)
37896    int mem_base;
37897    int ret_val;
37898    int code; /* UCS code point */
37899    int n_code;
37900
37901    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37902        mem_base = xmlMemBlocks();
37903        code = gen_int(n_code, 0);
37904
37905        ret_val = xmlUCSIsCatPi(code);
37906        desret_int(ret_val);
37907        call_tests++;
37908        des_int(n_code, code, 0);
37909        xmlResetLastError();
37910        if (mem_base != xmlMemBlocks()) {
37911            printf("Leak of %d blocks found in xmlUCSIsCatPi",
37912	           xmlMemBlocks() - mem_base);
37913	    test_ret++;
37914            printf(" %d", n_code);
37915            printf("\n");
37916        }
37917    }
37918    function_tests++;
37919#endif
37920
37921    return(test_ret);
37922}
37923
37924
37925static int
37926test_xmlUCSIsCatPo(void) {
37927    int test_ret = 0;
37928
37929#if defined(LIBXML_UNICODE_ENABLED)
37930    int mem_base;
37931    int ret_val;
37932    int code; /* UCS code point */
37933    int n_code;
37934
37935    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37936        mem_base = xmlMemBlocks();
37937        code = gen_int(n_code, 0);
37938
37939        ret_val = xmlUCSIsCatPo(code);
37940        desret_int(ret_val);
37941        call_tests++;
37942        des_int(n_code, code, 0);
37943        xmlResetLastError();
37944        if (mem_base != xmlMemBlocks()) {
37945            printf("Leak of %d blocks found in xmlUCSIsCatPo",
37946	           xmlMemBlocks() - mem_base);
37947	    test_ret++;
37948            printf(" %d", n_code);
37949            printf("\n");
37950        }
37951    }
37952    function_tests++;
37953#endif
37954
37955    return(test_ret);
37956}
37957
37958
37959static int
37960test_xmlUCSIsCatPs(void) {
37961    int test_ret = 0;
37962
37963#if defined(LIBXML_UNICODE_ENABLED)
37964    int mem_base;
37965    int ret_val;
37966    int code; /* UCS code point */
37967    int n_code;
37968
37969    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37970        mem_base = xmlMemBlocks();
37971        code = gen_int(n_code, 0);
37972
37973        ret_val = xmlUCSIsCatPs(code);
37974        desret_int(ret_val);
37975        call_tests++;
37976        des_int(n_code, code, 0);
37977        xmlResetLastError();
37978        if (mem_base != xmlMemBlocks()) {
37979            printf("Leak of %d blocks found in xmlUCSIsCatPs",
37980	           xmlMemBlocks() - mem_base);
37981	    test_ret++;
37982            printf(" %d", n_code);
37983            printf("\n");
37984        }
37985    }
37986    function_tests++;
37987#endif
37988
37989    return(test_ret);
37990}
37991
37992
37993static int
37994test_xmlUCSIsCatS(void) {
37995    int test_ret = 0;
37996
37997#if defined(LIBXML_UNICODE_ENABLED)
37998    int mem_base;
37999    int ret_val;
38000    int code; /* UCS code point */
38001    int n_code;
38002
38003    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38004        mem_base = xmlMemBlocks();
38005        code = gen_int(n_code, 0);
38006
38007        ret_val = xmlUCSIsCatS(code);
38008        desret_int(ret_val);
38009        call_tests++;
38010        des_int(n_code, code, 0);
38011        xmlResetLastError();
38012        if (mem_base != xmlMemBlocks()) {
38013            printf("Leak of %d blocks found in xmlUCSIsCatS",
38014	           xmlMemBlocks() - mem_base);
38015	    test_ret++;
38016            printf(" %d", n_code);
38017            printf("\n");
38018        }
38019    }
38020    function_tests++;
38021#endif
38022
38023    return(test_ret);
38024}
38025
38026
38027static int
38028test_xmlUCSIsCatSc(void) {
38029    int test_ret = 0;
38030
38031#if defined(LIBXML_UNICODE_ENABLED)
38032    int mem_base;
38033    int ret_val;
38034    int code; /* UCS code point */
38035    int n_code;
38036
38037    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38038        mem_base = xmlMemBlocks();
38039        code = gen_int(n_code, 0);
38040
38041        ret_val = xmlUCSIsCatSc(code);
38042        desret_int(ret_val);
38043        call_tests++;
38044        des_int(n_code, code, 0);
38045        xmlResetLastError();
38046        if (mem_base != xmlMemBlocks()) {
38047            printf("Leak of %d blocks found in xmlUCSIsCatSc",
38048	           xmlMemBlocks() - mem_base);
38049	    test_ret++;
38050            printf(" %d", n_code);
38051            printf("\n");
38052        }
38053    }
38054    function_tests++;
38055#endif
38056
38057    return(test_ret);
38058}
38059
38060
38061static int
38062test_xmlUCSIsCatSk(void) {
38063    int test_ret = 0;
38064
38065#if defined(LIBXML_UNICODE_ENABLED)
38066    int mem_base;
38067    int ret_val;
38068    int code; /* UCS code point */
38069    int n_code;
38070
38071    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38072        mem_base = xmlMemBlocks();
38073        code = gen_int(n_code, 0);
38074
38075        ret_val = xmlUCSIsCatSk(code);
38076        desret_int(ret_val);
38077        call_tests++;
38078        des_int(n_code, code, 0);
38079        xmlResetLastError();
38080        if (mem_base != xmlMemBlocks()) {
38081            printf("Leak of %d blocks found in xmlUCSIsCatSk",
38082	           xmlMemBlocks() - mem_base);
38083	    test_ret++;
38084            printf(" %d", n_code);
38085            printf("\n");
38086        }
38087    }
38088    function_tests++;
38089#endif
38090
38091    return(test_ret);
38092}
38093
38094
38095static int
38096test_xmlUCSIsCatSm(void) {
38097    int test_ret = 0;
38098
38099#if defined(LIBXML_UNICODE_ENABLED)
38100    int mem_base;
38101    int ret_val;
38102    int code; /* UCS code point */
38103    int n_code;
38104
38105    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38106        mem_base = xmlMemBlocks();
38107        code = gen_int(n_code, 0);
38108
38109        ret_val = xmlUCSIsCatSm(code);
38110        desret_int(ret_val);
38111        call_tests++;
38112        des_int(n_code, code, 0);
38113        xmlResetLastError();
38114        if (mem_base != xmlMemBlocks()) {
38115            printf("Leak of %d blocks found in xmlUCSIsCatSm",
38116	           xmlMemBlocks() - mem_base);
38117	    test_ret++;
38118            printf(" %d", n_code);
38119            printf("\n");
38120        }
38121    }
38122    function_tests++;
38123#endif
38124
38125    return(test_ret);
38126}
38127
38128
38129static int
38130test_xmlUCSIsCatSo(void) {
38131    int test_ret = 0;
38132
38133#if defined(LIBXML_UNICODE_ENABLED)
38134    int mem_base;
38135    int ret_val;
38136    int code; /* UCS code point */
38137    int n_code;
38138
38139    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38140        mem_base = xmlMemBlocks();
38141        code = gen_int(n_code, 0);
38142
38143        ret_val = xmlUCSIsCatSo(code);
38144        desret_int(ret_val);
38145        call_tests++;
38146        des_int(n_code, code, 0);
38147        xmlResetLastError();
38148        if (mem_base != xmlMemBlocks()) {
38149            printf("Leak of %d blocks found in xmlUCSIsCatSo",
38150	           xmlMemBlocks() - mem_base);
38151	    test_ret++;
38152            printf(" %d", n_code);
38153            printf("\n");
38154        }
38155    }
38156    function_tests++;
38157#endif
38158
38159    return(test_ret);
38160}
38161
38162
38163static int
38164test_xmlUCSIsCatZ(void) {
38165    int test_ret = 0;
38166
38167#if defined(LIBXML_UNICODE_ENABLED)
38168    int mem_base;
38169    int ret_val;
38170    int code; /* UCS code point */
38171    int n_code;
38172
38173    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38174        mem_base = xmlMemBlocks();
38175        code = gen_int(n_code, 0);
38176
38177        ret_val = xmlUCSIsCatZ(code);
38178        desret_int(ret_val);
38179        call_tests++;
38180        des_int(n_code, code, 0);
38181        xmlResetLastError();
38182        if (mem_base != xmlMemBlocks()) {
38183            printf("Leak of %d blocks found in xmlUCSIsCatZ",
38184	           xmlMemBlocks() - mem_base);
38185	    test_ret++;
38186            printf(" %d", n_code);
38187            printf("\n");
38188        }
38189    }
38190    function_tests++;
38191#endif
38192
38193    return(test_ret);
38194}
38195
38196
38197static int
38198test_xmlUCSIsCatZl(void) {
38199    int test_ret = 0;
38200
38201#if defined(LIBXML_UNICODE_ENABLED)
38202    int mem_base;
38203    int ret_val;
38204    int code; /* UCS code point */
38205    int n_code;
38206
38207    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38208        mem_base = xmlMemBlocks();
38209        code = gen_int(n_code, 0);
38210
38211        ret_val = xmlUCSIsCatZl(code);
38212        desret_int(ret_val);
38213        call_tests++;
38214        des_int(n_code, code, 0);
38215        xmlResetLastError();
38216        if (mem_base != xmlMemBlocks()) {
38217            printf("Leak of %d blocks found in xmlUCSIsCatZl",
38218	           xmlMemBlocks() - mem_base);
38219	    test_ret++;
38220            printf(" %d", n_code);
38221            printf("\n");
38222        }
38223    }
38224    function_tests++;
38225#endif
38226
38227    return(test_ret);
38228}
38229
38230
38231static int
38232test_xmlUCSIsCatZp(void) {
38233    int test_ret = 0;
38234
38235#if defined(LIBXML_UNICODE_ENABLED)
38236    int mem_base;
38237    int ret_val;
38238    int code; /* UCS code point */
38239    int n_code;
38240
38241    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38242        mem_base = xmlMemBlocks();
38243        code = gen_int(n_code, 0);
38244
38245        ret_val = xmlUCSIsCatZp(code);
38246        desret_int(ret_val);
38247        call_tests++;
38248        des_int(n_code, code, 0);
38249        xmlResetLastError();
38250        if (mem_base != xmlMemBlocks()) {
38251            printf("Leak of %d blocks found in xmlUCSIsCatZp",
38252	           xmlMemBlocks() - mem_base);
38253	    test_ret++;
38254            printf(" %d", n_code);
38255            printf("\n");
38256        }
38257    }
38258    function_tests++;
38259#endif
38260
38261    return(test_ret);
38262}
38263
38264
38265static int
38266test_xmlUCSIsCatZs(void) {
38267    int test_ret = 0;
38268
38269#if defined(LIBXML_UNICODE_ENABLED)
38270    int mem_base;
38271    int ret_val;
38272    int code; /* UCS code point */
38273    int n_code;
38274
38275    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38276        mem_base = xmlMemBlocks();
38277        code = gen_int(n_code, 0);
38278
38279        ret_val = xmlUCSIsCatZs(code);
38280        desret_int(ret_val);
38281        call_tests++;
38282        des_int(n_code, code, 0);
38283        xmlResetLastError();
38284        if (mem_base != xmlMemBlocks()) {
38285            printf("Leak of %d blocks found in xmlUCSIsCatZs",
38286	           xmlMemBlocks() - mem_base);
38287	    test_ret++;
38288            printf(" %d", n_code);
38289            printf("\n");
38290        }
38291    }
38292    function_tests++;
38293#endif
38294
38295    return(test_ret);
38296}
38297
38298
38299static int
38300test_xmlUCSIsCherokee(void) {
38301    int test_ret = 0;
38302
38303#if defined(LIBXML_UNICODE_ENABLED)
38304    int mem_base;
38305    int ret_val;
38306    int code; /* UCS code point */
38307    int n_code;
38308
38309    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38310        mem_base = xmlMemBlocks();
38311        code = gen_int(n_code, 0);
38312
38313        ret_val = xmlUCSIsCherokee(code);
38314        desret_int(ret_val);
38315        call_tests++;
38316        des_int(n_code, code, 0);
38317        xmlResetLastError();
38318        if (mem_base != xmlMemBlocks()) {
38319            printf("Leak of %d blocks found in xmlUCSIsCherokee",
38320	           xmlMemBlocks() - mem_base);
38321	    test_ret++;
38322            printf(" %d", n_code);
38323            printf("\n");
38324        }
38325    }
38326    function_tests++;
38327#endif
38328
38329    return(test_ret);
38330}
38331
38332
38333static int
38334test_xmlUCSIsCombiningDiacriticalMarks(void) {
38335    int test_ret = 0;
38336
38337#if defined(LIBXML_UNICODE_ENABLED)
38338    int mem_base;
38339    int ret_val;
38340    int code; /* UCS code point */
38341    int n_code;
38342
38343    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38344        mem_base = xmlMemBlocks();
38345        code = gen_int(n_code, 0);
38346
38347        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
38348        desret_int(ret_val);
38349        call_tests++;
38350        des_int(n_code, code, 0);
38351        xmlResetLastError();
38352        if (mem_base != xmlMemBlocks()) {
38353            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
38354	           xmlMemBlocks() - mem_base);
38355	    test_ret++;
38356            printf(" %d", n_code);
38357            printf("\n");
38358        }
38359    }
38360    function_tests++;
38361#endif
38362
38363    return(test_ret);
38364}
38365
38366
38367static int
38368test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
38369    int test_ret = 0;
38370
38371#if defined(LIBXML_UNICODE_ENABLED)
38372    int mem_base;
38373    int ret_val;
38374    int code; /* UCS code point */
38375    int n_code;
38376
38377    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38378        mem_base = xmlMemBlocks();
38379        code = gen_int(n_code, 0);
38380
38381        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
38382        desret_int(ret_val);
38383        call_tests++;
38384        des_int(n_code, code, 0);
38385        xmlResetLastError();
38386        if (mem_base != xmlMemBlocks()) {
38387            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
38388	           xmlMemBlocks() - mem_base);
38389	    test_ret++;
38390            printf(" %d", n_code);
38391            printf("\n");
38392        }
38393    }
38394    function_tests++;
38395#endif
38396
38397    return(test_ret);
38398}
38399
38400
38401static int
38402test_xmlUCSIsCombiningHalfMarks(void) {
38403    int test_ret = 0;
38404
38405#if defined(LIBXML_UNICODE_ENABLED)
38406    int mem_base;
38407    int ret_val;
38408    int code; /* UCS code point */
38409    int n_code;
38410
38411    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38412        mem_base = xmlMemBlocks();
38413        code = gen_int(n_code, 0);
38414
38415        ret_val = xmlUCSIsCombiningHalfMarks(code);
38416        desret_int(ret_val);
38417        call_tests++;
38418        des_int(n_code, code, 0);
38419        xmlResetLastError();
38420        if (mem_base != xmlMemBlocks()) {
38421            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
38422	           xmlMemBlocks() - mem_base);
38423	    test_ret++;
38424            printf(" %d", n_code);
38425            printf("\n");
38426        }
38427    }
38428    function_tests++;
38429#endif
38430
38431    return(test_ret);
38432}
38433
38434
38435static int
38436test_xmlUCSIsCombiningMarksforSymbols(void) {
38437    int test_ret = 0;
38438
38439#if defined(LIBXML_UNICODE_ENABLED)
38440    int mem_base;
38441    int ret_val;
38442    int code; /* UCS code point */
38443    int n_code;
38444
38445    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38446        mem_base = xmlMemBlocks();
38447        code = gen_int(n_code, 0);
38448
38449        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
38450        desret_int(ret_val);
38451        call_tests++;
38452        des_int(n_code, code, 0);
38453        xmlResetLastError();
38454        if (mem_base != xmlMemBlocks()) {
38455            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
38456	           xmlMemBlocks() - mem_base);
38457	    test_ret++;
38458            printf(" %d", n_code);
38459            printf("\n");
38460        }
38461    }
38462    function_tests++;
38463#endif
38464
38465    return(test_ret);
38466}
38467
38468
38469static int
38470test_xmlUCSIsControlPictures(void) {
38471    int test_ret = 0;
38472
38473#if defined(LIBXML_UNICODE_ENABLED)
38474    int mem_base;
38475    int ret_val;
38476    int code; /* UCS code point */
38477    int n_code;
38478
38479    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38480        mem_base = xmlMemBlocks();
38481        code = gen_int(n_code, 0);
38482
38483        ret_val = xmlUCSIsControlPictures(code);
38484        desret_int(ret_val);
38485        call_tests++;
38486        des_int(n_code, code, 0);
38487        xmlResetLastError();
38488        if (mem_base != xmlMemBlocks()) {
38489            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
38490	           xmlMemBlocks() - mem_base);
38491	    test_ret++;
38492            printf(" %d", n_code);
38493            printf("\n");
38494        }
38495    }
38496    function_tests++;
38497#endif
38498
38499    return(test_ret);
38500}
38501
38502
38503static int
38504test_xmlUCSIsCurrencySymbols(void) {
38505    int test_ret = 0;
38506
38507#if defined(LIBXML_UNICODE_ENABLED)
38508    int mem_base;
38509    int ret_val;
38510    int code; /* UCS code point */
38511    int n_code;
38512
38513    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38514        mem_base = xmlMemBlocks();
38515        code = gen_int(n_code, 0);
38516
38517        ret_val = xmlUCSIsCurrencySymbols(code);
38518        desret_int(ret_val);
38519        call_tests++;
38520        des_int(n_code, code, 0);
38521        xmlResetLastError();
38522        if (mem_base != xmlMemBlocks()) {
38523            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
38524	           xmlMemBlocks() - mem_base);
38525	    test_ret++;
38526            printf(" %d", n_code);
38527            printf("\n");
38528        }
38529    }
38530    function_tests++;
38531#endif
38532
38533    return(test_ret);
38534}
38535
38536
38537static int
38538test_xmlUCSIsCypriotSyllabary(void) {
38539    int test_ret = 0;
38540
38541#if defined(LIBXML_UNICODE_ENABLED)
38542    int mem_base;
38543    int ret_val;
38544    int code; /* UCS code point */
38545    int n_code;
38546
38547    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38548        mem_base = xmlMemBlocks();
38549        code = gen_int(n_code, 0);
38550
38551        ret_val = xmlUCSIsCypriotSyllabary(code);
38552        desret_int(ret_val);
38553        call_tests++;
38554        des_int(n_code, code, 0);
38555        xmlResetLastError();
38556        if (mem_base != xmlMemBlocks()) {
38557            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
38558	           xmlMemBlocks() - mem_base);
38559	    test_ret++;
38560            printf(" %d", n_code);
38561            printf("\n");
38562        }
38563    }
38564    function_tests++;
38565#endif
38566
38567    return(test_ret);
38568}
38569
38570
38571static int
38572test_xmlUCSIsCyrillic(void) {
38573    int test_ret = 0;
38574
38575#if defined(LIBXML_UNICODE_ENABLED)
38576    int mem_base;
38577    int ret_val;
38578    int code; /* UCS code point */
38579    int n_code;
38580
38581    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38582        mem_base = xmlMemBlocks();
38583        code = gen_int(n_code, 0);
38584
38585        ret_val = xmlUCSIsCyrillic(code);
38586        desret_int(ret_val);
38587        call_tests++;
38588        des_int(n_code, code, 0);
38589        xmlResetLastError();
38590        if (mem_base != xmlMemBlocks()) {
38591            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
38592	           xmlMemBlocks() - mem_base);
38593	    test_ret++;
38594            printf(" %d", n_code);
38595            printf("\n");
38596        }
38597    }
38598    function_tests++;
38599#endif
38600
38601    return(test_ret);
38602}
38603
38604
38605static int
38606test_xmlUCSIsCyrillicSupplement(void) {
38607    int test_ret = 0;
38608
38609#if defined(LIBXML_UNICODE_ENABLED)
38610    int mem_base;
38611    int ret_val;
38612    int code; /* UCS code point */
38613    int n_code;
38614
38615    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38616        mem_base = xmlMemBlocks();
38617        code = gen_int(n_code, 0);
38618
38619        ret_val = xmlUCSIsCyrillicSupplement(code);
38620        desret_int(ret_val);
38621        call_tests++;
38622        des_int(n_code, code, 0);
38623        xmlResetLastError();
38624        if (mem_base != xmlMemBlocks()) {
38625            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
38626	           xmlMemBlocks() - mem_base);
38627	    test_ret++;
38628            printf(" %d", n_code);
38629            printf("\n");
38630        }
38631    }
38632    function_tests++;
38633#endif
38634
38635    return(test_ret);
38636}
38637
38638
38639static int
38640test_xmlUCSIsDeseret(void) {
38641    int test_ret = 0;
38642
38643#if defined(LIBXML_UNICODE_ENABLED)
38644    int mem_base;
38645    int ret_val;
38646    int code; /* UCS code point */
38647    int n_code;
38648
38649    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38650        mem_base = xmlMemBlocks();
38651        code = gen_int(n_code, 0);
38652
38653        ret_val = xmlUCSIsDeseret(code);
38654        desret_int(ret_val);
38655        call_tests++;
38656        des_int(n_code, code, 0);
38657        xmlResetLastError();
38658        if (mem_base != xmlMemBlocks()) {
38659            printf("Leak of %d blocks found in xmlUCSIsDeseret",
38660	           xmlMemBlocks() - mem_base);
38661	    test_ret++;
38662            printf(" %d", n_code);
38663            printf("\n");
38664        }
38665    }
38666    function_tests++;
38667#endif
38668
38669    return(test_ret);
38670}
38671
38672
38673static int
38674test_xmlUCSIsDevanagari(void) {
38675    int test_ret = 0;
38676
38677#if defined(LIBXML_UNICODE_ENABLED)
38678    int mem_base;
38679    int ret_val;
38680    int code; /* UCS code point */
38681    int n_code;
38682
38683    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38684        mem_base = xmlMemBlocks();
38685        code = gen_int(n_code, 0);
38686
38687        ret_val = xmlUCSIsDevanagari(code);
38688        desret_int(ret_val);
38689        call_tests++;
38690        des_int(n_code, code, 0);
38691        xmlResetLastError();
38692        if (mem_base != xmlMemBlocks()) {
38693            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
38694	           xmlMemBlocks() - mem_base);
38695	    test_ret++;
38696            printf(" %d", n_code);
38697            printf("\n");
38698        }
38699    }
38700    function_tests++;
38701#endif
38702
38703    return(test_ret);
38704}
38705
38706
38707static int
38708test_xmlUCSIsDingbats(void) {
38709    int test_ret = 0;
38710
38711#if defined(LIBXML_UNICODE_ENABLED)
38712    int mem_base;
38713    int ret_val;
38714    int code; /* UCS code point */
38715    int n_code;
38716
38717    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38718        mem_base = xmlMemBlocks();
38719        code = gen_int(n_code, 0);
38720
38721        ret_val = xmlUCSIsDingbats(code);
38722        desret_int(ret_val);
38723        call_tests++;
38724        des_int(n_code, code, 0);
38725        xmlResetLastError();
38726        if (mem_base != xmlMemBlocks()) {
38727            printf("Leak of %d blocks found in xmlUCSIsDingbats",
38728	           xmlMemBlocks() - mem_base);
38729	    test_ret++;
38730            printf(" %d", n_code);
38731            printf("\n");
38732        }
38733    }
38734    function_tests++;
38735#endif
38736
38737    return(test_ret);
38738}
38739
38740
38741static int
38742test_xmlUCSIsEnclosedAlphanumerics(void) {
38743    int test_ret = 0;
38744
38745#if defined(LIBXML_UNICODE_ENABLED)
38746    int mem_base;
38747    int ret_val;
38748    int code; /* UCS code point */
38749    int n_code;
38750
38751    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38752        mem_base = xmlMemBlocks();
38753        code = gen_int(n_code, 0);
38754
38755        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
38756        desret_int(ret_val);
38757        call_tests++;
38758        des_int(n_code, code, 0);
38759        xmlResetLastError();
38760        if (mem_base != xmlMemBlocks()) {
38761            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
38762	           xmlMemBlocks() - mem_base);
38763	    test_ret++;
38764            printf(" %d", n_code);
38765            printf("\n");
38766        }
38767    }
38768    function_tests++;
38769#endif
38770
38771    return(test_ret);
38772}
38773
38774
38775static int
38776test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
38777    int test_ret = 0;
38778
38779#if defined(LIBXML_UNICODE_ENABLED)
38780    int mem_base;
38781    int ret_val;
38782    int code; /* UCS code point */
38783    int n_code;
38784
38785    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38786        mem_base = xmlMemBlocks();
38787        code = gen_int(n_code, 0);
38788
38789        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
38790        desret_int(ret_val);
38791        call_tests++;
38792        des_int(n_code, code, 0);
38793        xmlResetLastError();
38794        if (mem_base != xmlMemBlocks()) {
38795            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
38796	           xmlMemBlocks() - mem_base);
38797	    test_ret++;
38798            printf(" %d", n_code);
38799            printf("\n");
38800        }
38801    }
38802    function_tests++;
38803#endif
38804
38805    return(test_ret);
38806}
38807
38808
38809static int
38810test_xmlUCSIsEthiopic(void) {
38811    int test_ret = 0;
38812
38813#if defined(LIBXML_UNICODE_ENABLED)
38814    int mem_base;
38815    int ret_val;
38816    int code; /* UCS code point */
38817    int n_code;
38818
38819    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38820        mem_base = xmlMemBlocks();
38821        code = gen_int(n_code, 0);
38822
38823        ret_val = xmlUCSIsEthiopic(code);
38824        desret_int(ret_val);
38825        call_tests++;
38826        des_int(n_code, code, 0);
38827        xmlResetLastError();
38828        if (mem_base != xmlMemBlocks()) {
38829            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
38830	           xmlMemBlocks() - mem_base);
38831	    test_ret++;
38832            printf(" %d", n_code);
38833            printf("\n");
38834        }
38835    }
38836    function_tests++;
38837#endif
38838
38839    return(test_ret);
38840}
38841
38842
38843static int
38844test_xmlUCSIsGeneralPunctuation(void) {
38845    int test_ret = 0;
38846
38847#if defined(LIBXML_UNICODE_ENABLED)
38848    int mem_base;
38849    int ret_val;
38850    int code; /* UCS code point */
38851    int n_code;
38852
38853    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38854        mem_base = xmlMemBlocks();
38855        code = gen_int(n_code, 0);
38856
38857        ret_val = xmlUCSIsGeneralPunctuation(code);
38858        desret_int(ret_val);
38859        call_tests++;
38860        des_int(n_code, code, 0);
38861        xmlResetLastError();
38862        if (mem_base != xmlMemBlocks()) {
38863            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
38864	           xmlMemBlocks() - mem_base);
38865	    test_ret++;
38866            printf(" %d", n_code);
38867            printf("\n");
38868        }
38869    }
38870    function_tests++;
38871#endif
38872
38873    return(test_ret);
38874}
38875
38876
38877static int
38878test_xmlUCSIsGeometricShapes(void) {
38879    int test_ret = 0;
38880
38881#if defined(LIBXML_UNICODE_ENABLED)
38882    int mem_base;
38883    int ret_val;
38884    int code; /* UCS code point */
38885    int n_code;
38886
38887    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38888        mem_base = xmlMemBlocks();
38889        code = gen_int(n_code, 0);
38890
38891        ret_val = xmlUCSIsGeometricShapes(code);
38892        desret_int(ret_val);
38893        call_tests++;
38894        des_int(n_code, code, 0);
38895        xmlResetLastError();
38896        if (mem_base != xmlMemBlocks()) {
38897            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
38898	           xmlMemBlocks() - mem_base);
38899	    test_ret++;
38900            printf(" %d", n_code);
38901            printf("\n");
38902        }
38903    }
38904    function_tests++;
38905#endif
38906
38907    return(test_ret);
38908}
38909
38910
38911static int
38912test_xmlUCSIsGeorgian(void) {
38913    int test_ret = 0;
38914
38915#if defined(LIBXML_UNICODE_ENABLED)
38916    int mem_base;
38917    int ret_val;
38918    int code; /* UCS code point */
38919    int n_code;
38920
38921    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38922        mem_base = xmlMemBlocks();
38923        code = gen_int(n_code, 0);
38924
38925        ret_val = xmlUCSIsGeorgian(code);
38926        desret_int(ret_val);
38927        call_tests++;
38928        des_int(n_code, code, 0);
38929        xmlResetLastError();
38930        if (mem_base != xmlMemBlocks()) {
38931            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
38932	           xmlMemBlocks() - mem_base);
38933	    test_ret++;
38934            printf(" %d", n_code);
38935            printf("\n");
38936        }
38937    }
38938    function_tests++;
38939#endif
38940
38941    return(test_ret);
38942}
38943
38944
38945static int
38946test_xmlUCSIsGothic(void) {
38947    int test_ret = 0;
38948
38949#if defined(LIBXML_UNICODE_ENABLED)
38950    int mem_base;
38951    int ret_val;
38952    int code; /* UCS code point */
38953    int n_code;
38954
38955    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38956        mem_base = xmlMemBlocks();
38957        code = gen_int(n_code, 0);
38958
38959        ret_val = xmlUCSIsGothic(code);
38960        desret_int(ret_val);
38961        call_tests++;
38962        des_int(n_code, code, 0);
38963        xmlResetLastError();
38964        if (mem_base != xmlMemBlocks()) {
38965            printf("Leak of %d blocks found in xmlUCSIsGothic",
38966	           xmlMemBlocks() - mem_base);
38967	    test_ret++;
38968            printf(" %d", n_code);
38969            printf("\n");
38970        }
38971    }
38972    function_tests++;
38973#endif
38974
38975    return(test_ret);
38976}
38977
38978
38979static int
38980test_xmlUCSIsGreek(void) {
38981    int test_ret = 0;
38982
38983#if defined(LIBXML_UNICODE_ENABLED)
38984    int mem_base;
38985    int ret_val;
38986    int code; /* UCS code point */
38987    int n_code;
38988
38989    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38990        mem_base = xmlMemBlocks();
38991        code = gen_int(n_code, 0);
38992
38993        ret_val = xmlUCSIsGreek(code);
38994        desret_int(ret_val);
38995        call_tests++;
38996        des_int(n_code, code, 0);
38997        xmlResetLastError();
38998        if (mem_base != xmlMemBlocks()) {
38999            printf("Leak of %d blocks found in xmlUCSIsGreek",
39000	           xmlMemBlocks() - mem_base);
39001	    test_ret++;
39002            printf(" %d", n_code);
39003            printf("\n");
39004        }
39005    }
39006    function_tests++;
39007#endif
39008
39009    return(test_ret);
39010}
39011
39012
39013static int
39014test_xmlUCSIsGreekExtended(void) {
39015    int test_ret = 0;
39016
39017#if defined(LIBXML_UNICODE_ENABLED)
39018    int mem_base;
39019    int ret_val;
39020    int code; /* UCS code point */
39021    int n_code;
39022
39023    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39024        mem_base = xmlMemBlocks();
39025        code = gen_int(n_code, 0);
39026
39027        ret_val = xmlUCSIsGreekExtended(code);
39028        desret_int(ret_val);
39029        call_tests++;
39030        des_int(n_code, code, 0);
39031        xmlResetLastError();
39032        if (mem_base != xmlMemBlocks()) {
39033            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39034	           xmlMemBlocks() - mem_base);
39035	    test_ret++;
39036            printf(" %d", n_code);
39037            printf("\n");
39038        }
39039    }
39040    function_tests++;
39041#endif
39042
39043    return(test_ret);
39044}
39045
39046
39047static int
39048test_xmlUCSIsGreekandCoptic(void) {
39049    int test_ret = 0;
39050
39051#if defined(LIBXML_UNICODE_ENABLED)
39052    int mem_base;
39053    int ret_val;
39054    int code; /* UCS code point */
39055    int n_code;
39056
39057    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39058        mem_base = xmlMemBlocks();
39059        code = gen_int(n_code, 0);
39060
39061        ret_val = xmlUCSIsGreekandCoptic(code);
39062        desret_int(ret_val);
39063        call_tests++;
39064        des_int(n_code, code, 0);
39065        xmlResetLastError();
39066        if (mem_base != xmlMemBlocks()) {
39067            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39068	           xmlMemBlocks() - mem_base);
39069	    test_ret++;
39070            printf(" %d", n_code);
39071            printf("\n");
39072        }
39073    }
39074    function_tests++;
39075#endif
39076
39077    return(test_ret);
39078}
39079
39080
39081static int
39082test_xmlUCSIsGujarati(void) {
39083    int test_ret = 0;
39084
39085#if defined(LIBXML_UNICODE_ENABLED)
39086    int mem_base;
39087    int ret_val;
39088    int code; /* UCS code point */
39089    int n_code;
39090
39091    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39092        mem_base = xmlMemBlocks();
39093        code = gen_int(n_code, 0);
39094
39095        ret_val = xmlUCSIsGujarati(code);
39096        desret_int(ret_val);
39097        call_tests++;
39098        des_int(n_code, code, 0);
39099        xmlResetLastError();
39100        if (mem_base != xmlMemBlocks()) {
39101            printf("Leak of %d blocks found in xmlUCSIsGujarati",
39102	           xmlMemBlocks() - mem_base);
39103	    test_ret++;
39104            printf(" %d", n_code);
39105            printf("\n");
39106        }
39107    }
39108    function_tests++;
39109#endif
39110
39111    return(test_ret);
39112}
39113
39114
39115static int
39116test_xmlUCSIsGurmukhi(void) {
39117    int test_ret = 0;
39118
39119#if defined(LIBXML_UNICODE_ENABLED)
39120    int mem_base;
39121    int ret_val;
39122    int code; /* UCS code point */
39123    int n_code;
39124
39125    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39126        mem_base = xmlMemBlocks();
39127        code = gen_int(n_code, 0);
39128
39129        ret_val = xmlUCSIsGurmukhi(code);
39130        desret_int(ret_val);
39131        call_tests++;
39132        des_int(n_code, code, 0);
39133        xmlResetLastError();
39134        if (mem_base != xmlMemBlocks()) {
39135            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39136	           xmlMemBlocks() - mem_base);
39137	    test_ret++;
39138            printf(" %d", n_code);
39139            printf("\n");
39140        }
39141    }
39142    function_tests++;
39143#endif
39144
39145    return(test_ret);
39146}
39147
39148
39149static int
39150test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39151    int test_ret = 0;
39152
39153#if defined(LIBXML_UNICODE_ENABLED)
39154    int mem_base;
39155    int ret_val;
39156    int code; /* UCS code point */
39157    int n_code;
39158
39159    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39160        mem_base = xmlMemBlocks();
39161        code = gen_int(n_code, 0);
39162
39163        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39164        desret_int(ret_val);
39165        call_tests++;
39166        des_int(n_code, code, 0);
39167        xmlResetLastError();
39168        if (mem_base != xmlMemBlocks()) {
39169            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39170	           xmlMemBlocks() - mem_base);
39171	    test_ret++;
39172            printf(" %d", n_code);
39173            printf("\n");
39174        }
39175    }
39176    function_tests++;
39177#endif
39178
39179    return(test_ret);
39180}
39181
39182
39183static int
39184test_xmlUCSIsHangulCompatibilityJamo(void) {
39185    int test_ret = 0;
39186
39187#if defined(LIBXML_UNICODE_ENABLED)
39188    int mem_base;
39189    int ret_val;
39190    int code; /* UCS code point */
39191    int n_code;
39192
39193    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39194        mem_base = xmlMemBlocks();
39195        code = gen_int(n_code, 0);
39196
39197        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39198        desret_int(ret_val);
39199        call_tests++;
39200        des_int(n_code, code, 0);
39201        xmlResetLastError();
39202        if (mem_base != xmlMemBlocks()) {
39203            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39204	           xmlMemBlocks() - mem_base);
39205	    test_ret++;
39206            printf(" %d", n_code);
39207            printf("\n");
39208        }
39209    }
39210    function_tests++;
39211#endif
39212
39213    return(test_ret);
39214}
39215
39216
39217static int
39218test_xmlUCSIsHangulJamo(void) {
39219    int test_ret = 0;
39220
39221#if defined(LIBXML_UNICODE_ENABLED)
39222    int mem_base;
39223    int ret_val;
39224    int code; /* UCS code point */
39225    int n_code;
39226
39227    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39228        mem_base = xmlMemBlocks();
39229        code = gen_int(n_code, 0);
39230
39231        ret_val = xmlUCSIsHangulJamo(code);
39232        desret_int(ret_val);
39233        call_tests++;
39234        des_int(n_code, code, 0);
39235        xmlResetLastError();
39236        if (mem_base != xmlMemBlocks()) {
39237            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
39238	           xmlMemBlocks() - mem_base);
39239	    test_ret++;
39240            printf(" %d", n_code);
39241            printf("\n");
39242        }
39243    }
39244    function_tests++;
39245#endif
39246
39247    return(test_ret);
39248}
39249
39250
39251static int
39252test_xmlUCSIsHangulSyllables(void) {
39253    int test_ret = 0;
39254
39255#if defined(LIBXML_UNICODE_ENABLED)
39256    int mem_base;
39257    int ret_val;
39258    int code; /* UCS code point */
39259    int n_code;
39260
39261    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39262        mem_base = xmlMemBlocks();
39263        code = gen_int(n_code, 0);
39264
39265        ret_val = xmlUCSIsHangulSyllables(code);
39266        desret_int(ret_val);
39267        call_tests++;
39268        des_int(n_code, code, 0);
39269        xmlResetLastError();
39270        if (mem_base != xmlMemBlocks()) {
39271            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
39272	           xmlMemBlocks() - mem_base);
39273	    test_ret++;
39274            printf(" %d", n_code);
39275            printf("\n");
39276        }
39277    }
39278    function_tests++;
39279#endif
39280
39281    return(test_ret);
39282}
39283
39284
39285static int
39286test_xmlUCSIsHanunoo(void) {
39287    int test_ret = 0;
39288
39289#if defined(LIBXML_UNICODE_ENABLED)
39290    int mem_base;
39291    int ret_val;
39292    int code; /* UCS code point */
39293    int n_code;
39294
39295    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39296        mem_base = xmlMemBlocks();
39297        code = gen_int(n_code, 0);
39298
39299        ret_val = xmlUCSIsHanunoo(code);
39300        desret_int(ret_val);
39301        call_tests++;
39302        des_int(n_code, code, 0);
39303        xmlResetLastError();
39304        if (mem_base != xmlMemBlocks()) {
39305            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
39306	           xmlMemBlocks() - mem_base);
39307	    test_ret++;
39308            printf(" %d", n_code);
39309            printf("\n");
39310        }
39311    }
39312    function_tests++;
39313#endif
39314
39315    return(test_ret);
39316}
39317
39318
39319static int
39320test_xmlUCSIsHebrew(void) {
39321    int test_ret = 0;
39322
39323#if defined(LIBXML_UNICODE_ENABLED)
39324    int mem_base;
39325    int ret_val;
39326    int code; /* UCS code point */
39327    int n_code;
39328
39329    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39330        mem_base = xmlMemBlocks();
39331        code = gen_int(n_code, 0);
39332
39333        ret_val = xmlUCSIsHebrew(code);
39334        desret_int(ret_val);
39335        call_tests++;
39336        des_int(n_code, code, 0);
39337        xmlResetLastError();
39338        if (mem_base != xmlMemBlocks()) {
39339            printf("Leak of %d blocks found in xmlUCSIsHebrew",
39340	           xmlMemBlocks() - mem_base);
39341	    test_ret++;
39342            printf(" %d", n_code);
39343            printf("\n");
39344        }
39345    }
39346    function_tests++;
39347#endif
39348
39349    return(test_ret);
39350}
39351
39352
39353static int
39354test_xmlUCSIsHighPrivateUseSurrogates(void) {
39355    int test_ret = 0;
39356
39357#if defined(LIBXML_UNICODE_ENABLED)
39358    int mem_base;
39359    int ret_val;
39360    int code; /* UCS code point */
39361    int n_code;
39362
39363    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39364        mem_base = xmlMemBlocks();
39365        code = gen_int(n_code, 0);
39366
39367        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
39368        desret_int(ret_val);
39369        call_tests++;
39370        des_int(n_code, code, 0);
39371        xmlResetLastError();
39372        if (mem_base != xmlMemBlocks()) {
39373            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
39374	           xmlMemBlocks() - mem_base);
39375	    test_ret++;
39376            printf(" %d", n_code);
39377            printf("\n");
39378        }
39379    }
39380    function_tests++;
39381#endif
39382
39383    return(test_ret);
39384}
39385
39386
39387static int
39388test_xmlUCSIsHighSurrogates(void) {
39389    int test_ret = 0;
39390
39391#if defined(LIBXML_UNICODE_ENABLED)
39392    int mem_base;
39393    int ret_val;
39394    int code; /* UCS code point */
39395    int n_code;
39396
39397    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39398        mem_base = xmlMemBlocks();
39399        code = gen_int(n_code, 0);
39400
39401        ret_val = xmlUCSIsHighSurrogates(code);
39402        desret_int(ret_val);
39403        call_tests++;
39404        des_int(n_code, code, 0);
39405        xmlResetLastError();
39406        if (mem_base != xmlMemBlocks()) {
39407            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
39408	           xmlMemBlocks() - mem_base);
39409	    test_ret++;
39410            printf(" %d", n_code);
39411            printf("\n");
39412        }
39413    }
39414    function_tests++;
39415#endif
39416
39417    return(test_ret);
39418}
39419
39420
39421static int
39422test_xmlUCSIsHiragana(void) {
39423    int test_ret = 0;
39424
39425#if defined(LIBXML_UNICODE_ENABLED)
39426    int mem_base;
39427    int ret_val;
39428    int code; /* UCS code point */
39429    int n_code;
39430
39431    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39432        mem_base = xmlMemBlocks();
39433        code = gen_int(n_code, 0);
39434
39435        ret_val = xmlUCSIsHiragana(code);
39436        desret_int(ret_val);
39437        call_tests++;
39438        des_int(n_code, code, 0);
39439        xmlResetLastError();
39440        if (mem_base != xmlMemBlocks()) {
39441            printf("Leak of %d blocks found in xmlUCSIsHiragana",
39442	           xmlMemBlocks() - mem_base);
39443	    test_ret++;
39444            printf(" %d", n_code);
39445            printf("\n");
39446        }
39447    }
39448    function_tests++;
39449#endif
39450
39451    return(test_ret);
39452}
39453
39454
39455static int
39456test_xmlUCSIsIPAExtensions(void) {
39457    int test_ret = 0;
39458
39459#if defined(LIBXML_UNICODE_ENABLED)
39460    int mem_base;
39461    int ret_val;
39462    int code; /* UCS code point */
39463    int n_code;
39464
39465    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39466        mem_base = xmlMemBlocks();
39467        code = gen_int(n_code, 0);
39468
39469        ret_val = xmlUCSIsIPAExtensions(code);
39470        desret_int(ret_val);
39471        call_tests++;
39472        des_int(n_code, code, 0);
39473        xmlResetLastError();
39474        if (mem_base != xmlMemBlocks()) {
39475            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
39476	           xmlMemBlocks() - mem_base);
39477	    test_ret++;
39478            printf(" %d", n_code);
39479            printf("\n");
39480        }
39481    }
39482    function_tests++;
39483#endif
39484
39485    return(test_ret);
39486}
39487
39488
39489static int
39490test_xmlUCSIsIdeographicDescriptionCharacters(void) {
39491    int test_ret = 0;
39492
39493#if defined(LIBXML_UNICODE_ENABLED)
39494    int mem_base;
39495    int ret_val;
39496    int code; /* UCS code point */
39497    int n_code;
39498
39499    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39500        mem_base = xmlMemBlocks();
39501        code = gen_int(n_code, 0);
39502
39503        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
39504        desret_int(ret_val);
39505        call_tests++;
39506        des_int(n_code, code, 0);
39507        xmlResetLastError();
39508        if (mem_base != xmlMemBlocks()) {
39509            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
39510	           xmlMemBlocks() - mem_base);
39511	    test_ret++;
39512            printf(" %d", n_code);
39513            printf("\n");
39514        }
39515    }
39516    function_tests++;
39517#endif
39518
39519    return(test_ret);
39520}
39521
39522
39523static int
39524test_xmlUCSIsKanbun(void) {
39525    int test_ret = 0;
39526
39527#if defined(LIBXML_UNICODE_ENABLED)
39528    int mem_base;
39529    int ret_val;
39530    int code; /* UCS code point */
39531    int n_code;
39532
39533    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39534        mem_base = xmlMemBlocks();
39535        code = gen_int(n_code, 0);
39536
39537        ret_val = xmlUCSIsKanbun(code);
39538        desret_int(ret_val);
39539        call_tests++;
39540        des_int(n_code, code, 0);
39541        xmlResetLastError();
39542        if (mem_base != xmlMemBlocks()) {
39543            printf("Leak of %d blocks found in xmlUCSIsKanbun",
39544	           xmlMemBlocks() - mem_base);
39545	    test_ret++;
39546            printf(" %d", n_code);
39547            printf("\n");
39548        }
39549    }
39550    function_tests++;
39551#endif
39552
39553    return(test_ret);
39554}
39555
39556
39557static int
39558test_xmlUCSIsKangxiRadicals(void) {
39559    int test_ret = 0;
39560
39561#if defined(LIBXML_UNICODE_ENABLED)
39562    int mem_base;
39563    int ret_val;
39564    int code; /* UCS code point */
39565    int n_code;
39566
39567    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39568        mem_base = xmlMemBlocks();
39569        code = gen_int(n_code, 0);
39570
39571        ret_val = xmlUCSIsKangxiRadicals(code);
39572        desret_int(ret_val);
39573        call_tests++;
39574        des_int(n_code, code, 0);
39575        xmlResetLastError();
39576        if (mem_base != xmlMemBlocks()) {
39577            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
39578	           xmlMemBlocks() - mem_base);
39579	    test_ret++;
39580            printf(" %d", n_code);
39581            printf("\n");
39582        }
39583    }
39584    function_tests++;
39585#endif
39586
39587    return(test_ret);
39588}
39589
39590
39591static int
39592test_xmlUCSIsKannada(void) {
39593    int test_ret = 0;
39594
39595#if defined(LIBXML_UNICODE_ENABLED)
39596    int mem_base;
39597    int ret_val;
39598    int code; /* UCS code point */
39599    int n_code;
39600
39601    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39602        mem_base = xmlMemBlocks();
39603        code = gen_int(n_code, 0);
39604
39605        ret_val = xmlUCSIsKannada(code);
39606        desret_int(ret_val);
39607        call_tests++;
39608        des_int(n_code, code, 0);
39609        xmlResetLastError();
39610        if (mem_base != xmlMemBlocks()) {
39611            printf("Leak of %d blocks found in xmlUCSIsKannada",
39612	           xmlMemBlocks() - mem_base);
39613	    test_ret++;
39614            printf(" %d", n_code);
39615            printf("\n");
39616        }
39617    }
39618    function_tests++;
39619#endif
39620
39621    return(test_ret);
39622}
39623
39624
39625static int
39626test_xmlUCSIsKatakana(void) {
39627    int test_ret = 0;
39628
39629#if defined(LIBXML_UNICODE_ENABLED)
39630    int mem_base;
39631    int ret_val;
39632    int code; /* UCS code point */
39633    int n_code;
39634
39635    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39636        mem_base = xmlMemBlocks();
39637        code = gen_int(n_code, 0);
39638
39639        ret_val = xmlUCSIsKatakana(code);
39640        desret_int(ret_val);
39641        call_tests++;
39642        des_int(n_code, code, 0);
39643        xmlResetLastError();
39644        if (mem_base != xmlMemBlocks()) {
39645            printf("Leak of %d blocks found in xmlUCSIsKatakana",
39646	           xmlMemBlocks() - mem_base);
39647	    test_ret++;
39648            printf(" %d", n_code);
39649            printf("\n");
39650        }
39651    }
39652    function_tests++;
39653#endif
39654
39655    return(test_ret);
39656}
39657
39658
39659static int
39660test_xmlUCSIsKatakanaPhoneticExtensions(void) {
39661    int test_ret = 0;
39662
39663#if defined(LIBXML_UNICODE_ENABLED)
39664    int mem_base;
39665    int ret_val;
39666    int code; /* UCS code point */
39667    int n_code;
39668
39669    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39670        mem_base = xmlMemBlocks();
39671        code = gen_int(n_code, 0);
39672
39673        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
39674        desret_int(ret_val);
39675        call_tests++;
39676        des_int(n_code, code, 0);
39677        xmlResetLastError();
39678        if (mem_base != xmlMemBlocks()) {
39679            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
39680	           xmlMemBlocks() - mem_base);
39681	    test_ret++;
39682            printf(" %d", n_code);
39683            printf("\n");
39684        }
39685    }
39686    function_tests++;
39687#endif
39688
39689    return(test_ret);
39690}
39691
39692
39693static int
39694test_xmlUCSIsKhmer(void) {
39695    int test_ret = 0;
39696
39697#if defined(LIBXML_UNICODE_ENABLED)
39698    int mem_base;
39699    int ret_val;
39700    int code; /* UCS code point */
39701    int n_code;
39702
39703    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39704        mem_base = xmlMemBlocks();
39705        code = gen_int(n_code, 0);
39706
39707        ret_val = xmlUCSIsKhmer(code);
39708        desret_int(ret_val);
39709        call_tests++;
39710        des_int(n_code, code, 0);
39711        xmlResetLastError();
39712        if (mem_base != xmlMemBlocks()) {
39713            printf("Leak of %d blocks found in xmlUCSIsKhmer",
39714	           xmlMemBlocks() - mem_base);
39715	    test_ret++;
39716            printf(" %d", n_code);
39717            printf("\n");
39718        }
39719    }
39720    function_tests++;
39721#endif
39722
39723    return(test_ret);
39724}
39725
39726
39727static int
39728test_xmlUCSIsKhmerSymbols(void) {
39729    int test_ret = 0;
39730
39731#if defined(LIBXML_UNICODE_ENABLED)
39732    int mem_base;
39733    int ret_val;
39734    int code; /* UCS code point */
39735    int n_code;
39736
39737    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39738        mem_base = xmlMemBlocks();
39739        code = gen_int(n_code, 0);
39740
39741        ret_val = xmlUCSIsKhmerSymbols(code);
39742        desret_int(ret_val);
39743        call_tests++;
39744        des_int(n_code, code, 0);
39745        xmlResetLastError();
39746        if (mem_base != xmlMemBlocks()) {
39747            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
39748	           xmlMemBlocks() - mem_base);
39749	    test_ret++;
39750            printf(" %d", n_code);
39751            printf("\n");
39752        }
39753    }
39754    function_tests++;
39755#endif
39756
39757    return(test_ret);
39758}
39759
39760
39761static int
39762test_xmlUCSIsLao(void) {
39763    int test_ret = 0;
39764
39765#if defined(LIBXML_UNICODE_ENABLED)
39766    int mem_base;
39767    int ret_val;
39768    int code; /* UCS code point */
39769    int n_code;
39770
39771    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39772        mem_base = xmlMemBlocks();
39773        code = gen_int(n_code, 0);
39774
39775        ret_val = xmlUCSIsLao(code);
39776        desret_int(ret_val);
39777        call_tests++;
39778        des_int(n_code, code, 0);
39779        xmlResetLastError();
39780        if (mem_base != xmlMemBlocks()) {
39781            printf("Leak of %d blocks found in xmlUCSIsLao",
39782	           xmlMemBlocks() - mem_base);
39783	    test_ret++;
39784            printf(" %d", n_code);
39785            printf("\n");
39786        }
39787    }
39788    function_tests++;
39789#endif
39790
39791    return(test_ret);
39792}
39793
39794
39795static int
39796test_xmlUCSIsLatin1Supplement(void) {
39797    int test_ret = 0;
39798
39799#if defined(LIBXML_UNICODE_ENABLED)
39800    int mem_base;
39801    int ret_val;
39802    int code; /* UCS code point */
39803    int n_code;
39804
39805    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39806        mem_base = xmlMemBlocks();
39807        code = gen_int(n_code, 0);
39808
39809        ret_val = xmlUCSIsLatin1Supplement(code);
39810        desret_int(ret_val);
39811        call_tests++;
39812        des_int(n_code, code, 0);
39813        xmlResetLastError();
39814        if (mem_base != xmlMemBlocks()) {
39815            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
39816	           xmlMemBlocks() - mem_base);
39817	    test_ret++;
39818            printf(" %d", n_code);
39819            printf("\n");
39820        }
39821    }
39822    function_tests++;
39823#endif
39824
39825    return(test_ret);
39826}
39827
39828
39829static int
39830test_xmlUCSIsLatinExtendedA(void) {
39831    int test_ret = 0;
39832
39833#if defined(LIBXML_UNICODE_ENABLED)
39834    int mem_base;
39835    int ret_val;
39836    int code; /* UCS code point */
39837    int n_code;
39838
39839    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39840        mem_base = xmlMemBlocks();
39841        code = gen_int(n_code, 0);
39842
39843        ret_val = xmlUCSIsLatinExtendedA(code);
39844        desret_int(ret_val);
39845        call_tests++;
39846        des_int(n_code, code, 0);
39847        xmlResetLastError();
39848        if (mem_base != xmlMemBlocks()) {
39849            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
39850	           xmlMemBlocks() - mem_base);
39851	    test_ret++;
39852            printf(" %d", n_code);
39853            printf("\n");
39854        }
39855    }
39856    function_tests++;
39857#endif
39858
39859    return(test_ret);
39860}
39861
39862
39863static int
39864test_xmlUCSIsLatinExtendedAdditional(void) {
39865    int test_ret = 0;
39866
39867#if defined(LIBXML_UNICODE_ENABLED)
39868    int mem_base;
39869    int ret_val;
39870    int code; /* UCS code point */
39871    int n_code;
39872
39873    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39874        mem_base = xmlMemBlocks();
39875        code = gen_int(n_code, 0);
39876
39877        ret_val = xmlUCSIsLatinExtendedAdditional(code);
39878        desret_int(ret_val);
39879        call_tests++;
39880        des_int(n_code, code, 0);
39881        xmlResetLastError();
39882        if (mem_base != xmlMemBlocks()) {
39883            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
39884	           xmlMemBlocks() - mem_base);
39885	    test_ret++;
39886            printf(" %d", n_code);
39887            printf("\n");
39888        }
39889    }
39890    function_tests++;
39891#endif
39892
39893    return(test_ret);
39894}
39895
39896
39897static int
39898test_xmlUCSIsLatinExtendedB(void) {
39899    int test_ret = 0;
39900
39901#if defined(LIBXML_UNICODE_ENABLED)
39902    int mem_base;
39903    int ret_val;
39904    int code; /* UCS code point */
39905    int n_code;
39906
39907    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39908        mem_base = xmlMemBlocks();
39909        code = gen_int(n_code, 0);
39910
39911        ret_val = xmlUCSIsLatinExtendedB(code);
39912        desret_int(ret_val);
39913        call_tests++;
39914        des_int(n_code, code, 0);
39915        xmlResetLastError();
39916        if (mem_base != xmlMemBlocks()) {
39917            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
39918	           xmlMemBlocks() - mem_base);
39919	    test_ret++;
39920            printf(" %d", n_code);
39921            printf("\n");
39922        }
39923    }
39924    function_tests++;
39925#endif
39926
39927    return(test_ret);
39928}
39929
39930
39931static int
39932test_xmlUCSIsLetterlikeSymbols(void) {
39933    int test_ret = 0;
39934
39935#if defined(LIBXML_UNICODE_ENABLED)
39936    int mem_base;
39937    int ret_val;
39938    int code; /* UCS code point */
39939    int n_code;
39940
39941    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39942        mem_base = xmlMemBlocks();
39943        code = gen_int(n_code, 0);
39944
39945        ret_val = xmlUCSIsLetterlikeSymbols(code);
39946        desret_int(ret_val);
39947        call_tests++;
39948        des_int(n_code, code, 0);
39949        xmlResetLastError();
39950        if (mem_base != xmlMemBlocks()) {
39951            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
39952	           xmlMemBlocks() - mem_base);
39953	    test_ret++;
39954            printf(" %d", n_code);
39955            printf("\n");
39956        }
39957    }
39958    function_tests++;
39959#endif
39960
39961    return(test_ret);
39962}
39963
39964
39965static int
39966test_xmlUCSIsLimbu(void) {
39967    int test_ret = 0;
39968
39969#if defined(LIBXML_UNICODE_ENABLED)
39970    int mem_base;
39971    int ret_val;
39972    int code; /* UCS code point */
39973    int n_code;
39974
39975    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39976        mem_base = xmlMemBlocks();
39977        code = gen_int(n_code, 0);
39978
39979        ret_val = xmlUCSIsLimbu(code);
39980        desret_int(ret_val);
39981        call_tests++;
39982        des_int(n_code, code, 0);
39983        xmlResetLastError();
39984        if (mem_base != xmlMemBlocks()) {
39985            printf("Leak of %d blocks found in xmlUCSIsLimbu",
39986	           xmlMemBlocks() - mem_base);
39987	    test_ret++;
39988            printf(" %d", n_code);
39989            printf("\n");
39990        }
39991    }
39992    function_tests++;
39993#endif
39994
39995    return(test_ret);
39996}
39997
39998
39999static int
40000test_xmlUCSIsLinearBIdeograms(void) {
40001    int test_ret = 0;
40002
40003#if defined(LIBXML_UNICODE_ENABLED)
40004    int mem_base;
40005    int ret_val;
40006    int code; /* UCS code point */
40007    int n_code;
40008
40009    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40010        mem_base = xmlMemBlocks();
40011        code = gen_int(n_code, 0);
40012
40013        ret_val = xmlUCSIsLinearBIdeograms(code);
40014        desret_int(ret_val);
40015        call_tests++;
40016        des_int(n_code, code, 0);
40017        xmlResetLastError();
40018        if (mem_base != xmlMemBlocks()) {
40019            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40020	           xmlMemBlocks() - mem_base);
40021	    test_ret++;
40022            printf(" %d", n_code);
40023            printf("\n");
40024        }
40025    }
40026    function_tests++;
40027#endif
40028
40029    return(test_ret);
40030}
40031
40032
40033static int
40034test_xmlUCSIsLinearBSyllabary(void) {
40035    int test_ret = 0;
40036
40037#if defined(LIBXML_UNICODE_ENABLED)
40038    int mem_base;
40039    int ret_val;
40040    int code; /* UCS code point */
40041    int n_code;
40042
40043    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40044        mem_base = xmlMemBlocks();
40045        code = gen_int(n_code, 0);
40046
40047        ret_val = xmlUCSIsLinearBSyllabary(code);
40048        desret_int(ret_val);
40049        call_tests++;
40050        des_int(n_code, code, 0);
40051        xmlResetLastError();
40052        if (mem_base != xmlMemBlocks()) {
40053            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40054	           xmlMemBlocks() - mem_base);
40055	    test_ret++;
40056            printf(" %d", n_code);
40057            printf("\n");
40058        }
40059    }
40060    function_tests++;
40061#endif
40062
40063    return(test_ret);
40064}
40065
40066
40067static int
40068test_xmlUCSIsLowSurrogates(void) {
40069    int test_ret = 0;
40070
40071#if defined(LIBXML_UNICODE_ENABLED)
40072    int mem_base;
40073    int ret_val;
40074    int code; /* UCS code point */
40075    int n_code;
40076
40077    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40078        mem_base = xmlMemBlocks();
40079        code = gen_int(n_code, 0);
40080
40081        ret_val = xmlUCSIsLowSurrogates(code);
40082        desret_int(ret_val);
40083        call_tests++;
40084        des_int(n_code, code, 0);
40085        xmlResetLastError();
40086        if (mem_base != xmlMemBlocks()) {
40087            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40088	           xmlMemBlocks() - mem_base);
40089	    test_ret++;
40090            printf(" %d", n_code);
40091            printf("\n");
40092        }
40093    }
40094    function_tests++;
40095#endif
40096
40097    return(test_ret);
40098}
40099
40100
40101static int
40102test_xmlUCSIsMalayalam(void) {
40103    int test_ret = 0;
40104
40105#if defined(LIBXML_UNICODE_ENABLED)
40106    int mem_base;
40107    int ret_val;
40108    int code; /* UCS code point */
40109    int n_code;
40110
40111    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40112        mem_base = xmlMemBlocks();
40113        code = gen_int(n_code, 0);
40114
40115        ret_val = xmlUCSIsMalayalam(code);
40116        desret_int(ret_val);
40117        call_tests++;
40118        des_int(n_code, code, 0);
40119        xmlResetLastError();
40120        if (mem_base != xmlMemBlocks()) {
40121            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40122	           xmlMemBlocks() - mem_base);
40123	    test_ret++;
40124            printf(" %d", n_code);
40125            printf("\n");
40126        }
40127    }
40128    function_tests++;
40129#endif
40130
40131    return(test_ret);
40132}
40133
40134
40135static int
40136test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40137    int test_ret = 0;
40138
40139#if defined(LIBXML_UNICODE_ENABLED)
40140    int mem_base;
40141    int ret_val;
40142    int code; /* UCS code point */
40143    int n_code;
40144
40145    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40146        mem_base = xmlMemBlocks();
40147        code = gen_int(n_code, 0);
40148
40149        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40150        desret_int(ret_val);
40151        call_tests++;
40152        des_int(n_code, code, 0);
40153        xmlResetLastError();
40154        if (mem_base != xmlMemBlocks()) {
40155            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40156	           xmlMemBlocks() - mem_base);
40157	    test_ret++;
40158            printf(" %d", n_code);
40159            printf("\n");
40160        }
40161    }
40162    function_tests++;
40163#endif
40164
40165    return(test_ret);
40166}
40167
40168
40169static int
40170test_xmlUCSIsMathematicalOperators(void) {
40171    int test_ret = 0;
40172
40173#if defined(LIBXML_UNICODE_ENABLED)
40174    int mem_base;
40175    int ret_val;
40176    int code; /* UCS code point */
40177    int n_code;
40178
40179    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40180        mem_base = xmlMemBlocks();
40181        code = gen_int(n_code, 0);
40182
40183        ret_val = xmlUCSIsMathematicalOperators(code);
40184        desret_int(ret_val);
40185        call_tests++;
40186        des_int(n_code, code, 0);
40187        xmlResetLastError();
40188        if (mem_base != xmlMemBlocks()) {
40189            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40190	           xmlMemBlocks() - mem_base);
40191	    test_ret++;
40192            printf(" %d", n_code);
40193            printf("\n");
40194        }
40195    }
40196    function_tests++;
40197#endif
40198
40199    return(test_ret);
40200}
40201
40202
40203static int
40204test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40205    int test_ret = 0;
40206
40207#if defined(LIBXML_UNICODE_ENABLED)
40208    int mem_base;
40209    int ret_val;
40210    int code; /* UCS code point */
40211    int n_code;
40212
40213    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40214        mem_base = xmlMemBlocks();
40215        code = gen_int(n_code, 0);
40216
40217        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
40218        desret_int(ret_val);
40219        call_tests++;
40220        des_int(n_code, code, 0);
40221        xmlResetLastError();
40222        if (mem_base != xmlMemBlocks()) {
40223            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
40224	           xmlMemBlocks() - mem_base);
40225	    test_ret++;
40226            printf(" %d", n_code);
40227            printf("\n");
40228        }
40229    }
40230    function_tests++;
40231#endif
40232
40233    return(test_ret);
40234}
40235
40236
40237static int
40238test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
40239    int test_ret = 0;
40240
40241#if defined(LIBXML_UNICODE_ENABLED)
40242    int mem_base;
40243    int ret_val;
40244    int code; /* UCS code point */
40245    int n_code;
40246
40247    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40248        mem_base = xmlMemBlocks();
40249        code = gen_int(n_code, 0);
40250
40251        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
40252        desret_int(ret_val);
40253        call_tests++;
40254        des_int(n_code, code, 0);
40255        xmlResetLastError();
40256        if (mem_base != xmlMemBlocks()) {
40257            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
40258	           xmlMemBlocks() - mem_base);
40259	    test_ret++;
40260            printf(" %d", n_code);
40261            printf("\n");
40262        }
40263    }
40264    function_tests++;
40265#endif
40266
40267    return(test_ret);
40268}
40269
40270
40271static int
40272test_xmlUCSIsMiscellaneousSymbols(void) {
40273    int test_ret = 0;
40274
40275#if defined(LIBXML_UNICODE_ENABLED)
40276    int mem_base;
40277    int ret_val;
40278    int code; /* UCS code point */
40279    int n_code;
40280
40281    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40282        mem_base = xmlMemBlocks();
40283        code = gen_int(n_code, 0);
40284
40285        ret_val = xmlUCSIsMiscellaneousSymbols(code);
40286        desret_int(ret_val);
40287        call_tests++;
40288        des_int(n_code, code, 0);
40289        xmlResetLastError();
40290        if (mem_base != xmlMemBlocks()) {
40291            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
40292	           xmlMemBlocks() - mem_base);
40293	    test_ret++;
40294            printf(" %d", n_code);
40295            printf("\n");
40296        }
40297    }
40298    function_tests++;
40299#endif
40300
40301    return(test_ret);
40302}
40303
40304
40305static int
40306test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
40307    int test_ret = 0;
40308
40309#if defined(LIBXML_UNICODE_ENABLED)
40310    int mem_base;
40311    int ret_val;
40312    int code; /* UCS code point */
40313    int n_code;
40314
40315    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40316        mem_base = xmlMemBlocks();
40317        code = gen_int(n_code, 0);
40318
40319        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
40320        desret_int(ret_val);
40321        call_tests++;
40322        des_int(n_code, code, 0);
40323        xmlResetLastError();
40324        if (mem_base != xmlMemBlocks()) {
40325            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
40326	           xmlMemBlocks() - mem_base);
40327	    test_ret++;
40328            printf(" %d", n_code);
40329            printf("\n");
40330        }
40331    }
40332    function_tests++;
40333#endif
40334
40335    return(test_ret);
40336}
40337
40338
40339static int
40340test_xmlUCSIsMiscellaneousTechnical(void) {
40341    int test_ret = 0;
40342
40343#if defined(LIBXML_UNICODE_ENABLED)
40344    int mem_base;
40345    int ret_val;
40346    int code; /* UCS code point */
40347    int n_code;
40348
40349    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40350        mem_base = xmlMemBlocks();
40351        code = gen_int(n_code, 0);
40352
40353        ret_val = xmlUCSIsMiscellaneousTechnical(code);
40354        desret_int(ret_val);
40355        call_tests++;
40356        des_int(n_code, code, 0);
40357        xmlResetLastError();
40358        if (mem_base != xmlMemBlocks()) {
40359            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
40360	           xmlMemBlocks() - mem_base);
40361	    test_ret++;
40362            printf(" %d", n_code);
40363            printf("\n");
40364        }
40365    }
40366    function_tests++;
40367#endif
40368
40369    return(test_ret);
40370}
40371
40372
40373static int
40374test_xmlUCSIsMongolian(void) {
40375    int test_ret = 0;
40376
40377#if defined(LIBXML_UNICODE_ENABLED)
40378    int mem_base;
40379    int ret_val;
40380    int code; /* UCS code point */
40381    int n_code;
40382
40383    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40384        mem_base = xmlMemBlocks();
40385        code = gen_int(n_code, 0);
40386
40387        ret_val = xmlUCSIsMongolian(code);
40388        desret_int(ret_val);
40389        call_tests++;
40390        des_int(n_code, code, 0);
40391        xmlResetLastError();
40392        if (mem_base != xmlMemBlocks()) {
40393            printf("Leak of %d blocks found in xmlUCSIsMongolian",
40394	           xmlMemBlocks() - mem_base);
40395	    test_ret++;
40396            printf(" %d", n_code);
40397            printf("\n");
40398        }
40399    }
40400    function_tests++;
40401#endif
40402
40403    return(test_ret);
40404}
40405
40406
40407static int
40408test_xmlUCSIsMusicalSymbols(void) {
40409    int test_ret = 0;
40410
40411#if defined(LIBXML_UNICODE_ENABLED)
40412    int mem_base;
40413    int ret_val;
40414    int code; /* UCS code point */
40415    int n_code;
40416
40417    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40418        mem_base = xmlMemBlocks();
40419        code = gen_int(n_code, 0);
40420
40421        ret_val = xmlUCSIsMusicalSymbols(code);
40422        desret_int(ret_val);
40423        call_tests++;
40424        des_int(n_code, code, 0);
40425        xmlResetLastError();
40426        if (mem_base != xmlMemBlocks()) {
40427            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
40428	           xmlMemBlocks() - mem_base);
40429	    test_ret++;
40430            printf(" %d", n_code);
40431            printf("\n");
40432        }
40433    }
40434    function_tests++;
40435#endif
40436
40437    return(test_ret);
40438}
40439
40440
40441static int
40442test_xmlUCSIsMyanmar(void) {
40443    int test_ret = 0;
40444
40445#if defined(LIBXML_UNICODE_ENABLED)
40446    int mem_base;
40447    int ret_val;
40448    int code; /* UCS code point */
40449    int n_code;
40450
40451    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40452        mem_base = xmlMemBlocks();
40453        code = gen_int(n_code, 0);
40454
40455        ret_val = xmlUCSIsMyanmar(code);
40456        desret_int(ret_val);
40457        call_tests++;
40458        des_int(n_code, code, 0);
40459        xmlResetLastError();
40460        if (mem_base != xmlMemBlocks()) {
40461            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
40462	           xmlMemBlocks() - mem_base);
40463	    test_ret++;
40464            printf(" %d", n_code);
40465            printf("\n");
40466        }
40467    }
40468    function_tests++;
40469#endif
40470
40471    return(test_ret);
40472}
40473
40474
40475static int
40476test_xmlUCSIsNumberForms(void) {
40477    int test_ret = 0;
40478
40479#if defined(LIBXML_UNICODE_ENABLED)
40480    int mem_base;
40481    int ret_val;
40482    int code; /* UCS code point */
40483    int n_code;
40484
40485    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40486        mem_base = xmlMemBlocks();
40487        code = gen_int(n_code, 0);
40488
40489        ret_val = xmlUCSIsNumberForms(code);
40490        desret_int(ret_val);
40491        call_tests++;
40492        des_int(n_code, code, 0);
40493        xmlResetLastError();
40494        if (mem_base != xmlMemBlocks()) {
40495            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
40496	           xmlMemBlocks() - mem_base);
40497	    test_ret++;
40498            printf(" %d", n_code);
40499            printf("\n");
40500        }
40501    }
40502    function_tests++;
40503#endif
40504
40505    return(test_ret);
40506}
40507
40508
40509static int
40510test_xmlUCSIsOgham(void) {
40511    int test_ret = 0;
40512
40513#if defined(LIBXML_UNICODE_ENABLED)
40514    int mem_base;
40515    int ret_val;
40516    int code; /* UCS code point */
40517    int n_code;
40518
40519    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40520        mem_base = xmlMemBlocks();
40521        code = gen_int(n_code, 0);
40522
40523        ret_val = xmlUCSIsOgham(code);
40524        desret_int(ret_val);
40525        call_tests++;
40526        des_int(n_code, code, 0);
40527        xmlResetLastError();
40528        if (mem_base != xmlMemBlocks()) {
40529            printf("Leak of %d blocks found in xmlUCSIsOgham",
40530	           xmlMemBlocks() - mem_base);
40531	    test_ret++;
40532            printf(" %d", n_code);
40533            printf("\n");
40534        }
40535    }
40536    function_tests++;
40537#endif
40538
40539    return(test_ret);
40540}
40541
40542
40543static int
40544test_xmlUCSIsOldItalic(void) {
40545    int test_ret = 0;
40546
40547#if defined(LIBXML_UNICODE_ENABLED)
40548    int mem_base;
40549    int ret_val;
40550    int code; /* UCS code point */
40551    int n_code;
40552
40553    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40554        mem_base = xmlMemBlocks();
40555        code = gen_int(n_code, 0);
40556
40557        ret_val = xmlUCSIsOldItalic(code);
40558        desret_int(ret_val);
40559        call_tests++;
40560        des_int(n_code, code, 0);
40561        xmlResetLastError();
40562        if (mem_base != xmlMemBlocks()) {
40563            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
40564	           xmlMemBlocks() - mem_base);
40565	    test_ret++;
40566            printf(" %d", n_code);
40567            printf("\n");
40568        }
40569    }
40570    function_tests++;
40571#endif
40572
40573    return(test_ret);
40574}
40575
40576
40577static int
40578test_xmlUCSIsOpticalCharacterRecognition(void) {
40579    int test_ret = 0;
40580
40581#if defined(LIBXML_UNICODE_ENABLED)
40582    int mem_base;
40583    int ret_val;
40584    int code; /* UCS code point */
40585    int n_code;
40586
40587    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40588        mem_base = xmlMemBlocks();
40589        code = gen_int(n_code, 0);
40590
40591        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
40592        desret_int(ret_val);
40593        call_tests++;
40594        des_int(n_code, code, 0);
40595        xmlResetLastError();
40596        if (mem_base != xmlMemBlocks()) {
40597            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
40598	           xmlMemBlocks() - mem_base);
40599	    test_ret++;
40600            printf(" %d", n_code);
40601            printf("\n");
40602        }
40603    }
40604    function_tests++;
40605#endif
40606
40607    return(test_ret);
40608}
40609
40610
40611static int
40612test_xmlUCSIsOriya(void) {
40613    int test_ret = 0;
40614
40615#if defined(LIBXML_UNICODE_ENABLED)
40616    int mem_base;
40617    int ret_val;
40618    int code; /* UCS code point */
40619    int n_code;
40620
40621    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40622        mem_base = xmlMemBlocks();
40623        code = gen_int(n_code, 0);
40624
40625        ret_val = xmlUCSIsOriya(code);
40626        desret_int(ret_val);
40627        call_tests++;
40628        des_int(n_code, code, 0);
40629        xmlResetLastError();
40630        if (mem_base != xmlMemBlocks()) {
40631            printf("Leak of %d blocks found in xmlUCSIsOriya",
40632	           xmlMemBlocks() - mem_base);
40633	    test_ret++;
40634            printf(" %d", n_code);
40635            printf("\n");
40636        }
40637    }
40638    function_tests++;
40639#endif
40640
40641    return(test_ret);
40642}
40643
40644
40645static int
40646test_xmlUCSIsOsmanya(void) {
40647    int test_ret = 0;
40648
40649#if defined(LIBXML_UNICODE_ENABLED)
40650    int mem_base;
40651    int ret_val;
40652    int code; /* UCS code point */
40653    int n_code;
40654
40655    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40656        mem_base = xmlMemBlocks();
40657        code = gen_int(n_code, 0);
40658
40659        ret_val = xmlUCSIsOsmanya(code);
40660        desret_int(ret_val);
40661        call_tests++;
40662        des_int(n_code, code, 0);
40663        xmlResetLastError();
40664        if (mem_base != xmlMemBlocks()) {
40665            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
40666	           xmlMemBlocks() - mem_base);
40667	    test_ret++;
40668            printf(" %d", n_code);
40669            printf("\n");
40670        }
40671    }
40672    function_tests++;
40673#endif
40674
40675    return(test_ret);
40676}
40677
40678
40679static int
40680test_xmlUCSIsPhoneticExtensions(void) {
40681    int test_ret = 0;
40682
40683#if defined(LIBXML_UNICODE_ENABLED)
40684    int mem_base;
40685    int ret_val;
40686    int code; /* UCS code point */
40687    int n_code;
40688
40689    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40690        mem_base = xmlMemBlocks();
40691        code = gen_int(n_code, 0);
40692
40693        ret_val = xmlUCSIsPhoneticExtensions(code);
40694        desret_int(ret_val);
40695        call_tests++;
40696        des_int(n_code, code, 0);
40697        xmlResetLastError();
40698        if (mem_base != xmlMemBlocks()) {
40699            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
40700	           xmlMemBlocks() - mem_base);
40701	    test_ret++;
40702            printf(" %d", n_code);
40703            printf("\n");
40704        }
40705    }
40706    function_tests++;
40707#endif
40708
40709    return(test_ret);
40710}
40711
40712
40713static int
40714test_xmlUCSIsPrivateUse(void) {
40715    int test_ret = 0;
40716
40717#if defined(LIBXML_UNICODE_ENABLED)
40718    int mem_base;
40719    int ret_val;
40720    int code; /* UCS code point */
40721    int n_code;
40722
40723    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40724        mem_base = xmlMemBlocks();
40725        code = gen_int(n_code, 0);
40726
40727        ret_val = xmlUCSIsPrivateUse(code);
40728        desret_int(ret_val);
40729        call_tests++;
40730        des_int(n_code, code, 0);
40731        xmlResetLastError();
40732        if (mem_base != xmlMemBlocks()) {
40733            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
40734	           xmlMemBlocks() - mem_base);
40735	    test_ret++;
40736            printf(" %d", n_code);
40737            printf("\n");
40738        }
40739    }
40740    function_tests++;
40741#endif
40742
40743    return(test_ret);
40744}
40745
40746
40747static int
40748test_xmlUCSIsPrivateUseArea(void) {
40749    int test_ret = 0;
40750
40751#if defined(LIBXML_UNICODE_ENABLED)
40752    int mem_base;
40753    int ret_val;
40754    int code; /* UCS code point */
40755    int n_code;
40756
40757    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40758        mem_base = xmlMemBlocks();
40759        code = gen_int(n_code, 0);
40760
40761        ret_val = xmlUCSIsPrivateUseArea(code);
40762        desret_int(ret_val);
40763        call_tests++;
40764        des_int(n_code, code, 0);
40765        xmlResetLastError();
40766        if (mem_base != xmlMemBlocks()) {
40767            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
40768	           xmlMemBlocks() - mem_base);
40769	    test_ret++;
40770            printf(" %d", n_code);
40771            printf("\n");
40772        }
40773    }
40774    function_tests++;
40775#endif
40776
40777    return(test_ret);
40778}
40779
40780
40781static int
40782test_xmlUCSIsRunic(void) {
40783    int test_ret = 0;
40784
40785#if defined(LIBXML_UNICODE_ENABLED)
40786    int mem_base;
40787    int ret_val;
40788    int code; /* UCS code point */
40789    int n_code;
40790
40791    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40792        mem_base = xmlMemBlocks();
40793        code = gen_int(n_code, 0);
40794
40795        ret_val = xmlUCSIsRunic(code);
40796        desret_int(ret_val);
40797        call_tests++;
40798        des_int(n_code, code, 0);
40799        xmlResetLastError();
40800        if (mem_base != xmlMemBlocks()) {
40801            printf("Leak of %d blocks found in xmlUCSIsRunic",
40802	           xmlMemBlocks() - mem_base);
40803	    test_ret++;
40804            printf(" %d", n_code);
40805            printf("\n");
40806        }
40807    }
40808    function_tests++;
40809#endif
40810
40811    return(test_ret);
40812}
40813
40814
40815static int
40816test_xmlUCSIsShavian(void) {
40817    int test_ret = 0;
40818
40819#if defined(LIBXML_UNICODE_ENABLED)
40820    int mem_base;
40821    int ret_val;
40822    int code; /* UCS code point */
40823    int n_code;
40824
40825    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40826        mem_base = xmlMemBlocks();
40827        code = gen_int(n_code, 0);
40828
40829        ret_val = xmlUCSIsShavian(code);
40830        desret_int(ret_val);
40831        call_tests++;
40832        des_int(n_code, code, 0);
40833        xmlResetLastError();
40834        if (mem_base != xmlMemBlocks()) {
40835            printf("Leak of %d blocks found in xmlUCSIsShavian",
40836	           xmlMemBlocks() - mem_base);
40837	    test_ret++;
40838            printf(" %d", n_code);
40839            printf("\n");
40840        }
40841    }
40842    function_tests++;
40843#endif
40844
40845    return(test_ret);
40846}
40847
40848
40849static int
40850test_xmlUCSIsSinhala(void) {
40851    int test_ret = 0;
40852
40853#if defined(LIBXML_UNICODE_ENABLED)
40854    int mem_base;
40855    int ret_val;
40856    int code; /* UCS code point */
40857    int n_code;
40858
40859    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40860        mem_base = xmlMemBlocks();
40861        code = gen_int(n_code, 0);
40862
40863        ret_val = xmlUCSIsSinhala(code);
40864        desret_int(ret_val);
40865        call_tests++;
40866        des_int(n_code, code, 0);
40867        xmlResetLastError();
40868        if (mem_base != xmlMemBlocks()) {
40869            printf("Leak of %d blocks found in xmlUCSIsSinhala",
40870	           xmlMemBlocks() - mem_base);
40871	    test_ret++;
40872            printf(" %d", n_code);
40873            printf("\n");
40874        }
40875    }
40876    function_tests++;
40877#endif
40878
40879    return(test_ret);
40880}
40881
40882
40883static int
40884test_xmlUCSIsSmallFormVariants(void) {
40885    int test_ret = 0;
40886
40887#if defined(LIBXML_UNICODE_ENABLED)
40888    int mem_base;
40889    int ret_val;
40890    int code; /* UCS code point */
40891    int n_code;
40892
40893    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40894        mem_base = xmlMemBlocks();
40895        code = gen_int(n_code, 0);
40896
40897        ret_val = xmlUCSIsSmallFormVariants(code);
40898        desret_int(ret_val);
40899        call_tests++;
40900        des_int(n_code, code, 0);
40901        xmlResetLastError();
40902        if (mem_base != xmlMemBlocks()) {
40903            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
40904	           xmlMemBlocks() - mem_base);
40905	    test_ret++;
40906            printf(" %d", n_code);
40907            printf("\n");
40908        }
40909    }
40910    function_tests++;
40911#endif
40912
40913    return(test_ret);
40914}
40915
40916
40917static int
40918test_xmlUCSIsSpacingModifierLetters(void) {
40919    int test_ret = 0;
40920
40921#if defined(LIBXML_UNICODE_ENABLED)
40922    int mem_base;
40923    int ret_val;
40924    int code; /* UCS code point */
40925    int n_code;
40926
40927    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40928        mem_base = xmlMemBlocks();
40929        code = gen_int(n_code, 0);
40930
40931        ret_val = xmlUCSIsSpacingModifierLetters(code);
40932        desret_int(ret_val);
40933        call_tests++;
40934        des_int(n_code, code, 0);
40935        xmlResetLastError();
40936        if (mem_base != xmlMemBlocks()) {
40937            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
40938	           xmlMemBlocks() - mem_base);
40939	    test_ret++;
40940            printf(" %d", n_code);
40941            printf("\n");
40942        }
40943    }
40944    function_tests++;
40945#endif
40946
40947    return(test_ret);
40948}
40949
40950
40951static int
40952test_xmlUCSIsSpecials(void) {
40953    int test_ret = 0;
40954
40955#if defined(LIBXML_UNICODE_ENABLED)
40956    int mem_base;
40957    int ret_val;
40958    int code; /* UCS code point */
40959    int n_code;
40960
40961    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40962        mem_base = xmlMemBlocks();
40963        code = gen_int(n_code, 0);
40964
40965        ret_val = xmlUCSIsSpecials(code);
40966        desret_int(ret_val);
40967        call_tests++;
40968        des_int(n_code, code, 0);
40969        xmlResetLastError();
40970        if (mem_base != xmlMemBlocks()) {
40971            printf("Leak of %d blocks found in xmlUCSIsSpecials",
40972	           xmlMemBlocks() - mem_base);
40973	    test_ret++;
40974            printf(" %d", n_code);
40975            printf("\n");
40976        }
40977    }
40978    function_tests++;
40979#endif
40980
40981    return(test_ret);
40982}
40983
40984
40985static int
40986test_xmlUCSIsSuperscriptsandSubscripts(void) {
40987    int test_ret = 0;
40988
40989#if defined(LIBXML_UNICODE_ENABLED)
40990    int mem_base;
40991    int ret_val;
40992    int code; /* UCS code point */
40993    int n_code;
40994
40995    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40996        mem_base = xmlMemBlocks();
40997        code = gen_int(n_code, 0);
40998
40999        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41000        desret_int(ret_val);
41001        call_tests++;
41002        des_int(n_code, code, 0);
41003        xmlResetLastError();
41004        if (mem_base != xmlMemBlocks()) {
41005            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41006	           xmlMemBlocks() - mem_base);
41007	    test_ret++;
41008            printf(" %d", n_code);
41009            printf("\n");
41010        }
41011    }
41012    function_tests++;
41013#endif
41014
41015    return(test_ret);
41016}
41017
41018
41019static int
41020test_xmlUCSIsSupplementalArrowsA(void) {
41021    int test_ret = 0;
41022
41023#if defined(LIBXML_UNICODE_ENABLED)
41024    int mem_base;
41025    int ret_val;
41026    int code; /* UCS code point */
41027    int n_code;
41028
41029    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41030        mem_base = xmlMemBlocks();
41031        code = gen_int(n_code, 0);
41032
41033        ret_val = xmlUCSIsSupplementalArrowsA(code);
41034        desret_int(ret_val);
41035        call_tests++;
41036        des_int(n_code, code, 0);
41037        xmlResetLastError();
41038        if (mem_base != xmlMemBlocks()) {
41039            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41040	           xmlMemBlocks() - mem_base);
41041	    test_ret++;
41042            printf(" %d", n_code);
41043            printf("\n");
41044        }
41045    }
41046    function_tests++;
41047#endif
41048
41049    return(test_ret);
41050}
41051
41052
41053static int
41054test_xmlUCSIsSupplementalArrowsB(void) {
41055    int test_ret = 0;
41056
41057#if defined(LIBXML_UNICODE_ENABLED)
41058    int mem_base;
41059    int ret_val;
41060    int code; /* UCS code point */
41061    int n_code;
41062
41063    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41064        mem_base = xmlMemBlocks();
41065        code = gen_int(n_code, 0);
41066
41067        ret_val = xmlUCSIsSupplementalArrowsB(code);
41068        desret_int(ret_val);
41069        call_tests++;
41070        des_int(n_code, code, 0);
41071        xmlResetLastError();
41072        if (mem_base != xmlMemBlocks()) {
41073            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41074	           xmlMemBlocks() - mem_base);
41075	    test_ret++;
41076            printf(" %d", n_code);
41077            printf("\n");
41078        }
41079    }
41080    function_tests++;
41081#endif
41082
41083    return(test_ret);
41084}
41085
41086
41087static int
41088test_xmlUCSIsSupplementalMathematicalOperators(void) {
41089    int test_ret = 0;
41090
41091#if defined(LIBXML_UNICODE_ENABLED)
41092    int mem_base;
41093    int ret_val;
41094    int code; /* UCS code point */
41095    int n_code;
41096
41097    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41098        mem_base = xmlMemBlocks();
41099        code = gen_int(n_code, 0);
41100
41101        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41102        desret_int(ret_val);
41103        call_tests++;
41104        des_int(n_code, code, 0);
41105        xmlResetLastError();
41106        if (mem_base != xmlMemBlocks()) {
41107            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41108	           xmlMemBlocks() - mem_base);
41109	    test_ret++;
41110            printf(" %d", n_code);
41111            printf("\n");
41112        }
41113    }
41114    function_tests++;
41115#endif
41116
41117    return(test_ret);
41118}
41119
41120
41121static int
41122test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41123    int test_ret = 0;
41124
41125#if defined(LIBXML_UNICODE_ENABLED)
41126    int mem_base;
41127    int ret_val;
41128    int code; /* UCS code point */
41129    int n_code;
41130
41131    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41132        mem_base = xmlMemBlocks();
41133        code = gen_int(n_code, 0);
41134
41135        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41136        desret_int(ret_val);
41137        call_tests++;
41138        des_int(n_code, code, 0);
41139        xmlResetLastError();
41140        if (mem_base != xmlMemBlocks()) {
41141            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41142	           xmlMemBlocks() - mem_base);
41143	    test_ret++;
41144            printf(" %d", n_code);
41145            printf("\n");
41146        }
41147    }
41148    function_tests++;
41149#endif
41150
41151    return(test_ret);
41152}
41153
41154
41155static int
41156test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41157    int test_ret = 0;
41158
41159#if defined(LIBXML_UNICODE_ENABLED)
41160    int mem_base;
41161    int ret_val;
41162    int code; /* UCS code point */
41163    int n_code;
41164
41165    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41166        mem_base = xmlMemBlocks();
41167        code = gen_int(n_code, 0);
41168
41169        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41170        desret_int(ret_val);
41171        call_tests++;
41172        des_int(n_code, code, 0);
41173        xmlResetLastError();
41174        if (mem_base != xmlMemBlocks()) {
41175            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41176	           xmlMemBlocks() - mem_base);
41177	    test_ret++;
41178            printf(" %d", n_code);
41179            printf("\n");
41180        }
41181    }
41182    function_tests++;
41183#endif
41184
41185    return(test_ret);
41186}
41187
41188
41189static int
41190test_xmlUCSIsSyriac(void) {
41191    int test_ret = 0;
41192
41193#if defined(LIBXML_UNICODE_ENABLED)
41194    int mem_base;
41195    int ret_val;
41196    int code; /* UCS code point */
41197    int n_code;
41198
41199    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41200        mem_base = xmlMemBlocks();
41201        code = gen_int(n_code, 0);
41202
41203        ret_val = xmlUCSIsSyriac(code);
41204        desret_int(ret_val);
41205        call_tests++;
41206        des_int(n_code, code, 0);
41207        xmlResetLastError();
41208        if (mem_base != xmlMemBlocks()) {
41209            printf("Leak of %d blocks found in xmlUCSIsSyriac",
41210	           xmlMemBlocks() - mem_base);
41211	    test_ret++;
41212            printf(" %d", n_code);
41213            printf("\n");
41214        }
41215    }
41216    function_tests++;
41217#endif
41218
41219    return(test_ret);
41220}
41221
41222
41223static int
41224test_xmlUCSIsTagalog(void) {
41225    int test_ret = 0;
41226
41227#if defined(LIBXML_UNICODE_ENABLED)
41228    int mem_base;
41229    int ret_val;
41230    int code; /* UCS code point */
41231    int n_code;
41232
41233    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41234        mem_base = xmlMemBlocks();
41235        code = gen_int(n_code, 0);
41236
41237        ret_val = xmlUCSIsTagalog(code);
41238        desret_int(ret_val);
41239        call_tests++;
41240        des_int(n_code, code, 0);
41241        xmlResetLastError();
41242        if (mem_base != xmlMemBlocks()) {
41243            printf("Leak of %d blocks found in xmlUCSIsTagalog",
41244	           xmlMemBlocks() - mem_base);
41245	    test_ret++;
41246            printf(" %d", n_code);
41247            printf("\n");
41248        }
41249    }
41250    function_tests++;
41251#endif
41252
41253    return(test_ret);
41254}
41255
41256
41257static int
41258test_xmlUCSIsTagbanwa(void) {
41259    int test_ret = 0;
41260
41261#if defined(LIBXML_UNICODE_ENABLED)
41262    int mem_base;
41263    int ret_val;
41264    int code; /* UCS code point */
41265    int n_code;
41266
41267    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41268        mem_base = xmlMemBlocks();
41269        code = gen_int(n_code, 0);
41270
41271        ret_val = xmlUCSIsTagbanwa(code);
41272        desret_int(ret_val);
41273        call_tests++;
41274        des_int(n_code, code, 0);
41275        xmlResetLastError();
41276        if (mem_base != xmlMemBlocks()) {
41277            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
41278	           xmlMemBlocks() - mem_base);
41279	    test_ret++;
41280            printf(" %d", n_code);
41281            printf("\n");
41282        }
41283    }
41284    function_tests++;
41285#endif
41286
41287    return(test_ret);
41288}
41289
41290
41291static int
41292test_xmlUCSIsTags(void) {
41293    int test_ret = 0;
41294
41295#if defined(LIBXML_UNICODE_ENABLED)
41296    int mem_base;
41297    int ret_val;
41298    int code; /* UCS code point */
41299    int n_code;
41300
41301    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41302        mem_base = xmlMemBlocks();
41303        code = gen_int(n_code, 0);
41304
41305        ret_val = xmlUCSIsTags(code);
41306        desret_int(ret_val);
41307        call_tests++;
41308        des_int(n_code, code, 0);
41309        xmlResetLastError();
41310        if (mem_base != xmlMemBlocks()) {
41311            printf("Leak of %d blocks found in xmlUCSIsTags",
41312	           xmlMemBlocks() - mem_base);
41313	    test_ret++;
41314            printf(" %d", n_code);
41315            printf("\n");
41316        }
41317    }
41318    function_tests++;
41319#endif
41320
41321    return(test_ret);
41322}
41323
41324
41325static int
41326test_xmlUCSIsTaiLe(void) {
41327    int test_ret = 0;
41328
41329#if defined(LIBXML_UNICODE_ENABLED)
41330    int mem_base;
41331    int ret_val;
41332    int code; /* UCS code point */
41333    int n_code;
41334
41335    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41336        mem_base = xmlMemBlocks();
41337        code = gen_int(n_code, 0);
41338
41339        ret_val = xmlUCSIsTaiLe(code);
41340        desret_int(ret_val);
41341        call_tests++;
41342        des_int(n_code, code, 0);
41343        xmlResetLastError();
41344        if (mem_base != xmlMemBlocks()) {
41345            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
41346	           xmlMemBlocks() - mem_base);
41347	    test_ret++;
41348            printf(" %d", n_code);
41349            printf("\n");
41350        }
41351    }
41352    function_tests++;
41353#endif
41354
41355    return(test_ret);
41356}
41357
41358
41359static int
41360test_xmlUCSIsTaiXuanJingSymbols(void) {
41361    int test_ret = 0;
41362
41363#if defined(LIBXML_UNICODE_ENABLED)
41364    int mem_base;
41365    int ret_val;
41366    int code; /* UCS code point */
41367    int n_code;
41368
41369    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41370        mem_base = xmlMemBlocks();
41371        code = gen_int(n_code, 0);
41372
41373        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
41374        desret_int(ret_val);
41375        call_tests++;
41376        des_int(n_code, code, 0);
41377        xmlResetLastError();
41378        if (mem_base != xmlMemBlocks()) {
41379            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
41380	           xmlMemBlocks() - mem_base);
41381	    test_ret++;
41382            printf(" %d", n_code);
41383            printf("\n");
41384        }
41385    }
41386    function_tests++;
41387#endif
41388
41389    return(test_ret);
41390}
41391
41392
41393static int
41394test_xmlUCSIsTamil(void) {
41395    int test_ret = 0;
41396
41397#if defined(LIBXML_UNICODE_ENABLED)
41398    int mem_base;
41399    int ret_val;
41400    int code; /* UCS code point */
41401    int n_code;
41402
41403    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41404        mem_base = xmlMemBlocks();
41405        code = gen_int(n_code, 0);
41406
41407        ret_val = xmlUCSIsTamil(code);
41408        desret_int(ret_val);
41409        call_tests++;
41410        des_int(n_code, code, 0);
41411        xmlResetLastError();
41412        if (mem_base != xmlMemBlocks()) {
41413            printf("Leak of %d blocks found in xmlUCSIsTamil",
41414	           xmlMemBlocks() - mem_base);
41415	    test_ret++;
41416            printf(" %d", n_code);
41417            printf("\n");
41418        }
41419    }
41420    function_tests++;
41421#endif
41422
41423    return(test_ret);
41424}
41425
41426
41427static int
41428test_xmlUCSIsTelugu(void) {
41429    int test_ret = 0;
41430
41431#if defined(LIBXML_UNICODE_ENABLED)
41432    int mem_base;
41433    int ret_val;
41434    int code; /* UCS code point */
41435    int n_code;
41436
41437    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41438        mem_base = xmlMemBlocks();
41439        code = gen_int(n_code, 0);
41440
41441        ret_val = xmlUCSIsTelugu(code);
41442        desret_int(ret_val);
41443        call_tests++;
41444        des_int(n_code, code, 0);
41445        xmlResetLastError();
41446        if (mem_base != xmlMemBlocks()) {
41447            printf("Leak of %d blocks found in xmlUCSIsTelugu",
41448	           xmlMemBlocks() - mem_base);
41449	    test_ret++;
41450            printf(" %d", n_code);
41451            printf("\n");
41452        }
41453    }
41454    function_tests++;
41455#endif
41456
41457    return(test_ret);
41458}
41459
41460
41461static int
41462test_xmlUCSIsThaana(void) {
41463    int test_ret = 0;
41464
41465#if defined(LIBXML_UNICODE_ENABLED)
41466    int mem_base;
41467    int ret_val;
41468    int code; /* UCS code point */
41469    int n_code;
41470
41471    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41472        mem_base = xmlMemBlocks();
41473        code = gen_int(n_code, 0);
41474
41475        ret_val = xmlUCSIsThaana(code);
41476        desret_int(ret_val);
41477        call_tests++;
41478        des_int(n_code, code, 0);
41479        xmlResetLastError();
41480        if (mem_base != xmlMemBlocks()) {
41481            printf("Leak of %d blocks found in xmlUCSIsThaana",
41482	           xmlMemBlocks() - mem_base);
41483	    test_ret++;
41484            printf(" %d", n_code);
41485            printf("\n");
41486        }
41487    }
41488    function_tests++;
41489#endif
41490
41491    return(test_ret);
41492}
41493
41494
41495static int
41496test_xmlUCSIsThai(void) {
41497    int test_ret = 0;
41498
41499#if defined(LIBXML_UNICODE_ENABLED)
41500    int mem_base;
41501    int ret_val;
41502    int code; /* UCS code point */
41503    int n_code;
41504
41505    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41506        mem_base = xmlMemBlocks();
41507        code = gen_int(n_code, 0);
41508
41509        ret_val = xmlUCSIsThai(code);
41510        desret_int(ret_val);
41511        call_tests++;
41512        des_int(n_code, code, 0);
41513        xmlResetLastError();
41514        if (mem_base != xmlMemBlocks()) {
41515            printf("Leak of %d blocks found in xmlUCSIsThai",
41516	           xmlMemBlocks() - mem_base);
41517	    test_ret++;
41518            printf(" %d", n_code);
41519            printf("\n");
41520        }
41521    }
41522    function_tests++;
41523#endif
41524
41525    return(test_ret);
41526}
41527
41528
41529static int
41530test_xmlUCSIsTibetan(void) {
41531    int test_ret = 0;
41532
41533#if defined(LIBXML_UNICODE_ENABLED)
41534    int mem_base;
41535    int ret_val;
41536    int code; /* UCS code point */
41537    int n_code;
41538
41539    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41540        mem_base = xmlMemBlocks();
41541        code = gen_int(n_code, 0);
41542
41543        ret_val = xmlUCSIsTibetan(code);
41544        desret_int(ret_val);
41545        call_tests++;
41546        des_int(n_code, code, 0);
41547        xmlResetLastError();
41548        if (mem_base != xmlMemBlocks()) {
41549            printf("Leak of %d blocks found in xmlUCSIsTibetan",
41550	           xmlMemBlocks() - mem_base);
41551	    test_ret++;
41552            printf(" %d", n_code);
41553            printf("\n");
41554        }
41555    }
41556    function_tests++;
41557#endif
41558
41559    return(test_ret);
41560}
41561
41562
41563static int
41564test_xmlUCSIsUgaritic(void) {
41565    int test_ret = 0;
41566
41567#if defined(LIBXML_UNICODE_ENABLED)
41568    int mem_base;
41569    int ret_val;
41570    int code; /* UCS code point */
41571    int n_code;
41572
41573    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41574        mem_base = xmlMemBlocks();
41575        code = gen_int(n_code, 0);
41576
41577        ret_val = xmlUCSIsUgaritic(code);
41578        desret_int(ret_val);
41579        call_tests++;
41580        des_int(n_code, code, 0);
41581        xmlResetLastError();
41582        if (mem_base != xmlMemBlocks()) {
41583            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
41584	           xmlMemBlocks() - mem_base);
41585	    test_ret++;
41586            printf(" %d", n_code);
41587            printf("\n");
41588        }
41589    }
41590    function_tests++;
41591#endif
41592
41593    return(test_ret);
41594}
41595
41596
41597static int
41598test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
41599    int test_ret = 0;
41600
41601#if defined(LIBXML_UNICODE_ENABLED)
41602    int mem_base;
41603    int ret_val;
41604    int code; /* UCS code point */
41605    int n_code;
41606
41607    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41608        mem_base = xmlMemBlocks();
41609        code = gen_int(n_code, 0);
41610
41611        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
41612        desret_int(ret_val);
41613        call_tests++;
41614        des_int(n_code, code, 0);
41615        xmlResetLastError();
41616        if (mem_base != xmlMemBlocks()) {
41617            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
41618	           xmlMemBlocks() - mem_base);
41619	    test_ret++;
41620            printf(" %d", n_code);
41621            printf("\n");
41622        }
41623    }
41624    function_tests++;
41625#endif
41626
41627    return(test_ret);
41628}
41629
41630
41631static int
41632test_xmlUCSIsVariationSelectors(void) {
41633    int test_ret = 0;
41634
41635#if defined(LIBXML_UNICODE_ENABLED)
41636    int mem_base;
41637    int ret_val;
41638    int code; /* UCS code point */
41639    int n_code;
41640
41641    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41642        mem_base = xmlMemBlocks();
41643        code = gen_int(n_code, 0);
41644
41645        ret_val = xmlUCSIsVariationSelectors(code);
41646        desret_int(ret_val);
41647        call_tests++;
41648        des_int(n_code, code, 0);
41649        xmlResetLastError();
41650        if (mem_base != xmlMemBlocks()) {
41651            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
41652	           xmlMemBlocks() - mem_base);
41653	    test_ret++;
41654            printf(" %d", n_code);
41655            printf("\n");
41656        }
41657    }
41658    function_tests++;
41659#endif
41660
41661    return(test_ret);
41662}
41663
41664
41665static int
41666test_xmlUCSIsVariationSelectorsSupplement(void) {
41667    int test_ret = 0;
41668
41669#if defined(LIBXML_UNICODE_ENABLED)
41670    int mem_base;
41671    int ret_val;
41672    int code; /* UCS code point */
41673    int n_code;
41674
41675    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41676        mem_base = xmlMemBlocks();
41677        code = gen_int(n_code, 0);
41678
41679        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
41680        desret_int(ret_val);
41681        call_tests++;
41682        des_int(n_code, code, 0);
41683        xmlResetLastError();
41684        if (mem_base != xmlMemBlocks()) {
41685            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
41686	           xmlMemBlocks() - mem_base);
41687	    test_ret++;
41688            printf(" %d", n_code);
41689            printf("\n");
41690        }
41691    }
41692    function_tests++;
41693#endif
41694
41695    return(test_ret);
41696}
41697
41698
41699static int
41700test_xmlUCSIsYiRadicals(void) {
41701    int test_ret = 0;
41702
41703#if defined(LIBXML_UNICODE_ENABLED)
41704    int mem_base;
41705    int ret_val;
41706    int code; /* UCS code point */
41707    int n_code;
41708
41709    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41710        mem_base = xmlMemBlocks();
41711        code = gen_int(n_code, 0);
41712
41713        ret_val = xmlUCSIsYiRadicals(code);
41714        desret_int(ret_val);
41715        call_tests++;
41716        des_int(n_code, code, 0);
41717        xmlResetLastError();
41718        if (mem_base != xmlMemBlocks()) {
41719            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
41720	           xmlMemBlocks() - mem_base);
41721	    test_ret++;
41722            printf(" %d", n_code);
41723            printf("\n");
41724        }
41725    }
41726    function_tests++;
41727#endif
41728
41729    return(test_ret);
41730}
41731
41732
41733static int
41734test_xmlUCSIsYiSyllables(void) {
41735    int test_ret = 0;
41736
41737#if defined(LIBXML_UNICODE_ENABLED)
41738    int mem_base;
41739    int ret_val;
41740    int code; /* UCS code point */
41741    int n_code;
41742
41743    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41744        mem_base = xmlMemBlocks();
41745        code = gen_int(n_code, 0);
41746
41747        ret_val = xmlUCSIsYiSyllables(code);
41748        desret_int(ret_val);
41749        call_tests++;
41750        des_int(n_code, code, 0);
41751        xmlResetLastError();
41752        if (mem_base != xmlMemBlocks()) {
41753            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
41754	           xmlMemBlocks() - mem_base);
41755	    test_ret++;
41756            printf(" %d", n_code);
41757            printf("\n");
41758        }
41759    }
41760    function_tests++;
41761#endif
41762
41763    return(test_ret);
41764}
41765
41766
41767static int
41768test_xmlUCSIsYijingHexagramSymbols(void) {
41769    int test_ret = 0;
41770
41771#if defined(LIBXML_UNICODE_ENABLED)
41772    int mem_base;
41773    int ret_val;
41774    int code; /* UCS code point */
41775    int n_code;
41776
41777    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41778        mem_base = xmlMemBlocks();
41779        code = gen_int(n_code, 0);
41780
41781        ret_val = xmlUCSIsYijingHexagramSymbols(code);
41782        desret_int(ret_val);
41783        call_tests++;
41784        des_int(n_code, code, 0);
41785        xmlResetLastError();
41786        if (mem_base != xmlMemBlocks()) {
41787            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
41788	           xmlMemBlocks() - mem_base);
41789	    test_ret++;
41790            printf(" %d", n_code);
41791            printf("\n");
41792        }
41793    }
41794    function_tests++;
41795#endif
41796
41797    return(test_ret);
41798}
41799
41800static int
41801test_xmlunicode(void) {
41802    int test_ret = 0;
41803
41804    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
41805    test_ret += test_xmlUCSIsAegeanNumbers();
41806    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
41807    test_ret += test_xmlUCSIsArabic();
41808    test_ret += test_xmlUCSIsArabicPresentationFormsA();
41809    test_ret += test_xmlUCSIsArabicPresentationFormsB();
41810    test_ret += test_xmlUCSIsArmenian();
41811    test_ret += test_xmlUCSIsArrows();
41812    test_ret += test_xmlUCSIsBasicLatin();
41813    test_ret += test_xmlUCSIsBengali();
41814    test_ret += test_xmlUCSIsBlock();
41815    test_ret += test_xmlUCSIsBlockElements();
41816    test_ret += test_xmlUCSIsBopomofo();
41817    test_ret += test_xmlUCSIsBopomofoExtended();
41818    test_ret += test_xmlUCSIsBoxDrawing();
41819    test_ret += test_xmlUCSIsBraillePatterns();
41820    test_ret += test_xmlUCSIsBuhid();
41821    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
41822    test_ret += test_xmlUCSIsCJKCompatibility();
41823    test_ret += test_xmlUCSIsCJKCompatibilityForms();
41824    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
41825    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
41826    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
41827    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
41828    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
41829    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
41830    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
41831    test_ret += test_xmlUCSIsCat();
41832    test_ret += test_xmlUCSIsCatC();
41833    test_ret += test_xmlUCSIsCatCc();
41834    test_ret += test_xmlUCSIsCatCf();
41835    test_ret += test_xmlUCSIsCatCo();
41836    test_ret += test_xmlUCSIsCatCs();
41837    test_ret += test_xmlUCSIsCatL();
41838    test_ret += test_xmlUCSIsCatLl();
41839    test_ret += test_xmlUCSIsCatLm();
41840    test_ret += test_xmlUCSIsCatLo();
41841    test_ret += test_xmlUCSIsCatLt();
41842    test_ret += test_xmlUCSIsCatLu();
41843    test_ret += test_xmlUCSIsCatM();
41844    test_ret += test_xmlUCSIsCatMc();
41845    test_ret += test_xmlUCSIsCatMe();
41846    test_ret += test_xmlUCSIsCatMn();
41847    test_ret += test_xmlUCSIsCatN();
41848    test_ret += test_xmlUCSIsCatNd();
41849    test_ret += test_xmlUCSIsCatNl();
41850    test_ret += test_xmlUCSIsCatNo();
41851    test_ret += test_xmlUCSIsCatP();
41852    test_ret += test_xmlUCSIsCatPc();
41853    test_ret += test_xmlUCSIsCatPd();
41854    test_ret += test_xmlUCSIsCatPe();
41855    test_ret += test_xmlUCSIsCatPf();
41856    test_ret += test_xmlUCSIsCatPi();
41857    test_ret += test_xmlUCSIsCatPo();
41858    test_ret += test_xmlUCSIsCatPs();
41859    test_ret += test_xmlUCSIsCatS();
41860    test_ret += test_xmlUCSIsCatSc();
41861    test_ret += test_xmlUCSIsCatSk();
41862    test_ret += test_xmlUCSIsCatSm();
41863    test_ret += test_xmlUCSIsCatSo();
41864    test_ret += test_xmlUCSIsCatZ();
41865    test_ret += test_xmlUCSIsCatZl();
41866    test_ret += test_xmlUCSIsCatZp();
41867    test_ret += test_xmlUCSIsCatZs();
41868    test_ret += test_xmlUCSIsCherokee();
41869    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
41870    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
41871    test_ret += test_xmlUCSIsCombiningHalfMarks();
41872    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
41873    test_ret += test_xmlUCSIsControlPictures();
41874    test_ret += test_xmlUCSIsCurrencySymbols();
41875    test_ret += test_xmlUCSIsCypriotSyllabary();
41876    test_ret += test_xmlUCSIsCyrillic();
41877    test_ret += test_xmlUCSIsCyrillicSupplement();
41878    test_ret += test_xmlUCSIsDeseret();
41879    test_ret += test_xmlUCSIsDevanagari();
41880    test_ret += test_xmlUCSIsDingbats();
41881    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
41882    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
41883    test_ret += test_xmlUCSIsEthiopic();
41884    test_ret += test_xmlUCSIsGeneralPunctuation();
41885    test_ret += test_xmlUCSIsGeometricShapes();
41886    test_ret += test_xmlUCSIsGeorgian();
41887    test_ret += test_xmlUCSIsGothic();
41888    test_ret += test_xmlUCSIsGreek();
41889    test_ret += test_xmlUCSIsGreekExtended();
41890    test_ret += test_xmlUCSIsGreekandCoptic();
41891    test_ret += test_xmlUCSIsGujarati();
41892    test_ret += test_xmlUCSIsGurmukhi();
41893    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
41894    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
41895    test_ret += test_xmlUCSIsHangulJamo();
41896    test_ret += test_xmlUCSIsHangulSyllables();
41897    test_ret += test_xmlUCSIsHanunoo();
41898    test_ret += test_xmlUCSIsHebrew();
41899    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
41900    test_ret += test_xmlUCSIsHighSurrogates();
41901    test_ret += test_xmlUCSIsHiragana();
41902    test_ret += test_xmlUCSIsIPAExtensions();
41903    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
41904    test_ret += test_xmlUCSIsKanbun();
41905    test_ret += test_xmlUCSIsKangxiRadicals();
41906    test_ret += test_xmlUCSIsKannada();
41907    test_ret += test_xmlUCSIsKatakana();
41908    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
41909    test_ret += test_xmlUCSIsKhmer();
41910    test_ret += test_xmlUCSIsKhmerSymbols();
41911    test_ret += test_xmlUCSIsLao();
41912    test_ret += test_xmlUCSIsLatin1Supplement();
41913    test_ret += test_xmlUCSIsLatinExtendedA();
41914    test_ret += test_xmlUCSIsLatinExtendedAdditional();
41915    test_ret += test_xmlUCSIsLatinExtendedB();
41916    test_ret += test_xmlUCSIsLetterlikeSymbols();
41917    test_ret += test_xmlUCSIsLimbu();
41918    test_ret += test_xmlUCSIsLinearBIdeograms();
41919    test_ret += test_xmlUCSIsLinearBSyllabary();
41920    test_ret += test_xmlUCSIsLowSurrogates();
41921    test_ret += test_xmlUCSIsMalayalam();
41922    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
41923    test_ret += test_xmlUCSIsMathematicalOperators();
41924    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
41925    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
41926    test_ret += test_xmlUCSIsMiscellaneousSymbols();
41927    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
41928    test_ret += test_xmlUCSIsMiscellaneousTechnical();
41929    test_ret += test_xmlUCSIsMongolian();
41930    test_ret += test_xmlUCSIsMusicalSymbols();
41931    test_ret += test_xmlUCSIsMyanmar();
41932    test_ret += test_xmlUCSIsNumberForms();
41933    test_ret += test_xmlUCSIsOgham();
41934    test_ret += test_xmlUCSIsOldItalic();
41935    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
41936    test_ret += test_xmlUCSIsOriya();
41937    test_ret += test_xmlUCSIsOsmanya();
41938    test_ret += test_xmlUCSIsPhoneticExtensions();
41939    test_ret += test_xmlUCSIsPrivateUse();
41940    test_ret += test_xmlUCSIsPrivateUseArea();
41941    test_ret += test_xmlUCSIsRunic();
41942    test_ret += test_xmlUCSIsShavian();
41943    test_ret += test_xmlUCSIsSinhala();
41944    test_ret += test_xmlUCSIsSmallFormVariants();
41945    test_ret += test_xmlUCSIsSpacingModifierLetters();
41946    test_ret += test_xmlUCSIsSpecials();
41947    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
41948    test_ret += test_xmlUCSIsSupplementalArrowsA();
41949    test_ret += test_xmlUCSIsSupplementalArrowsB();
41950    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
41951    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
41952    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
41953    test_ret += test_xmlUCSIsSyriac();
41954    test_ret += test_xmlUCSIsTagalog();
41955    test_ret += test_xmlUCSIsTagbanwa();
41956    test_ret += test_xmlUCSIsTags();
41957    test_ret += test_xmlUCSIsTaiLe();
41958    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
41959    test_ret += test_xmlUCSIsTamil();
41960    test_ret += test_xmlUCSIsTelugu();
41961    test_ret += test_xmlUCSIsThaana();
41962    test_ret += test_xmlUCSIsThai();
41963    test_ret += test_xmlUCSIsTibetan();
41964    test_ret += test_xmlUCSIsUgaritic();
41965    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
41966    test_ret += test_xmlUCSIsVariationSelectors();
41967    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
41968    test_ret += test_xmlUCSIsYiRadicals();
41969    test_ret += test_xmlUCSIsYiSyllables();
41970    test_ret += test_xmlUCSIsYijingHexagramSymbols();
41971
41972    if (test_ret != 0)
41973	printf("Module xmlunicode: %d errors\n", test_ret);
41974    return(test_ret);
41975}
41976
41977static int
41978test_xmlNewTextWriter(void) {
41979    int test_ret = 0;
41980
41981#if defined(LIBXML_WRITER_ENABLED)
41982    int mem_base;
41983    xmlTextWriterPtr ret_val;
41984    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
41985    int n_out;
41986
41987    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
41988        mem_base = xmlMemBlocks();
41989        out = gen_xmlOutputBufferPtr(n_out, 0);
41990
41991        ret_val = xmlNewTextWriter(out);
41992        if (ret_val != NULL) out = NULL;
41993        desret_xmlTextWriterPtr(ret_val);
41994        call_tests++;
41995        des_xmlOutputBufferPtr(n_out, out, 0);
41996        xmlResetLastError();
41997        if (mem_base != xmlMemBlocks()) {
41998            printf("Leak of %d blocks found in xmlNewTextWriter",
41999	           xmlMemBlocks() - mem_base);
42000	    test_ret++;
42001            printf(" %d", n_out);
42002            printf("\n");
42003        }
42004    }
42005    function_tests++;
42006#endif
42007
42008    return(test_ret);
42009}
42010
42011
42012static int
42013test_xmlNewTextWriterFilename(void) {
42014    int test_ret = 0;
42015
42016#if defined(LIBXML_WRITER_ENABLED)
42017    int mem_base;
42018    xmlTextWriterPtr ret_val;
42019    const char * uri; /* the URI of the resource for the output */
42020    int n_uri;
42021    int compression; /* compress the output? */
42022    int n_compression;
42023
42024    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42025    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42026        mem_base = xmlMemBlocks();
42027        uri = gen_fileoutput(n_uri, 0);
42028        compression = gen_int(n_compression, 1);
42029
42030        ret_val = xmlNewTextWriterFilename(uri, compression);
42031        desret_xmlTextWriterPtr(ret_val);
42032        call_tests++;
42033        des_fileoutput(n_uri, uri, 0);
42034        des_int(n_compression, compression, 1);
42035        xmlResetLastError();
42036        if (mem_base != xmlMemBlocks()) {
42037            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42038	           xmlMemBlocks() - mem_base);
42039	    test_ret++;
42040            printf(" %d", n_uri);
42041            printf(" %d", n_compression);
42042            printf("\n");
42043        }
42044    }
42045    }
42046    function_tests++;
42047#endif
42048
42049    return(test_ret);
42050}
42051
42052
42053static int
42054test_xmlNewTextWriterMemory(void) {
42055    int test_ret = 0;
42056
42057#if defined(LIBXML_WRITER_ENABLED)
42058    int mem_base;
42059    xmlTextWriterPtr ret_val;
42060    xmlBufferPtr buf; /* xmlBufferPtr */
42061    int n_buf;
42062    int compression; /* compress the output? */
42063    int n_compression;
42064
42065    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42066    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42067        mem_base = xmlMemBlocks();
42068        buf = gen_xmlBufferPtr(n_buf, 0);
42069        compression = gen_int(n_compression, 1);
42070
42071        ret_val = xmlNewTextWriterMemory(buf, compression);
42072        desret_xmlTextWriterPtr(ret_val);
42073        call_tests++;
42074        des_xmlBufferPtr(n_buf, buf, 0);
42075        des_int(n_compression, compression, 1);
42076        xmlResetLastError();
42077        if (mem_base != xmlMemBlocks()) {
42078            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42079	           xmlMemBlocks() - mem_base);
42080	    test_ret++;
42081            printf(" %d", n_buf);
42082            printf(" %d", n_compression);
42083            printf("\n");
42084        }
42085    }
42086    }
42087    function_tests++;
42088#endif
42089
42090    return(test_ret);
42091}
42092
42093
42094static int
42095test_xmlNewTextWriterPushParser(void) {
42096    int test_ret = 0;
42097
42098#if defined(LIBXML_WRITER_ENABLED)
42099    int mem_base;
42100    xmlTextWriterPtr ret_val;
42101    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42102    int n_ctxt;
42103    int compression; /* compress the output? */
42104    int n_compression;
42105
42106    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42107    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42108        mem_base = xmlMemBlocks();
42109        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42110        compression = gen_int(n_compression, 1);
42111
42112        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42113        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42114        desret_xmlTextWriterPtr(ret_val);
42115        call_tests++;
42116        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42117        des_int(n_compression, compression, 1);
42118        xmlResetLastError();
42119        if (mem_base != xmlMemBlocks()) {
42120            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42121	           xmlMemBlocks() - mem_base);
42122	    test_ret++;
42123            printf(" %d", n_ctxt);
42124            printf(" %d", n_compression);
42125            printf("\n");
42126        }
42127    }
42128    }
42129    function_tests++;
42130#endif
42131
42132    return(test_ret);
42133}
42134
42135
42136static int
42137test_xmlNewTextWriterTree(void) {
42138    int test_ret = 0;
42139
42140#if defined(LIBXML_WRITER_ENABLED)
42141    int mem_base;
42142    xmlTextWriterPtr ret_val;
42143    xmlDocPtr doc; /* xmlDocPtr */
42144    int n_doc;
42145    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42146    int n_node;
42147    int compression; /* compress the output? */
42148    int n_compression;
42149
42150    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42151    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42152    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42153        mem_base = xmlMemBlocks();
42154        doc = gen_xmlDocPtr(n_doc, 0);
42155        node = gen_xmlNodePtr(n_node, 1);
42156        compression = gen_int(n_compression, 2);
42157
42158        ret_val = xmlNewTextWriterTree(doc, node, compression);
42159        desret_xmlTextWriterPtr(ret_val);
42160        call_tests++;
42161        des_xmlDocPtr(n_doc, doc, 0);
42162        des_xmlNodePtr(n_node, node, 1);
42163        des_int(n_compression, compression, 2);
42164        xmlResetLastError();
42165        if (mem_base != xmlMemBlocks()) {
42166            printf("Leak of %d blocks found in xmlNewTextWriterTree",
42167	           xmlMemBlocks() - mem_base);
42168	    test_ret++;
42169            printf(" %d", n_doc);
42170            printf(" %d", n_node);
42171            printf(" %d", n_compression);
42172            printf("\n");
42173        }
42174    }
42175    }
42176    }
42177    function_tests++;
42178#endif
42179
42180    return(test_ret);
42181}
42182
42183
42184static int
42185test_xmlTextWriterEndAttribute(void) {
42186    int test_ret = 0;
42187
42188#if defined(LIBXML_WRITER_ENABLED)
42189    int mem_base;
42190    int ret_val;
42191    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42192    int n_writer;
42193
42194    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42195        mem_base = xmlMemBlocks();
42196        writer = gen_xmlTextWriterPtr(n_writer, 0);
42197
42198        ret_val = xmlTextWriterEndAttribute(writer);
42199        desret_int(ret_val);
42200        call_tests++;
42201        des_xmlTextWriterPtr(n_writer, writer, 0);
42202        xmlResetLastError();
42203        if (mem_base != xmlMemBlocks()) {
42204            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42205	           xmlMemBlocks() - mem_base);
42206	    test_ret++;
42207            printf(" %d", n_writer);
42208            printf("\n");
42209        }
42210    }
42211    function_tests++;
42212#endif
42213
42214    return(test_ret);
42215}
42216
42217
42218static int
42219test_xmlTextWriterEndCDATA(void) {
42220    int test_ret = 0;
42221
42222#if defined(LIBXML_WRITER_ENABLED)
42223    int mem_base;
42224    int ret_val;
42225    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42226    int n_writer;
42227
42228    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42229        mem_base = xmlMemBlocks();
42230        writer = gen_xmlTextWriterPtr(n_writer, 0);
42231
42232        ret_val = xmlTextWriterEndCDATA(writer);
42233        desret_int(ret_val);
42234        call_tests++;
42235        des_xmlTextWriterPtr(n_writer, writer, 0);
42236        xmlResetLastError();
42237        if (mem_base != xmlMemBlocks()) {
42238            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42239	           xmlMemBlocks() - mem_base);
42240	    test_ret++;
42241            printf(" %d", n_writer);
42242            printf("\n");
42243        }
42244    }
42245    function_tests++;
42246#endif
42247
42248    return(test_ret);
42249}
42250
42251
42252static int
42253test_xmlTextWriterEndComment(void) {
42254    int test_ret = 0;
42255
42256#if defined(LIBXML_WRITER_ENABLED)
42257    int mem_base;
42258    int ret_val;
42259    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42260    int n_writer;
42261
42262    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42263        mem_base = xmlMemBlocks();
42264        writer = gen_xmlTextWriterPtr(n_writer, 0);
42265
42266        ret_val = xmlTextWriterEndComment(writer);
42267        desret_int(ret_val);
42268        call_tests++;
42269        des_xmlTextWriterPtr(n_writer, writer, 0);
42270        xmlResetLastError();
42271        if (mem_base != xmlMemBlocks()) {
42272            printf("Leak of %d blocks found in xmlTextWriterEndComment",
42273	           xmlMemBlocks() - mem_base);
42274	    test_ret++;
42275            printf(" %d", n_writer);
42276            printf("\n");
42277        }
42278    }
42279    function_tests++;
42280#endif
42281
42282    return(test_ret);
42283}
42284
42285
42286static int
42287test_xmlTextWriterEndDTD(void) {
42288    int test_ret = 0;
42289
42290#if defined(LIBXML_WRITER_ENABLED)
42291    int mem_base;
42292    int ret_val;
42293    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42294    int n_writer;
42295
42296    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42297        mem_base = xmlMemBlocks();
42298        writer = gen_xmlTextWriterPtr(n_writer, 0);
42299
42300        ret_val = xmlTextWriterEndDTD(writer);
42301        desret_int(ret_val);
42302        call_tests++;
42303        des_xmlTextWriterPtr(n_writer, writer, 0);
42304        xmlResetLastError();
42305        if (mem_base != xmlMemBlocks()) {
42306            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42307	           xmlMemBlocks() - mem_base);
42308	    test_ret++;
42309            printf(" %d", n_writer);
42310            printf("\n");
42311        }
42312    }
42313    function_tests++;
42314#endif
42315
42316    return(test_ret);
42317}
42318
42319
42320static int
42321test_xmlTextWriterEndDTDAttlist(void) {
42322    int test_ret = 0;
42323
42324#if defined(LIBXML_WRITER_ENABLED)
42325    int mem_base;
42326    int ret_val;
42327    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42328    int n_writer;
42329
42330    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42331        mem_base = xmlMemBlocks();
42332        writer = gen_xmlTextWriterPtr(n_writer, 0);
42333
42334        ret_val = xmlTextWriterEndDTDAttlist(writer);
42335        desret_int(ret_val);
42336        call_tests++;
42337        des_xmlTextWriterPtr(n_writer, writer, 0);
42338        xmlResetLastError();
42339        if (mem_base != xmlMemBlocks()) {
42340            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42341	           xmlMemBlocks() - mem_base);
42342	    test_ret++;
42343            printf(" %d", n_writer);
42344            printf("\n");
42345        }
42346    }
42347    function_tests++;
42348#endif
42349
42350    return(test_ret);
42351}
42352
42353
42354static int
42355test_xmlTextWriterEndDTDElement(void) {
42356    int test_ret = 0;
42357
42358#if defined(LIBXML_WRITER_ENABLED)
42359    int mem_base;
42360    int ret_val;
42361    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42362    int n_writer;
42363
42364    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42365        mem_base = xmlMemBlocks();
42366        writer = gen_xmlTextWriterPtr(n_writer, 0);
42367
42368        ret_val = xmlTextWriterEndDTDElement(writer);
42369        desret_int(ret_val);
42370        call_tests++;
42371        des_xmlTextWriterPtr(n_writer, writer, 0);
42372        xmlResetLastError();
42373        if (mem_base != xmlMemBlocks()) {
42374            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
42375	           xmlMemBlocks() - mem_base);
42376	    test_ret++;
42377            printf(" %d", n_writer);
42378            printf("\n");
42379        }
42380    }
42381    function_tests++;
42382#endif
42383
42384    return(test_ret);
42385}
42386
42387
42388static int
42389test_xmlTextWriterEndDTDEntity(void) {
42390    int test_ret = 0;
42391
42392#if defined(LIBXML_WRITER_ENABLED)
42393    int mem_base;
42394    int ret_val;
42395    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42396    int n_writer;
42397
42398    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42399        mem_base = xmlMemBlocks();
42400        writer = gen_xmlTextWriterPtr(n_writer, 0);
42401
42402        ret_val = xmlTextWriterEndDTDEntity(writer);
42403        desret_int(ret_val);
42404        call_tests++;
42405        des_xmlTextWriterPtr(n_writer, writer, 0);
42406        xmlResetLastError();
42407        if (mem_base != xmlMemBlocks()) {
42408            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
42409	           xmlMemBlocks() - mem_base);
42410	    test_ret++;
42411            printf(" %d", n_writer);
42412            printf("\n");
42413        }
42414    }
42415    function_tests++;
42416#endif
42417
42418    return(test_ret);
42419}
42420
42421
42422static int
42423test_xmlTextWriterEndDocument(void) {
42424    int test_ret = 0;
42425
42426#if defined(LIBXML_WRITER_ENABLED)
42427    int mem_base;
42428    int ret_val;
42429    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42430    int n_writer;
42431
42432    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42433        mem_base = xmlMemBlocks();
42434        writer = gen_xmlTextWriterPtr(n_writer, 0);
42435
42436        ret_val = xmlTextWriterEndDocument(writer);
42437        desret_int(ret_val);
42438        call_tests++;
42439        des_xmlTextWriterPtr(n_writer, writer, 0);
42440        xmlResetLastError();
42441        if (mem_base != xmlMemBlocks()) {
42442            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
42443	           xmlMemBlocks() - mem_base);
42444	    test_ret++;
42445            printf(" %d", n_writer);
42446            printf("\n");
42447        }
42448    }
42449    function_tests++;
42450#endif
42451
42452    return(test_ret);
42453}
42454
42455
42456static int
42457test_xmlTextWriterEndElement(void) {
42458    int test_ret = 0;
42459
42460#if defined(LIBXML_WRITER_ENABLED)
42461    int mem_base;
42462    int ret_val;
42463    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42464    int n_writer;
42465
42466    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42467        mem_base = xmlMemBlocks();
42468        writer = gen_xmlTextWriterPtr(n_writer, 0);
42469
42470        ret_val = xmlTextWriterEndElement(writer);
42471        desret_int(ret_val);
42472        call_tests++;
42473        des_xmlTextWriterPtr(n_writer, writer, 0);
42474        xmlResetLastError();
42475        if (mem_base != xmlMemBlocks()) {
42476            printf("Leak of %d blocks found in xmlTextWriterEndElement",
42477	           xmlMemBlocks() - mem_base);
42478	    test_ret++;
42479            printf(" %d", n_writer);
42480            printf("\n");
42481        }
42482    }
42483    function_tests++;
42484#endif
42485
42486    return(test_ret);
42487}
42488
42489
42490static int
42491test_xmlTextWriterEndPI(void) {
42492    int test_ret = 0;
42493
42494#if defined(LIBXML_WRITER_ENABLED)
42495    int mem_base;
42496    int ret_val;
42497    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42498    int n_writer;
42499
42500    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42501        mem_base = xmlMemBlocks();
42502        writer = gen_xmlTextWriterPtr(n_writer, 0);
42503
42504        ret_val = xmlTextWriterEndPI(writer);
42505        desret_int(ret_val);
42506        call_tests++;
42507        des_xmlTextWriterPtr(n_writer, writer, 0);
42508        xmlResetLastError();
42509        if (mem_base != xmlMemBlocks()) {
42510            printf("Leak of %d blocks found in xmlTextWriterEndPI",
42511	           xmlMemBlocks() - mem_base);
42512	    test_ret++;
42513            printf(" %d", n_writer);
42514            printf("\n");
42515        }
42516    }
42517    function_tests++;
42518#endif
42519
42520    return(test_ret);
42521}
42522
42523
42524static int
42525test_xmlTextWriterFlush(void) {
42526    int test_ret = 0;
42527
42528#if defined(LIBXML_WRITER_ENABLED)
42529    int mem_base;
42530    int ret_val;
42531    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42532    int n_writer;
42533
42534    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42535        mem_base = xmlMemBlocks();
42536        writer = gen_xmlTextWriterPtr(n_writer, 0);
42537
42538        ret_val = xmlTextWriterFlush(writer);
42539        desret_int(ret_val);
42540        call_tests++;
42541        des_xmlTextWriterPtr(n_writer, writer, 0);
42542        xmlResetLastError();
42543        if (mem_base != xmlMemBlocks()) {
42544            printf("Leak of %d blocks found in xmlTextWriterFlush",
42545	           xmlMemBlocks() - mem_base);
42546	    test_ret++;
42547            printf(" %d", n_writer);
42548            printf("\n");
42549        }
42550    }
42551    function_tests++;
42552#endif
42553
42554    return(test_ret);
42555}
42556
42557
42558static int
42559test_xmlTextWriterFullEndElement(void) {
42560    int test_ret = 0;
42561
42562#if defined(LIBXML_WRITER_ENABLED)
42563    int mem_base;
42564    int ret_val;
42565    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42566    int n_writer;
42567
42568    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42569        mem_base = xmlMemBlocks();
42570        writer = gen_xmlTextWriterPtr(n_writer, 0);
42571
42572        ret_val = xmlTextWriterFullEndElement(writer);
42573        desret_int(ret_val);
42574        call_tests++;
42575        des_xmlTextWriterPtr(n_writer, writer, 0);
42576        xmlResetLastError();
42577        if (mem_base != xmlMemBlocks()) {
42578            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
42579	           xmlMemBlocks() - mem_base);
42580	    test_ret++;
42581            printf(" %d", n_writer);
42582            printf("\n");
42583        }
42584    }
42585    function_tests++;
42586#endif
42587
42588    return(test_ret);
42589}
42590
42591
42592static int
42593test_xmlTextWriterSetIndent(void) {
42594    int test_ret = 0;
42595
42596#if defined(LIBXML_WRITER_ENABLED)
42597    int mem_base;
42598    int ret_val;
42599    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42600    int n_writer;
42601    int indent; /* do indentation? */
42602    int n_indent;
42603
42604    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42605    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
42606        mem_base = xmlMemBlocks();
42607        writer = gen_xmlTextWriterPtr(n_writer, 0);
42608        indent = gen_int(n_indent, 1);
42609
42610        ret_val = xmlTextWriterSetIndent(writer, indent);
42611        desret_int(ret_val);
42612        call_tests++;
42613        des_xmlTextWriterPtr(n_writer, writer, 0);
42614        des_int(n_indent, indent, 1);
42615        xmlResetLastError();
42616        if (mem_base != xmlMemBlocks()) {
42617            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
42618	           xmlMemBlocks() - mem_base);
42619	    test_ret++;
42620            printf(" %d", n_writer);
42621            printf(" %d", n_indent);
42622            printf("\n");
42623        }
42624    }
42625    }
42626    function_tests++;
42627#endif
42628
42629    return(test_ret);
42630}
42631
42632
42633static int
42634test_xmlTextWriterSetIndentString(void) {
42635    int test_ret = 0;
42636
42637#if defined(LIBXML_WRITER_ENABLED)
42638    int mem_base;
42639    int ret_val;
42640    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42641    int n_writer;
42642    xmlChar * str; /* the xmlChar string */
42643    int n_str;
42644
42645    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42646    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
42647        mem_base = xmlMemBlocks();
42648        writer = gen_xmlTextWriterPtr(n_writer, 0);
42649        str = gen_const_xmlChar_ptr(n_str, 1);
42650
42651        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
42652        desret_int(ret_val);
42653        call_tests++;
42654        des_xmlTextWriterPtr(n_writer, writer, 0);
42655        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
42656        xmlResetLastError();
42657        if (mem_base != xmlMemBlocks()) {
42658            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
42659	           xmlMemBlocks() - mem_base);
42660	    test_ret++;
42661            printf(" %d", n_writer);
42662            printf(" %d", n_str);
42663            printf("\n");
42664        }
42665    }
42666    }
42667    function_tests++;
42668#endif
42669
42670    return(test_ret);
42671}
42672
42673
42674static int
42675test_xmlTextWriterStartAttribute(void) {
42676    int test_ret = 0;
42677
42678#if defined(LIBXML_WRITER_ENABLED)
42679    int mem_base;
42680    int ret_val;
42681    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42682    int n_writer;
42683    xmlChar * name; /* element name */
42684    int n_name;
42685
42686    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42687    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42688        mem_base = xmlMemBlocks();
42689        writer = gen_xmlTextWriterPtr(n_writer, 0);
42690        name = gen_const_xmlChar_ptr(n_name, 1);
42691
42692        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
42693        desret_int(ret_val);
42694        call_tests++;
42695        des_xmlTextWriterPtr(n_writer, writer, 0);
42696        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42697        xmlResetLastError();
42698        if (mem_base != xmlMemBlocks()) {
42699            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
42700	           xmlMemBlocks() - mem_base);
42701	    test_ret++;
42702            printf(" %d", n_writer);
42703            printf(" %d", n_name);
42704            printf("\n");
42705        }
42706    }
42707    }
42708    function_tests++;
42709#endif
42710
42711    return(test_ret);
42712}
42713
42714
42715static int
42716test_xmlTextWriterStartAttributeNS(void) {
42717    int test_ret = 0;
42718
42719#if defined(LIBXML_WRITER_ENABLED)
42720    int mem_base;
42721    int ret_val;
42722    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42723    int n_writer;
42724    xmlChar * prefix; /* namespace prefix or NULL */
42725    int n_prefix;
42726    xmlChar * name; /* element local name */
42727    int n_name;
42728    xmlChar * namespaceURI; /* namespace URI or NULL */
42729    int n_namespaceURI;
42730
42731    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42732    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
42733    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42734    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
42735        mem_base = xmlMemBlocks();
42736        writer = gen_xmlTextWriterPtr(n_writer, 0);
42737        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
42738        name = gen_const_xmlChar_ptr(n_name, 2);
42739        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
42740
42741        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
42742        desret_int(ret_val);
42743        call_tests++;
42744        des_xmlTextWriterPtr(n_writer, writer, 0);
42745        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
42746        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42747        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
42748        xmlResetLastError();
42749        if (mem_base != xmlMemBlocks()) {
42750            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
42751	           xmlMemBlocks() - mem_base);
42752	    test_ret++;
42753            printf(" %d", n_writer);
42754            printf(" %d", n_prefix);
42755            printf(" %d", n_name);
42756            printf(" %d", n_namespaceURI);
42757            printf("\n");
42758        }
42759    }
42760    }
42761    }
42762    }
42763    function_tests++;
42764#endif
42765
42766    return(test_ret);
42767}
42768
42769
42770static int
42771test_xmlTextWriterStartCDATA(void) {
42772    int test_ret = 0;
42773
42774#if defined(LIBXML_WRITER_ENABLED)
42775    int mem_base;
42776    int ret_val;
42777    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42778    int n_writer;
42779
42780    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42781        mem_base = xmlMemBlocks();
42782        writer = gen_xmlTextWriterPtr(n_writer, 0);
42783
42784        ret_val = xmlTextWriterStartCDATA(writer);
42785        desret_int(ret_val);
42786        call_tests++;
42787        des_xmlTextWriterPtr(n_writer, writer, 0);
42788        xmlResetLastError();
42789        if (mem_base != xmlMemBlocks()) {
42790            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
42791	           xmlMemBlocks() - mem_base);
42792	    test_ret++;
42793            printf(" %d", n_writer);
42794            printf("\n");
42795        }
42796    }
42797    function_tests++;
42798#endif
42799
42800    return(test_ret);
42801}
42802
42803
42804static int
42805test_xmlTextWriterStartComment(void) {
42806    int test_ret = 0;
42807
42808#if defined(LIBXML_WRITER_ENABLED)
42809    int mem_base;
42810    int ret_val;
42811    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42812    int n_writer;
42813
42814    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42815        mem_base = xmlMemBlocks();
42816        writer = gen_xmlTextWriterPtr(n_writer, 0);
42817
42818        ret_val = xmlTextWriterStartComment(writer);
42819        desret_int(ret_val);
42820        call_tests++;
42821        des_xmlTextWriterPtr(n_writer, writer, 0);
42822        xmlResetLastError();
42823        if (mem_base != xmlMemBlocks()) {
42824            printf("Leak of %d blocks found in xmlTextWriterStartComment",
42825	           xmlMemBlocks() - mem_base);
42826	    test_ret++;
42827            printf(" %d", n_writer);
42828            printf("\n");
42829        }
42830    }
42831    function_tests++;
42832#endif
42833
42834    return(test_ret);
42835}
42836
42837
42838static int
42839test_xmlTextWriterStartDTD(void) {
42840    int test_ret = 0;
42841
42842#if defined(LIBXML_WRITER_ENABLED)
42843    int mem_base;
42844    int ret_val;
42845    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42846    int n_writer;
42847    xmlChar * name; /* the name of the DTD */
42848    int n_name;
42849    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42850    int n_pubid;
42851    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42852    int n_sysid;
42853
42854    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42855    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42856    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42857    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42858        mem_base = xmlMemBlocks();
42859        writer = gen_xmlTextWriterPtr(n_writer, 0);
42860        name = gen_const_xmlChar_ptr(n_name, 1);
42861        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
42862        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
42863
42864        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
42865        desret_int(ret_val);
42866        call_tests++;
42867        des_xmlTextWriterPtr(n_writer, writer, 0);
42868        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42869        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
42870        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
42871        xmlResetLastError();
42872        if (mem_base != xmlMemBlocks()) {
42873            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
42874	           xmlMemBlocks() - mem_base);
42875	    test_ret++;
42876            printf(" %d", n_writer);
42877            printf(" %d", n_name);
42878            printf(" %d", n_pubid);
42879            printf(" %d", n_sysid);
42880            printf("\n");
42881        }
42882    }
42883    }
42884    }
42885    }
42886    function_tests++;
42887#endif
42888
42889    return(test_ret);
42890}
42891
42892
42893static int
42894test_xmlTextWriterStartDTDAttlist(void) {
42895    int test_ret = 0;
42896
42897#if defined(LIBXML_WRITER_ENABLED)
42898    int mem_base;
42899    int ret_val;
42900    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42901    int n_writer;
42902    xmlChar * name; /* the name of the DTD ATTLIST */
42903    int n_name;
42904
42905    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42906    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42907        mem_base = xmlMemBlocks();
42908        writer = gen_xmlTextWriterPtr(n_writer, 0);
42909        name = gen_const_xmlChar_ptr(n_name, 1);
42910
42911        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
42912        desret_int(ret_val);
42913        call_tests++;
42914        des_xmlTextWriterPtr(n_writer, writer, 0);
42915        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42916        xmlResetLastError();
42917        if (mem_base != xmlMemBlocks()) {
42918            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
42919	           xmlMemBlocks() - mem_base);
42920	    test_ret++;
42921            printf(" %d", n_writer);
42922            printf(" %d", n_name);
42923            printf("\n");
42924        }
42925    }
42926    }
42927    function_tests++;
42928#endif
42929
42930    return(test_ret);
42931}
42932
42933
42934static int
42935test_xmlTextWriterStartDTDElement(void) {
42936    int test_ret = 0;
42937
42938#if defined(LIBXML_WRITER_ENABLED)
42939    int mem_base;
42940    int ret_val;
42941    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42942    int n_writer;
42943    xmlChar * name; /* the name of the DTD element */
42944    int n_name;
42945
42946    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42947    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42948        mem_base = xmlMemBlocks();
42949        writer = gen_xmlTextWriterPtr(n_writer, 0);
42950        name = gen_const_xmlChar_ptr(n_name, 1);
42951
42952        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
42953        desret_int(ret_val);
42954        call_tests++;
42955        des_xmlTextWriterPtr(n_writer, writer, 0);
42956        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42957        xmlResetLastError();
42958        if (mem_base != xmlMemBlocks()) {
42959            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
42960	           xmlMemBlocks() - mem_base);
42961	    test_ret++;
42962            printf(" %d", n_writer);
42963            printf(" %d", n_name);
42964            printf("\n");
42965        }
42966    }
42967    }
42968    function_tests++;
42969#endif
42970
42971    return(test_ret);
42972}
42973
42974
42975static int
42976test_xmlTextWriterStartDTDEntity(void) {
42977    int test_ret = 0;
42978
42979#if defined(LIBXML_WRITER_ENABLED)
42980    int mem_base;
42981    int ret_val;
42982    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42983    int n_writer;
42984    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42985    int n_pe;
42986    xmlChar * name; /* the name of the DTD ATTLIST */
42987    int n_name;
42988
42989    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42990    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42991    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42992        mem_base = xmlMemBlocks();
42993        writer = gen_xmlTextWriterPtr(n_writer, 0);
42994        pe = gen_int(n_pe, 1);
42995        name = gen_const_xmlChar_ptr(n_name, 2);
42996
42997        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
42998        desret_int(ret_val);
42999        call_tests++;
43000        des_xmlTextWriterPtr(n_writer, writer, 0);
43001        des_int(n_pe, pe, 1);
43002        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43003        xmlResetLastError();
43004        if (mem_base != xmlMemBlocks()) {
43005            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43006	           xmlMemBlocks() - mem_base);
43007	    test_ret++;
43008            printf(" %d", n_writer);
43009            printf(" %d", n_pe);
43010            printf(" %d", n_name);
43011            printf("\n");
43012        }
43013    }
43014    }
43015    }
43016    function_tests++;
43017#endif
43018
43019    return(test_ret);
43020}
43021
43022
43023static int
43024test_xmlTextWriterStartDocument(void) {
43025    int test_ret = 0;
43026
43027#if defined(LIBXML_WRITER_ENABLED)
43028    int mem_base;
43029    int ret_val;
43030    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43031    int n_writer;
43032    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43033    int n_version;
43034    char * encoding; /* the encoding or NULL for default */
43035    int n_encoding;
43036    char * standalone; /* "yes" or "no" or NULL for default */
43037    int n_standalone;
43038
43039    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43040    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43041    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43042    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43043        mem_base = xmlMemBlocks();
43044        writer = gen_xmlTextWriterPtr(n_writer, 0);
43045        version = gen_const_char_ptr(n_version, 1);
43046        encoding = gen_const_char_ptr(n_encoding, 2);
43047        standalone = gen_const_char_ptr(n_standalone, 3);
43048
43049        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43050        desret_int(ret_val);
43051        call_tests++;
43052        des_xmlTextWriterPtr(n_writer, writer, 0);
43053        des_const_char_ptr(n_version, (const char *)version, 1);
43054        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43055        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43056        xmlResetLastError();
43057        if (mem_base != xmlMemBlocks()) {
43058            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43059	           xmlMemBlocks() - mem_base);
43060	    test_ret++;
43061            printf(" %d", n_writer);
43062            printf(" %d", n_version);
43063            printf(" %d", n_encoding);
43064            printf(" %d", n_standalone);
43065            printf("\n");
43066        }
43067    }
43068    }
43069    }
43070    }
43071    function_tests++;
43072#endif
43073
43074    return(test_ret);
43075}
43076
43077
43078static int
43079test_xmlTextWriterStartElement(void) {
43080    int test_ret = 0;
43081
43082#if defined(LIBXML_WRITER_ENABLED)
43083    int mem_base;
43084    int ret_val;
43085    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43086    int n_writer;
43087    xmlChar * name; /* element name */
43088    int n_name;
43089
43090    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43091    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43092        mem_base = xmlMemBlocks();
43093        writer = gen_xmlTextWriterPtr(n_writer, 0);
43094        name = gen_const_xmlChar_ptr(n_name, 1);
43095
43096        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43097        desret_int(ret_val);
43098        call_tests++;
43099        des_xmlTextWriterPtr(n_writer, writer, 0);
43100        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43101        xmlResetLastError();
43102        if (mem_base != xmlMemBlocks()) {
43103            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43104	           xmlMemBlocks() - mem_base);
43105	    test_ret++;
43106            printf(" %d", n_writer);
43107            printf(" %d", n_name);
43108            printf("\n");
43109        }
43110    }
43111    }
43112    function_tests++;
43113#endif
43114
43115    return(test_ret);
43116}
43117
43118
43119static int
43120test_xmlTextWriterStartElementNS(void) {
43121    int test_ret = 0;
43122
43123#if defined(LIBXML_WRITER_ENABLED)
43124    int mem_base;
43125    int ret_val;
43126    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43127    int n_writer;
43128    xmlChar * prefix; /* namespace prefix or NULL */
43129    int n_prefix;
43130    xmlChar * name; /* element local name */
43131    int n_name;
43132    xmlChar * namespaceURI; /* namespace URI or NULL */
43133    int n_namespaceURI;
43134
43135    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43136    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43137    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43138    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43139        mem_base = xmlMemBlocks();
43140        writer = gen_xmlTextWriterPtr(n_writer, 0);
43141        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43142        name = gen_const_xmlChar_ptr(n_name, 2);
43143        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43144
43145        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43146        desret_int(ret_val);
43147        call_tests++;
43148        des_xmlTextWriterPtr(n_writer, writer, 0);
43149        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43150        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43151        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43152        xmlResetLastError();
43153        if (mem_base != xmlMemBlocks()) {
43154            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43155	           xmlMemBlocks() - mem_base);
43156	    test_ret++;
43157            printf(" %d", n_writer);
43158            printf(" %d", n_prefix);
43159            printf(" %d", n_name);
43160            printf(" %d", n_namespaceURI);
43161            printf("\n");
43162        }
43163    }
43164    }
43165    }
43166    }
43167    function_tests++;
43168#endif
43169
43170    return(test_ret);
43171}
43172
43173
43174static int
43175test_xmlTextWriterStartPI(void) {
43176    int test_ret = 0;
43177
43178#if defined(LIBXML_WRITER_ENABLED)
43179    int mem_base;
43180    int ret_val;
43181    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43182    int n_writer;
43183    xmlChar * target; /* PI target */
43184    int n_target;
43185
43186    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43187    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43188        mem_base = xmlMemBlocks();
43189        writer = gen_xmlTextWriterPtr(n_writer, 0);
43190        target = gen_const_xmlChar_ptr(n_target, 1);
43191
43192        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43193        desret_int(ret_val);
43194        call_tests++;
43195        des_xmlTextWriterPtr(n_writer, writer, 0);
43196        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43197        xmlResetLastError();
43198        if (mem_base != xmlMemBlocks()) {
43199            printf("Leak of %d blocks found in xmlTextWriterStartPI",
43200	           xmlMemBlocks() - mem_base);
43201	    test_ret++;
43202            printf(" %d", n_writer);
43203            printf(" %d", n_target);
43204            printf("\n");
43205        }
43206    }
43207    }
43208    function_tests++;
43209#endif
43210
43211    return(test_ret);
43212}
43213
43214
43215static int
43216test_xmlTextWriterWriteAttribute(void) {
43217    int test_ret = 0;
43218
43219#if defined(LIBXML_WRITER_ENABLED)
43220    int mem_base;
43221    int ret_val;
43222    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43223    int n_writer;
43224    xmlChar * name; /* attribute name */
43225    int n_name;
43226    xmlChar * content; /* attribute content */
43227    int n_content;
43228
43229    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43230    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43231    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43232        mem_base = xmlMemBlocks();
43233        writer = gen_xmlTextWriterPtr(n_writer, 0);
43234        name = gen_const_xmlChar_ptr(n_name, 1);
43235        content = gen_const_xmlChar_ptr(n_content, 2);
43236
43237        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43238        desret_int(ret_val);
43239        call_tests++;
43240        des_xmlTextWriterPtr(n_writer, writer, 0);
43241        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43242        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43243        xmlResetLastError();
43244        if (mem_base != xmlMemBlocks()) {
43245            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43246	           xmlMemBlocks() - mem_base);
43247	    test_ret++;
43248            printf(" %d", n_writer);
43249            printf(" %d", n_name);
43250            printf(" %d", n_content);
43251            printf("\n");
43252        }
43253    }
43254    }
43255    }
43256    function_tests++;
43257#endif
43258
43259    return(test_ret);
43260}
43261
43262
43263static int
43264test_xmlTextWriterWriteAttributeNS(void) {
43265    int test_ret = 0;
43266
43267#if defined(LIBXML_WRITER_ENABLED)
43268    int mem_base;
43269    int ret_val;
43270    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43271    int n_writer;
43272    xmlChar * prefix; /* namespace prefix */
43273    int n_prefix;
43274    xmlChar * name; /* attribute local name */
43275    int n_name;
43276    xmlChar * namespaceURI; /* namespace URI */
43277    int n_namespaceURI;
43278    xmlChar * content; /* attribute content */
43279    int n_content;
43280
43281    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43282    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43283    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43284    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43285    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43286        mem_base = xmlMemBlocks();
43287        writer = gen_xmlTextWriterPtr(n_writer, 0);
43288        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43289        name = gen_const_xmlChar_ptr(n_name, 2);
43290        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43291        content = gen_const_xmlChar_ptr(n_content, 4);
43292
43293        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43294        desret_int(ret_val);
43295        call_tests++;
43296        des_xmlTextWriterPtr(n_writer, writer, 0);
43297        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43298        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43299        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43300        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43301        xmlResetLastError();
43302        if (mem_base != xmlMemBlocks()) {
43303            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43304	           xmlMemBlocks() - mem_base);
43305	    test_ret++;
43306            printf(" %d", n_writer);
43307            printf(" %d", n_prefix);
43308            printf(" %d", n_name);
43309            printf(" %d", n_namespaceURI);
43310            printf(" %d", n_content);
43311            printf("\n");
43312        }
43313    }
43314    }
43315    }
43316    }
43317    }
43318    function_tests++;
43319#endif
43320
43321    return(test_ret);
43322}
43323
43324
43325static int
43326test_xmlTextWriterWriteBase64(void) {
43327    int test_ret = 0;
43328
43329#if defined(LIBXML_WRITER_ENABLED)
43330    int mem_base;
43331    int ret_val;
43332    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43333    int n_writer;
43334    char * data; /* binary data */
43335    int n_data;
43336    int start; /* the position within the data of the first byte to encode */
43337    int n_start;
43338    int len; /* the number of bytes to encode */
43339    int n_len;
43340
43341    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43342    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43343    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43344    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43345        mem_base = xmlMemBlocks();
43346        writer = gen_xmlTextWriterPtr(n_writer, 0);
43347        data = gen_const_char_ptr(n_data, 1);
43348        start = gen_int(n_start, 2);
43349        len = gen_int(n_len, 3);
43350
43351        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43352        desret_int(ret_val);
43353        call_tests++;
43354        des_xmlTextWriterPtr(n_writer, writer, 0);
43355        des_const_char_ptr(n_data, (const char *)data, 1);
43356        des_int(n_start, start, 2);
43357        des_int(n_len, len, 3);
43358        xmlResetLastError();
43359        if (mem_base != xmlMemBlocks()) {
43360            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43361	           xmlMemBlocks() - mem_base);
43362	    test_ret++;
43363            printf(" %d", n_writer);
43364            printf(" %d", n_data);
43365            printf(" %d", n_start);
43366            printf(" %d", n_len);
43367            printf("\n");
43368        }
43369    }
43370    }
43371    }
43372    }
43373    function_tests++;
43374#endif
43375
43376    return(test_ret);
43377}
43378
43379
43380static int
43381test_xmlTextWriterWriteBinHex(void) {
43382    int test_ret = 0;
43383
43384#if defined(LIBXML_WRITER_ENABLED)
43385    int mem_base;
43386    int ret_val;
43387    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43388    int n_writer;
43389    char * data; /* binary data */
43390    int n_data;
43391    int start; /* the position within the data of the first byte to encode */
43392    int n_start;
43393    int len; /* the number of bytes to encode */
43394    int n_len;
43395
43396    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43397    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43398    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43399    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43400        mem_base = xmlMemBlocks();
43401        writer = gen_xmlTextWriterPtr(n_writer, 0);
43402        data = gen_const_char_ptr(n_data, 1);
43403        start = gen_int(n_start, 2);
43404        len = gen_int(n_len, 3);
43405
43406        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
43407        desret_int(ret_val);
43408        call_tests++;
43409        des_xmlTextWriterPtr(n_writer, writer, 0);
43410        des_const_char_ptr(n_data, (const char *)data, 1);
43411        des_int(n_start, start, 2);
43412        des_int(n_len, len, 3);
43413        xmlResetLastError();
43414        if (mem_base != xmlMemBlocks()) {
43415            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
43416	           xmlMemBlocks() - mem_base);
43417	    test_ret++;
43418            printf(" %d", n_writer);
43419            printf(" %d", n_data);
43420            printf(" %d", n_start);
43421            printf(" %d", n_len);
43422            printf("\n");
43423        }
43424    }
43425    }
43426    }
43427    }
43428    function_tests++;
43429#endif
43430
43431    return(test_ret);
43432}
43433
43434
43435static int
43436test_xmlTextWriterWriteCDATA(void) {
43437    int test_ret = 0;
43438
43439#if defined(LIBXML_WRITER_ENABLED)
43440    int mem_base;
43441    int ret_val;
43442    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43443    int n_writer;
43444    xmlChar * content; /* CDATA content */
43445    int n_content;
43446
43447    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43448    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43449        mem_base = xmlMemBlocks();
43450        writer = gen_xmlTextWriterPtr(n_writer, 0);
43451        content = gen_const_xmlChar_ptr(n_content, 1);
43452
43453        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
43454        desret_int(ret_val);
43455        call_tests++;
43456        des_xmlTextWriterPtr(n_writer, writer, 0);
43457        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43458        xmlResetLastError();
43459        if (mem_base != xmlMemBlocks()) {
43460            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
43461	           xmlMemBlocks() - mem_base);
43462	    test_ret++;
43463            printf(" %d", n_writer);
43464            printf(" %d", n_content);
43465            printf("\n");
43466        }
43467    }
43468    }
43469    function_tests++;
43470#endif
43471
43472    return(test_ret);
43473}
43474
43475
43476static int
43477test_xmlTextWriterWriteComment(void) {
43478    int test_ret = 0;
43479
43480#if defined(LIBXML_WRITER_ENABLED)
43481    int mem_base;
43482    int ret_val;
43483    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43484    int n_writer;
43485    xmlChar * content; /* comment string */
43486    int n_content;
43487
43488    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43489    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43490        mem_base = xmlMemBlocks();
43491        writer = gen_xmlTextWriterPtr(n_writer, 0);
43492        content = gen_const_xmlChar_ptr(n_content, 1);
43493
43494        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
43495        desret_int(ret_val);
43496        call_tests++;
43497        des_xmlTextWriterPtr(n_writer, writer, 0);
43498        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43499        xmlResetLastError();
43500        if (mem_base != xmlMemBlocks()) {
43501            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
43502	           xmlMemBlocks() - mem_base);
43503	    test_ret++;
43504            printf(" %d", n_writer);
43505            printf(" %d", n_content);
43506            printf("\n");
43507        }
43508    }
43509    }
43510    function_tests++;
43511#endif
43512
43513    return(test_ret);
43514}
43515
43516
43517static int
43518test_xmlTextWriterWriteDTD(void) {
43519    int test_ret = 0;
43520
43521#if defined(LIBXML_WRITER_ENABLED)
43522    int mem_base;
43523    int ret_val;
43524    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43525    int n_writer;
43526    xmlChar * name; /* the name of the DTD */
43527    int n_name;
43528    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43529    int n_pubid;
43530    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43531    int n_sysid;
43532    xmlChar * subset; /* string content of the DTD */
43533    int n_subset;
43534
43535    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43536    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43537    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43538    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43539    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
43540        mem_base = xmlMemBlocks();
43541        writer = gen_xmlTextWriterPtr(n_writer, 0);
43542        name = gen_const_xmlChar_ptr(n_name, 1);
43543        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43544        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43545        subset = gen_const_xmlChar_ptr(n_subset, 4);
43546
43547        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
43548        desret_int(ret_val);
43549        call_tests++;
43550        des_xmlTextWriterPtr(n_writer, writer, 0);
43551        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43552        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43553        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43554        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
43555        xmlResetLastError();
43556        if (mem_base != xmlMemBlocks()) {
43557            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
43558	           xmlMemBlocks() - mem_base);
43559	    test_ret++;
43560            printf(" %d", n_writer);
43561            printf(" %d", n_name);
43562            printf(" %d", n_pubid);
43563            printf(" %d", n_sysid);
43564            printf(" %d", n_subset);
43565            printf("\n");
43566        }
43567    }
43568    }
43569    }
43570    }
43571    }
43572    function_tests++;
43573#endif
43574
43575    return(test_ret);
43576}
43577
43578
43579static int
43580test_xmlTextWriterWriteDTDAttlist(void) {
43581    int test_ret = 0;
43582
43583#if defined(LIBXML_WRITER_ENABLED)
43584    int mem_base;
43585    int ret_val;
43586    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43587    int n_writer;
43588    xmlChar * name; /* the name of the DTD ATTLIST */
43589    int n_name;
43590    xmlChar * content; /* content of the ATTLIST */
43591    int n_content;
43592
43593    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43594    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43595    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43596        mem_base = xmlMemBlocks();
43597        writer = gen_xmlTextWriterPtr(n_writer, 0);
43598        name = gen_const_xmlChar_ptr(n_name, 1);
43599        content = gen_const_xmlChar_ptr(n_content, 2);
43600
43601        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
43602        desret_int(ret_val);
43603        call_tests++;
43604        des_xmlTextWriterPtr(n_writer, writer, 0);
43605        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43606        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43607        xmlResetLastError();
43608        if (mem_base != xmlMemBlocks()) {
43609            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
43610	           xmlMemBlocks() - mem_base);
43611	    test_ret++;
43612            printf(" %d", n_writer);
43613            printf(" %d", n_name);
43614            printf(" %d", n_content);
43615            printf("\n");
43616        }
43617    }
43618    }
43619    }
43620    function_tests++;
43621#endif
43622
43623    return(test_ret);
43624}
43625
43626
43627static int
43628test_xmlTextWriterWriteDTDElement(void) {
43629    int test_ret = 0;
43630
43631#if defined(LIBXML_WRITER_ENABLED)
43632    int mem_base;
43633    int ret_val;
43634    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43635    int n_writer;
43636    xmlChar * name; /* the name of the DTD element */
43637    int n_name;
43638    xmlChar * content; /* content of the element */
43639    int n_content;
43640
43641    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43642    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43643    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43644        mem_base = xmlMemBlocks();
43645        writer = gen_xmlTextWriterPtr(n_writer, 0);
43646        name = gen_const_xmlChar_ptr(n_name, 1);
43647        content = gen_const_xmlChar_ptr(n_content, 2);
43648
43649        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
43650        desret_int(ret_val);
43651        call_tests++;
43652        des_xmlTextWriterPtr(n_writer, writer, 0);
43653        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43654        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43655        xmlResetLastError();
43656        if (mem_base != xmlMemBlocks()) {
43657            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
43658	           xmlMemBlocks() - mem_base);
43659	    test_ret++;
43660            printf(" %d", n_writer);
43661            printf(" %d", n_name);
43662            printf(" %d", n_content);
43663            printf("\n");
43664        }
43665    }
43666    }
43667    }
43668    function_tests++;
43669#endif
43670
43671    return(test_ret);
43672}
43673
43674
43675static int
43676test_xmlTextWriterWriteDTDEntity(void) {
43677    int test_ret = 0;
43678
43679#if defined(LIBXML_WRITER_ENABLED)
43680    int mem_base;
43681    int ret_val;
43682    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43683    int n_writer;
43684    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43685    int n_pe;
43686    xmlChar * name; /* the name of the DTD entity */
43687    int n_name;
43688    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43689    int n_pubid;
43690    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43691    int n_sysid;
43692    xmlChar * ndataid; /* the xml notation name. */
43693    int n_ndataid;
43694    xmlChar * content; /* content of the entity */
43695    int n_content;
43696
43697    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43698    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43699    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43700    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43701    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43702    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
43703    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43704        mem_base = xmlMemBlocks();
43705        writer = gen_xmlTextWriterPtr(n_writer, 0);
43706        pe = gen_int(n_pe, 1);
43707        name = gen_const_xmlChar_ptr(n_name, 2);
43708        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
43709        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
43710        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
43711        content = gen_const_xmlChar_ptr(n_content, 6);
43712
43713        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
43714        desret_int(ret_val);
43715        call_tests++;
43716        des_xmlTextWriterPtr(n_writer, writer, 0);
43717        des_int(n_pe, pe, 1);
43718        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43719        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
43720        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
43721        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
43722        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
43723        xmlResetLastError();
43724        if (mem_base != xmlMemBlocks()) {
43725            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
43726	           xmlMemBlocks() - mem_base);
43727	    test_ret++;
43728            printf(" %d", n_writer);
43729            printf(" %d", n_pe);
43730            printf(" %d", n_name);
43731            printf(" %d", n_pubid);
43732            printf(" %d", n_sysid);
43733            printf(" %d", n_ndataid);
43734            printf(" %d", n_content);
43735            printf("\n");
43736        }
43737    }
43738    }
43739    }
43740    }
43741    }
43742    }
43743    }
43744    function_tests++;
43745#endif
43746
43747    return(test_ret);
43748}
43749
43750
43751static int
43752test_xmlTextWriterWriteDTDExternalEntity(void) {
43753    int test_ret = 0;
43754
43755#if defined(LIBXML_WRITER_ENABLED)
43756    int mem_base;
43757    int ret_val;
43758    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43759    int n_writer;
43760    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43761    int n_pe;
43762    xmlChar * name; /* the name of the DTD entity */
43763    int n_name;
43764    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43765    int n_pubid;
43766    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43767    int n_sysid;
43768    xmlChar * ndataid; /* the xml notation name. */
43769    int n_ndataid;
43770
43771    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43772    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43773    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43774    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43775    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43776    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
43777        mem_base = xmlMemBlocks();
43778        writer = gen_xmlTextWriterPtr(n_writer, 0);
43779        pe = gen_int(n_pe, 1);
43780        name = gen_const_xmlChar_ptr(n_name, 2);
43781        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
43782        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
43783        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
43784
43785        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
43786        desret_int(ret_val);
43787        call_tests++;
43788        des_xmlTextWriterPtr(n_writer, writer, 0);
43789        des_int(n_pe, pe, 1);
43790        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43791        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
43792        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
43793        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
43794        xmlResetLastError();
43795        if (mem_base != xmlMemBlocks()) {
43796            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
43797	           xmlMemBlocks() - mem_base);
43798	    test_ret++;
43799            printf(" %d", n_writer);
43800            printf(" %d", n_pe);
43801            printf(" %d", n_name);
43802            printf(" %d", n_pubid);
43803            printf(" %d", n_sysid);
43804            printf(" %d", n_ndataid);
43805            printf("\n");
43806        }
43807    }
43808    }
43809    }
43810    }
43811    }
43812    }
43813    function_tests++;
43814#endif
43815
43816    return(test_ret);
43817}
43818
43819
43820static int
43821test_xmlTextWriterWriteDTDExternalEntityContents(void) {
43822    int test_ret = 0;
43823
43824#if defined(LIBXML_WRITER_ENABLED)
43825    int mem_base;
43826    int ret_val;
43827    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43828    int n_writer;
43829    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43830    int n_pubid;
43831    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43832    int n_sysid;
43833    xmlChar * ndataid; /* the xml notation name. */
43834    int n_ndataid;
43835
43836    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43837    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43838    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43839    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
43840        mem_base = xmlMemBlocks();
43841        writer = gen_xmlTextWriterPtr(n_writer, 0);
43842        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
43843        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
43844        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
43845
43846        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
43847        desret_int(ret_val);
43848        call_tests++;
43849        des_xmlTextWriterPtr(n_writer, writer, 0);
43850        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
43851        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
43852        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
43853        xmlResetLastError();
43854        if (mem_base != xmlMemBlocks()) {
43855            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
43856	           xmlMemBlocks() - mem_base);
43857	    test_ret++;
43858            printf(" %d", n_writer);
43859            printf(" %d", n_pubid);
43860            printf(" %d", n_sysid);
43861            printf(" %d", n_ndataid);
43862            printf("\n");
43863        }
43864    }
43865    }
43866    }
43867    }
43868    function_tests++;
43869#endif
43870
43871    return(test_ret);
43872}
43873
43874
43875static int
43876test_xmlTextWriterWriteDTDInternalEntity(void) {
43877    int test_ret = 0;
43878
43879#if defined(LIBXML_WRITER_ENABLED)
43880    int mem_base;
43881    int ret_val;
43882    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43883    int n_writer;
43884    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43885    int n_pe;
43886    xmlChar * name; /* the name of the DTD entity */
43887    int n_name;
43888    xmlChar * content; /* content of the entity */
43889    int n_content;
43890
43891    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43892    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43893    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43894    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43895        mem_base = xmlMemBlocks();
43896        writer = gen_xmlTextWriterPtr(n_writer, 0);
43897        pe = gen_int(n_pe, 1);
43898        name = gen_const_xmlChar_ptr(n_name, 2);
43899        content = gen_const_xmlChar_ptr(n_content, 3);
43900
43901        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
43902        desret_int(ret_val);
43903        call_tests++;
43904        des_xmlTextWriterPtr(n_writer, writer, 0);
43905        des_int(n_pe, pe, 1);
43906        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43907        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
43908        xmlResetLastError();
43909        if (mem_base != xmlMemBlocks()) {
43910            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
43911	           xmlMemBlocks() - mem_base);
43912	    test_ret++;
43913            printf(" %d", n_writer);
43914            printf(" %d", n_pe);
43915            printf(" %d", n_name);
43916            printf(" %d", n_content);
43917            printf("\n");
43918        }
43919    }
43920    }
43921    }
43922    }
43923    function_tests++;
43924#endif
43925
43926    return(test_ret);
43927}
43928
43929
43930static int
43931test_xmlTextWriterWriteDTDNotation(void) {
43932    int test_ret = 0;
43933
43934#if defined(LIBXML_WRITER_ENABLED)
43935    int mem_base;
43936    int ret_val;
43937    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43938    int n_writer;
43939    xmlChar * name; /* the name of the xml notation */
43940    int n_name;
43941    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43942    int n_pubid;
43943    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43944    int n_sysid;
43945
43946    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43947    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43948    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43949    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43950        mem_base = xmlMemBlocks();
43951        writer = gen_xmlTextWriterPtr(n_writer, 0);
43952        name = gen_const_xmlChar_ptr(n_name, 1);
43953        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43954        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43955
43956        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43957        desret_int(ret_val);
43958        call_tests++;
43959        des_xmlTextWriterPtr(n_writer, writer, 0);
43960        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43961        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43962        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43963        xmlResetLastError();
43964        if (mem_base != xmlMemBlocks()) {
43965            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
43966	           xmlMemBlocks() - mem_base);
43967	    test_ret++;
43968            printf(" %d", n_writer);
43969            printf(" %d", n_name);
43970            printf(" %d", n_pubid);
43971            printf(" %d", n_sysid);
43972            printf("\n");
43973        }
43974    }
43975    }
43976    }
43977    }
43978    function_tests++;
43979#endif
43980
43981    return(test_ret);
43982}
43983
43984
43985static int
43986test_xmlTextWriterWriteElement(void) {
43987    int test_ret = 0;
43988
43989#if defined(LIBXML_WRITER_ENABLED)
43990    int mem_base;
43991    int ret_val;
43992    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43993    int n_writer;
43994    xmlChar * name; /* element name */
43995    int n_name;
43996    xmlChar * content; /* element content */
43997    int n_content;
43998
43999    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44000    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44001    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44002        mem_base = xmlMemBlocks();
44003        writer = gen_xmlTextWriterPtr(n_writer, 0);
44004        name = gen_const_xmlChar_ptr(n_name, 1);
44005        content = gen_const_xmlChar_ptr(n_content, 2);
44006
44007        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44008        desret_int(ret_val);
44009        call_tests++;
44010        des_xmlTextWriterPtr(n_writer, writer, 0);
44011        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44012        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44013        xmlResetLastError();
44014        if (mem_base != xmlMemBlocks()) {
44015            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44016	           xmlMemBlocks() - mem_base);
44017	    test_ret++;
44018            printf(" %d", n_writer);
44019            printf(" %d", n_name);
44020            printf(" %d", n_content);
44021            printf("\n");
44022        }
44023    }
44024    }
44025    }
44026    function_tests++;
44027#endif
44028
44029    return(test_ret);
44030}
44031
44032
44033static int
44034test_xmlTextWriterWriteElementNS(void) {
44035    int test_ret = 0;
44036
44037#if defined(LIBXML_WRITER_ENABLED)
44038    int mem_base;
44039    int ret_val;
44040    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44041    int n_writer;
44042    xmlChar * prefix; /* namespace prefix */
44043    int n_prefix;
44044    xmlChar * name; /* element local name */
44045    int n_name;
44046    xmlChar * namespaceURI; /* namespace URI */
44047    int n_namespaceURI;
44048    xmlChar * content; /* element content */
44049    int n_content;
44050
44051    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44052    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44053    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44054    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44055    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44056        mem_base = xmlMemBlocks();
44057        writer = gen_xmlTextWriterPtr(n_writer, 0);
44058        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44059        name = gen_const_xmlChar_ptr(n_name, 2);
44060        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44061        content = gen_const_xmlChar_ptr(n_content, 4);
44062
44063        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44064        desret_int(ret_val);
44065        call_tests++;
44066        des_xmlTextWriterPtr(n_writer, writer, 0);
44067        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44068        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44069        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44070        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44071        xmlResetLastError();
44072        if (mem_base != xmlMemBlocks()) {
44073            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44074	           xmlMemBlocks() - mem_base);
44075	    test_ret++;
44076            printf(" %d", n_writer);
44077            printf(" %d", n_prefix);
44078            printf(" %d", n_name);
44079            printf(" %d", n_namespaceURI);
44080            printf(" %d", n_content);
44081            printf("\n");
44082        }
44083    }
44084    }
44085    }
44086    }
44087    }
44088    function_tests++;
44089#endif
44090
44091    return(test_ret);
44092}
44093
44094
44095static int
44096test_xmlTextWriterWriteFormatAttribute(void) {
44097    int test_ret = 0;
44098
44099
44100    /* missing type support */
44101    return(test_ret);
44102}
44103
44104
44105static int
44106test_xmlTextWriterWriteFormatAttributeNS(void) {
44107    int test_ret = 0;
44108
44109
44110    /* missing type support */
44111    return(test_ret);
44112}
44113
44114
44115static int
44116test_xmlTextWriterWriteFormatCDATA(void) {
44117    int test_ret = 0;
44118
44119
44120    /* missing type support */
44121    return(test_ret);
44122}
44123
44124
44125static int
44126test_xmlTextWriterWriteFormatComment(void) {
44127    int test_ret = 0;
44128
44129
44130    /* missing type support */
44131    return(test_ret);
44132}
44133
44134
44135static int
44136test_xmlTextWriterWriteFormatDTD(void) {
44137    int test_ret = 0;
44138
44139
44140    /* missing type support */
44141    return(test_ret);
44142}
44143
44144
44145static int
44146test_xmlTextWriterWriteFormatDTDAttlist(void) {
44147    int test_ret = 0;
44148
44149
44150    /* missing type support */
44151    return(test_ret);
44152}
44153
44154
44155static int
44156test_xmlTextWriterWriteFormatDTDElement(void) {
44157    int test_ret = 0;
44158
44159
44160    /* missing type support */
44161    return(test_ret);
44162}
44163
44164
44165static int
44166test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44167    int test_ret = 0;
44168
44169
44170    /* missing type support */
44171    return(test_ret);
44172}
44173
44174
44175static int
44176test_xmlTextWriterWriteFormatElement(void) {
44177    int test_ret = 0;
44178
44179
44180    /* missing type support */
44181    return(test_ret);
44182}
44183
44184
44185static int
44186test_xmlTextWriterWriteFormatElementNS(void) {
44187    int test_ret = 0;
44188
44189
44190    /* missing type support */
44191    return(test_ret);
44192}
44193
44194
44195static int
44196test_xmlTextWriterWriteFormatPI(void) {
44197    int test_ret = 0;
44198
44199
44200    /* missing type support */
44201    return(test_ret);
44202}
44203
44204
44205static int
44206test_xmlTextWriterWriteFormatRaw(void) {
44207    int test_ret = 0;
44208
44209
44210    /* missing type support */
44211    return(test_ret);
44212}
44213
44214
44215static int
44216test_xmlTextWriterWriteFormatString(void) {
44217    int test_ret = 0;
44218
44219
44220    /* missing type support */
44221    return(test_ret);
44222}
44223
44224
44225static int
44226test_xmlTextWriterWritePI(void) {
44227    int test_ret = 0;
44228
44229#if defined(LIBXML_WRITER_ENABLED)
44230    int mem_base;
44231    int ret_val;
44232    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44233    int n_writer;
44234    xmlChar * target; /* PI target */
44235    int n_target;
44236    xmlChar * content; /* PI content */
44237    int n_content;
44238
44239    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44240    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44241    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44242        mem_base = xmlMemBlocks();
44243        writer = gen_xmlTextWriterPtr(n_writer, 0);
44244        target = gen_const_xmlChar_ptr(n_target, 1);
44245        content = gen_const_xmlChar_ptr(n_content, 2);
44246
44247        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44248        desret_int(ret_val);
44249        call_tests++;
44250        des_xmlTextWriterPtr(n_writer, writer, 0);
44251        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44252        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44253        xmlResetLastError();
44254        if (mem_base != xmlMemBlocks()) {
44255            printf("Leak of %d blocks found in xmlTextWriterWritePI",
44256	           xmlMemBlocks() - mem_base);
44257	    test_ret++;
44258            printf(" %d", n_writer);
44259            printf(" %d", n_target);
44260            printf(" %d", n_content);
44261            printf("\n");
44262        }
44263    }
44264    }
44265    }
44266    function_tests++;
44267#endif
44268
44269    return(test_ret);
44270}
44271
44272
44273static int
44274test_xmlTextWriterWriteRaw(void) {
44275    int test_ret = 0;
44276
44277#if defined(LIBXML_WRITER_ENABLED)
44278    int mem_base;
44279    int ret_val;
44280    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44281    int n_writer;
44282    xmlChar * content; /* text string */
44283    int n_content;
44284
44285    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44286    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44287        mem_base = xmlMemBlocks();
44288        writer = gen_xmlTextWriterPtr(n_writer, 0);
44289        content = gen_const_xmlChar_ptr(n_content, 1);
44290
44291        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44292        desret_int(ret_val);
44293        call_tests++;
44294        des_xmlTextWriterPtr(n_writer, writer, 0);
44295        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44296        xmlResetLastError();
44297        if (mem_base != xmlMemBlocks()) {
44298            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44299	           xmlMemBlocks() - mem_base);
44300	    test_ret++;
44301            printf(" %d", n_writer);
44302            printf(" %d", n_content);
44303            printf("\n");
44304        }
44305    }
44306    }
44307    function_tests++;
44308#endif
44309
44310    return(test_ret);
44311}
44312
44313
44314static int
44315test_xmlTextWriterWriteRawLen(void) {
44316    int test_ret = 0;
44317
44318#if defined(LIBXML_WRITER_ENABLED)
44319    int mem_base;
44320    int ret_val;
44321    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44322    int n_writer;
44323    xmlChar * content; /* text string */
44324    int n_content;
44325    int len; /* length of the text string */
44326    int n_len;
44327
44328    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44329    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44330    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44331        mem_base = xmlMemBlocks();
44332        writer = gen_xmlTextWriterPtr(n_writer, 0);
44333        content = gen_const_xmlChar_ptr(n_content, 1);
44334        len = gen_int(n_len, 2);
44335
44336        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44337        desret_int(ret_val);
44338        call_tests++;
44339        des_xmlTextWriterPtr(n_writer, writer, 0);
44340        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44341        des_int(n_len, len, 2);
44342        xmlResetLastError();
44343        if (mem_base != xmlMemBlocks()) {
44344            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44345	           xmlMemBlocks() - mem_base);
44346	    test_ret++;
44347            printf(" %d", n_writer);
44348            printf(" %d", n_content);
44349            printf(" %d", n_len);
44350            printf("\n");
44351        }
44352    }
44353    }
44354    }
44355    function_tests++;
44356#endif
44357
44358    return(test_ret);
44359}
44360
44361
44362static int
44363test_xmlTextWriterWriteString(void) {
44364    int test_ret = 0;
44365
44366#if defined(LIBXML_WRITER_ENABLED)
44367    int mem_base;
44368    int ret_val;
44369    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44370    int n_writer;
44371    xmlChar * content; /* text string */
44372    int n_content;
44373
44374    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44375    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44376        mem_base = xmlMemBlocks();
44377        writer = gen_xmlTextWriterPtr(n_writer, 0);
44378        content = gen_const_xmlChar_ptr(n_content, 1);
44379
44380        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
44381        desret_int(ret_val);
44382        call_tests++;
44383        des_xmlTextWriterPtr(n_writer, writer, 0);
44384        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44385        xmlResetLastError();
44386        if (mem_base != xmlMemBlocks()) {
44387            printf("Leak of %d blocks found in xmlTextWriterWriteString",
44388	           xmlMemBlocks() - mem_base);
44389	    test_ret++;
44390            printf(" %d", n_writer);
44391            printf(" %d", n_content);
44392            printf("\n");
44393        }
44394    }
44395    }
44396    function_tests++;
44397#endif
44398
44399    return(test_ret);
44400}
44401
44402
44403static int
44404test_xmlTextWriterWriteVFormatAttribute(void) {
44405    int test_ret = 0;
44406
44407
44408    /* missing type support */
44409    return(test_ret);
44410}
44411
44412
44413static int
44414test_xmlTextWriterWriteVFormatAttributeNS(void) {
44415    int test_ret = 0;
44416
44417
44418    /* missing type support */
44419    return(test_ret);
44420}
44421
44422
44423static int
44424test_xmlTextWriterWriteVFormatCDATA(void) {
44425    int test_ret = 0;
44426
44427
44428    /* missing type support */
44429    return(test_ret);
44430}
44431
44432
44433static int
44434test_xmlTextWriterWriteVFormatComment(void) {
44435    int test_ret = 0;
44436
44437
44438    /* missing type support */
44439    return(test_ret);
44440}
44441
44442
44443static int
44444test_xmlTextWriterWriteVFormatDTD(void) {
44445    int test_ret = 0;
44446
44447
44448    /* missing type support */
44449    return(test_ret);
44450}
44451
44452
44453static int
44454test_xmlTextWriterWriteVFormatDTDAttlist(void) {
44455    int test_ret = 0;
44456
44457
44458    /* missing type support */
44459    return(test_ret);
44460}
44461
44462
44463static int
44464test_xmlTextWriterWriteVFormatDTDElement(void) {
44465    int test_ret = 0;
44466
44467
44468    /* missing type support */
44469    return(test_ret);
44470}
44471
44472
44473static int
44474test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
44475    int test_ret = 0;
44476
44477
44478    /* missing type support */
44479    return(test_ret);
44480}
44481
44482
44483static int
44484test_xmlTextWriterWriteVFormatElement(void) {
44485    int test_ret = 0;
44486
44487
44488    /* missing type support */
44489    return(test_ret);
44490}
44491
44492
44493static int
44494test_xmlTextWriterWriteVFormatElementNS(void) {
44495    int test_ret = 0;
44496
44497
44498    /* missing type support */
44499    return(test_ret);
44500}
44501
44502
44503static int
44504test_xmlTextWriterWriteVFormatPI(void) {
44505    int test_ret = 0;
44506
44507
44508    /* missing type support */
44509    return(test_ret);
44510}
44511
44512
44513static int
44514test_xmlTextWriterWriteVFormatRaw(void) {
44515    int test_ret = 0;
44516
44517
44518    /* missing type support */
44519    return(test_ret);
44520}
44521
44522
44523static int
44524test_xmlTextWriterWriteVFormatString(void) {
44525    int test_ret = 0;
44526
44527
44528    /* missing type support */
44529    return(test_ret);
44530}
44531
44532static int
44533test_xmlwriter(void) {
44534    int test_ret = 0;
44535
44536    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
44537    test_ret += test_xmlNewTextWriter();
44538    test_ret += test_xmlNewTextWriterFilename();
44539    test_ret += test_xmlNewTextWriterMemory();
44540    test_ret += test_xmlNewTextWriterPushParser();
44541    test_ret += test_xmlNewTextWriterTree();
44542    test_ret += test_xmlTextWriterEndAttribute();
44543    test_ret += test_xmlTextWriterEndCDATA();
44544    test_ret += test_xmlTextWriterEndComment();
44545    test_ret += test_xmlTextWriterEndDTD();
44546    test_ret += test_xmlTextWriterEndDTDAttlist();
44547    test_ret += test_xmlTextWriterEndDTDElement();
44548    test_ret += test_xmlTextWriterEndDTDEntity();
44549    test_ret += test_xmlTextWriterEndDocument();
44550    test_ret += test_xmlTextWriterEndElement();
44551    test_ret += test_xmlTextWriterEndPI();
44552    test_ret += test_xmlTextWriterFlush();
44553    test_ret += test_xmlTextWriterFullEndElement();
44554    test_ret += test_xmlTextWriterSetIndent();
44555    test_ret += test_xmlTextWriterSetIndentString();
44556    test_ret += test_xmlTextWriterStartAttribute();
44557    test_ret += test_xmlTextWriterStartAttributeNS();
44558    test_ret += test_xmlTextWriterStartCDATA();
44559    test_ret += test_xmlTextWriterStartComment();
44560    test_ret += test_xmlTextWriterStartDTD();
44561    test_ret += test_xmlTextWriterStartDTDAttlist();
44562    test_ret += test_xmlTextWriterStartDTDElement();
44563    test_ret += test_xmlTextWriterStartDTDEntity();
44564    test_ret += test_xmlTextWriterStartDocument();
44565    test_ret += test_xmlTextWriterStartElement();
44566    test_ret += test_xmlTextWriterStartElementNS();
44567    test_ret += test_xmlTextWriterStartPI();
44568    test_ret += test_xmlTextWriterWriteAttribute();
44569    test_ret += test_xmlTextWriterWriteAttributeNS();
44570    test_ret += test_xmlTextWriterWriteBase64();
44571    test_ret += test_xmlTextWriterWriteBinHex();
44572    test_ret += test_xmlTextWriterWriteCDATA();
44573    test_ret += test_xmlTextWriterWriteComment();
44574    test_ret += test_xmlTextWriterWriteDTD();
44575    test_ret += test_xmlTextWriterWriteDTDAttlist();
44576    test_ret += test_xmlTextWriterWriteDTDElement();
44577    test_ret += test_xmlTextWriterWriteDTDEntity();
44578    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
44579    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
44580    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
44581    test_ret += test_xmlTextWriterWriteDTDNotation();
44582    test_ret += test_xmlTextWriterWriteElement();
44583    test_ret += test_xmlTextWriterWriteElementNS();
44584    test_ret += test_xmlTextWriterWriteFormatAttribute();
44585    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
44586    test_ret += test_xmlTextWriterWriteFormatCDATA();
44587    test_ret += test_xmlTextWriterWriteFormatComment();
44588    test_ret += test_xmlTextWriterWriteFormatDTD();
44589    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
44590    test_ret += test_xmlTextWriterWriteFormatDTDElement();
44591    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
44592    test_ret += test_xmlTextWriterWriteFormatElement();
44593    test_ret += test_xmlTextWriterWriteFormatElementNS();
44594    test_ret += test_xmlTextWriterWriteFormatPI();
44595    test_ret += test_xmlTextWriterWriteFormatRaw();
44596    test_ret += test_xmlTextWriterWriteFormatString();
44597    test_ret += test_xmlTextWriterWritePI();
44598    test_ret += test_xmlTextWriterWriteRaw();
44599    test_ret += test_xmlTextWriterWriteRawLen();
44600    test_ret += test_xmlTextWriterWriteString();
44601    test_ret += test_xmlTextWriterWriteVFormatAttribute();
44602    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
44603    test_ret += test_xmlTextWriterWriteVFormatCDATA();
44604    test_ret += test_xmlTextWriterWriteVFormatComment();
44605    test_ret += test_xmlTextWriterWriteVFormatDTD();
44606    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
44607    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
44608    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
44609    test_ret += test_xmlTextWriterWriteVFormatElement();
44610    test_ret += test_xmlTextWriterWriteVFormatElementNS();
44611    test_ret += test_xmlTextWriterWriteVFormatPI();
44612    test_ret += test_xmlTextWriterWriteVFormatRaw();
44613    test_ret += test_xmlTextWriterWriteVFormatString();
44614
44615    if (test_ret != 0)
44616	printf("Module xmlwriter: %d errors\n", test_ret);
44617    return(test_ret);
44618}
44619
44620static int
44621test_xmlXPathCastBooleanToNumber(void) {
44622    int test_ret = 0;
44623
44624#if defined(LIBXML_XPATH_ENABLED)
44625    int mem_base;
44626    double ret_val;
44627    int val; /* a boolean */
44628    int n_val;
44629
44630    for (n_val = 0;n_val < gen_nb_int;n_val++) {
44631        mem_base = xmlMemBlocks();
44632        val = gen_int(n_val, 0);
44633
44634        ret_val = xmlXPathCastBooleanToNumber(val);
44635        desret_double(ret_val);
44636        call_tests++;
44637        des_int(n_val, val, 0);
44638        xmlResetLastError();
44639        if (mem_base != xmlMemBlocks()) {
44640            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
44641	           xmlMemBlocks() - mem_base);
44642	    test_ret++;
44643            printf(" %d", n_val);
44644            printf("\n");
44645        }
44646    }
44647    function_tests++;
44648#endif
44649
44650    return(test_ret);
44651}
44652
44653
44654static int
44655test_xmlXPathCastBooleanToString(void) {
44656    int test_ret = 0;
44657
44658#if defined(LIBXML_XPATH_ENABLED)
44659    int mem_base;
44660    xmlChar * ret_val;
44661    int val; /* a boolean */
44662    int n_val;
44663
44664    for (n_val = 0;n_val < gen_nb_int;n_val++) {
44665        mem_base = xmlMemBlocks();
44666        val = gen_int(n_val, 0);
44667
44668        ret_val = xmlXPathCastBooleanToString(val);
44669        desret_xmlChar_ptr(ret_val);
44670        call_tests++;
44671        des_int(n_val, val, 0);
44672        xmlResetLastError();
44673        if (mem_base != xmlMemBlocks()) {
44674            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
44675	           xmlMemBlocks() - mem_base);
44676	    test_ret++;
44677            printf(" %d", n_val);
44678            printf("\n");
44679        }
44680    }
44681    function_tests++;
44682#endif
44683
44684    return(test_ret);
44685}
44686
44687
44688static int
44689test_xmlXPathCastNodeSetToBoolean(void) {
44690    int test_ret = 0;
44691
44692#if defined(LIBXML_XPATH_ENABLED)
44693    int mem_base;
44694    int ret_val;
44695    xmlNodeSetPtr ns; /* a node-set */
44696    int n_ns;
44697
44698    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
44699        mem_base = xmlMemBlocks();
44700        ns = gen_xmlNodeSetPtr(n_ns, 0);
44701
44702        ret_val = xmlXPathCastNodeSetToBoolean(ns);
44703        desret_int(ret_val);
44704        call_tests++;
44705        des_xmlNodeSetPtr(n_ns, ns, 0);
44706        xmlResetLastError();
44707        if (mem_base != xmlMemBlocks()) {
44708            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
44709	           xmlMemBlocks() - mem_base);
44710	    test_ret++;
44711            printf(" %d", n_ns);
44712            printf("\n");
44713        }
44714    }
44715    function_tests++;
44716#endif
44717
44718    return(test_ret);
44719}
44720
44721
44722static int
44723test_xmlXPathCastNodeSetToNumber(void) {
44724    int test_ret = 0;
44725
44726#if defined(LIBXML_XPATH_ENABLED)
44727    int mem_base;
44728    double ret_val;
44729    xmlNodeSetPtr ns; /* a node-set */
44730    int n_ns;
44731
44732    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
44733        mem_base = xmlMemBlocks();
44734        ns = gen_xmlNodeSetPtr(n_ns, 0);
44735
44736        ret_val = xmlXPathCastNodeSetToNumber(ns);
44737        desret_double(ret_val);
44738        call_tests++;
44739        des_xmlNodeSetPtr(n_ns, ns, 0);
44740        xmlResetLastError();
44741        if (mem_base != xmlMemBlocks()) {
44742            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
44743	           xmlMemBlocks() - mem_base);
44744	    test_ret++;
44745            printf(" %d", n_ns);
44746            printf("\n");
44747        }
44748    }
44749    function_tests++;
44750#endif
44751
44752    return(test_ret);
44753}
44754
44755
44756static int
44757test_xmlXPathCastNodeSetToString(void) {
44758    int test_ret = 0;
44759
44760#if defined(LIBXML_XPATH_ENABLED)
44761    int mem_base;
44762    xmlChar * ret_val;
44763    xmlNodeSetPtr ns; /* a node-set */
44764    int n_ns;
44765
44766    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
44767        mem_base = xmlMemBlocks();
44768        ns = gen_xmlNodeSetPtr(n_ns, 0);
44769
44770        ret_val = xmlXPathCastNodeSetToString(ns);
44771        desret_xmlChar_ptr(ret_val);
44772        call_tests++;
44773        des_xmlNodeSetPtr(n_ns, ns, 0);
44774        xmlResetLastError();
44775        if (mem_base != xmlMemBlocks()) {
44776            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
44777	           xmlMemBlocks() - mem_base);
44778	    test_ret++;
44779            printf(" %d", n_ns);
44780            printf("\n");
44781        }
44782    }
44783    function_tests++;
44784#endif
44785
44786    return(test_ret);
44787}
44788
44789
44790static int
44791test_xmlXPathCastNodeToNumber(void) {
44792    int test_ret = 0;
44793
44794#if defined(LIBXML_XPATH_ENABLED)
44795    int mem_base;
44796    double ret_val;
44797    xmlNodePtr node; /* a node */
44798    int n_node;
44799
44800    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
44801        mem_base = xmlMemBlocks();
44802        node = gen_xmlNodePtr(n_node, 0);
44803
44804        ret_val = xmlXPathCastNodeToNumber(node);
44805        desret_double(ret_val);
44806        call_tests++;
44807        des_xmlNodePtr(n_node, node, 0);
44808        xmlResetLastError();
44809        if (mem_base != xmlMemBlocks()) {
44810            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
44811	           xmlMemBlocks() - mem_base);
44812	    test_ret++;
44813            printf(" %d", n_node);
44814            printf("\n");
44815        }
44816    }
44817    function_tests++;
44818#endif
44819
44820    return(test_ret);
44821}
44822
44823
44824static int
44825test_xmlXPathCastNodeToString(void) {
44826    int test_ret = 0;
44827
44828#if defined(LIBXML_XPATH_ENABLED)
44829    int mem_base;
44830    xmlChar * ret_val;
44831    xmlNodePtr node; /* a node */
44832    int n_node;
44833
44834    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
44835        mem_base = xmlMemBlocks();
44836        node = gen_xmlNodePtr(n_node, 0);
44837
44838        ret_val = xmlXPathCastNodeToString(node);
44839        desret_xmlChar_ptr(ret_val);
44840        call_tests++;
44841        des_xmlNodePtr(n_node, node, 0);
44842        xmlResetLastError();
44843        if (mem_base != xmlMemBlocks()) {
44844            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
44845	           xmlMemBlocks() - mem_base);
44846	    test_ret++;
44847            printf(" %d", n_node);
44848            printf("\n");
44849        }
44850    }
44851    function_tests++;
44852#endif
44853
44854    return(test_ret);
44855}
44856
44857
44858static int
44859test_xmlXPathCastNumberToBoolean(void) {
44860    int test_ret = 0;
44861
44862#if defined(LIBXML_XPATH_ENABLED)
44863    int mem_base;
44864    int ret_val;
44865    double val; /* a number */
44866    int n_val;
44867
44868    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44869        mem_base = xmlMemBlocks();
44870        val = gen_double(n_val, 0);
44871
44872        ret_val = xmlXPathCastNumberToBoolean(val);
44873        desret_int(ret_val);
44874        call_tests++;
44875        des_double(n_val, val, 0);
44876        xmlResetLastError();
44877        if (mem_base != xmlMemBlocks()) {
44878            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
44879	           xmlMemBlocks() - mem_base);
44880	    test_ret++;
44881            printf(" %d", n_val);
44882            printf("\n");
44883        }
44884    }
44885    function_tests++;
44886#endif
44887
44888    return(test_ret);
44889}
44890
44891
44892static int
44893test_xmlXPathCastNumberToString(void) {
44894    int test_ret = 0;
44895
44896#if defined(LIBXML_XPATH_ENABLED)
44897    int mem_base;
44898    xmlChar * ret_val;
44899    double val; /* a number */
44900    int n_val;
44901
44902    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44903        mem_base = xmlMemBlocks();
44904        val = gen_double(n_val, 0);
44905
44906        ret_val = xmlXPathCastNumberToString(val);
44907        desret_xmlChar_ptr(ret_val);
44908        call_tests++;
44909        des_double(n_val, val, 0);
44910        xmlResetLastError();
44911        if (mem_base != xmlMemBlocks()) {
44912            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
44913	           xmlMemBlocks() - mem_base);
44914	    test_ret++;
44915            printf(" %d", n_val);
44916            printf("\n");
44917        }
44918    }
44919    function_tests++;
44920#endif
44921
44922    return(test_ret);
44923}
44924
44925
44926static int
44927test_xmlXPathCastStringToBoolean(void) {
44928    int test_ret = 0;
44929
44930#if defined(LIBXML_XPATH_ENABLED)
44931    int mem_base;
44932    int ret_val;
44933    xmlChar * val; /* a string */
44934    int n_val;
44935
44936    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
44937        mem_base = xmlMemBlocks();
44938        val = gen_const_xmlChar_ptr(n_val, 0);
44939
44940        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
44941        desret_int(ret_val);
44942        call_tests++;
44943        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
44944        xmlResetLastError();
44945        if (mem_base != xmlMemBlocks()) {
44946            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
44947	           xmlMemBlocks() - mem_base);
44948	    test_ret++;
44949            printf(" %d", n_val);
44950            printf("\n");
44951        }
44952    }
44953    function_tests++;
44954#endif
44955
44956    return(test_ret);
44957}
44958
44959
44960static int
44961test_xmlXPathCastStringToNumber(void) {
44962    int test_ret = 0;
44963
44964#if defined(LIBXML_XPATH_ENABLED)
44965    int mem_base;
44966    double ret_val;
44967    xmlChar * val; /* a string */
44968    int n_val;
44969
44970    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
44971        mem_base = xmlMemBlocks();
44972        val = gen_const_xmlChar_ptr(n_val, 0);
44973
44974        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
44975        desret_double(ret_val);
44976        call_tests++;
44977        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
44978        xmlResetLastError();
44979        if (mem_base != xmlMemBlocks()) {
44980            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
44981	           xmlMemBlocks() - mem_base);
44982	    test_ret++;
44983            printf(" %d", n_val);
44984            printf("\n");
44985        }
44986    }
44987    function_tests++;
44988#endif
44989
44990    return(test_ret);
44991}
44992
44993
44994static int
44995test_xmlXPathCastToBoolean(void) {
44996    int test_ret = 0;
44997
44998#if defined(LIBXML_XPATH_ENABLED)
44999    int mem_base;
45000    int ret_val;
45001    xmlXPathObjectPtr val; /* an XPath object */
45002    int n_val;
45003
45004    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45005        mem_base = xmlMemBlocks();
45006        val = gen_xmlXPathObjectPtr(n_val, 0);
45007
45008        ret_val = xmlXPathCastToBoolean(val);
45009        desret_int(ret_val);
45010        call_tests++;
45011        des_xmlXPathObjectPtr(n_val, val, 0);
45012        xmlResetLastError();
45013        if (mem_base != xmlMemBlocks()) {
45014            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45015	           xmlMemBlocks() - mem_base);
45016	    test_ret++;
45017            printf(" %d", n_val);
45018            printf("\n");
45019        }
45020    }
45021    function_tests++;
45022#endif
45023
45024    return(test_ret);
45025}
45026
45027
45028static int
45029test_xmlXPathCastToNumber(void) {
45030    int test_ret = 0;
45031
45032#if defined(LIBXML_XPATH_ENABLED)
45033    int mem_base;
45034    double ret_val;
45035    xmlXPathObjectPtr val; /* an XPath object */
45036    int n_val;
45037
45038    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45039        mem_base = xmlMemBlocks();
45040        val = gen_xmlXPathObjectPtr(n_val, 0);
45041
45042        ret_val = xmlXPathCastToNumber(val);
45043        desret_double(ret_val);
45044        call_tests++;
45045        des_xmlXPathObjectPtr(n_val, val, 0);
45046        xmlResetLastError();
45047        if (mem_base != xmlMemBlocks()) {
45048            printf("Leak of %d blocks found in xmlXPathCastToNumber",
45049	           xmlMemBlocks() - mem_base);
45050	    test_ret++;
45051            printf(" %d", n_val);
45052            printf("\n");
45053        }
45054    }
45055    function_tests++;
45056#endif
45057
45058    return(test_ret);
45059}
45060
45061
45062static int
45063test_xmlXPathCastToString(void) {
45064    int test_ret = 0;
45065
45066#if defined(LIBXML_XPATH_ENABLED)
45067    int mem_base;
45068    xmlChar * ret_val;
45069    xmlXPathObjectPtr val; /* an XPath object */
45070    int n_val;
45071
45072    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45073        mem_base = xmlMemBlocks();
45074        val = gen_xmlXPathObjectPtr(n_val, 0);
45075
45076        ret_val = xmlXPathCastToString(val);
45077        desret_xmlChar_ptr(ret_val);
45078        call_tests++;
45079        des_xmlXPathObjectPtr(n_val, val, 0);
45080        xmlResetLastError();
45081        if (mem_base != xmlMemBlocks()) {
45082            printf("Leak of %d blocks found in xmlXPathCastToString",
45083	           xmlMemBlocks() - mem_base);
45084	    test_ret++;
45085            printf(" %d", n_val);
45086            printf("\n");
45087        }
45088    }
45089    function_tests++;
45090#endif
45091
45092    return(test_ret);
45093}
45094
45095
45096static int
45097test_xmlXPathCmpNodes(void) {
45098    int test_ret = 0;
45099
45100#if defined(LIBXML_XPATH_ENABLED)
45101    int mem_base;
45102    int ret_val;
45103    xmlNodePtr node1; /* the first node */
45104    int n_node1;
45105    xmlNodePtr node2; /* the second node */
45106    int n_node2;
45107
45108    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45109    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45110        mem_base = xmlMemBlocks();
45111        node1 = gen_xmlNodePtr(n_node1, 0);
45112        node2 = gen_xmlNodePtr(n_node2, 1);
45113
45114        ret_val = xmlXPathCmpNodes(node1, node2);
45115        desret_int(ret_val);
45116        call_tests++;
45117        des_xmlNodePtr(n_node1, node1, 0);
45118        des_xmlNodePtr(n_node2, node2, 1);
45119        xmlResetLastError();
45120        if (mem_base != xmlMemBlocks()) {
45121            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45122	           xmlMemBlocks() - mem_base);
45123	    test_ret++;
45124            printf(" %d", n_node1);
45125            printf(" %d", n_node2);
45126            printf("\n");
45127        }
45128    }
45129    }
45130    function_tests++;
45131#endif
45132
45133    return(test_ret);
45134}
45135
45136
45137static int
45138test_xmlXPathCompile(void) {
45139    int test_ret = 0;
45140
45141
45142    /* missing type support */
45143    return(test_ret);
45144}
45145
45146#ifdef LIBXML_XPATH_ENABLED
45147
45148#define gen_nb_xmlXPathCompExprPtr 1
45149static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45150    return(NULL);
45151}
45152static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45153}
45154#endif
45155
45156#ifdef LIBXML_XPATH_ENABLED
45157
45158#define gen_nb_xmlXPathContextPtr 1
45159static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45160    return(NULL);
45161}
45162static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45163}
45164#endif
45165
45166
45167static int
45168test_xmlXPathCompiledEval(void) {
45169    int test_ret = 0;
45170
45171#if defined(LIBXML_XPATH_ENABLED)
45172    int mem_base;
45173    xmlXPathObjectPtr ret_val;
45174    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45175    int n_comp;
45176    xmlXPathContextPtr ctx; /* the XPath context */
45177    int n_ctx;
45178
45179    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45180    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45181        mem_base = xmlMemBlocks();
45182        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45183        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45184
45185        ret_val = xmlXPathCompiledEval(comp, ctx);
45186        desret_xmlXPathObjectPtr(ret_val);
45187        call_tests++;
45188        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45189        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45190        xmlResetLastError();
45191        if (mem_base != xmlMemBlocks()) {
45192            printf("Leak of %d blocks found in xmlXPathCompiledEval",
45193	           xmlMemBlocks() - mem_base);
45194	    test_ret++;
45195            printf(" %d", n_comp);
45196            printf(" %d", n_ctx);
45197            printf("\n");
45198        }
45199    }
45200    }
45201    function_tests++;
45202#endif
45203
45204    return(test_ret);
45205}
45206
45207
45208static int
45209test_xmlXPathConvertBoolean(void) {
45210    int test_ret = 0;
45211
45212#if defined(LIBXML_XPATH_ENABLED)
45213    int mem_base;
45214    xmlXPathObjectPtr ret_val;
45215    xmlXPathObjectPtr val; /* an XPath object */
45216    int n_val;
45217
45218    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45219        mem_base = xmlMemBlocks();
45220        val = gen_xmlXPathObjectPtr(n_val, 0);
45221
45222        ret_val = xmlXPathConvertBoolean(val);
45223        val = NULL;
45224        desret_xmlXPathObjectPtr(ret_val);
45225        call_tests++;
45226        des_xmlXPathObjectPtr(n_val, val, 0);
45227        xmlResetLastError();
45228        if (mem_base != xmlMemBlocks()) {
45229            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45230	           xmlMemBlocks() - mem_base);
45231	    test_ret++;
45232            printf(" %d", n_val);
45233            printf("\n");
45234        }
45235    }
45236    function_tests++;
45237#endif
45238
45239    return(test_ret);
45240}
45241
45242
45243static int
45244test_xmlXPathConvertNumber(void) {
45245    int test_ret = 0;
45246
45247#if defined(LIBXML_XPATH_ENABLED)
45248    int mem_base;
45249    xmlXPathObjectPtr ret_val;
45250    xmlXPathObjectPtr val; /* an XPath object */
45251    int n_val;
45252
45253    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45254        mem_base = xmlMemBlocks();
45255        val = gen_xmlXPathObjectPtr(n_val, 0);
45256
45257        ret_val = xmlXPathConvertNumber(val);
45258        val = NULL;
45259        desret_xmlXPathObjectPtr(ret_val);
45260        call_tests++;
45261        des_xmlXPathObjectPtr(n_val, val, 0);
45262        xmlResetLastError();
45263        if (mem_base != xmlMemBlocks()) {
45264            printf("Leak of %d blocks found in xmlXPathConvertNumber",
45265	           xmlMemBlocks() - mem_base);
45266	    test_ret++;
45267            printf(" %d", n_val);
45268            printf("\n");
45269        }
45270    }
45271    function_tests++;
45272#endif
45273
45274    return(test_ret);
45275}
45276
45277
45278static int
45279test_xmlXPathConvertString(void) {
45280    int test_ret = 0;
45281
45282#if defined(LIBXML_XPATH_ENABLED)
45283    int mem_base;
45284    xmlXPathObjectPtr ret_val;
45285    xmlXPathObjectPtr val; /* an XPath object */
45286    int n_val;
45287
45288    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45289        mem_base = xmlMemBlocks();
45290        val = gen_xmlXPathObjectPtr(n_val, 0);
45291
45292        ret_val = xmlXPathConvertString(val);
45293        val = NULL;
45294        desret_xmlXPathObjectPtr(ret_val);
45295        call_tests++;
45296        des_xmlXPathObjectPtr(n_val, val, 0);
45297        xmlResetLastError();
45298        if (mem_base != xmlMemBlocks()) {
45299            printf("Leak of %d blocks found in xmlXPathConvertString",
45300	           xmlMemBlocks() - mem_base);
45301	    test_ret++;
45302            printf(" %d", n_val);
45303            printf("\n");
45304        }
45305    }
45306    function_tests++;
45307#endif
45308
45309    return(test_ret);
45310}
45311
45312
45313static int
45314test_xmlXPathCtxtCompile(void) {
45315    int test_ret = 0;
45316
45317
45318    /* missing type support */
45319    return(test_ret);
45320}
45321
45322
45323static int
45324test_xmlXPathEval(void) {
45325    int test_ret = 0;
45326
45327#if defined(LIBXML_XPATH_ENABLED)
45328    int mem_base;
45329    xmlXPathObjectPtr ret_val;
45330    xmlChar * str; /* the XPath expression */
45331    int n_str;
45332    xmlXPathContextPtr ctx; /* the XPath context */
45333    int n_ctx;
45334
45335    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45336    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45337        mem_base = xmlMemBlocks();
45338        str = gen_const_xmlChar_ptr(n_str, 0);
45339        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45340
45341        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
45342        desret_xmlXPathObjectPtr(ret_val);
45343        call_tests++;
45344        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
45345        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45346        xmlResetLastError();
45347        if (mem_base != xmlMemBlocks()) {
45348            printf("Leak of %d blocks found in xmlXPathEval",
45349	           xmlMemBlocks() - mem_base);
45350	    test_ret++;
45351            printf(" %d", n_str);
45352            printf(" %d", n_ctx);
45353            printf("\n");
45354        }
45355    }
45356    }
45357    function_tests++;
45358#endif
45359
45360    return(test_ret);
45361}
45362
45363
45364static int
45365test_xmlXPathEvalExpression(void) {
45366    int test_ret = 0;
45367
45368#if defined(LIBXML_XPATH_ENABLED)
45369    int mem_base;
45370    xmlXPathObjectPtr ret_val;
45371    xmlChar * str; /* the XPath expression */
45372    int n_str;
45373    xmlXPathContextPtr ctxt; /* the XPath context */
45374    int n_ctxt;
45375
45376    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45377    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45378        mem_base = xmlMemBlocks();
45379        str = gen_const_xmlChar_ptr(n_str, 0);
45380        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45381
45382        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
45383        desret_xmlXPathObjectPtr(ret_val);
45384        call_tests++;
45385        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
45386        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45387        xmlResetLastError();
45388        if (mem_base != xmlMemBlocks()) {
45389            printf("Leak of %d blocks found in xmlXPathEvalExpression",
45390	           xmlMemBlocks() - mem_base);
45391	    test_ret++;
45392            printf(" %d", n_str);
45393            printf(" %d", n_ctxt);
45394            printf("\n");
45395        }
45396    }
45397    }
45398    function_tests++;
45399#endif
45400
45401    return(test_ret);
45402}
45403
45404
45405static int
45406test_xmlXPathEvalPredicate(void) {
45407    int test_ret = 0;
45408
45409#if defined(LIBXML_XPATH_ENABLED)
45410    int mem_base;
45411    int ret_val;
45412    xmlXPathContextPtr ctxt; /* the XPath context */
45413    int n_ctxt;
45414    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
45415    int n_res;
45416
45417    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45418    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
45419        mem_base = xmlMemBlocks();
45420        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45421        res = gen_xmlXPathObjectPtr(n_res, 1);
45422
45423        ret_val = xmlXPathEvalPredicate(ctxt, res);
45424        desret_int(ret_val);
45425        call_tests++;
45426        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45427        des_xmlXPathObjectPtr(n_res, res, 1);
45428        xmlResetLastError();
45429        if (mem_base != xmlMemBlocks()) {
45430            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
45431	           xmlMemBlocks() - mem_base);
45432	    test_ret++;
45433            printf(" %d", n_ctxt);
45434            printf(" %d", n_res);
45435            printf("\n");
45436        }
45437    }
45438    }
45439    function_tests++;
45440#endif
45441
45442    return(test_ret);
45443}
45444
45445
45446static int
45447test_xmlXPathInit(void) {
45448    int test_ret = 0;
45449
45450#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45451    int mem_base;
45452
45453        mem_base = xmlMemBlocks();
45454
45455        xmlXPathInit();
45456        call_tests++;
45457        xmlResetLastError();
45458        if (mem_base != xmlMemBlocks()) {
45459            printf("Leak of %d blocks found in xmlXPathInit",
45460	           xmlMemBlocks() - mem_base);
45461	    test_ret++;
45462            printf("\n");
45463        }
45464    function_tests++;
45465#endif
45466
45467    return(test_ret);
45468}
45469
45470
45471static int
45472test_xmlXPathIsInf(void) {
45473    int test_ret = 0;
45474
45475#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45476    int mem_base;
45477    int ret_val;
45478    double val; /* a double value */
45479    int n_val;
45480
45481    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45482        mem_base = xmlMemBlocks();
45483        val = gen_double(n_val, 0);
45484
45485        ret_val = xmlXPathIsInf(val);
45486        desret_int(ret_val);
45487        call_tests++;
45488        des_double(n_val, val, 0);
45489        xmlResetLastError();
45490        if (mem_base != xmlMemBlocks()) {
45491            printf("Leak of %d blocks found in xmlXPathIsInf",
45492	           xmlMemBlocks() - mem_base);
45493	    test_ret++;
45494            printf(" %d", n_val);
45495            printf("\n");
45496        }
45497    }
45498    function_tests++;
45499#endif
45500
45501    return(test_ret);
45502}
45503
45504
45505static int
45506test_xmlXPathIsNaN(void) {
45507    int test_ret = 0;
45508
45509#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
45510    int mem_base;
45511    int ret_val;
45512    double val; /* a double value */
45513    int n_val;
45514
45515    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45516        mem_base = xmlMemBlocks();
45517        val = gen_double(n_val, 0);
45518
45519        ret_val = xmlXPathIsNaN(val);
45520        desret_int(ret_val);
45521        call_tests++;
45522        des_double(n_val, val, 0);
45523        xmlResetLastError();
45524        if (mem_base != xmlMemBlocks()) {
45525            printf("Leak of %d blocks found in xmlXPathIsNaN",
45526	           xmlMemBlocks() - mem_base);
45527	    test_ret++;
45528            printf(" %d", n_val);
45529            printf("\n");
45530        }
45531    }
45532    function_tests++;
45533#endif
45534
45535    return(test_ret);
45536}
45537
45538
45539static int
45540test_xmlXPathNewContext(void) {
45541    int test_ret = 0;
45542
45543
45544    /* missing type support */
45545    return(test_ret);
45546}
45547
45548
45549static int
45550test_xmlXPathNodeSetCreate(void) {
45551    int test_ret = 0;
45552
45553#if defined(LIBXML_XPATH_ENABLED)
45554    int mem_base;
45555    xmlNodeSetPtr ret_val;
45556    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
45557    int n_val;
45558
45559    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45560        mem_base = xmlMemBlocks();
45561        val = gen_xmlNodePtr(n_val, 0);
45562
45563        ret_val = xmlXPathNodeSetCreate(val);
45564        desret_xmlNodeSetPtr(ret_val);
45565        call_tests++;
45566        des_xmlNodePtr(n_val, val, 0);
45567        xmlResetLastError();
45568        if (mem_base != xmlMemBlocks()) {
45569            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
45570	           xmlMemBlocks() - mem_base);
45571	    test_ret++;
45572            printf(" %d", n_val);
45573            printf("\n");
45574        }
45575    }
45576    function_tests++;
45577#endif
45578
45579    return(test_ret);
45580}
45581
45582
45583static int
45584test_xmlXPathObjectCopy(void) {
45585    int test_ret = 0;
45586
45587#if defined(LIBXML_XPATH_ENABLED)
45588    int mem_base;
45589    xmlXPathObjectPtr ret_val;
45590    xmlXPathObjectPtr val; /* the original object */
45591    int n_val;
45592
45593    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45594        mem_base = xmlMemBlocks();
45595        val = gen_xmlXPathObjectPtr(n_val, 0);
45596
45597        ret_val = xmlXPathObjectCopy(val);
45598        desret_xmlXPathObjectPtr(ret_val);
45599        call_tests++;
45600        des_xmlXPathObjectPtr(n_val, val, 0);
45601        xmlResetLastError();
45602        if (mem_base != xmlMemBlocks()) {
45603            printf("Leak of %d blocks found in xmlXPathObjectCopy",
45604	           xmlMemBlocks() - mem_base);
45605	    test_ret++;
45606            printf(" %d", n_val);
45607            printf("\n");
45608        }
45609    }
45610    function_tests++;
45611#endif
45612
45613    return(test_ret);
45614}
45615
45616
45617static int
45618test_xmlXPathOrderDocElems(void) {
45619    int test_ret = 0;
45620
45621#if defined(LIBXML_XPATH_ENABLED)
45622    int mem_base;
45623    long ret_val;
45624    xmlDocPtr doc; /* an input document */
45625    int n_doc;
45626
45627    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
45628        mem_base = xmlMemBlocks();
45629        doc = gen_xmlDocPtr(n_doc, 0);
45630
45631        ret_val = xmlXPathOrderDocElems(doc);
45632        desret_long(ret_val);
45633        call_tests++;
45634        des_xmlDocPtr(n_doc, doc, 0);
45635        xmlResetLastError();
45636        if (mem_base != xmlMemBlocks()) {
45637            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
45638	           xmlMemBlocks() - mem_base);
45639	    test_ret++;
45640            printf(" %d", n_doc);
45641            printf("\n");
45642        }
45643    }
45644    function_tests++;
45645#endif
45646
45647    return(test_ret);
45648}
45649
45650static int
45651test_xpath(void) {
45652    int test_ret = 0;
45653
45654    if (quiet == 0) printf("Testing xpath : 28 of 36 functions ...\n");
45655    test_ret += test_xmlXPathCastBooleanToNumber();
45656    test_ret += test_xmlXPathCastBooleanToString();
45657    test_ret += test_xmlXPathCastNodeSetToBoolean();
45658    test_ret += test_xmlXPathCastNodeSetToNumber();
45659    test_ret += test_xmlXPathCastNodeSetToString();
45660    test_ret += test_xmlXPathCastNodeToNumber();
45661    test_ret += test_xmlXPathCastNodeToString();
45662    test_ret += test_xmlXPathCastNumberToBoolean();
45663    test_ret += test_xmlXPathCastNumberToString();
45664    test_ret += test_xmlXPathCastStringToBoolean();
45665    test_ret += test_xmlXPathCastStringToNumber();
45666    test_ret += test_xmlXPathCastToBoolean();
45667    test_ret += test_xmlXPathCastToNumber();
45668    test_ret += test_xmlXPathCastToString();
45669    test_ret += test_xmlXPathCmpNodes();
45670    test_ret += test_xmlXPathCompile();
45671    test_ret += test_xmlXPathCompiledEval();
45672    test_ret += test_xmlXPathConvertBoolean();
45673    test_ret += test_xmlXPathConvertNumber();
45674    test_ret += test_xmlXPathConvertString();
45675    test_ret += test_xmlXPathCtxtCompile();
45676    test_ret += test_xmlXPathEval();
45677    test_ret += test_xmlXPathEvalExpression();
45678    test_ret += test_xmlXPathEvalPredicate();
45679    test_ret += test_xmlXPathInit();
45680    test_ret += test_xmlXPathIsInf();
45681    test_ret += test_xmlXPathIsNaN();
45682    test_ret += test_xmlXPathNewContext();
45683    test_ret += test_xmlXPathNodeSetCreate();
45684    test_ret += test_xmlXPathObjectCopy();
45685    test_ret += test_xmlXPathOrderDocElems();
45686
45687    if (test_ret != 0)
45688	printf("Module xpath: %d errors\n", test_ret);
45689    return(test_ret);
45690}
45691#ifdef LIBXML_XPATH_ENABLED
45692
45693#define gen_nb_xmlXPathParserContextPtr 1
45694static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45695    return(NULL);
45696}
45697static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45698}
45699#endif
45700
45701
45702static int
45703test_valuePop(void) {
45704    int test_ret = 0;
45705
45706#if defined(LIBXML_XPATH_ENABLED)
45707    int mem_base;
45708    xmlXPathObjectPtr ret_val;
45709    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
45710    int n_ctxt;
45711
45712    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45713        mem_base = xmlMemBlocks();
45714        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45715
45716        ret_val = valuePop(ctxt);
45717        desret_xmlXPathObjectPtr(ret_val);
45718        call_tests++;
45719        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45720        xmlResetLastError();
45721        if (mem_base != xmlMemBlocks()) {
45722            printf("Leak of %d blocks found in valuePop",
45723	           xmlMemBlocks() - mem_base);
45724	    test_ret++;
45725            printf(" %d", n_ctxt);
45726            printf("\n");
45727        }
45728    }
45729    function_tests++;
45730#endif
45731
45732    return(test_ret);
45733}
45734
45735
45736static int
45737test_valuePush(void) {
45738    int test_ret = 0;
45739
45740#if defined(LIBXML_XPATH_ENABLED)
45741    int mem_base;
45742    int ret_val;
45743    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
45744    int n_ctxt;
45745    xmlXPathObjectPtr value; /* the XPath object */
45746    int n_value;
45747
45748    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45749    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
45750        mem_base = xmlMemBlocks();
45751        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45752        value = gen_xmlXPathObjectPtr(n_value, 1);
45753
45754        ret_val = valuePush(ctxt, value);
45755        desret_int(ret_val);
45756        call_tests++;
45757        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45758        des_xmlXPathObjectPtr(n_value, value, 1);
45759        xmlResetLastError();
45760        if (mem_base != xmlMemBlocks()) {
45761            printf("Leak of %d blocks found in valuePush",
45762	           xmlMemBlocks() - mem_base);
45763	    test_ret++;
45764            printf(" %d", n_ctxt);
45765            printf(" %d", n_value);
45766            printf("\n");
45767        }
45768    }
45769    }
45770    function_tests++;
45771#endif
45772
45773    return(test_ret);
45774}
45775
45776
45777static int
45778test_xmlXPathAddValues(void) {
45779    int test_ret = 0;
45780
45781#if defined(LIBXML_XPATH_ENABLED)
45782    int mem_base;
45783    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45784    int n_ctxt;
45785
45786    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45787        mem_base = xmlMemBlocks();
45788        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45789
45790        xmlXPathAddValues(ctxt);
45791        call_tests++;
45792        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45793        xmlResetLastError();
45794        if (mem_base != xmlMemBlocks()) {
45795            printf("Leak of %d blocks found in xmlXPathAddValues",
45796	           xmlMemBlocks() - mem_base);
45797	    test_ret++;
45798            printf(" %d", n_ctxt);
45799            printf("\n");
45800        }
45801    }
45802    function_tests++;
45803#endif
45804
45805    return(test_ret);
45806}
45807
45808
45809static int
45810test_xmlXPathBooleanFunction(void) {
45811    int test_ret = 0;
45812
45813#if defined(LIBXML_XPATH_ENABLED)
45814    int mem_base;
45815    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45816    int n_ctxt;
45817    int nargs; /* the number of arguments */
45818    int n_nargs;
45819
45820    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45821    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45822        mem_base = xmlMemBlocks();
45823        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45824        nargs = gen_int(n_nargs, 1);
45825
45826        xmlXPathBooleanFunction(ctxt, nargs);
45827        call_tests++;
45828        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45829        des_int(n_nargs, nargs, 1);
45830        xmlResetLastError();
45831        if (mem_base != xmlMemBlocks()) {
45832            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
45833	           xmlMemBlocks() - mem_base);
45834	    test_ret++;
45835            printf(" %d", n_ctxt);
45836            printf(" %d", n_nargs);
45837            printf("\n");
45838        }
45839    }
45840    }
45841    function_tests++;
45842#endif
45843
45844    return(test_ret);
45845}
45846
45847
45848static int
45849test_xmlXPathCeilingFunction(void) {
45850    int test_ret = 0;
45851
45852#if defined(LIBXML_XPATH_ENABLED)
45853    int mem_base;
45854    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45855    int n_ctxt;
45856    int nargs; /* the number of arguments */
45857    int n_nargs;
45858
45859    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45860    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45861        mem_base = xmlMemBlocks();
45862        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45863        nargs = gen_int(n_nargs, 1);
45864
45865        xmlXPathCeilingFunction(ctxt, nargs);
45866        call_tests++;
45867        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45868        des_int(n_nargs, nargs, 1);
45869        xmlResetLastError();
45870        if (mem_base != xmlMemBlocks()) {
45871            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
45872	           xmlMemBlocks() - mem_base);
45873	    test_ret++;
45874            printf(" %d", n_ctxt);
45875            printf(" %d", n_nargs);
45876            printf("\n");
45877        }
45878    }
45879    }
45880    function_tests++;
45881#endif
45882
45883    return(test_ret);
45884}
45885
45886
45887static int
45888test_xmlXPathCompareValues(void) {
45889    int test_ret = 0;
45890
45891#if defined(LIBXML_XPATH_ENABLED)
45892    int mem_base;
45893    int ret_val;
45894    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45895    int n_ctxt;
45896    int inf; /* less than (1) or greater than (0) */
45897    int n_inf;
45898    int strict; /* is the comparison strict */
45899    int n_strict;
45900
45901    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45902    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
45903    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
45904        mem_base = xmlMemBlocks();
45905        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45906        inf = gen_int(n_inf, 1);
45907        strict = gen_int(n_strict, 2);
45908
45909        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
45910        desret_int(ret_val);
45911        call_tests++;
45912        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45913        des_int(n_inf, inf, 1);
45914        des_int(n_strict, strict, 2);
45915        xmlResetLastError();
45916        if (mem_base != xmlMemBlocks()) {
45917            printf("Leak of %d blocks found in xmlXPathCompareValues",
45918	           xmlMemBlocks() - mem_base);
45919	    test_ret++;
45920            printf(" %d", n_ctxt);
45921            printf(" %d", n_inf);
45922            printf(" %d", n_strict);
45923            printf("\n");
45924        }
45925    }
45926    }
45927    }
45928    function_tests++;
45929#endif
45930
45931    return(test_ret);
45932}
45933
45934
45935static int
45936test_xmlXPathConcatFunction(void) {
45937    int test_ret = 0;
45938
45939#if defined(LIBXML_XPATH_ENABLED)
45940    int mem_base;
45941    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45942    int n_ctxt;
45943    int nargs; /* the number of arguments */
45944    int n_nargs;
45945
45946    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45947    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45948        mem_base = xmlMemBlocks();
45949        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45950        nargs = gen_int(n_nargs, 1);
45951
45952        xmlXPathConcatFunction(ctxt, nargs);
45953        call_tests++;
45954        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45955        des_int(n_nargs, nargs, 1);
45956        xmlResetLastError();
45957        if (mem_base != xmlMemBlocks()) {
45958            printf("Leak of %d blocks found in xmlXPathConcatFunction",
45959	           xmlMemBlocks() - mem_base);
45960	    test_ret++;
45961            printf(" %d", n_ctxt);
45962            printf(" %d", n_nargs);
45963            printf("\n");
45964        }
45965    }
45966    }
45967    function_tests++;
45968#endif
45969
45970    return(test_ret);
45971}
45972
45973
45974static int
45975test_xmlXPathContainsFunction(void) {
45976    int test_ret = 0;
45977
45978#if defined(LIBXML_XPATH_ENABLED)
45979    int mem_base;
45980    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45981    int n_ctxt;
45982    int nargs; /* the number of arguments */
45983    int n_nargs;
45984
45985    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45986    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45987        mem_base = xmlMemBlocks();
45988        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45989        nargs = gen_int(n_nargs, 1);
45990
45991        xmlXPathContainsFunction(ctxt, nargs);
45992        call_tests++;
45993        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45994        des_int(n_nargs, nargs, 1);
45995        xmlResetLastError();
45996        if (mem_base != xmlMemBlocks()) {
45997            printf("Leak of %d blocks found in xmlXPathContainsFunction",
45998	           xmlMemBlocks() - mem_base);
45999	    test_ret++;
46000            printf(" %d", n_ctxt);
46001            printf(" %d", n_nargs);
46002            printf("\n");
46003        }
46004    }
46005    }
46006    function_tests++;
46007#endif
46008
46009    return(test_ret);
46010}
46011
46012
46013static int
46014test_xmlXPathCountFunction(void) {
46015    int test_ret = 0;
46016
46017#if defined(LIBXML_XPATH_ENABLED)
46018    int mem_base;
46019    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46020    int n_ctxt;
46021    int nargs; /* the number of arguments */
46022    int n_nargs;
46023
46024    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46025    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46026        mem_base = xmlMemBlocks();
46027        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46028        nargs = gen_int(n_nargs, 1);
46029
46030        xmlXPathCountFunction(ctxt, nargs);
46031        call_tests++;
46032        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46033        des_int(n_nargs, nargs, 1);
46034        xmlResetLastError();
46035        if (mem_base != xmlMemBlocks()) {
46036            printf("Leak of %d blocks found in xmlXPathCountFunction",
46037	           xmlMemBlocks() - mem_base);
46038	    test_ret++;
46039            printf(" %d", n_ctxt);
46040            printf(" %d", n_nargs);
46041            printf("\n");
46042        }
46043    }
46044    }
46045    function_tests++;
46046#endif
46047
46048    return(test_ret);
46049}
46050
46051
46052static int
46053test_xmlXPathDebugDumpCompExpr(void) {
46054    int test_ret = 0;
46055
46056#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46057    int mem_base;
46058    FILE * output; /* the FILE * for the output */
46059    int n_output;
46060    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46061    int n_comp;
46062    int depth; /* the indentation level. */
46063    int n_depth;
46064
46065    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46066    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46067    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46068        mem_base = xmlMemBlocks();
46069        output = gen_FILE_ptr(n_output, 0);
46070        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46071        depth = gen_int(n_depth, 2);
46072
46073        xmlXPathDebugDumpCompExpr(output, comp, depth);
46074        call_tests++;
46075        des_FILE_ptr(n_output, output, 0);
46076        des_xmlXPathCompExprPtr(n_comp, comp, 1);
46077        des_int(n_depth, depth, 2);
46078        xmlResetLastError();
46079        if (mem_base != xmlMemBlocks()) {
46080            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46081	           xmlMemBlocks() - mem_base);
46082	    test_ret++;
46083            printf(" %d", n_output);
46084            printf(" %d", n_comp);
46085            printf(" %d", n_depth);
46086            printf("\n");
46087        }
46088    }
46089    }
46090    }
46091    function_tests++;
46092#endif
46093
46094    return(test_ret);
46095}
46096
46097
46098static int
46099test_xmlXPathDebugDumpObject(void) {
46100    int test_ret = 0;
46101
46102#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46103    int mem_base;
46104    FILE * output; /* the FILE * to dump the output */
46105    int n_output;
46106    xmlXPathObjectPtr cur; /* the object to inspect */
46107    int n_cur;
46108    int depth; /* indentation level */
46109    int n_depth;
46110
46111    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46112    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46113    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46114        mem_base = xmlMemBlocks();
46115        output = gen_FILE_ptr(n_output, 0);
46116        cur = gen_xmlXPathObjectPtr(n_cur, 1);
46117        depth = gen_int(n_depth, 2);
46118
46119        xmlXPathDebugDumpObject(output, cur, depth);
46120        call_tests++;
46121        des_FILE_ptr(n_output, output, 0);
46122        des_xmlXPathObjectPtr(n_cur, cur, 1);
46123        des_int(n_depth, depth, 2);
46124        xmlResetLastError();
46125        if (mem_base != xmlMemBlocks()) {
46126            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46127	           xmlMemBlocks() - mem_base);
46128	    test_ret++;
46129            printf(" %d", n_output);
46130            printf(" %d", n_cur);
46131            printf(" %d", n_depth);
46132            printf("\n");
46133        }
46134    }
46135    }
46136    }
46137    function_tests++;
46138#endif
46139
46140    return(test_ret);
46141}
46142
46143
46144static int
46145test_xmlXPathDifference(void) {
46146    int test_ret = 0;
46147
46148#if defined(LIBXML_XPATH_ENABLED)
46149    int mem_base;
46150    xmlNodeSetPtr ret_val;
46151    xmlNodeSetPtr nodes1; /* a node-set */
46152    int n_nodes1;
46153    xmlNodeSetPtr nodes2; /* a node-set */
46154    int n_nodes2;
46155
46156    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46157    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46158        mem_base = xmlMemBlocks();
46159        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46160        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46161
46162        ret_val = xmlXPathDifference(nodes1, nodes2);
46163        desret_xmlNodeSetPtr(ret_val);
46164        call_tests++;
46165        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46166        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46167        xmlResetLastError();
46168        if (mem_base != xmlMemBlocks()) {
46169            printf("Leak of %d blocks found in xmlXPathDifference",
46170	           xmlMemBlocks() - mem_base);
46171	    test_ret++;
46172            printf(" %d", n_nodes1);
46173            printf(" %d", n_nodes2);
46174            printf("\n");
46175        }
46176    }
46177    }
46178    function_tests++;
46179#endif
46180
46181    return(test_ret);
46182}
46183
46184
46185static int
46186test_xmlXPathDistinct(void) {
46187    int test_ret = 0;
46188
46189#if defined(LIBXML_XPATH_ENABLED)
46190    int mem_base;
46191    xmlNodeSetPtr ret_val;
46192    xmlNodeSetPtr nodes; /* a node-set */
46193    int n_nodes;
46194
46195    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46196        mem_base = xmlMemBlocks();
46197        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46198
46199        ret_val = xmlXPathDistinct(nodes);
46200        desret_xmlNodeSetPtr(ret_val);
46201        call_tests++;
46202        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46203        xmlResetLastError();
46204        if (mem_base != xmlMemBlocks()) {
46205            printf("Leak of %d blocks found in xmlXPathDistinct",
46206	           xmlMemBlocks() - mem_base);
46207	    test_ret++;
46208            printf(" %d", n_nodes);
46209            printf("\n");
46210        }
46211    }
46212    function_tests++;
46213#endif
46214
46215    return(test_ret);
46216}
46217
46218
46219static int
46220test_xmlXPathDistinctSorted(void) {
46221    int test_ret = 0;
46222
46223#if defined(LIBXML_XPATH_ENABLED)
46224    int mem_base;
46225    xmlNodeSetPtr ret_val;
46226    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46227    int n_nodes;
46228
46229    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46230        mem_base = xmlMemBlocks();
46231        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46232
46233        ret_val = xmlXPathDistinctSorted(nodes);
46234        desret_xmlNodeSetPtr(ret_val);
46235        call_tests++;
46236        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46237        xmlResetLastError();
46238        if (mem_base != xmlMemBlocks()) {
46239            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46240	           xmlMemBlocks() - mem_base);
46241	    test_ret++;
46242            printf(" %d", n_nodes);
46243            printf("\n");
46244        }
46245    }
46246    function_tests++;
46247#endif
46248
46249    return(test_ret);
46250}
46251
46252
46253static int
46254test_xmlXPathDivValues(void) {
46255    int test_ret = 0;
46256
46257#if defined(LIBXML_XPATH_ENABLED)
46258    int mem_base;
46259    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46260    int n_ctxt;
46261
46262    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46263        mem_base = xmlMemBlocks();
46264        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46265
46266        xmlXPathDivValues(ctxt);
46267        call_tests++;
46268        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46269        xmlResetLastError();
46270        if (mem_base != xmlMemBlocks()) {
46271            printf("Leak of %d blocks found in xmlXPathDivValues",
46272	           xmlMemBlocks() - mem_base);
46273	    test_ret++;
46274            printf(" %d", n_ctxt);
46275            printf("\n");
46276        }
46277    }
46278    function_tests++;
46279#endif
46280
46281    return(test_ret);
46282}
46283
46284
46285static int
46286test_xmlXPathEqualValues(void) {
46287    int test_ret = 0;
46288
46289#if defined(LIBXML_XPATH_ENABLED)
46290    int mem_base;
46291    int ret_val;
46292    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46293    int n_ctxt;
46294
46295    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46296        mem_base = xmlMemBlocks();
46297        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46298
46299        ret_val = xmlXPathEqualValues(ctxt);
46300        desret_int(ret_val);
46301        call_tests++;
46302        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46303        xmlResetLastError();
46304        if (mem_base != xmlMemBlocks()) {
46305            printf("Leak of %d blocks found in xmlXPathEqualValues",
46306	           xmlMemBlocks() - mem_base);
46307	    test_ret++;
46308            printf(" %d", n_ctxt);
46309            printf("\n");
46310        }
46311    }
46312    function_tests++;
46313#endif
46314
46315    return(test_ret);
46316}
46317
46318
46319static int
46320test_xmlXPathErr(void) {
46321    int test_ret = 0;
46322
46323#if defined(LIBXML_XPATH_ENABLED)
46324    int mem_base;
46325    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
46326    int n_ctxt;
46327    int error; /* the error code */
46328    int n_error;
46329
46330    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46331    for (n_error = 0;n_error < gen_nb_int;n_error++) {
46332        mem_base = xmlMemBlocks();
46333        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46334        error = gen_int(n_error, 1);
46335
46336        xmlXPathErr(ctxt, error);
46337        call_tests++;
46338        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46339        des_int(n_error, error, 1);
46340        xmlResetLastError();
46341        if (mem_base != xmlMemBlocks()) {
46342            printf("Leak of %d blocks found in xmlXPathErr",
46343	           xmlMemBlocks() - mem_base);
46344	    test_ret++;
46345            printf(" %d", n_ctxt);
46346            printf(" %d", n_error);
46347            printf("\n");
46348        }
46349    }
46350    }
46351    function_tests++;
46352#endif
46353
46354    return(test_ret);
46355}
46356
46357
46358static int
46359test_xmlXPathEvalExpr(void) {
46360    int test_ret = 0;
46361
46362#if defined(LIBXML_XPATH_ENABLED)
46363    int mem_base;
46364    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46365    int n_ctxt;
46366
46367    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46368        mem_base = xmlMemBlocks();
46369        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46370
46371        xmlXPathEvalExpr(ctxt);
46372        call_tests++;
46373        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46374        xmlResetLastError();
46375        if (mem_base != xmlMemBlocks()) {
46376            printf("Leak of %d blocks found in xmlXPathEvalExpr",
46377	           xmlMemBlocks() - mem_base);
46378	    test_ret++;
46379            printf(" %d", n_ctxt);
46380            printf("\n");
46381        }
46382    }
46383    function_tests++;
46384#endif
46385
46386    return(test_ret);
46387}
46388
46389
46390static int
46391test_xmlXPathEvaluatePredicateResult(void) {
46392    int test_ret = 0;
46393
46394#if defined(LIBXML_XPATH_ENABLED)
46395    int mem_base;
46396    int ret_val;
46397    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46398    int n_ctxt;
46399    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46400    int n_res;
46401
46402    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46403    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46404        mem_base = xmlMemBlocks();
46405        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46406        res = gen_xmlXPathObjectPtr(n_res, 1);
46407
46408        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
46409        desret_int(ret_val);
46410        call_tests++;
46411        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46412        des_xmlXPathObjectPtr(n_res, res, 1);
46413        xmlResetLastError();
46414        if (mem_base != xmlMemBlocks()) {
46415            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
46416	           xmlMemBlocks() - mem_base);
46417	    test_ret++;
46418            printf(" %d", n_ctxt);
46419            printf(" %d", n_res);
46420            printf("\n");
46421        }
46422    }
46423    }
46424    function_tests++;
46425#endif
46426
46427    return(test_ret);
46428}
46429
46430
46431static int
46432test_xmlXPathFalseFunction(void) {
46433    int test_ret = 0;
46434
46435#if defined(LIBXML_XPATH_ENABLED)
46436    int mem_base;
46437    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46438    int n_ctxt;
46439    int nargs; /* the number of arguments */
46440    int n_nargs;
46441
46442    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46443    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46444        mem_base = xmlMemBlocks();
46445        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46446        nargs = gen_int(n_nargs, 1);
46447
46448        xmlXPathFalseFunction(ctxt, nargs);
46449        call_tests++;
46450        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46451        des_int(n_nargs, nargs, 1);
46452        xmlResetLastError();
46453        if (mem_base != xmlMemBlocks()) {
46454            printf("Leak of %d blocks found in xmlXPathFalseFunction",
46455	           xmlMemBlocks() - mem_base);
46456	    test_ret++;
46457            printf(" %d", n_ctxt);
46458            printf(" %d", n_nargs);
46459            printf("\n");
46460        }
46461    }
46462    }
46463    function_tests++;
46464#endif
46465
46466    return(test_ret);
46467}
46468
46469
46470static int
46471test_xmlXPathFloorFunction(void) {
46472    int test_ret = 0;
46473
46474#if defined(LIBXML_XPATH_ENABLED)
46475    int mem_base;
46476    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46477    int n_ctxt;
46478    int nargs; /* the number of arguments */
46479    int n_nargs;
46480
46481    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46482    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46483        mem_base = xmlMemBlocks();
46484        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46485        nargs = gen_int(n_nargs, 1);
46486
46487        xmlXPathFloorFunction(ctxt, nargs);
46488        call_tests++;
46489        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46490        des_int(n_nargs, nargs, 1);
46491        xmlResetLastError();
46492        if (mem_base != xmlMemBlocks()) {
46493            printf("Leak of %d blocks found in xmlXPathFloorFunction",
46494	           xmlMemBlocks() - mem_base);
46495	    test_ret++;
46496            printf(" %d", n_ctxt);
46497            printf(" %d", n_nargs);
46498            printf("\n");
46499        }
46500    }
46501    }
46502    function_tests++;
46503#endif
46504
46505    return(test_ret);
46506}
46507
46508
46509static int
46510test_xmlXPathFunctionLookup(void) {
46511    int test_ret = 0;
46512
46513
46514    /* missing type support */
46515    return(test_ret);
46516}
46517
46518
46519static int
46520test_xmlXPathFunctionLookupNS(void) {
46521    int test_ret = 0;
46522
46523
46524    /* missing type support */
46525    return(test_ret);
46526}
46527
46528
46529static int
46530test_xmlXPathHasSameNodes(void) {
46531    int test_ret = 0;
46532
46533#if defined(LIBXML_XPATH_ENABLED)
46534    int mem_base;
46535    int ret_val;
46536    xmlNodeSetPtr nodes1; /* a node-set */
46537    int n_nodes1;
46538    xmlNodeSetPtr nodes2; /* a node-set */
46539    int n_nodes2;
46540
46541    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46542    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46543        mem_base = xmlMemBlocks();
46544        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46545        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46546
46547        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
46548        desret_int(ret_val);
46549        call_tests++;
46550        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46551        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46552        xmlResetLastError();
46553        if (mem_base != xmlMemBlocks()) {
46554            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
46555	           xmlMemBlocks() - mem_base);
46556	    test_ret++;
46557            printf(" %d", n_nodes1);
46558            printf(" %d", n_nodes2);
46559            printf("\n");
46560        }
46561    }
46562    }
46563    function_tests++;
46564#endif
46565
46566    return(test_ret);
46567}
46568
46569
46570static int
46571test_xmlXPathIdFunction(void) {
46572    int test_ret = 0;
46573
46574#if defined(LIBXML_XPATH_ENABLED)
46575    int mem_base;
46576    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46577    int n_ctxt;
46578    int nargs; /* the number of arguments */
46579    int n_nargs;
46580
46581    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46582    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46583        mem_base = xmlMemBlocks();
46584        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46585        nargs = gen_int(n_nargs, 1);
46586
46587        xmlXPathIdFunction(ctxt, nargs);
46588        call_tests++;
46589        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46590        des_int(n_nargs, nargs, 1);
46591        xmlResetLastError();
46592        if (mem_base != xmlMemBlocks()) {
46593            printf("Leak of %d blocks found in xmlXPathIdFunction",
46594	           xmlMemBlocks() - mem_base);
46595	    test_ret++;
46596            printf(" %d", n_ctxt);
46597            printf(" %d", n_nargs);
46598            printf("\n");
46599        }
46600    }
46601    }
46602    function_tests++;
46603#endif
46604
46605    return(test_ret);
46606}
46607
46608
46609static int
46610test_xmlXPathIntersection(void) {
46611    int test_ret = 0;
46612
46613#if defined(LIBXML_XPATH_ENABLED)
46614    int mem_base;
46615    xmlNodeSetPtr ret_val;
46616    xmlNodeSetPtr nodes1; /* a node-set */
46617    int n_nodes1;
46618    xmlNodeSetPtr nodes2; /* a node-set */
46619    int n_nodes2;
46620
46621    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46622    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46623        mem_base = xmlMemBlocks();
46624        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46625        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46626
46627        ret_val = xmlXPathIntersection(nodes1, nodes2);
46628        desret_xmlNodeSetPtr(ret_val);
46629        call_tests++;
46630        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46631        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46632        xmlResetLastError();
46633        if (mem_base != xmlMemBlocks()) {
46634            printf("Leak of %d blocks found in xmlXPathIntersection",
46635	           xmlMemBlocks() - mem_base);
46636	    test_ret++;
46637            printf(" %d", n_nodes1);
46638            printf(" %d", n_nodes2);
46639            printf("\n");
46640        }
46641    }
46642    }
46643    function_tests++;
46644#endif
46645
46646    return(test_ret);
46647}
46648
46649
46650static int
46651test_xmlXPathIsNodeType(void) {
46652    int test_ret = 0;
46653
46654#if defined(LIBXML_XPATH_ENABLED)
46655    int mem_base;
46656    int ret_val;
46657    xmlChar * name; /* a name string */
46658    int n_name;
46659
46660    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46661        mem_base = xmlMemBlocks();
46662        name = gen_const_xmlChar_ptr(n_name, 0);
46663
46664        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
46665        desret_int(ret_val);
46666        call_tests++;
46667        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
46668        xmlResetLastError();
46669        if (mem_base != xmlMemBlocks()) {
46670            printf("Leak of %d blocks found in xmlXPathIsNodeType",
46671	           xmlMemBlocks() - mem_base);
46672	    test_ret++;
46673            printf(" %d", n_name);
46674            printf("\n");
46675        }
46676    }
46677    function_tests++;
46678#endif
46679
46680    return(test_ret);
46681}
46682
46683
46684static int
46685test_xmlXPathLangFunction(void) {
46686    int test_ret = 0;
46687
46688#if defined(LIBXML_XPATH_ENABLED)
46689    int mem_base;
46690    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46691    int n_ctxt;
46692    int nargs; /* the number of arguments */
46693    int n_nargs;
46694
46695    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46696    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46697        mem_base = xmlMemBlocks();
46698        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46699        nargs = gen_int(n_nargs, 1);
46700
46701        xmlXPathLangFunction(ctxt, nargs);
46702        call_tests++;
46703        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46704        des_int(n_nargs, nargs, 1);
46705        xmlResetLastError();
46706        if (mem_base != xmlMemBlocks()) {
46707            printf("Leak of %d blocks found in xmlXPathLangFunction",
46708	           xmlMemBlocks() - mem_base);
46709	    test_ret++;
46710            printf(" %d", n_ctxt);
46711            printf(" %d", n_nargs);
46712            printf("\n");
46713        }
46714    }
46715    }
46716    function_tests++;
46717#endif
46718
46719    return(test_ret);
46720}
46721
46722
46723static int
46724test_xmlXPathLastFunction(void) {
46725    int test_ret = 0;
46726
46727#if defined(LIBXML_XPATH_ENABLED)
46728    int mem_base;
46729    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46730    int n_ctxt;
46731    int nargs; /* the number of arguments */
46732    int n_nargs;
46733
46734    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46735    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46736        mem_base = xmlMemBlocks();
46737        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46738        nargs = gen_int(n_nargs, 1);
46739
46740        xmlXPathLastFunction(ctxt, nargs);
46741        call_tests++;
46742        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46743        des_int(n_nargs, nargs, 1);
46744        xmlResetLastError();
46745        if (mem_base != xmlMemBlocks()) {
46746            printf("Leak of %d blocks found in xmlXPathLastFunction",
46747	           xmlMemBlocks() - mem_base);
46748	    test_ret++;
46749            printf(" %d", n_ctxt);
46750            printf(" %d", n_nargs);
46751            printf("\n");
46752        }
46753    }
46754    }
46755    function_tests++;
46756#endif
46757
46758    return(test_ret);
46759}
46760
46761
46762static int
46763test_xmlXPathLeading(void) {
46764    int test_ret = 0;
46765
46766#if defined(LIBXML_XPATH_ENABLED)
46767    int mem_base;
46768    xmlNodeSetPtr ret_val;
46769    xmlNodeSetPtr nodes1; /* a node-set */
46770    int n_nodes1;
46771    xmlNodeSetPtr nodes2; /* a node-set */
46772    int n_nodes2;
46773
46774    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46775    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46776        mem_base = xmlMemBlocks();
46777        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46778        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46779
46780        ret_val = xmlXPathLeading(nodes1, nodes2);
46781        desret_xmlNodeSetPtr(ret_val);
46782        call_tests++;
46783        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46784        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46785        xmlResetLastError();
46786        if (mem_base != xmlMemBlocks()) {
46787            printf("Leak of %d blocks found in xmlXPathLeading",
46788	           xmlMemBlocks() - mem_base);
46789	    test_ret++;
46790            printf(" %d", n_nodes1);
46791            printf(" %d", n_nodes2);
46792            printf("\n");
46793        }
46794    }
46795    }
46796    function_tests++;
46797#endif
46798
46799    return(test_ret);
46800}
46801
46802
46803static int
46804test_xmlXPathLeadingSorted(void) {
46805    int test_ret = 0;
46806
46807#if defined(LIBXML_XPATH_ENABLED)
46808    int mem_base;
46809    xmlNodeSetPtr ret_val;
46810    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
46811    int n_nodes1;
46812    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
46813    int n_nodes2;
46814
46815    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46816    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46817        mem_base = xmlMemBlocks();
46818        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46819        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46820
46821        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
46822        desret_xmlNodeSetPtr(ret_val);
46823        call_tests++;
46824        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46825        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46826        xmlResetLastError();
46827        if (mem_base != xmlMemBlocks()) {
46828            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
46829	           xmlMemBlocks() - mem_base);
46830	    test_ret++;
46831            printf(" %d", n_nodes1);
46832            printf(" %d", n_nodes2);
46833            printf("\n");
46834        }
46835    }
46836    }
46837    function_tests++;
46838#endif
46839
46840    return(test_ret);
46841}
46842
46843
46844static int
46845test_xmlXPathLocalNameFunction(void) {
46846    int test_ret = 0;
46847
46848#if defined(LIBXML_XPATH_ENABLED)
46849    int mem_base;
46850    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46851    int n_ctxt;
46852    int nargs; /* the number of arguments */
46853    int n_nargs;
46854
46855    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46856    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46857        mem_base = xmlMemBlocks();
46858        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46859        nargs = gen_int(n_nargs, 1);
46860
46861        xmlXPathLocalNameFunction(ctxt, nargs);
46862        call_tests++;
46863        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46864        des_int(n_nargs, nargs, 1);
46865        xmlResetLastError();
46866        if (mem_base != xmlMemBlocks()) {
46867            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
46868	           xmlMemBlocks() - mem_base);
46869	    test_ret++;
46870            printf(" %d", n_ctxt);
46871            printf(" %d", n_nargs);
46872            printf("\n");
46873        }
46874    }
46875    }
46876    function_tests++;
46877#endif
46878
46879    return(test_ret);
46880}
46881
46882
46883static int
46884test_xmlXPathModValues(void) {
46885    int test_ret = 0;
46886
46887#if defined(LIBXML_XPATH_ENABLED)
46888    int mem_base;
46889    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46890    int n_ctxt;
46891
46892    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46893        mem_base = xmlMemBlocks();
46894        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46895
46896        xmlXPathModValues(ctxt);
46897        call_tests++;
46898        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46899        xmlResetLastError();
46900        if (mem_base != xmlMemBlocks()) {
46901            printf("Leak of %d blocks found in xmlXPathModValues",
46902	           xmlMemBlocks() - mem_base);
46903	    test_ret++;
46904            printf(" %d", n_ctxt);
46905            printf("\n");
46906        }
46907    }
46908    function_tests++;
46909#endif
46910
46911    return(test_ret);
46912}
46913
46914
46915static int
46916test_xmlXPathMultValues(void) {
46917    int test_ret = 0;
46918
46919#if defined(LIBXML_XPATH_ENABLED)
46920    int mem_base;
46921    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46922    int n_ctxt;
46923
46924    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46925        mem_base = xmlMemBlocks();
46926        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46927
46928        xmlXPathMultValues(ctxt);
46929        call_tests++;
46930        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46931        xmlResetLastError();
46932        if (mem_base != xmlMemBlocks()) {
46933            printf("Leak of %d blocks found in xmlXPathMultValues",
46934	           xmlMemBlocks() - mem_base);
46935	    test_ret++;
46936            printf(" %d", n_ctxt);
46937            printf("\n");
46938        }
46939    }
46940    function_tests++;
46941#endif
46942
46943    return(test_ret);
46944}
46945
46946
46947static int
46948test_xmlXPathNamespaceURIFunction(void) {
46949    int test_ret = 0;
46950
46951#if defined(LIBXML_XPATH_ENABLED)
46952    int mem_base;
46953    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46954    int n_ctxt;
46955    int nargs; /* the number of arguments */
46956    int n_nargs;
46957
46958    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46959    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46960        mem_base = xmlMemBlocks();
46961        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46962        nargs = gen_int(n_nargs, 1);
46963
46964        xmlXPathNamespaceURIFunction(ctxt, nargs);
46965        call_tests++;
46966        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46967        des_int(n_nargs, nargs, 1);
46968        xmlResetLastError();
46969        if (mem_base != xmlMemBlocks()) {
46970            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
46971	           xmlMemBlocks() - mem_base);
46972	    test_ret++;
46973            printf(" %d", n_ctxt);
46974            printf(" %d", n_nargs);
46975            printf("\n");
46976        }
46977    }
46978    }
46979    function_tests++;
46980#endif
46981
46982    return(test_ret);
46983}
46984
46985
46986static int
46987test_xmlXPathNewBoolean(void) {
46988    int test_ret = 0;
46989
46990#if defined(LIBXML_XPATH_ENABLED)
46991    int mem_base;
46992    xmlXPathObjectPtr ret_val;
46993    int val; /* the boolean value */
46994    int n_val;
46995
46996    for (n_val = 0;n_val < gen_nb_int;n_val++) {
46997        mem_base = xmlMemBlocks();
46998        val = gen_int(n_val, 0);
46999
47000        ret_val = xmlXPathNewBoolean(val);
47001        desret_xmlXPathObjectPtr(ret_val);
47002        call_tests++;
47003        des_int(n_val, val, 0);
47004        xmlResetLastError();
47005        if (mem_base != xmlMemBlocks()) {
47006            printf("Leak of %d blocks found in xmlXPathNewBoolean",
47007	           xmlMemBlocks() - mem_base);
47008	    test_ret++;
47009            printf(" %d", n_val);
47010            printf("\n");
47011        }
47012    }
47013    function_tests++;
47014#endif
47015
47016    return(test_ret);
47017}
47018
47019
47020static int
47021test_xmlXPathNewCString(void) {
47022    int test_ret = 0;
47023
47024#if defined(LIBXML_XPATH_ENABLED)
47025    int mem_base;
47026    xmlXPathObjectPtr ret_val;
47027    char * val; /* the char * value */
47028    int n_val;
47029
47030    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47031        mem_base = xmlMemBlocks();
47032        val = gen_const_char_ptr(n_val, 0);
47033
47034        ret_val = xmlXPathNewCString((const char *)val);
47035        desret_xmlXPathObjectPtr(ret_val);
47036        call_tests++;
47037        des_const_char_ptr(n_val, (const char *)val, 0);
47038        xmlResetLastError();
47039        if (mem_base != xmlMemBlocks()) {
47040            printf("Leak of %d blocks found in xmlXPathNewCString",
47041	           xmlMemBlocks() - mem_base);
47042	    test_ret++;
47043            printf(" %d", n_val);
47044            printf("\n");
47045        }
47046    }
47047    function_tests++;
47048#endif
47049
47050    return(test_ret);
47051}
47052
47053
47054static int
47055test_xmlXPathNewFloat(void) {
47056    int test_ret = 0;
47057
47058#if defined(LIBXML_XPATH_ENABLED)
47059    int mem_base;
47060    xmlXPathObjectPtr ret_val;
47061    double val; /* the double value */
47062    int n_val;
47063
47064    for (n_val = 0;n_val < gen_nb_double;n_val++) {
47065        mem_base = xmlMemBlocks();
47066        val = gen_double(n_val, 0);
47067
47068        ret_val = xmlXPathNewFloat(val);
47069        desret_xmlXPathObjectPtr(ret_val);
47070        call_tests++;
47071        des_double(n_val, val, 0);
47072        xmlResetLastError();
47073        if (mem_base != xmlMemBlocks()) {
47074            printf("Leak of %d blocks found in xmlXPathNewFloat",
47075	           xmlMemBlocks() - mem_base);
47076	    test_ret++;
47077            printf(" %d", n_val);
47078            printf("\n");
47079        }
47080    }
47081    function_tests++;
47082#endif
47083
47084    return(test_ret);
47085}
47086
47087
47088static int
47089test_xmlXPathNewNodeSet(void) {
47090    int test_ret = 0;
47091
47092#if defined(LIBXML_XPATH_ENABLED)
47093    int mem_base;
47094    xmlXPathObjectPtr ret_val;
47095    xmlNodePtr val; /* the NodePtr value */
47096    int n_val;
47097
47098    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47099        mem_base = xmlMemBlocks();
47100        val = gen_xmlNodePtr(n_val, 0);
47101
47102        ret_val = xmlXPathNewNodeSet(val);
47103        desret_xmlXPathObjectPtr(ret_val);
47104        call_tests++;
47105        des_xmlNodePtr(n_val, val, 0);
47106        xmlResetLastError();
47107        if (mem_base != xmlMemBlocks()) {
47108            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47109	           xmlMemBlocks() - mem_base);
47110	    test_ret++;
47111            printf(" %d", n_val);
47112            printf("\n");
47113        }
47114    }
47115    function_tests++;
47116#endif
47117
47118    return(test_ret);
47119}
47120
47121
47122static int
47123test_xmlXPathNewNodeSetList(void) {
47124    int test_ret = 0;
47125
47126#if defined(LIBXML_XPATH_ENABLED)
47127    int mem_base;
47128    xmlXPathObjectPtr ret_val;
47129    xmlNodeSetPtr val; /* an existing NodeSet */
47130    int n_val;
47131
47132    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47133        mem_base = xmlMemBlocks();
47134        val = gen_xmlNodeSetPtr(n_val, 0);
47135
47136        ret_val = xmlXPathNewNodeSetList(val);
47137        desret_xmlXPathObjectPtr(ret_val);
47138        call_tests++;
47139        des_xmlNodeSetPtr(n_val, val, 0);
47140        xmlResetLastError();
47141        if (mem_base != xmlMemBlocks()) {
47142            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47143	           xmlMemBlocks() - mem_base);
47144	    test_ret++;
47145            printf(" %d", n_val);
47146            printf("\n");
47147        }
47148    }
47149    function_tests++;
47150#endif
47151
47152    return(test_ret);
47153}
47154
47155
47156static int
47157test_xmlXPathNewParserContext(void) {
47158    int test_ret = 0;
47159
47160
47161    /* missing type support */
47162    return(test_ret);
47163}
47164
47165
47166static int
47167test_xmlXPathNewString(void) {
47168    int test_ret = 0;
47169
47170#if defined(LIBXML_XPATH_ENABLED)
47171    int mem_base;
47172    xmlXPathObjectPtr ret_val;
47173    xmlChar * val; /* the xmlChar * value */
47174    int n_val;
47175
47176    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47177        mem_base = xmlMemBlocks();
47178        val = gen_const_xmlChar_ptr(n_val, 0);
47179
47180        ret_val = xmlXPathNewString((const xmlChar *)val);
47181        desret_xmlXPathObjectPtr(ret_val);
47182        call_tests++;
47183        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47184        xmlResetLastError();
47185        if (mem_base != xmlMemBlocks()) {
47186            printf("Leak of %d blocks found in xmlXPathNewString",
47187	           xmlMemBlocks() - mem_base);
47188	    test_ret++;
47189            printf(" %d", n_val);
47190            printf("\n");
47191        }
47192    }
47193    function_tests++;
47194#endif
47195
47196    return(test_ret);
47197}
47198
47199
47200static int
47201test_xmlXPathNextAncestor(void) {
47202    int test_ret = 0;
47203
47204#if defined(LIBXML_XPATH_ENABLED)
47205    int mem_base;
47206    xmlNodePtr ret_val;
47207    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47208    int n_ctxt;
47209    xmlNodePtr cur; /* the current node in the traversal */
47210    int n_cur;
47211
47212    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47213    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47214        mem_base = xmlMemBlocks();
47215        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47216        cur = gen_xmlNodePtr(n_cur, 1);
47217
47218        ret_val = xmlXPathNextAncestor(ctxt, cur);
47219        desret_xmlNodePtr(ret_val);
47220        call_tests++;
47221        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47222        des_xmlNodePtr(n_cur, cur, 1);
47223        xmlResetLastError();
47224        if (mem_base != xmlMemBlocks()) {
47225            printf("Leak of %d blocks found in xmlXPathNextAncestor",
47226	           xmlMemBlocks() - mem_base);
47227	    test_ret++;
47228            printf(" %d", n_ctxt);
47229            printf(" %d", n_cur);
47230            printf("\n");
47231        }
47232    }
47233    }
47234    function_tests++;
47235#endif
47236
47237    return(test_ret);
47238}
47239
47240
47241static int
47242test_xmlXPathNextAncestorOrSelf(void) {
47243    int test_ret = 0;
47244
47245#if defined(LIBXML_XPATH_ENABLED)
47246    int mem_base;
47247    xmlNodePtr ret_val;
47248    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47249    int n_ctxt;
47250    xmlNodePtr cur; /* the current node in the traversal */
47251    int n_cur;
47252
47253    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47254    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47255        mem_base = xmlMemBlocks();
47256        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47257        cur = gen_xmlNodePtr(n_cur, 1);
47258
47259        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47260        desret_xmlNodePtr(ret_val);
47261        call_tests++;
47262        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47263        des_xmlNodePtr(n_cur, cur, 1);
47264        xmlResetLastError();
47265        if (mem_base != xmlMemBlocks()) {
47266            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47267	           xmlMemBlocks() - mem_base);
47268	    test_ret++;
47269            printf(" %d", n_ctxt);
47270            printf(" %d", n_cur);
47271            printf("\n");
47272        }
47273    }
47274    }
47275    function_tests++;
47276#endif
47277
47278    return(test_ret);
47279}
47280
47281
47282static int
47283test_xmlXPathNextAttribute(void) {
47284    int test_ret = 0;
47285
47286#if defined(LIBXML_XPATH_ENABLED)
47287    int mem_base;
47288    xmlNodePtr ret_val;
47289    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47290    int n_ctxt;
47291    xmlNodePtr cur; /* the current attribute in the traversal */
47292    int n_cur;
47293
47294    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47295    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47296        mem_base = xmlMemBlocks();
47297        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47298        cur = gen_xmlNodePtr(n_cur, 1);
47299
47300        ret_val = xmlXPathNextAttribute(ctxt, cur);
47301        desret_xmlNodePtr(ret_val);
47302        call_tests++;
47303        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47304        des_xmlNodePtr(n_cur, cur, 1);
47305        xmlResetLastError();
47306        if (mem_base != xmlMemBlocks()) {
47307            printf("Leak of %d blocks found in xmlXPathNextAttribute",
47308	           xmlMemBlocks() - mem_base);
47309	    test_ret++;
47310            printf(" %d", n_ctxt);
47311            printf(" %d", n_cur);
47312            printf("\n");
47313        }
47314    }
47315    }
47316    function_tests++;
47317#endif
47318
47319    return(test_ret);
47320}
47321
47322
47323static int
47324test_xmlXPathNextChild(void) {
47325    int test_ret = 0;
47326
47327#if defined(LIBXML_XPATH_ENABLED)
47328    int mem_base;
47329    xmlNodePtr ret_val;
47330    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47331    int n_ctxt;
47332    xmlNodePtr cur; /* the current node in the traversal */
47333    int n_cur;
47334
47335    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47336    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47337        mem_base = xmlMemBlocks();
47338        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47339        cur = gen_xmlNodePtr(n_cur, 1);
47340
47341        ret_val = xmlXPathNextChild(ctxt, cur);
47342        desret_xmlNodePtr(ret_val);
47343        call_tests++;
47344        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47345        des_xmlNodePtr(n_cur, cur, 1);
47346        xmlResetLastError();
47347        if (mem_base != xmlMemBlocks()) {
47348            printf("Leak of %d blocks found in xmlXPathNextChild",
47349	           xmlMemBlocks() - mem_base);
47350	    test_ret++;
47351            printf(" %d", n_ctxt);
47352            printf(" %d", n_cur);
47353            printf("\n");
47354        }
47355    }
47356    }
47357    function_tests++;
47358#endif
47359
47360    return(test_ret);
47361}
47362
47363
47364static int
47365test_xmlXPathNextDescendant(void) {
47366    int test_ret = 0;
47367
47368#if defined(LIBXML_XPATH_ENABLED)
47369    int mem_base;
47370    xmlNodePtr ret_val;
47371    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47372    int n_ctxt;
47373    xmlNodePtr cur; /* the current node in the traversal */
47374    int n_cur;
47375
47376    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47377    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47378        mem_base = xmlMemBlocks();
47379        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47380        cur = gen_xmlNodePtr(n_cur, 1);
47381
47382        ret_val = xmlXPathNextDescendant(ctxt, cur);
47383        desret_xmlNodePtr(ret_val);
47384        call_tests++;
47385        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47386        des_xmlNodePtr(n_cur, cur, 1);
47387        xmlResetLastError();
47388        if (mem_base != xmlMemBlocks()) {
47389            printf("Leak of %d blocks found in xmlXPathNextDescendant",
47390	           xmlMemBlocks() - mem_base);
47391	    test_ret++;
47392            printf(" %d", n_ctxt);
47393            printf(" %d", n_cur);
47394            printf("\n");
47395        }
47396    }
47397    }
47398    function_tests++;
47399#endif
47400
47401    return(test_ret);
47402}
47403
47404
47405static int
47406test_xmlXPathNextDescendantOrSelf(void) {
47407    int test_ret = 0;
47408
47409#if defined(LIBXML_XPATH_ENABLED)
47410    int mem_base;
47411    xmlNodePtr ret_val;
47412    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47413    int n_ctxt;
47414    xmlNodePtr cur; /* the current node in the traversal */
47415    int n_cur;
47416
47417    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47418    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47419        mem_base = xmlMemBlocks();
47420        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47421        cur = gen_xmlNodePtr(n_cur, 1);
47422
47423        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
47424        desret_xmlNodePtr(ret_val);
47425        call_tests++;
47426        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47427        des_xmlNodePtr(n_cur, cur, 1);
47428        xmlResetLastError();
47429        if (mem_base != xmlMemBlocks()) {
47430            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
47431	           xmlMemBlocks() - mem_base);
47432	    test_ret++;
47433            printf(" %d", n_ctxt);
47434            printf(" %d", n_cur);
47435            printf("\n");
47436        }
47437    }
47438    }
47439    function_tests++;
47440#endif
47441
47442    return(test_ret);
47443}
47444
47445
47446static int
47447test_xmlXPathNextFollowing(void) {
47448    int test_ret = 0;
47449
47450#if defined(LIBXML_XPATH_ENABLED)
47451    int mem_base;
47452    xmlNodePtr ret_val;
47453    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47454    int n_ctxt;
47455    xmlNodePtr cur; /* the current node in the traversal */
47456    int n_cur;
47457
47458    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47459    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47460        mem_base = xmlMemBlocks();
47461        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47462        cur = gen_xmlNodePtr(n_cur, 1);
47463
47464        ret_val = xmlXPathNextFollowing(ctxt, cur);
47465        desret_xmlNodePtr(ret_val);
47466        call_tests++;
47467        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47468        des_xmlNodePtr(n_cur, cur, 1);
47469        xmlResetLastError();
47470        if (mem_base != xmlMemBlocks()) {
47471            printf("Leak of %d blocks found in xmlXPathNextFollowing",
47472	           xmlMemBlocks() - mem_base);
47473	    test_ret++;
47474            printf(" %d", n_ctxt);
47475            printf(" %d", n_cur);
47476            printf("\n");
47477        }
47478    }
47479    }
47480    function_tests++;
47481#endif
47482
47483    return(test_ret);
47484}
47485
47486
47487static int
47488test_xmlXPathNextFollowingSibling(void) {
47489    int test_ret = 0;
47490
47491#if defined(LIBXML_XPATH_ENABLED)
47492    int mem_base;
47493    xmlNodePtr ret_val;
47494    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47495    int n_ctxt;
47496    xmlNodePtr cur; /* the current node in the traversal */
47497    int n_cur;
47498
47499    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47500    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47501        mem_base = xmlMemBlocks();
47502        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47503        cur = gen_xmlNodePtr(n_cur, 1);
47504
47505        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
47506        desret_xmlNodePtr(ret_val);
47507        call_tests++;
47508        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47509        des_xmlNodePtr(n_cur, cur, 1);
47510        xmlResetLastError();
47511        if (mem_base != xmlMemBlocks()) {
47512            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
47513	           xmlMemBlocks() - mem_base);
47514	    test_ret++;
47515            printf(" %d", n_ctxt);
47516            printf(" %d", n_cur);
47517            printf("\n");
47518        }
47519    }
47520    }
47521    function_tests++;
47522#endif
47523
47524    return(test_ret);
47525}
47526
47527
47528static int
47529test_xmlXPathNextNamespace(void) {
47530    int test_ret = 0;
47531
47532#if defined(LIBXML_XPATH_ENABLED)
47533    int mem_base;
47534    xmlNodePtr ret_val;
47535    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47536    int n_ctxt;
47537    xmlNodePtr cur; /* the current attribute in the traversal */
47538    int n_cur;
47539
47540    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47541    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47542        mem_base = xmlMemBlocks();
47543        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47544        cur = gen_xmlNodePtr(n_cur, 1);
47545
47546        ret_val = xmlXPathNextNamespace(ctxt, cur);
47547        desret_xmlNodePtr(ret_val);
47548        call_tests++;
47549        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47550        des_xmlNodePtr(n_cur, cur, 1);
47551        xmlResetLastError();
47552        if (mem_base != xmlMemBlocks()) {
47553            printf("Leak of %d blocks found in xmlXPathNextNamespace",
47554	           xmlMemBlocks() - mem_base);
47555	    test_ret++;
47556            printf(" %d", n_ctxt);
47557            printf(" %d", n_cur);
47558            printf("\n");
47559        }
47560    }
47561    }
47562    function_tests++;
47563#endif
47564
47565    return(test_ret);
47566}
47567
47568
47569static int
47570test_xmlXPathNextParent(void) {
47571    int test_ret = 0;
47572
47573#if defined(LIBXML_XPATH_ENABLED)
47574    int mem_base;
47575    xmlNodePtr ret_val;
47576    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47577    int n_ctxt;
47578    xmlNodePtr cur; /* the current node in the traversal */
47579    int n_cur;
47580
47581    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47582    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47583        mem_base = xmlMemBlocks();
47584        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47585        cur = gen_xmlNodePtr(n_cur, 1);
47586
47587        ret_val = xmlXPathNextParent(ctxt, cur);
47588        desret_xmlNodePtr(ret_val);
47589        call_tests++;
47590        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47591        des_xmlNodePtr(n_cur, cur, 1);
47592        xmlResetLastError();
47593        if (mem_base != xmlMemBlocks()) {
47594            printf("Leak of %d blocks found in xmlXPathNextParent",
47595	           xmlMemBlocks() - mem_base);
47596	    test_ret++;
47597            printf(" %d", n_ctxt);
47598            printf(" %d", n_cur);
47599            printf("\n");
47600        }
47601    }
47602    }
47603    function_tests++;
47604#endif
47605
47606    return(test_ret);
47607}
47608
47609
47610static int
47611test_xmlXPathNextPreceding(void) {
47612    int test_ret = 0;
47613
47614#if defined(LIBXML_XPATH_ENABLED)
47615    int mem_base;
47616    xmlNodePtr ret_val;
47617    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47618    int n_ctxt;
47619    xmlNodePtr cur; /* the current node in the traversal */
47620    int n_cur;
47621
47622    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47623    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47624        mem_base = xmlMemBlocks();
47625        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47626        cur = gen_xmlNodePtr(n_cur, 1);
47627
47628        ret_val = xmlXPathNextPreceding(ctxt, cur);
47629        desret_xmlNodePtr(ret_val);
47630        call_tests++;
47631        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47632        des_xmlNodePtr(n_cur, cur, 1);
47633        xmlResetLastError();
47634        if (mem_base != xmlMemBlocks()) {
47635            printf("Leak of %d blocks found in xmlXPathNextPreceding",
47636	           xmlMemBlocks() - mem_base);
47637	    test_ret++;
47638            printf(" %d", n_ctxt);
47639            printf(" %d", n_cur);
47640            printf("\n");
47641        }
47642    }
47643    }
47644    function_tests++;
47645#endif
47646
47647    return(test_ret);
47648}
47649
47650
47651static int
47652test_xmlXPathNextPrecedingSibling(void) {
47653    int test_ret = 0;
47654
47655#if defined(LIBXML_XPATH_ENABLED)
47656    int mem_base;
47657    xmlNodePtr ret_val;
47658    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47659    int n_ctxt;
47660    xmlNodePtr cur; /* the current node in the traversal */
47661    int n_cur;
47662
47663    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47664    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47665        mem_base = xmlMemBlocks();
47666        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47667        cur = gen_xmlNodePtr(n_cur, 1);
47668
47669        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
47670        desret_xmlNodePtr(ret_val);
47671        call_tests++;
47672        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47673        des_xmlNodePtr(n_cur, cur, 1);
47674        xmlResetLastError();
47675        if (mem_base != xmlMemBlocks()) {
47676            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
47677	           xmlMemBlocks() - mem_base);
47678	    test_ret++;
47679            printf(" %d", n_ctxt);
47680            printf(" %d", n_cur);
47681            printf("\n");
47682        }
47683    }
47684    }
47685    function_tests++;
47686#endif
47687
47688    return(test_ret);
47689}
47690
47691
47692static int
47693test_xmlXPathNextSelf(void) {
47694    int test_ret = 0;
47695
47696#if defined(LIBXML_XPATH_ENABLED)
47697    int mem_base;
47698    xmlNodePtr ret_val;
47699    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47700    int n_ctxt;
47701    xmlNodePtr cur; /* the current node in the traversal */
47702    int n_cur;
47703
47704    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47705    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47706        mem_base = xmlMemBlocks();
47707        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47708        cur = gen_xmlNodePtr(n_cur, 1);
47709
47710        ret_val = xmlXPathNextSelf(ctxt, cur);
47711        desret_xmlNodePtr(ret_val);
47712        call_tests++;
47713        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47714        des_xmlNodePtr(n_cur, cur, 1);
47715        xmlResetLastError();
47716        if (mem_base != xmlMemBlocks()) {
47717            printf("Leak of %d blocks found in xmlXPathNextSelf",
47718	           xmlMemBlocks() - mem_base);
47719	    test_ret++;
47720            printf(" %d", n_ctxt);
47721            printf(" %d", n_cur);
47722            printf("\n");
47723        }
47724    }
47725    }
47726    function_tests++;
47727#endif
47728
47729    return(test_ret);
47730}
47731
47732
47733static int
47734test_xmlXPathNodeLeading(void) {
47735    int test_ret = 0;
47736
47737#if defined(LIBXML_XPATH_ENABLED)
47738    int mem_base;
47739    xmlNodeSetPtr ret_val;
47740    xmlNodeSetPtr nodes; /* a node-set */
47741    int n_nodes;
47742    xmlNodePtr node; /* a node */
47743    int n_node;
47744
47745    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47746    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47747        mem_base = xmlMemBlocks();
47748        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47749        node = gen_xmlNodePtr(n_node, 1);
47750
47751        ret_val = xmlXPathNodeLeading(nodes, node);
47752        desret_xmlNodeSetPtr(ret_val);
47753        call_tests++;
47754        des_xmlNodeSetPtr(n_nodes, nodes, 0);
47755        des_xmlNodePtr(n_node, node, 1);
47756        xmlResetLastError();
47757        if (mem_base != xmlMemBlocks()) {
47758            printf("Leak of %d blocks found in xmlXPathNodeLeading",
47759	           xmlMemBlocks() - mem_base);
47760	    test_ret++;
47761            printf(" %d", n_nodes);
47762            printf(" %d", n_node);
47763            printf("\n");
47764        }
47765    }
47766    }
47767    function_tests++;
47768#endif
47769
47770    return(test_ret);
47771}
47772
47773
47774static int
47775test_xmlXPathNodeLeadingSorted(void) {
47776    int test_ret = 0;
47777
47778#if defined(LIBXML_XPATH_ENABLED)
47779    int mem_base;
47780    xmlNodeSetPtr ret_val;
47781    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47782    int n_nodes;
47783    xmlNodePtr node; /* a node */
47784    int n_node;
47785
47786    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47787    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47788        mem_base = xmlMemBlocks();
47789        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47790        node = gen_xmlNodePtr(n_node, 1);
47791
47792        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
47793        desret_xmlNodeSetPtr(ret_val);
47794        call_tests++;
47795        des_xmlNodeSetPtr(n_nodes, nodes, 0);
47796        des_xmlNodePtr(n_node, node, 1);
47797        xmlResetLastError();
47798        if (mem_base != xmlMemBlocks()) {
47799            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
47800	           xmlMemBlocks() - mem_base);
47801	    test_ret++;
47802            printf(" %d", n_nodes);
47803            printf(" %d", n_node);
47804            printf("\n");
47805        }
47806    }
47807    }
47808    function_tests++;
47809#endif
47810
47811    return(test_ret);
47812}
47813
47814
47815static int
47816test_xmlXPathNodeSetAdd(void) {
47817    int test_ret = 0;
47818
47819#if defined(LIBXML_XPATH_ENABLED)
47820    int mem_base;
47821    xmlNodeSetPtr cur; /* the initial node set */
47822    int n_cur;
47823    xmlNodePtr val; /* a new xmlNodePtr */
47824    int n_val;
47825
47826    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47827    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47828        mem_base = xmlMemBlocks();
47829        cur = gen_xmlNodeSetPtr(n_cur, 0);
47830        val = gen_xmlNodePtr(n_val, 1);
47831
47832        xmlXPathNodeSetAdd(cur, val);
47833        call_tests++;
47834        des_xmlNodeSetPtr(n_cur, cur, 0);
47835        des_xmlNodePtr(n_val, val, 1);
47836        xmlResetLastError();
47837        if (mem_base != xmlMemBlocks()) {
47838            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
47839	           xmlMemBlocks() - mem_base);
47840	    test_ret++;
47841            printf(" %d", n_cur);
47842            printf(" %d", n_val);
47843            printf("\n");
47844        }
47845    }
47846    }
47847    function_tests++;
47848#endif
47849
47850    return(test_ret);
47851}
47852
47853
47854static int
47855test_xmlXPathNodeSetAddNs(void) {
47856    int test_ret = 0;
47857
47858#if defined(LIBXML_XPATH_ENABLED)
47859    int mem_base;
47860    xmlNodeSetPtr cur; /* the initial node set */
47861    int n_cur;
47862    xmlNodePtr node; /* the hosting node */
47863    int n_node;
47864    xmlNsPtr ns; /* a the namespace node */
47865    int n_ns;
47866
47867    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47868    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47869    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
47870        mem_base = xmlMemBlocks();
47871        cur = gen_xmlNodeSetPtr(n_cur, 0);
47872        node = gen_xmlNodePtr(n_node, 1);
47873        ns = gen_xmlNsPtr(n_ns, 2);
47874
47875        xmlXPathNodeSetAddNs(cur, node, ns);
47876        call_tests++;
47877        des_xmlNodeSetPtr(n_cur, cur, 0);
47878        des_xmlNodePtr(n_node, node, 1);
47879        des_xmlNsPtr(n_ns, ns, 2);
47880        xmlResetLastError();
47881        if (mem_base != xmlMemBlocks()) {
47882            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
47883	           xmlMemBlocks() - mem_base);
47884	    test_ret++;
47885            printf(" %d", n_cur);
47886            printf(" %d", n_node);
47887            printf(" %d", n_ns);
47888            printf("\n");
47889        }
47890    }
47891    }
47892    }
47893    function_tests++;
47894#endif
47895
47896    return(test_ret);
47897}
47898
47899
47900static int
47901test_xmlXPathNodeSetAddUnique(void) {
47902    int test_ret = 0;
47903
47904#if defined(LIBXML_XPATH_ENABLED)
47905    int mem_base;
47906    xmlNodeSetPtr cur; /* the initial node set */
47907    int n_cur;
47908    xmlNodePtr val; /* a new xmlNodePtr */
47909    int n_val;
47910
47911    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47912    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47913        mem_base = xmlMemBlocks();
47914        cur = gen_xmlNodeSetPtr(n_cur, 0);
47915        val = gen_xmlNodePtr(n_val, 1);
47916
47917        xmlXPathNodeSetAddUnique(cur, val);
47918        call_tests++;
47919        des_xmlNodeSetPtr(n_cur, cur, 0);
47920        des_xmlNodePtr(n_val, val, 1);
47921        xmlResetLastError();
47922        if (mem_base != xmlMemBlocks()) {
47923            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
47924	           xmlMemBlocks() - mem_base);
47925	    test_ret++;
47926            printf(" %d", n_cur);
47927            printf(" %d", n_val);
47928            printf("\n");
47929        }
47930    }
47931    }
47932    function_tests++;
47933#endif
47934
47935    return(test_ret);
47936}
47937
47938
47939static int
47940test_xmlXPathNodeSetContains(void) {
47941    int test_ret = 0;
47942
47943#if defined(LIBXML_XPATH_ENABLED)
47944    int mem_base;
47945    int ret_val;
47946    xmlNodeSetPtr cur; /* the node-set */
47947    int n_cur;
47948    xmlNodePtr val; /* the node */
47949    int n_val;
47950
47951    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47952    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47953        mem_base = xmlMemBlocks();
47954        cur = gen_xmlNodeSetPtr(n_cur, 0);
47955        val = gen_xmlNodePtr(n_val, 1);
47956
47957        ret_val = xmlXPathNodeSetContains(cur, val);
47958        desret_int(ret_val);
47959        call_tests++;
47960        des_xmlNodeSetPtr(n_cur, cur, 0);
47961        des_xmlNodePtr(n_val, val, 1);
47962        xmlResetLastError();
47963        if (mem_base != xmlMemBlocks()) {
47964            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
47965	           xmlMemBlocks() - mem_base);
47966	    test_ret++;
47967            printf(" %d", n_cur);
47968            printf(" %d", n_val);
47969            printf("\n");
47970        }
47971    }
47972    }
47973    function_tests++;
47974#endif
47975
47976    return(test_ret);
47977}
47978
47979
47980static int
47981test_xmlXPathNodeSetDel(void) {
47982    int test_ret = 0;
47983
47984#if defined(LIBXML_XPATH_ENABLED)
47985    int mem_base;
47986    xmlNodeSetPtr cur; /* the initial node set */
47987    int n_cur;
47988    xmlNodePtr val; /* an xmlNodePtr */
47989    int n_val;
47990
47991    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
47992    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47993        mem_base = xmlMemBlocks();
47994        cur = gen_xmlNodeSetPtr(n_cur, 0);
47995        val = gen_xmlNodePtr(n_val, 1);
47996
47997        xmlXPathNodeSetDel(cur, val);
47998        call_tests++;
47999        des_xmlNodeSetPtr(n_cur, cur, 0);
48000        des_xmlNodePtr(n_val, val, 1);
48001        xmlResetLastError();
48002        if (mem_base != xmlMemBlocks()) {
48003            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48004	           xmlMemBlocks() - mem_base);
48005	    test_ret++;
48006            printf(" %d", n_cur);
48007            printf(" %d", n_val);
48008            printf("\n");
48009        }
48010    }
48011    }
48012    function_tests++;
48013#endif
48014
48015    return(test_ret);
48016}
48017
48018
48019static int
48020test_xmlXPathNodeSetMerge(void) {
48021    int test_ret = 0;
48022
48023#if defined(LIBXML_XPATH_ENABLED)
48024    int mem_base;
48025    xmlNodeSetPtr ret_val;
48026    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48027    int n_val1;
48028    xmlNodeSetPtr val2; /* the second NodeSet */
48029    int n_val2;
48030
48031    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48032    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48033        mem_base = xmlMemBlocks();
48034        val1 = gen_xmlNodeSetPtr(n_val1, 0);
48035        val2 = gen_xmlNodeSetPtr(n_val2, 1);
48036
48037        ret_val = xmlXPathNodeSetMerge(val1, val2);
48038        desret_xmlNodeSetPtr(ret_val);
48039        call_tests++;
48040        des_xmlNodeSetPtr(n_val1, val1, 0);
48041        des_xmlNodeSetPtr(n_val2, val2, 1);
48042        xmlResetLastError();
48043        if (mem_base != xmlMemBlocks()) {
48044            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48045	           xmlMemBlocks() - mem_base);
48046	    test_ret++;
48047            printf(" %d", n_val1);
48048            printf(" %d", n_val2);
48049            printf("\n");
48050        }
48051    }
48052    }
48053    function_tests++;
48054#endif
48055
48056    return(test_ret);
48057}
48058
48059
48060static int
48061test_xmlXPathNodeSetRemove(void) {
48062    int test_ret = 0;
48063
48064#if defined(LIBXML_XPATH_ENABLED)
48065    int mem_base;
48066    xmlNodeSetPtr cur; /* the initial node set */
48067    int n_cur;
48068    int val; /* the index to remove */
48069    int n_val;
48070
48071    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48072    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48073        mem_base = xmlMemBlocks();
48074        cur = gen_xmlNodeSetPtr(n_cur, 0);
48075        val = gen_int(n_val, 1);
48076
48077        xmlXPathNodeSetRemove(cur, val);
48078        call_tests++;
48079        des_xmlNodeSetPtr(n_cur, cur, 0);
48080        des_int(n_val, val, 1);
48081        xmlResetLastError();
48082        if (mem_base != xmlMemBlocks()) {
48083            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48084	           xmlMemBlocks() - mem_base);
48085	    test_ret++;
48086            printf(" %d", n_cur);
48087            printf(" %d", n_val);
48088            printf("\n");
48089        }
48090    }
48091    }
48092    function_tests++;
48093#endif
48094
48095    return(test_ret);
48096}
48097
48098
48099static int
48100test_xmlXPathNodeSetSort(void) {
48101    int test_ret = 0;
48102
48103#if defined(LIBXML_XPATH_ENABLED)
48104    int mem_base;
48105    xmlNodeSetPtr set; /* the node set */
48106    int n_set;
48107
48108    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48109        mem_base = xmlMemBlocks();
48110        set = gen_xmlNodeSetPtr(n_set, 0);
48111
48112        xmlXPathNodeSetSort(set);
48113        call_tests++;
48114        des_xmlNodeSetPtr(n_set, set, 0);
48115        xmlResetLastError();
48116        if (mem_base != xmlMemBlocks()) {
48117            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48118	           xmlMemBlocks() - mem_base);
48119	    test_ret++;
48120            printf(" %d", n_set);
48121            printf("\n");
48122        }
48123    }
48124    function_tests++;
48125#endif
48126
48127    return(test_ret);
48128}
48129
48130
48131static int
48132test_xmlXPathNodeTrailing(void) {
48133    int test_ret = 0;
48134
48135#if defined(LIBXML_XPATH_ENABLED)
48136    int mem_base;
48137    xmlNodeSetPtr ret_val;
48138    xmlNodeSetPtr nodes; /* a node-set */
48139    int n_nodes;
48140    xmlNodePtr node; /* a node */
48141    int n_node;
48142
48143    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48144    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48145        mem_base = xmlMemBlocks();
48146        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48147        node = gen_xmlNodePtr(n_node, 1);
48148
48149        ret_val = xmlXPathNodeTrailing(nodes, node);
48150        desret_xmlNodeSetPtr(ret_val);
48151        call_tests++;
48152        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48153        des_xmlNodePtr(n_node, node, 1);
48154        xmlResetLastError();
48155        if (mem_base != xmlMemBlocks()) {
48156            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48157	           xmlMemBlocks() - mem_base);
48158	    test_ret++;
48159            printf(" %d", n_nodes);
48160            printf(" %d", n_node);
48161            printf("\n");
48162        }
48163    }
48164    }
48165    function_tests++;
48166#endif
48167
48168    return(test_ret);
48169}
48170
48171
48172static int
48173test_xmlXPathNodeTrailingSorted(void) {
48174    int test_ret = 0;
48175
48176#if defined(LIBXML_XPATH_ENABLED)
48177    int mem_base;
48178    xmlNodeSetPtr ret_val;
48179    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48180    int n_nodes;
48181    xmlNodePtr node; /* a node */
48182    int n_node;
48183
48184    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48185    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48186        mem_base = xmlMemBlocks();
48187        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48188        node = gen_xmlNodePtr(n_node, 1);
48189
48190        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48191        desret_xmlNodeSetPtr(ret_val);
48192        call_tests++;
48193        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48194        des_xmlNodePtr(n_node, node, 1);
48195        xmlResetLastError();
48196        if (mem_base != xmlMemBlocks()) {
48197            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48198	           xmlMemBlocks() - mem_base);
48199	    test_ret++;
48200            printf(" %d", n_nodes);
48201            printf(" %d", n_node);
48202            printf("\n");
48203        }
48204    }
48205    }
48206    function_tests++;
48207#endif
48208
48209    return(test_ret);
48210}
48211
48212
48213static int
48214test_xmlXPathNormalizeFunction(void) {
48215    int test_ret = 0;
48216
48217#if defined(LIBXML_XPATH_ENABLED)
48218    int mem_base;
48219    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48220    int n_ctxt;
48221    int nargs; /* the number of arguments */
48222    int n_nargs;
48223
48224    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48225    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48226        mem_base = xmlMemBlocks();
48227        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48228        nargs = gen_int(n_nargs, 1);
48229
48230        xmlXPathNormalizeFunction(ctxt, nargs);
48231        call_tests++;
48232        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48233        des_int(n_nargs, nargs, 1);
48234        xmlResetLastError();
48235        if (mem_base != xmlMemBlocks()) {
48236            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48237	           xmlMemBlocks() - mem_base);
48238	    test_ret++;
48239            printf(" %d", n_ctxt);
48240            printf(" %d", n_nargs);
48241            printf("\n");
48242        }
48243    }
48244    }
48245    function_tests++;
48246#endif
48247
48248    return(test_ret);
48249}
48250
48251
48252static int
48253test_xmlXPathNotEqualValues(void) {
48254    int test_ret = 0;
48255
48256#if defined(LIBXML_XPATH_ENABLED)
48257    int mem_base;
48258    int ret_val;
48259    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48260    int n_ctxt;
48261
48262    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48263        mem_base = xmlMemBlocks();
48264        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48265
48266        ret_val = xmlXPathNotEqualValues(ctxt);
48267        desret_int(ret_val);
48268        call_tests++;
48269        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48270        xmlResetLastError();
48271        if (mem_base != xmlMemBlocks()) {
48272            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48273	           xmlMemBlocks() - mem_base);
48274	    test_ret++;
48275            printf(" %d", n_ctxt);
48276            printf("\n");
48277        }
48278    }
48279    function_tests++;
48280#endif
48281
48282    return(test_ret);
48283}
48284
48285
48286static int
48287test_xmlXPathNotFunction(void) {
48288    int test_ret = 0;
48289
48290#if defined(LIBXML_XPATH_ENABLED)
48291    int mem_base;
48292    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48293    int n_ctxt;
48294    int nargs; /* the number of arguments */
48295    int n_nargs;
48296
48297    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48298    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48299        mem_base = xmlMemBlocks();
48300        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48301        nargs = gen_int(n_nargs, 1);
48302
48303        xmlXPathNotFunction(ctxt, nargs);
48304        call_tests++;
48305        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48306        des_int(n_nargs, nargs, 1);
48307        xmlResetLastError();
48308        if (mem_base != xmlMemBlocks()) {
48309            printf("Leak of %d blocks found in xmlXPathNotFunction",
48310	           xmlMemBlocks() - mem_base);
48311	    test_ret++;
48312            printf(" %d", n_ctxt);
48313            printf(" %d", n_nargs);
48314            printf("\n");
48315        }
48316    }
48317    }
48318    function_tests++;
48319#endif
48320
48321    return(test_ret);
48322}
48323
48324
48325static int
48326test_xmlXPathNsLookup(void) {
48327    int test_ret = 0;
48328
48329#if defined(LIBXML_XPATH_ENABLED)
48330    int mem_base;
48331    const xmlChar * ret_val;
48332    xmlXPathContextPtr ctxt; /* the XPath context */
48333    int n_ctxt;
48334    xmlChar * prefix; /* the namespace prefix value */
48335    int n_prefix;
48336
48337    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48338    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
48339        mem_base = xmlMemBlocks();
48340        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48341        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
48342
48343        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
48344        desret_const_xmlChar_ptr(ret_val);
48345        call_tests++;
48346        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48347        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
48348        xmlResetLastError();
48349        if (mem_base != xmlMemBlocks()) {
48350            printf("Leak of %d blocks found in xmlXPathNsLookup",
48351	           xmlMemBlocks() - mem_base);
48352	    test_ret++;
48353            printf(" %d", n_ctxt);
48354            printf(" %d", n_prefix);
48355            printf("\n");
48356        }
48357    }
48358    }
48359    function_tests++;
48360#endif
48361
48362    return(test_ret);
48363}
48364
48365
48366static int
48367test_xmlXPathNumberFunction(void) {
48368    int test_ret = 0;
48369
48370#if defined(LIBXML_XPATH_ENABLED)
48371    int mem_base;
48372    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48373    int n_ctxt;
48374    int nargs; /* the number of arguments */
48375    int n_nargs;
48376
48377    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48378    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48379        mem_base = xmlMemBlocks();
48380        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48381        nargs = gen_int(n_nargs, 1);
48382
48383        xmlXPathNumberFunction(ctxt, nargs);
48384        call_tests++;
48385        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48386        des_int(n_nargs, nargs, 1);
48387        xmlResetLastError();
48388        if (mem_base != xmlMemBlocks()) {
48389            printf("Leak of %d blocks found in xmlXPathNumberFunction",
48390	           xmlMemBlocks() - mem_base);
48391	    test_ret++;
48392            printf(" %d", n_ctxt);
48393            printf(" %d", n_nargs);
48394            printf("\n");
48395        }
48396    }
48397    }
48398    function_tests++;
48399#endif
48400
48401    return(test_ret);
48402}
48403
48404
48405static int
48406test_xmlXPathParseNCName(void) {
48407    int test_ret = 0;
48408
48409#if defined(LIBXML_XPATH_ENABLED)
48410    int mem_base;
48411    xmlChar * ret_val;
48412    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48413    int n_ctxt;
48414
48415    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48416        mem_base = xmlMemBlocks();
48417        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48418
48419        ret_val = xmlXPathParseNCName(ctxt);
48420        desret_xmlChar_ptr(ret_val);
48421        call_tests++;
48422        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48423        xmlResetLastError();
48424        if (mem_base != xmlMemBlocks()) {
48425            printf("Leak of %d blocks found in xmlXPathParseNCName",
48426	           xmlMemBlocks() - mem_base);
48427	    test_ret++;
48428            printf(" %d", n_ctxt);
48429            printf("\n");
48430        }
48431    }
48432    function_tests++;
48433#endif
48434
48435    return(test_ret);
48436}
48437
48438
48439static int
48440test_xmlXPathParseName(void) {
48441    int test_ret = 0;
48442
48443#if defined(LIBXML_XPATH_ENABLED)
48444    int mem_base;
48445    xmlChar * ret_val;
48446    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48447    int n_ctxt;
48448
48449    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48450        mem_base = xmlMemBlocks();
48451        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48452
48453        ret_val = xmlXPathParseName(ctxt);
48454        desret_xmlChar_ptr(ret_val);
48455        call_tests++;
48456        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48457        xmlResetLastError();
48458        if (mem_base != xmlMemBlocks()) {
48459            printf("Leak of %d blocks found in xmlXPathParseName",
48460	           xmlMemBlocks() - mem_base);
48461	    test_ret++;
48462            printf(" %d", n_ctxt);
48463            printf("\n");
48464        }
48465    }
48466    function_tests++;
48467#endif
48468
48469    return(test_ret);
48470}
48471
48472
48473static int
48474test_xmlXPathPopBoolean(void) {
48475    int test_ret = 0;
48476
48477#if defined(LIBXML_XPATH_ENABLED)
48478    int mem_base;
48479    int ret_val;
48480    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48481    int n_ctxt;
48482
48483    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48484        mem_base = xmlMemBlocks();
48485        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48486
48487        ret_val = xmlXPathPopBoolean(ctxt);
48488        desret_int(ret_val);
48489        call_tests++;
48490        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48491        xmlResetLastError();
48492        if (mem_base != xmlMemBlocks()) {
48493            printf("Leak of %d blocks found in xmlXPathPopBoolean",
48494	           xmlMemBlocks() - mem_base);
48495	    test_ret++;
48496            printf(" %d", n_ctxt);
48497            printf("\n");
48498        }
48499    }
48500    function_tests++;
48501#endif
48502
48503    return(test_ret);
48504}
48505
48506
48507static int
48508test_xmlXPathPopExternal(void) {
48509    int test_ret = 0;
48510
48511#if defined(LIBXML_XPATH_ENABLED)
48512    int mem_base;
48513    void * ret_val;
48514    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48515    int n_ctxt;
48516
48517    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48518        mem_base = xmlMemBlocks();
48519        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48520
48521        ret_val = xmlXPathPopExternal(ctxt);
48522        desret_void_ptr(ret_val);
48523        call_tests++;
48524        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48525        xmlResetLastError();
48526        if (mem_base != xmlMemBlocks()) {
48527            printf("Leak of %d blocks found in xmlXPathPopExternal",
48528	           xmlMemBlocks() - mem_base);
48529	    test_ret++;
48530            printf(" %d", n_ctxt);
48531            printf("\n");
48532        }
48533    }
48534    function_tests++;
48535#endif
48536
48537    return(test_ret);
48538}
48539
48540
48541static int
48542test_xmlXPathPopNodeSet(void) {
48543    int test_ret = 0;
48544
48545#if defined(LIBXML_XPATH_ENABLED)
48546    int mem_base;
48547    xmlNodeSetPtr ret_val;
48548    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48549    int n_ctxt;
48550
48551    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48552        mem_base = xmlMemBlocks();
48553        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48554
48555        ret_val = xmlXPathPopNodeSet(ctxt);
48556        desret_xmlNodeSetPtr(ret_val);
48557        call_tests++;
48558        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48559        xmlResetLastError();
48560        if (mem_base != xmlMemBlocks()) {
48561            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
48562	           xmlMemBlocks() - mem_base);
48563	    test_ret++;
48564            printf(" %d", n_ctxt);
48565            printf("\n");
48566        }
48567    }
48568    function_tests++;
48569#endif
48570
48571    return(test_ret);
48572}
48573
48574
48575static int
48576test_xmlXPathPopNumber(void) {
48577    int test_ret = 0;
48578
48579#if defined(LIBXML_XPATH_ENABLED)
48580    int mem_base;
48581    double ret_val;
48582    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48583    int n_ctxt;
48584
48585    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48586        mem_base = xmlMemBlocks();
48587        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48588
48589        ret_val = xmlXPathPopNumber(ctxt);
48590        desret_double(ret_val);
48591        call_tests++;
48592        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48593        xmlResetLastError();
48594        if (mem_base != xmlMemBlocks()) {
48595            printf("Leak of %d blocks found in xmlXPathPopNumber",
48596	           xmlMemBlocks() - mem_base);
48597	    test_ret++;
48598            printf(" %d", n_ctxt);
48599            printf("\n");
48600        }
48601    }
48602    function_tests++;
48603#endif
48604
48605    return(test_ret);
48606}
48607
48608
48609static int
48610test_xmlXPathPopString(void) {
48611    int test_ret = 0;
48612
48613#if defined(LIBXML_XPATH_ENABLED)
48614    int mem_base;
48615    xmlChar * ret_val;
48616    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
48617    int n_ctxt;
48618
48619    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48620        mem_base = xmlMemBlocks();
48621        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48622
48623        ret_val = xmlXPathPopString(ctxt);
48624        desret_xmlChar_ptr(ret_val);
48625        call_tests++;
48626        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48627        xmlResetLastError();
48628        if (mem_base != xmlMemBlocks()) {
48629            printf("Leak of %d blocks found in xmlXPathPopString",
48630	           xmlMemBlocks() - mem_base);
48631	    test_ret++;
48632            printf(" %d", n_ctxt);
48633            printf("\n");
48634        }
48635    }
48636    function_tests++;
48637#endif
48638
48639    return(test_ret);
48640}
48641
48642
48643static int
48644test_xmlXPathPositionFunction(void) {
48645    int test_ret = 0;
48646
48647#if defined(LIBXML_XPATH_ENABLED)
48648    int mem_base;
48649    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48650    int n_ctxt;
48651    int nargs; /* the number of arguments */
48652    int n_nargs;
48653
48654    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48655    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48656        mem_base = xmlMemBlocks();
48657        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48658        nargs = gen_int(n_nargs, 1);
48659
48660        xmlXPathPositionFunction(ctxt, nargs);
48661        call_tests++;
48662        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48663        des_int(n_nargs, nargs, 1);
48664        xmlResetLastError();
48665        if (mem_base != xmlMemBlocks()) {
48666            printf("Leak of %d blocks found in xmlXPathPositionFunction",
48667	           xmlMemBlocks() - mem_base);
48668	    test_ret++;
48669            printf(" %d", n_ctxt);
48670            printf(" %d", n_nargs);
48671            printf("\n");
48672        }
48673    }
48674    }
48675    function_tests++;
48676#endif
48677
48678    return(test_ret);
48679}
48680
48681
48682static int
48683test_xmlXPathRegisterAllFunctions(void) {
48684    int test_ret = 0;
48685
48686#if defined(LIBXML_XPATH_ENABLED)
48687    int mem_base;
48688    xmlXPathContextPtr ctxt; /* the XPath context */
48689    int n_ctxt;
48690
48691    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48692        mem_base = xmlMemBlocks();
48693        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48694
48695        xmlXPathRegisterAllFunctions(ctxt);
48696        call_tests++;
48697        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48698        xmlResetLastError();
48699        if (mem_base != xmlMemBlocks()) {
48700            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
48701	           xmlMemBlocks() - mem_base);
48702	    test_ret++;
48703            printf(" %d", n_ctxt);
48704            printf("\n");
48705        }
48706    }
48707    function_tests++;
48708#endif
48709
48710    return(test_ret);
48711}
48712
48713
48714static int
48715test_xmlXPathRegisterFunc(void) {
48716    int test_ret = 0;
48717
48718
48719    /* missing type support */
48720    return(test_ret);
48721}
48722
48723
48724static int
48725test_xmlXPathRegisterFuncLookup(void) {
48726    int test_ret = 0;
48727
48728
48729    /* missing type support */
48730    return(test_ret);
48731}
48732
48733
48734static int
48735test_xmlXPathRegisterFuncNS(void) {
48736    int test_ret = 0;
48737
48738
48739    /* missing type support */
48740    return(test_ret);
48741}
48742
48743
48744static int
48745test_xmlXPathRegisterNs(void) {
48746    int test_ret = 0;
48747
48748#if defined(LIBXML_XPATH_ENABLED)
48749    int mem_base;
48750    int ret_val;
48751    xmlXPathContextPtr ctxt; /* the XPath context */
48752    int n_ctxt;
48753    xmlChar * prefix; /* the namespace prefix */
48754    int n_prefix;
48755    xmlChar * ns_uri; /* the namespace name */
48756    int n_ns_uri;
48757
48758    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48759    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
48760    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
48761        mem_base = xmlMemBlocks();
48762        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48763        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
48764        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
48765
48766        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
48767        desret_int(ret_val);
48768        call_tests++;
48769        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48770        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
48771        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
48772        xmlResetLastError();
48773        if (mem_base != xmlMemBlocks()) {
48774            printf("Leak of %d blocks found in xmlXPathRegisterNs",
48775	           xmlMemBlocks() - mem_base);
48776	    test_ret++;
48777            printf(" %d", n_ctxt);
48778            printf(" %d", n_prefix);
48779            printf(" %d", n_ns_uri);
48780            printf("\n");
48781        }
48782    }
48783    }
48784    }
48785    function_tests++;
48786#endif
48787
48788    return(test_ret);
48789}
48790
48791
48792static int
48793test_xmlXPathRegisterVariable(void) {
48794    int test_ret = 0;
48795
48796#if defined(LIBXML_XPATH_ENABLED)
48797    int mem_base;
48798    int ret_val;
48799    xmlXPathContextPtr ctxt; /* the XPath context */
48800    int n_ctxt;
48801    xmlChar * name; /* the variable name */
48802    int n_name;
48803    xmlXPathObjectPtr value; /* the variable value or NULL */
48804    int n_value;
48805
48806    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48807    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48808    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
48809        mem_base = xmlMemBlocks();
48810        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48811        name = gen_const_xmlChar_ptr(n_name, 1);
48812        value = gen_xmlXPathObjectPtr(n_value, 2);
48813
48814        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
48815        desret_int(ret_val);
48816        call_tests++;
48817        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48818        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48819        des_xmlXPathObjectPtr(n_value, value, 2);
48820        xmlResetLastError();
48821        if (mem_base != xmlMemBlocks()) {
48822            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
48823	           xmlMemBlocks() - mem_base);
48824	    test_ret++;
48825            printf(" %d", n_ctxt);
48826            printf(" %d", n_name);
48827            printf(" %d", n_value);
48828            printf("\n");
48829        }
48830    }
48831    }
48832    }
48833    function_tests++;
48834#endif
48835
48836    return(test_ret);
48837}
48838
48839
48840static int
48841test_xmlXPathRegisterVariableLookup(void) {
48842    int test_ret = 0;
48843
48844
48845    /* missing type support */
48846    return(test_ret);
48847}
48848
48849
48850static int
48851test_xmlXPathRegisterVariableNS(void) {
48852    int test_ret = 0;
48853
48854#if defined(LIBXML_XPATH_ENABLED)
48855    int mem_base;
48856    int ret_val;
48857    xmlXPathContextPtr ctxt; /* the XPath context */
48858    int n_ctxt;
48859    xmlChar * name; /* the variable name */
48860    int n_name;
48861    xmlChar * ns_uri; /* the variable namespace URI */
48862    int n_ns_uri;
48863    xmlXPathObjectPtr value; /* the variable value or NULL */
48864    int n_value;
48865
48866    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48867    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48868    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
48869    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
48870        mem_base = xmlMemBlocks();
48871        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48872        name = gen_const_xmlChar_ptr(n_name, 1);
48873        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
48874        value = gen_xmlXPathObjectPtr(n_value, 3);
48875
48876        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
48877        desret_int(ret_val);
48878        call_tests++;
48879        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48880        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48881        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
48882        des_xmlXPathObjectPtr(n_value, value, 3);
48883        xmlResetLastError();
48884        if (mem_base != xmlMemBlocks()) {
48885            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
48886	           xmlMemBlocks() - mem_base);
48887	    test_ret++;
48888            printf(" %d", n_ctxt);
48889            printf(" %d", n_name);
48890            printf(" %d", n_ns_uri);
48891            printf(" %d", n_value);
48892            printf("\n");
48893        }
48894    }
48895    }
48896    }
48897    }
48898    function_tests++;
48899#endif
48900
48901    return(test_ret);
48902}
48903
48904
48905static int
48906test_xmlXPathRegisteredFuncsCleanup(void) {
48907    int test_ret = 0;
48908
48909#if defined(LIBXML_XPATH_ENABLED)
48910    int mem_base;
48911    xmlXPathContextPtr ctxt; /* the XPath context */
48912    int n_ctxt;
48913
48914    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48915        mem_base = xmlMemBlocks();
48916        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48917
48918        xmlXPathRegisteredFuncsCleanup(ctxt);
48919        call_tests++;
48920        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48921        xmlResetLastError();
48922        if (mem_base != xmlMemBlocks()) {
48923            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
48924	           xmlMemBlocks() - mem_base);
48925	    test_ret++;
48926            printf(" %d", n_ctxt);
48927            printf("\n");
48928        }
48929    }
48930    function_tests++;
48931#endif
48932
48933    return(test_ret);
48934}
48935
48936
48937static int
48938test_xmlXPathRegisteredNsCleanup(void) {
48939    int test_ret = 0;
48940
48941#if defined(LIBXML_XPATH_ENABLED)
48942    int mem_base;
48943    xmlXPathContextPtr ctxt; /* the XPath context */
48944    int n_ctxt;
48945
48946    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48947        mem_base = xmlMemBlocks();
48948        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48949
48950        xmlXPathRegisteredNsCleanup(ctxt);
48951        call_tests++;
48952        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48953        xmlResetLastError();
48954        if (mem_base != xmlMemBlocks()) {
48955            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
48956	           xmlMemBlocks() - mem_base);
48957	    test_ret++;
48958            printf(" %d", n_ctxt);
48959            printf("\n");
48960        }
48961    }
48962    function_tests++;
48963#endif
48964
48965    return(test_ret);
48966}
48967
48968
48969static int
48970test_xmlXPathRegisteredVariablesCleanup(void) {
48971    int test_ret = 0;
48972
48973#if defined(LIBXML_XPATH_ENABLED)
48974    int mem_base;
48975    xmlXPathContextPtr ctxt; /* the XPath context */
48976    int n_ctxt;
48977
48978    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48979        mem_base = xmlMemBlocks();
48980        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48981
48982        xmlXPathRegisteredVariablesCleanup(ctxt);
48983        call_tests++;
48984        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48985        xmlResetLastError();
48986        if (mem_base != xmlMemBlocks()) {
48987            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
48988	           xmlMemBlocks() - mem_base);
48989	    test_ret++;
48990            printf(" %d", n_ctxt);
48991            printf("\n");
48992        }
48993    }
48994    function_tests++;
48995#endif
48996
48997    return(test_ret);
48998}
48999
49000
49001static int
49002test_xmlXPathRoot(void) {
49003    int test_ret = 0;
49004
49005#if defined(LIBXML_XPATH_ENABLED)
49006    int mem_base;
49007    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49008    int n_ctxt;
49009
49010    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49011        mem_base = xmlMemBlocks();
49012        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49013
49014        xmlXPathRoot(ctxt);
49015        call_tests++;
49016        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49017        xmlResetLastError();
49018        if (mem_base != xmlMemBlocks()) {
49019            printf("Leak of %d blocks found in xmlXPathRoot",
49020	           xmlMemBlocks() - mem_base);
49021	    test_ret++;
49022            printf(" %d", n_ctxt);
49023            printf("\n");
49024        }
49025    }
49026    function_tests++;
49027#endif
49028
49029    return(test_ret);
49030}
49031
49032
49033static int
49034test_xmlXPathRoundFunction(void) {
49035    int test_ret = 0;
49036
49037#if defined(LIBXML_XPATH_ENABLED)
49038    int mem_base;
49039    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49040    int n_ctxt;
49041    int nargs; /* the number of arguments */
49042    int n_nargs;
49043
49044    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49045    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49046        mem_base = xmlMemBlocks();
49047        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49048        nargs = gen_int(n_nargs, 1);
49049
49050        xmlXPathRoundFunction(ctxt, nargs);
49051        call_tests++;
49052        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49053        des_int(n_nargs, nargs, 1);
49054        xmlResetLastError();
49055        if (mem_base != xmlMemBlocks()) {
49056            printf("Leak of %d blocks found in xmlXPathRoundFunction",
49057	           xmlMemBlocks() - mem_base);
49058	    test_ret++;
49059            printf(" %d", n_ctxt);
49060            printf(" %d", n_nargs);
49061            printf("\n");
49062        }
49063    }
49064    }
49065    function_tests++;
49066#endif
49067
49068    return(test_ret);
49069}
49070
49071
49072static int
49073test_xmlXPathStartsWithFunction(void) {
49074    int test_ret = 0;
49075
49076#if defined(LIBXML_XPATH_ENABLED)
49077    int mem_base;
49078    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49079    int n_ctxt;
49080    int nargs; /* the number of arguments */
49081    int n_nargs;
49082
49083    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49084    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49085        mem_base = xmlMemBlocks();
49086        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49087        nargs = gen_int(n_nargs, 1);
49088
49089        xmlXPathStartsWithFunction(ctxt, nargs);
49090        call_tests++;
49091        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49092        des_int(n_nargs, nargs, 1);
49093        xmlResetLastError();
49094        if (mem_base != xmlMemBlocks()) {
49095            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49096	           xmlMemBlocks() - mem_base);
49097	    test_ret++;
49098            printf(" %d", n_ctxt);
49099            printf(" %d", n_nargs);
49100            printf("\n");
49101        }
49102    }
49103    }
49104    function_tests++;
49105#endif
49106
49107    return(test_ret);
49108}
49109
49110
49111static int
49112test_xmlXPathStringEvalNumber(void) {
49113    int test_ret = 0;
49114
49115#if defined(LIBXML_XPATH_ENABLED)
49116    int mem_base;
49117    double ret_val;
49118    xmlChar * str; /* A string to scan */
49119    int n_str;
49120
49121    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49122        mem_base = xmlMemBlocks();
49123        str = gen_const_xmlChar_ptr(n_str, 0);
49124
49125        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49126        desret_double(ret_val);
49127        call_tests++;
49128        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49129        xmlResetLastError();
49130        if (mem_base != xmlMemBlocks()) {
49131            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49132	           xmlMemBlocks() - mem_base);
49133	    test_ret++;
49134            printf(" %d", n_str);
49135            printf("\n");
49136        }
49137    }
49138    function_tests++;
49139#endif
49140
49141    return(test_ret);
49142}
49143
49144
49145static int
49146test_xmlXPathStringFunction(void) {
49147    int test_ret = 0;
49148
49149#if defined(LIBXML_XPATH_ENABLED)
49150    int mem_base;
49151    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49152    int n_ctxt;
49153    int nargs; /* the number of arguments */
49154    int n_nargs;
49155
49156    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49157    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49158        mem_base = xmlMemBlocks();
49159        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49160        nargs = gen_int(n_nargs, 1);
49161
49162        xmlXPathStringFunction(ctxt, nargs);
49163        call_tests++;
49164        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49165        des_int(n_nargs, nargs, 1);
49166        xmlResetLastError();
49167        if (mem_base != xmlMemBlocks()) {
49168            printf("Leak of %d blocks found in xmlXPathStringFunction",
49169	           xmlMemBlocks() - mem_base);
49170	    test_ret++;
49171            printf(" %d", n_ctxt);
49172            printf(" %d", n_nargs);
49173            printf("\n");
49174        }
49175    }
49176    }
49177    function_tests++;
49178#endif
49179
49180    return(test_ret);
49181}
49182
49183
49184static int
49185test_xmlXPathStringLengthFunction(void) {
49186    int test_ret = 0;
49187
49188#if defined(LIBXML_XPATH_ENABLED)
49189    int mem_base;
49190    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49191    int n_ctxt;
49192    int nargs; /* the number of arguments */
49193    int n_nargs;
49194
49195    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49196    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49197        mem_base = xmlMemBlocks();
49198        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49199        nargs = gen_int(n_nargs, 1);
49200
49201        xmlXPathStringLengthFunction(ctxt, nargs);
49202        call_tests++;
49203        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49204        des_int(n_nargs, nargs, 1);
49205        xmlResetLastError();
49206        if (mem_base != xmlMemBlocks()) {
49207            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49208	           xmlMemBlocks() - mem_base);
49209	    test_ret++;
49210            printf(" %d", n_ctxt);
49211            printf(" %d", n_nargs);
49212            printf("\n");
49213        }
49214    }
49215    }
49216    function_tests++;
49217#endif
49218
49219    return(test_ret);
49220}
49221
49222
49223static int
49224test_xmlXPathSubValues(void) {
49225    int test_ret = 0;
49226
49227#if defined(LIBXML_XPATH_ENABLED)
49228    int mem_base;
49229    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49230    int n_ctxt;
49231
49232    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49233        mem_base = xmlMemBlocks();
49234        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49235
49236        xmlXPathSubValues(ctxt);
49237        call_tests++;
49238        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49239        xmlResetLastError();
49240        if (mem_base != xmlMemBlocks()) {
49241            printf("Leak of %d blocks found in xmlXPathSubValues",
49242	           xmlMemBlocks() - mem_base);
49243	    test_ret++;
49244            printf(" %d", n_ctxt);
49245            printf("\n");
49246        }
49247    }
49248    function_tests++;
49249#endif
49250
49251    return(test_ret);
49252}
49253
49254
49255static int
49256test_xmlXPathSubstringAfterFunction(void) {
49257    int test_ret = 0;
49258
49259#if defined(LIBXML_XPATH_ENABLED)
49260    int mem_base;
49261    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49262    int n_ctxt;
49263    int nargs; /* the number of arguments */
49264    int n_nargs;
49265
49266    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49267    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49268        mem_base = xmlMemBlocks();
49269        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49270        nargs = gen_int(n_nargs, 1);
49271
49272        xmlXPathSubstringAfterFunction(ctxt, nargs);
49273        call_tests++;
49274        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49275        des_int(n_nargs, nargs, 1);
49276        xmlResetLastError();
49277        if (mem_base != xmlMemBlocks()) {
49278            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
49279	           xmlMemBlocks() - mem_base);
49280	    test_ret++;
49281            printf(" %d", n_ctxt);
49282            printf(" %d", n_nargs);
49283            printf("\n");
49284        }
49285    }
49286    }
49287    function_tests++;
49288#endif
49289
49290    return(test_ret);
49291}
49292
49293
49294static int
49295test_xmlXPathSubstringBeforeFunction(void) {
49296    int test_ret = 0;
49297
49298#if defined(LIBXML_XPATH_ENABLED)
49299    int mem_base;
49300    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49301    int n_ctxt;
49302    int nargs; /* the number of arguments */
49303    int n_nargs;
49304
49305    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49306    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49307        mem_base = xmlMemBlocks();
49308        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49309        nargs = gen_int(n_nargs, 1);
49310
49311        xmlXPathSubstringBeforeFunction(ctxt, nargs);
49312        call_tests++;
49313        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49314        des_int(n_nargs, nargs, 1);
49315        xmlResetLastError();
49316        if (mem_base != xmlMemBlocks()) {
49317            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
49318	           xmlMemBlocks() - mem_base);
49319	    test_ret++;
49320            printf(" %d", n_ctxt);
49321            printf(" %d", n_nargs);
49322            printf("\n");
49323        }
49324    }
49325    }
49326    function_tests++;
49327#endif
49328
49329    return(test_ret);
49330}
49331
49332
49333static int
49334test_xmlXPathSubstringFunction(void) {
49335    int test_ret = 0;
49336
49337#if defined(LIBXML_XPATH_ENABLED)
49338    int mem_base;
49339    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49340    int n_ctxt;
49341    int nargs; /* the number of arguments */
49342    int n_nargs;
49343
49344    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49345    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49346        mem_base = xmlMemBlocks();
49347        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49348        nargs = gen_int(n_nargs, 1);
49349
49350        xmlXPathSubstringFunction(ctxt, nargs);
49351        call_tests++;
49352        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49353        des_int(n_nargs, nargs, 1);
49354        xmlResetLastError();
49355        if (mem_base != xmlMemBlocks()) {
49356            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
49357	           xmlMemBlocks() - mem_base);
49358	    test_ret++;
49359            printf(" %d", n_ctxt);
49360            printf(" %d", n_nargs);
49361            printf("\n");
49362        }
49363    }
49364    }
49365    function_tests++;
49366#endif
49367
49368    return(test_ret);
49369}
49370
49371
49372static int
49373test_xmlXPathSumFunction(void) {
49374    int test_ret = 0;
49375
49376#if defined(LIBXML_XPATH_ENABLED)
49377    int mem_base;
49378    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49379    int n_ctxt;
49380    int nargs; /* the number of arguments */
49381    int n_nargs;
49382
49383    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49384    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49385        mem_base = xmlMemBlocks();
49386        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49387        nargs = gen_int(n_nargs, 1);
49388
49389        xmlXPathSumFunction(ctxt, nargs);
49390        call_tests++;
49391        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49392        des_int(n_nargs, nargs, 1);
49393        xmlResetLastError();
49394        if (mem_base != xmlMemBlocks()) {
49395            printf("Leak of %d blocks found in xmlXPathSumFunction",
49396	           xmlMemBlocks() - mem_base);
49397	    test_ret++;
49398            printf(" %d", n_ctxt);
49399            printf(" %d", n_nargs);
49400            printf("\n");
49401        }
49402    }
49403    }
49404    function_tests++;
49405#endif
49406
49407    return(test_ret);
49408}
49409
49410
49411static int
49412test_xmlXPathTrailing(void) {
49413    int test_ret = 0;
49414
49415#if defined(LIBXML_XPATH_ENABLED)
49416    int mem_base;
49417    xmlNodeSetPtr ret_val;
49418    xmlNodeSetPtr nodes1; /* a node-set */
49419    int n_nodes1;
49420    xmlNodeSetPtr nodes2; /* a node-set */
49421    int n_nodes2;
49422
49423    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49424    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49425        mem_base = xmlMemBlocks();
49426        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49427        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49428
49429        ret_val = xmlXPathTrailing(nodes1, nodes2);
49430        desret_xmlNodeSetPtr(ret_val);
49431        call_tests++;
49432        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49433        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49434        xmlResetLastError();
49435        if (mem_base != xmlMemBlocks()) {
49436            printf("Leak of %d blocks found in xmlXPathTrailing",
49437	           xmlMemBlocks() - mem_base);
49438	    test_ret++;
49439            printf(" %d", n_nodes1);
49440            printf(" %d", n_nodes2);
49441            printf("\n");
49442        }
49443    }
49444    }
49445    function_tests++;
49446#endif
49447
49448    return(test_ret);
49449}
49450
49451
49452static int
49453test_xmlXPathTrailingSorted(void) {
49454    int test_ret = 0;
49455
49456#if defined(LIBXML_XPATH_ENABLED)
49457    int mem_base;
49458    xmlNodeSetPtr ret_val;
49459    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
49460    int n_nodes1;
49461    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
49462    int n_nodes2;
49463
49464    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49465    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49466        mem_base = xmlMemBlocks();
49467        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49468        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49469
49470        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
49471        desret_xmlNodeSetPtr(ret_val);
49472        call_tests++;
49473        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49474        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49475        xmlResetLastError();
49476        if (mem_base != xmlMemBlocks()) {
49477            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
49478	           xmlMemBlocks() - mem_base);
49479	    test_ret++;
49480            printf(" %d", n_nodes1);
49481            printf(" %d", n_nodes2);
49482            printf("\n");
49483        }
49484    }
49485    }
49486    function_tests++;
49487#endif
49488
49489    return(test_ret);
49490}
49491
49492
49493static int
49494test_xmlXPathTranslateFunction(void) {
49495    int test_ret = 0;
49496
49497#if defined(LIBXML_XPATH_ENABLED)
49498    int mem_base;
49499    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49500    int n_ctxt;
49501    int nargs; /* the number of arguments */
49502    int n_nargs;
49503
49504    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49505    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49506        mem_base = xmlMemBlocks();
49507        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49508        nargs = gen_int(n_nargs, 1);
49509
49510        xmlXPathTranslateFunction(ctxt, nargs);
49511        call_tests++;
49512        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49513        des_int(n_nargs, nargs, 1);
49514        xmlResetLastError();
49515        if (mem_base != xmlMemBlocks()) {
49516            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
49517	           xmlMemBlocks() - mem_base);
49518	    test_ret++;
49519            printf(" %d", n_ctxt);
49520            printf(" %d", n_nargs);
49521            printf("\n");
49522        }
49523    }
49524    }
49525    function_tests++;
49526#endif
49527
49528    return(test_ret);
49529}
49530
49531
49532static int
49533test_xmlXPathTrueFunction(void) {
49534    int test_ret = 0;
49535
49536#if defined(LIBXML_XPATH_ENABLED)
49537    int mem_base;
49538    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49539    int n_ctxt;
49540    int nargs; /* the number of arguments */
49541    int n_nargs;
49542
49543    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49544    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49545        mem_base = xmlMemBlocks();
49546        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49547        nargs = gen_int(n_nargs, 1);
49548
49549        xmlXPathTrueFunction(ctxt, nargs);
49550        call_tests++;
49551        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49552        des_int(n_nargs, nargs, 1);
49553        xmlResetLastError();
49554        if (mem_base != xmlMemBlocks()) {
49555            printf("Leak of %d blocks found in xmlXPathTrueFunction",
49556	           xmlMemBlocks() - mem_base);
49557	    test_ret++;
49558            printf(" %d", n_ctxt);
49559            printf(" %d", n_nargs);
49560            printf("\n");
49561        }
49562    }
49563    }
49564    function_tests++;
49565#endif
49566
49567    return(test_ret);
49568}
49569
49570
49571static int
49572test_xmlXPathValueFlipSign(void) {
49573    int test_ret = 0;
49574
49575#if defined(LIBXML_XPATH_ENABLED)
49576    int mem_base;
49577    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49578    int n_ctxt;
49579
49580    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49581        mem_base = xmlMemBlocks();
49582        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49583
49584        xmlXPathValueFlipSign(ctxt);
49585        call_tests++;
49586        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49587        xmlResetLastError();
49588        if (mem_base != xmlMemBlocks()) {
49589            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
49590	           xmlMemBlocks() - mem_base);
49591	    test_ret++;
49592            printf(" %d", n_ctxt);
49593            printf("\n");
49594        }
49595    }
49596    function_tests++;
49597#endif
49598
49599    return(test_ret);
49600}
49601
49602
49603static int
49604test_xmlXPathVariableLookup(void) {
49605    int test_ret = 0;
49606
49607#if defined(LIBXML_XPATH_ENABLED)
49608    int mem_base;
49609    xmlXPathObjectPtr ret_val;
49610    xmlXPathContextPtr ctxt; /* the XPath context */
49611    int n_ctxt;
49612    xmlChar * name; /* the variable name */
49613    int n_name;
49614
49615    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49616    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49617        mem_base = xmlMemBlocks();
49618        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49619        name = gen_const_xmlChar_ptr(n_name, 1);
49620
49621        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
49622        desret_xmlXPathObjectPtr(ret_val);
49623        call_tests++;
49624        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49625        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49626        xmlResetLastError();
49627        if (mem_base != xmlMemBlocks()) {
49628            printf("Leak of %d blocks found in xmlXPathVariableLookup",
49629	           xmlMemBlocks() - mem_base);
49630	    test_ret++;
49631            printf(" %d", n_ctxt);
49632            printf(" %d", n_name);
49633            printf("\n");
49634        }
49635    }
49636    }
49637    function_tests++;
49638#endif
49639
49640    return(test_ret);
49641}
49642
49643
49644static int
49645test_xmlXPathVariableLookupNS(void) {
49646    int test_ret = 0;
49647
49648#if defined(LIBXML_XPATH_ENABLED)
49649    int mem_base;
49650    xmlXPathObjectPtr ret_val;
49651    xmlXPathContextPtr ctxt; /* the XPath context */
49652    int n_ctxt;
49653    xmlChar * name; /* the variable name */
49654    int n_name;
49655    xmlChar * ns_uri; /* the variable namespace URI */
49656    int n_ns_uri;
49657
49658    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49659    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49660    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49661        mem_base = xmlMemBlocks();
49662        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49663        name = gen_const_xmlChar_ptr(n_name, 1);
49664        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49665
49666        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
49667        desret_xmlXPathObjectPtr(ret_val);
49668        call_tests++;
49669        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49670        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49671        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49672        xmlResetLastError();
49673        if (mem_base != xmlMemBlocks()) {
49674            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
49675	           xmlMemBlocks() - mem_base);
49676	    test_ret++;
49677            printf(" %d", n_ctxt);
49678            printf(" %d", n_name);
49679            printf(" %d", n_ns_uri);
49680            printf("\n");
49681        }
49682    }
49683    }
49684    }
49685    function_tests++;
49686#endif
49687
49688    return(test_ret);
49689}
49690
49691
49692static int
49693test_xmlXPathWrapCString(void) {
49694    int test_ret = 0;
49695
49696#if defined(LIBXML_XPATH_ENABLED)
49697    int mem_base;
49698    xmlXPathObjectPtr ret_val;
49699    char * val; /* the char * value */
49700    int n_val;
49701
49702    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
49703        mem_base = xmlMemBlocks();
49704        val = gen_char_ptr(n_val, 0);
49705
49706        ret_val = xmlXPathWrapCString(val);
49707        desret_xmlXPathObjectPtr(ret_val);
49708        call_tests++;
49709        des_char_ptr(n_val, val, 0);
49710        xmlResetLastError();
49711        if (mem_base != xmlMemBlocks()) {
49712            printf("Leak of %d blocks found in xmlXPathWrapCString",
49713	           xmlMemBlocks() - mem_base);
49714	    test_ret++;
49715            printf(" %d", n_val);
49716            printf("\n");
49717        }
49718    }
49719    function_tests++;
49720#endif
49721
49722    return(test_ret);
49723}
49724
49725
49726static int
49727test_xmlXPathWrapExternal(void) {
49728    int test_ret = 0;
49729
49730#if defined(LIBXML_XPATH_ENABLED)
49731    int mem_base;
49732    xmlXPathObjectPtr ret_val;
49733    void * val; /* the user data */
49734    int n_val;
49735
49736    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
49737        mem_base = xmlMemBlocks();
49738        val = gen_void_ptr(n_val, 0);
49739
49740        ret_val = xmlXPathWrapExternal(val);
49741        desret_xmlXPathObjectPtr(ret_val);
49742        call_tests++;
49743        des_void_ptr(n_val, val, 0);
49744        xmlResetLastError();
49745        if (mem_base != xmlMemBlocks()) {
49746            printf("Leak of %d blocks found in xmlXPathWrapExternal",
49747	           xmlMemBlocks() - mem_base);
49748	    test_ret++;
49749            printf(" %d", n_val);
49750            printf("\n");
49751        }
49752    }
49753    function_tests++;
49754#endif
49755
49756    return(test_ret);
49757}
49758
49759
49760static int
49761test_xmlXPathWrapNodeSet(void) {
49762    int test_ret = 0;
49763
49764#if defined(LIBXML_XPATH_ENABLED)
49765    int mem_base;
49766    xmlXPathObjectPtr ret_val;
49767    xmlNodeSetPtr val; /* the NodePtr value */
49768    int n_val;
49769
49770    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
49771        mem_base = xmlMemBlocks();
49772        val = gen_xmlNodeSetPtr(n_val, 0);
49773
49774        ret_val = xmlXPathWrapNodeSet(val);
49775        desret_xmlXPathObjectPtr(ret_val);
49776        call_tests++;
49777        des_xmlNodeSetPtr(n_val, val, 0);
49778        xmlResetLastError();
49779        if (mem_base != xmlMemBlocks()) {
49780            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
49781	           xmlMemBlocks() - mem_base);
49782	    test_ret++;
49783            printf(" %d", n_val);
49784            printf("\n");
49785        }
49786    }
49787    function_tests++;
49788#endif
49789
49790    return(test_ret);
49791}
49792
49793
49794static int
49795test_xmlXPatherror(void) {
49796    int test_ret = 0;
49797
49798#if defined(LIBXML_XPATH_ENABLED)
49799    int mem_base;
49800    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49801    int n_ctxt;
49802    const char * file; /* the file name */
49803    int n_file;
49804    int line; /* the line number */
49805    int n_line;
49806    int no; /* the error number */
49807    int n_no;
49808
49809    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49810    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
49811    for (n_line = 0;n_line < gen_nb_int;n_line++) {
49812    for (n_no = 0;n_no < gen_nb_int;n_no++) {
49813        mem_base = xmlMemBlocks();
49814        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49815        file = gen_filepath(n_file, 1);
49816        line = gen_int(n_line, 2);
49817        no = gen_int(n_no, 3);
49818
49819        xmlXPatherror(ctxt, file, line, no);
49820        call_tests++;
49821        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49822        des_filepath(n_file, file, 1);
49823        des_int(n_line, line, 2);
49824        des_int(n_no, no, 3);
49825        xmlResetLastError();
49826        if (mem_base != xmlMemBlocks()) {
49827            printf("Leak of %d blocks found in xmlXPatherror",
49828	           xmlMemBlocks() - mem_base);
49829	    test_ret++;
49830            printf(" %d", n_ctxt);
49831            printf(" %d", n_file);
49832            printf(" %d", n_line);
49833            printf(" %d", n_no);
49834            printf("\n");
49835        }
49836    }
49837    }
49838    }
49839    }
49840    function_tests++;
49841#endif
49842
49843    return(test_ret);
49844}
49845
49846static int
49847test_xpathInternals(void) {
49848    int test_ret = 0;
49849
49850    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
49851    test_ret += test_valuePop();
49852    test_ret += test_valuePush();
49853    test_ret += test_xmlXPathAddValues();
49854    test_ret += test_xmlXPathBooleanFunction();
49855    test_ret += test_xmlXPathCeilingFunction();
49856    test_ret += test_xmlXPathCompareValues();
49857    test_ret += test_xmlXPathConcatFunction();
49858    test_ret += test_xmlXPathContainsFunction();
49859    test_ret += test_xmlXPathCountFunction();
49860    test_ret += test_xmlXPathDebugDumpCompExpr();
49861    test_ret += test_xmlXPathDebugDumpObject();
49862    test_ret += test_xmlXPathDifference();
49863    test_ret += test_xmlXPathDistinct();
49864    test_ret += test_xmlXPathDistinctSorted();
49865    test_ret += test_xmlXPathDivValues();
49866    test_ret += test_xmlXPathEqualValues();
49867    test_ret += test_xmlXPathErr();
49868    test_ret += test_xmlXPathEvalExpr();
49869    test_ret += test_xmlXPathEvaluatePredicateResult();
49870    test_ret += test_xmlXPathFalseFunction();
49871    test_ret += test_xmlXPathFloorFunction();
49872    test_ret += test_xmlXPathFunctionLookup();
49873    test_ret += test_xmlXPathFunctionLookupNS();
49874    test_ret += test_xmlXPathHasSameNodes();
49875    test_ret += test_xmlXPathIdFunction();
49876    test_ret += test_xmlXPathIntersection();
49877    test_ret += test_xmlXPathIsNodeType();
49878    test_ret += test_xmlXPathLangFunction();
49879    test_ret += test_xmlXPathLastFunction();
49880    test_ret += test_xmlXPathLeading();
49881    test_ret += test_xmlXPathLeadingSorted();
49882    test_ret += test_xmlXPathLocalNameFunction();
49883    test_ret += test_xmlXPathModValues();
49884    test_ret += test_xmlXPathMultValues();
49885    test_ret += test_xmlXPathNamespaceURIFunction();
49886    test_ret += test_xmlXPathNewBoolean();
49887    test_ret += test_xmlXPathNewCString();
49888    test_ret += test_xmlXPathNewFloat();
49889    test_ret += test_xmlXPathNewNodeSet();
49890    test_ret += test_xmlXPathNewNodeSetList();
49891    test_ret += test_xmlXPathNewParserContext();
49892    test_ret += test_xmlXPathNewString();
49893    test_ret += test_xmlXPathNextAncestor();
49894    test_ret += test_xmlXPathNextAncestorOrSelf();
49895    test_ret += test_xmlXPathNextAttribute();
49896    test_ret += test_xmlXPathNextChild();
49897    test_ret += test_xmlXPathNextDescendant();
49898    test_ret += test_xmlXPathNextDescendantOrSelf();
49899    test_ret += test_xmlXPathNextFollowing();
49900    test_ret += test_xmlXPathNextFollowingSibling();
49901    test_ret += test_xmlXPathNextNamespace();
49902    test_ret += test_xmlXPathNextParent();
49903    test_ret += test_xmlXPathNextPreceding();
49904    test_ret += test_xmlXPathNextPrecedingSibling();
49905    test_ret += test_xmlXPathNextSelf();
49906    test_ret += test_xmlXPathNodeLeading();
49907    test_ret += test_xmlXPathNodeLeadingSorted();
49908    test_ret += test_xmlXPathNodeSetAdd();
49909    test_ret += test_xmlXPathNodeSetAddNs();
49910    test_ret += test_xmlXPathNodeSetAddUnique();
49911    test_ret += test_xmlXPathNodeSetContains();
49912    test_ret += test_xmlXPathNodeSetDel();
49913    test_ret += test_xmlXPathNodeSetMerge();
49914    test_ret += test_xmlXPathNodeSetRemove();
49915    test_ret += test_xmlXPathNodeSetSort();
49916    test_ret += test_xmlXPathNodeTrailing();
49917    test_ret += test_xmlXPathNodeTrailingSorted();
49918    test_ret += test_xmlXPathNormalizeFunction();
49919    test_ret += test_xmlXPathNotEqualValues();
49920    test_ret += test_xmlXPathNotFunction();
49921    test_ret += test_xmlXPathNsLookup();
49922    test_ret += test_xmlXPathNumberFunction();
49923    test_ret += test_xmlXPathParseNCName();
49924    test_ret += test_xmlXPathParseName();
49925    test_ret += test_xmlXPathPopBoolean();
49926    test_ret += test_xmlXPathPopExternal();
49927    test_ret += test_xmlXPathPopNodeSet();
49928    test_ret += test_xmlXPathPopNumber();
49929    test_ret += test_xmlXPathPopString();
49930    test_ret += test_xmlXPathPositionFunction();
49931    test_ret += test_xmlXPathRegisterAllFunctions();
49932    test_ret += test_xmlXPathRegisterFunc();
49933    test_ret += test_xmlXPathRegisterFuncLookup();
49934    test_ret += test_xmlXPathRegisterFuncNS();
49935    test_ret += test_xmlXPathRegisterNs();
49936    test_ret += test_xmlXPathRegisterVariable();
49937    test_ret += test_xmlXPathRegisterVariableLookup();
49938    test_ret += test_xmlXPathRegisterVariableNS();
49939    test_ret += test_xmlXPathRegisteredFuncsCleanup();
49940    test_ret += test_xmlXPathRegisteredNsCleanup();
49941    test_ret += test_xmlXPathRegisteredVariablesCleanup();
49942    test_ret += test_xmlXPathRoot();
49943    test_ret += test_xmlXPathRoundFunction();
49944    test_ret += test_xmlXPathStartsWithFunction();
49945    test_ret += test_xmlXPathStringEvalNumber();
49946    test_ret += test_xmlXPathStringFunction();
49947    test_ret += test_xmlXPathStringLengthFunction();
49948    test_ret += test_xmlXPathSubValues();
49949    test_ret += test_xmlXPathSubstringAfterFunction();
49950    test_ret += test_xmlXPathSubstringBeforeFunction();
49951    test_ret += test_xmlXPathSubstringFunction();
49952    test_ret += test_xmlXPathSumFunction();
49953    test_ret += test_xmlXPathTrailing();
49954    test_ret += test_xmlXPathTrailingSorted();
49955    test_ret += test_xmlXPathTranslateFunction();
49956    test_ret += test_xmlXPathTrueFunction();
49957    test_ret += test_xmlXPathValueFlipSign();
49958    test_ret += test_xmlXPathVariableLookup();
49959    test_ret += test_xmlXPathVariableLookupNS();
49960    test_ret += test_xmlXPathWrapCString();
49961    test_ret += test_xmlXPathWrapExternal();
49962    test_ret += test_xmlXPathWrapNodeSet();
49963    test_ret += test_xmlXPatherror();
49964
49965    if (test_ret != 0)
49966	printf("Module xpathInternals: %d errors\n", test_ret);
49967    return(test_ret);
49968}
49969
49970static int
49971test_xmlXPtrBuildNodeList(void) {
49972    int test_ret = 0;
49973
49974#if defined(LIBXML_XPTR_ENABLED)
49975    int mem_base;
49976    xmlNodePtr ret_val;
49977    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
49978    int n_obj;
49979
49980    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
49981        mem_base = xmlMemBlocks();
49982        obj = gen_xmlXPathObjectPtr(n_obj, 0);
49983
49984        ret_val = xmlXPtrBuildNodeList(obj);
49985        desret_xmlNodePtr(ret_val);
49986        call_tests++;
49987        des_xmlXPathObjectPtr(n_obj, obj, 0);
49988        xmlResetLastError();
49989        if (mem_base != xmlMemBlocks()) {
49990            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
49991	           xmlMemBlocks() - mem_base);
49992	    test_ret++;
49993            printf(" %d", n_obj);
49994            printf("\n");
49995        }
49996    }
49997    function_tests++;
49998#endif
49999
50000    return(test_ret);
50001}
50002
50003
50004static int
50005test_xmlXPtrEval(void) {
50006    int test_ret = 0;
50007
50008#if defined(LIBXML_XPTR_ENABLED)
50009    int mem_base;
50010    xmlXPathObjectPtr ret_val;
50011    xmlChar * str; /* the XPointer expression */
50012    int n_str;
50013    xmlXPathContextPtr ctx; /* the XPointer context */
50014    int n_ctx;
50015
50016    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50017    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50018        mem_base = xmlMemBlocks();
50019        str = gen_const_xmlChar_ptr(n_str, 0);
50020        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50021
50022        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50023        desret_xmlXPathObjectPtr(ret_val);
50024        call_tests++;
50025        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50026        des_xmlXPathContextPtr(n_ctx, ctx, 1);
50027        xmlResetLastError();
50028        if (mem_base != xmlMemBlocks()) {
50029            printf("Leak of %d blocks found in xmlXPtrEval",
50030	           xmlMemBlocks() - mem_base);
50031	    test_ret++;
50032            printf(" %d", n_str);
50033            printf(" %d", n_ctx);
50034            printf("\n");
50035        }
50036    }
50037    }
50038    function_tests++;
50039#endif
50040
50041    return(test_ret);
50042}
50043
50044
50045static int
50046test_xmlXPtrEvalRangePredicate(void) {
50047    int test_ret = 0;
50048
50049#if defined(LIBXML_XPTR_ENABLED)
50050    int mem_base;
50051    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50052    int n_ctxt;
50053
50054    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50055        mem_base = xmlMemBlocks();
50056        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50057
50058        xmlXPtrEvalRangePredicate(ctxt);
50059        call_tests++;
50060        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50061        xmlResetLastError();
50062        if (mem_base != xmlMemBlocks()) {
50063            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50064	           xmlMemBlocks() - mem_base);
50065	    test_ret++;
50066            printf(" %d", n_ctxt);
50067            printf("\n");
50068        }
50069    }
50070    function_tests++;
50071#endif
50072
50073    return(test_ret);
50074}
50075
50076#ifdef LIBXML_XPTR_ENABLED
50077
50078#define gen_nb_xmlLocationSetPtr 1
50079static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50080    return(NULL);
50081}
50082static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50083}
50084#endif
50085
50086
50087static int
50088test_xmlXPtrLocationSetAdd(void) {
50089    int test_ret = 0;
50090
50091#if defined(LIBXML_XPTR_ENABLED)
50092    int mem_base;
50093    xmlLocationSetPtr cur; /* the initial range set */
50094    int n_cur;
50095    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50096    int n_val;
50097
50098    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50099    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50100        mem_base = xmlMemBlocks();
50101        cur = gen_xmlLocationSetPtr(n_cur, 0);
50102        val = gen_xmlXPathObjectPtr(n_val, 1);
50103
50104        xmlXPtrLocationSetAdd(cur, val);
50105        call_tests++;
50106        des_xmlLocationSetPtr(n_cur, cur, 0);
50107        des_xmlXPathObjectPtr(n_val, val, 1);
50108        xmlResetLastError();
50109        if (mem_base != xmlMemBlocks()) {
50110            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50111	           xmlMemBlocks() - mem_base);
50112	    test_ret++;
50113            printf(" %d", n_cur);
50114            printf(" %d", n_val);
50115            printf("\n");
50116        }
50117    }
50118    }
50119    function_tests++;
50120#endif
50121
50122    return(test_ret);
50123}
50124
50125
50126static int
50127test_xmlXPtrLocationSetCreate(void) {
50128    int test_ret = 0;
50129
50130
50131    /* missing type support */
50132    return(test_ret);
50133}
50134
50135
50136static int
50137test_xmlXPtrLocationSetDel(void) {
50138    int test_ret = 0;
50139
50140#if defined(LIBXML_XPTR_ENABLED)
50141    int mem_base;
50142    xmlLocationSetPtr cur; /* the initial range set */
50143    int n_cur;
50144    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50145    int n_val;
50146
50147    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50148    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50149        mem_base = xmlMemBlocks();
50150        cur = gen_xmlLocationSetPtr(n_cur, 0);
50151        val = gen_xmlXPathObjectPtr(n_val, 1);
50152
50153        xmlXPtrLocationSetDel(cur, val);
50154        call_tests++;
50155        des_xmlLocationSetPtr(n_cur, cur, 0);
50156        des_xmlXPathObjectPtr(n_val, val, 1);
50157        xmlResetLastError();
50158        if (mem_base != xmlMemBlocks()) {
50159            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50160	           xmlMemBlocks() - mem_base);
50161	    test_ret++;
50162            printf(" %d", n_cur);
50163            printf(" %d", n_val);
50164            printf("\n");
50165        }
50166    }
50167    }
50168    function_tests++;
50169#endif
50170
50171    return(test_ret);
50172}
50173
50174
50175static int
50176test_xmlXPtrLocationSetMerge(void) {
50177    int test_ret = 0;
50178
50179
50180    /* missing type support */
50181    return(test_ret);
50182}
50183
50184
50185static int
50186test_xmlXPtrLocationSetRemove(void) {
50187    int test_ret = 0;
50188
50189#if defined(LIBXML_XPTR_ENABLED)
50190    int mem_base;
50191    xmlLocationSetPtr cur; /* the initial range set */
50192    int n_cur;
50193    int val; /* the index to remove */
50194    int n_val;
50195
50196    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50197    for (n_val = 0;n_val < gen_nb_int;n_val++) {
50198        mem_base = xmlMemBlocks();
50199        cur = gen_xmlLocationSetPtr(n_cur, 0);
50200        val = gen_int(n_val, 1);
50201
50202        xmlXPtrLocationSetRemove(cur, val);
50203        call_tests++;
50204        des_xmlLocationSetPtr(n_cur, cur, 0);
50205        des_int(n_val, val, 1);
50206        xmlResetLastError();
50207        if (mem_base != xmlMemBlocks()) {
50208            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50209	           xmlMemBlocks() - mem_base);
50210	    test_ret++;
50211            printf(" %d", n_cur);
50212            printf(" %d", n_val);
50213            printf("\n");
50214        }
50215    }
50216    }
50217    function_tests++;
50218#endif
50219
50220    return(test_ret);
50221}
50222
50223
50224static int
50225test_xmlXPtrNewCollapsedRange(void) {
50226    int test_ret = 0;
50227
50228#if defined(LIBXML_XPTR_ENABLED)
50229    int mem_base;
50230    xmlXPathObjectPtr ret_val;
50231    xmlNodePtr start; /* the starting and ending node */
50232    int n_start;
50233
50234    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50235        mem_base = xmlMemBlocks();
50236        start = gen_xmlNodePtr(n_start, 0);
50237
50238        ret_val = xmlXPtrNewCollapsedRange(start);
50239        desret_xmlXPathObjectPtr(ret_val);
50240        call_tests++;
50241        des_xmlNodePtr(n_start, start, 0);
50242        xmlResetLastError();
50243        if (mem_base != xmlMemBlocks()) {
50244            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50245	           xmlMemBlocks() - mem_base);
50246	    test_ret++;
50247            printf(" %d", n_start);
50248            printf("\n");
50249        }
50250    }
50251    function_tests++;
50252#endif
50253
50254    return(test_ret);
50255}
50256
50257
50258static int
50259test_xmlXPtrNewContext(void) {
50260    int test_ret = 0;
50261
50262
50263    /* missing type support */
50264    return(test_ret);
50265}
50266
50267
50268static int
50269test_xmlXPtrNewLocationSetNodeSet(void) {
50270    int test_ret = 0;
50271
50272#if defined(LIBXML_XPTR_ENABLED)
50273    int mem_base;
50274    xmlXPathObjectPtr ret_val;
50275    xmlNodeSetPtr set; /* a node set */
50276    int n_set;
50277
50278    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50279        mem_base = xmlMemBlocks();
50280        set = gen_xmlNodeSetPtr(n_set, 0);
50281
50282        ret_val = xmlXPtrNewLocationSetNodeSet(set);
50283        desret_xmlXPathObjectPtr(ret_val);
50284        call_tests++;
50285        des_xmlNodeSetPtr(n_set, set, 0);
50286        xmlResetLastError();
50287        if (mem_base != xmlMemBlocks()) {
50288            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
50289	           xmlMemBlocks() - mem_base);
50290	    test_ret++;
50291            printf(" %d", n_set);
50292            printf("\n");
50293        }
50294    }
50295    function_tests++;
50296#endif
50297
50298    return(test_ret);
50299}
50300
50301
50302static int
50303test_xmlXPtrNewLocationSetNodes(void) {
50304    int test_ret = 0;
50305
50306#if defined(LIBXML_XPTR_ENABLED)
50307    int mem_base;
50308    xmlXPathObjectPtr ret_val;
50309    xmlNodePtr start; /* the start NodePtr value */
50310    int n_start;
50311    xmlNodePtr end; /* the end NodePtr value or NULL */
50312    int n_end;
50313
50314    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50315    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50316        mem_base = xmlMemBlocks();
50317        start = gen_xmlNodePtr(n_start, 0);
50318        end = gen_xmlNodePtr(n_end, 1);
50319
50320        ret_val = xmlXPtrNewLocationSetNodes(start, end);
50321        desret_xmlXPathObjectPtr(ret_val);
50322        call_tests++;
50323        des_xmlNodePtr(n_start, start, 0);
50324        des_xmlNodePtr(n_end, end, 1);
50325        xmlResetLastError();
50326        if (mem_base != xmlMemBlocks()) {
50327            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
50328	           xmlMemBlocks() - mem_base);
50329	    test_ret++;
50330            printf(" %d", n_start);
50331            printf(" %d", n_end);
50332            printf("\n");
50333        }
50334    }
50335    }
50336    function_tests++;
50337#endif
50338
50339    return(test_ret);
50340}
50341
50342
50343static int
50344test_xmlXPtrNewRange(void) {
50345    int test_ret = 0;
50346
50347#if defined(LIBXML_XPTR_ENABLED)
50348    int mem_base;
50349    xmlXPathObjectPtr ret_val;
50350    xmlNodePtr start; /* the starting node */
50351    int n_start;
50352    int startindex; /* the start index */
50353    int n_startindex;
50354    xmlNodePtr end; /* the ending point */
50355    int n_end;
50356    int endindex; /* the ending index */
50357    int n_endindex;
50358
50359    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50360    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
50361    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50362    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
50363        mem_base = xmlMemBlocks();
50364        start = gen_xmlNodePtr(n_start, 0);
50365        startindex = gen_int(n_startindex, 1);
50366        end = gen_xmlNodePtr(n_end, 2);
50367        endindex = gen_int(n_endindex, 3);
50368
50369        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
50370        desret_xmlXPathObjectPtr(ret_val);
50371        call_tests++;
50372        des_xmlNodePtr(n_start, start, 0);
50373        des_int(n_startindex, startindex, 1);
50374        des_xmlNodePtr(n_end, end, 2);
50375        des_int(n_endindex, endindex, 3);
50376        xmlResetLastError();
50377        if (mem_base != xmlMemBlocks()) {
50378            printf("Leak of %d blocks found in xmlXPtrNewRange",
50379	           xmlMemBlocks() - mem_base);
50380	    test_ret++;
50381            printf(" %d", n_start);
50382            printf(" %d", n_startindex);
50383            printf(" %d", n_end);
50384            printf(" %d", n_endindex);
50385            printf("\n");
50386        }
50387    }
50388    }
50389    }
50390    }
50391    function_tests++;
50392#endif
50393
50394    return(test_ret);
50395}
50396
50397
50398static int
50399test_xmlXPtrNewRangeNodeObject(void) {
50400    int test_ret = 0;
50401
50402#if defined(LIBXML_XPTR_ENABLED)
50403    int mem_base;
50404    xmlXPathObjectPtr ret_val;
50405    xmlNodePtr start; /* the starting node */
50406    int n_start;
50407    xmlXPathObjectPtr end; /* the ending object */
50408    int n_end;
50409
50410    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50411    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50412        mem_base = xmlMemBlocks();
50413        start = gen_xmlNodePtr(n_start, 0);
50414        end = gen_xmlXPathObjectPtr(n_end, 1);
50415
50416        ret_val = xmlXPtrNewRangeNodeObject(start, end);
50417        desret_xmlXPathObjectPtr(ret_val);
50418        call_tests++;
50419        des_xmlNodePtr(n_start, start, 0);
50420        des_xmlXPathObjectPtr(n_end, end, 1);
50421        xmlResetLastError();
50422        if (mem_base != xmlMemBlocks()) {
50423            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
50424	           xmlMemBlocks() - mem_base);
50425	    test_ret++;
50426            printf(" %d", n_start);
50427            printf(" %d", n_end);
50428            printf("\n");
50429        }
50430    }
50431    }
50432    function_tests++;
50433#endif
50434
50435    return(test_ret);
50436}
50437
50438
50439static int
50440test_xmlXPtrNewRangeNodePoint(void) {
50441    int test_ret = 0;
50442
50443#if defined(LIBXML_XPTR_ENABLED)
50444    int mem_base;
50445    xmlXPathObjectPtr ret_val;
50446    xmlNodePtr start; /* the starting node */
50447    int n_start;
50448    xmlXPathObjectPtr end; /* the ending point */
50449    int n_end;
50450
50451    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50452    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50453        mem_base = xmlMemBlocks();
50454        start = gen_xmlNodePtr(n_start, 0);
50455        end = gen_xmlXPathObjectPtr(n_end, 1);
50456
50457        ret_val = xmlXPtrNewRangeNodePoint(start, end);
50458        desret_xmlXPathObjectPtr(ret_val);
50459        call_tests++;
50460        des_xmlNodePtr(n_start, start, 0);
50461        des_xmlXPathObjectPtr(n_end, end, 1);
50462        xmlResetLastError();
50463        if (mem_base != xmlMemBlocks()) {
50464            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
50465	           xmlMemBlocks() - mem_base);
50466	    test_ret++;
50467            printf(" %d", n_start);
50468            printf(" %d", n_end);
50469            printf("\n");
50470        }
50471    }
50472    }
50473    function_tests++;
50474#endif
50475
50476    return(test_ret);
50477}
50478
50479
50480static int
50481test_xmlXPtrNewRangeNodes(void) {
50482    int test_ret = 0;
50483
50484#if defined(LIBXML_XPTR_ENABLED)
50485    int mem_base;
50486    xmlXPathObjectPtr ret_val;
50487    xmlNodePtr start; /* the starting node */
50488    int n_start;
50489    xmlNodePtr end; /* the ending node */
50490    int n_end;
50491
50492    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50493    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50494        mem_base = xmlMemBlocks();
50495        start = gen_xmlNodePtr(n_start, 0);
50496        end = gen_xmlNodePtr(n_end, 1);
50497
50498        ret_val = xmlXPtrNewRangeNodes(start, end);
50499        desret_xmlXPathObjectPtr(ret_val);
50500        call_tests++;
50501        des_xmlNodePtr(n_start, start, 0);
50502        des_xmlNodePtr(n_end, end, 1);
50503        xmlResetLastError();
50504        if (mem_base != xmlMemBlocks()) {
50505            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
50506	           xmlMemBlocks() - mem_base);
50507	    test_ret++;
50508            printf(" %d", n_start);
50509            printf(" %d", n_end);
50510            printf("\n");
50511        }
50512    }
50513    }
50514    function_tests++;
50515#endif
50516
50517    return(test_ret);
50518}
50519
50520
50521static int
50522test_xmlXPtrNewRangePointNode(void) {
50523    int test_ret = 0;
50524
50525#if defined(LIBXML_XPTR_ENABLED)
50526    int mem_base;
50527    xmlXPathObjectPtr ret_val;
50528    xmlXPathObjectPtr start; /* the starting point */
50529    int n_start;
50530    xmlNodePtr end; /* the ending node */
50531    int n_end;
50532
50533    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
50534    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50535        mem_base = xmlMemBlocks();
50536        start = gen_xmlXPathObjectPtr(n_start, 0);
50537        end = gen_xmlNodePtr(n_end, 1);
50538
50539        ret_val = xmlXPtrNewRangePointNode(start, end);
50540        desret_xmlXPathObjectPtr(ret_val);
50541        call_tests++;
50542        des_xmlXPathObjectPtr(n_start, start, 0);
50543        des_xmlNodePtr(n_end, end, 1);
50544        xmlResetLastError();
50545        if (mem_base != xmlMemBlocks()) {
50546            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
50547	           xmlMemBlocks() - mem_base);
50548	    test_ret++;
50549            printf(" %d", n_start);
50550            printf(" %d", n_end);
50551            printf("\n");
50552        }
50553    }
50554    }
50555    function_tests++;
50556#endif
50557
50558    return(test_ret);
50559}
50560
50561
50562static int
50563test_xmlXPtrNewRangePoints(void) {
50564    int test_ret = 0;
50565
50566#if defined(LIBXML_XPTR_ENABLED)
50567    int mem_base;
50568    xmlXPathObjectPtr ret_val;
50569    xmlXPathObjectPtr start; /* the starting point */
50570    int n_start;
50571    xmlXPathObjectPtr end; /* the ending point */
50572    int n_end;
50573
50574    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
50575    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
50576        mem_base = xmlMemBlocks();
50577        start = gen_xmlXPathObjectPtr(n_start, 0);
50578        end = gen_xmlXPathObjectPtr(n_end, 1);
50579
50580        ret_val = xmlXPtrNewRangePoints(start, end);
50581        desret_xmlXPathObjectPtr(ret_val);
50582        call_tests++;
50583        des_xmlXPathObjectPtr(n_start, start, 0);
50584        des_xmlXPathObjectPtr(n_end, end, 1);
50585        xmlResetLastError();
50586        if (mem_base != xmlMemBlocks()) {
50587            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
50588	           xmlMemBlocks() - mem_base);
50589	    test_ret++;
50590            printf(" %d", n_start);
50591            printf(" %d", n_end);
50592            printf("\n");
50593        }
50594    }
50595    }
50596    function_tests++;
50597#endif
50598
50599    return(test_ret);
50600}
50601
50602
50603static int
50604test_xmlXPtrRangeToFunction(void) {
50605    int test_ret = 0;
50606
50607#if defined(LIBXML_XPTR_ENABLED)
50608    int mem_base;
50609    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50610    int n_ctxt;
50611    int nargs; /* the number of args */
50612    int n_nargs;
50613
50614    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50615    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50616        mem_base = xmlMemBlocks();
50617        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50618        nargs = gen_int(n_nargs, 1);
50619
50620        xmlXPtrRangeToFunction(ctxt, nargs);
50621        call_tests++;
50622        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50623        des_int(n_nargs, nargs, 1);
50624        xmlResetLastError();
50625        if (mem_base != xmlMemBlocks()) {
50626            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
50627	           xmlMemBlocks() - mem_base);
50628	    test_ret++;
50629            printf(" %d", n_ctxt);
50630            printf(" %d", n_nargs);
50631            printf("\n");
50632        }
50633    }
50634    }
50635    function_tests++;
50636#endif
50637
50638    return(test_ret);
50639}
50640
50641
50642static int
50643test_xmlXPtrWrapLocationSet(void) {
50644    int test_ret = 0;
50645
50646#if defined(LIBXML_XPTR_ENABLED)
50647    int mem_base;
50648    xmlXPathObjectPtr ret_val;
50649    xmlLocationSetPtr val; /* the LocationSet value */
50650    int n_val;
50651
50652    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
50653        mem_base = xmlMemBlocks();
50654        val = gen_xmlLocationSetPtr(n_val, 0);
50655
50656        ret_val = xmlXPtrWrapLocationSet(val);
50657        desret_xmlXPathObjectPtr(ret_val);
50658        call_tests++;
50659        des_xmlLocationSetPtr(n_val, val, 0);
50660        xmlResetLastError();
50661        if (mem_base != xmlMemBlocks()) {
50662            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
50663	           xmlMemBlocks() - mem_base);
50664	    test_ret++;
50665            printf(" %d", n_val);
50666            printf("\n");
50667        }
50668    }
50669    function_tests++;
50670#endif
50671
50672    return(test_ret);
50673}
50674
50675static int
50676test_xpointer(void) {
50677    int test_ret = 0;
50678
50679    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
50680    test_ret += test_xmlXPtrBuildNodeList();
50681    test_ret += test_xmlXPtrEval();
50682    test_ret += test_xmlXPtrEvalRangePredicate();
50683    test_ret += test_xmlXPtrLocationSetAdd();
50684    test_ret += test_xmlXPtrLocationSetCreate();
50685    test_ret += test_xmlXPtrLocationSetDel();
50686    test_ret += test_xmlXPtrLocationSetMerge();
50687    test_ret += test_xmlXPtrLocationSetRemove();
50688    test_ret += test_xmlXPtrNewCollapsedRange();
50689    test_ret += test_xmlXPtrNewContext();
50690    test_ret += test_xmlXPtrNewLocationSetNodeSet();
50691    test_ret += test_xmlXPtrNewLocationSetNodes();
50692    test_ret += test_xmlXPtrNewRange();
50693    test_ret += test_xmlXPtrNewRangeNodeObject();
50694    test_ret += test_xmlXPtrNewRangeNodePoint();
50695    test_ret += test_xmlXPtrNewRangeNodes();
50696    test_ret += test_xmlXPtrNewRangePointNode();
50697    test_ret += test_xmlXPtrNewRangePoints();
50698    test_ret += test_xmlXPtrRangeToFunction();
50699    test_ret += test_xmlXPtrWrapLocationSet();
50700
50701    if (test_ret != 0)
50702	printf("Module xpointer: %d errors\n", test_ret);
50703    return(test_ret);
50704}
50705static int
50706test_module(const char *module) {
50707    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
50708    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
50709    if (!strcmp(module, "SAX2")) return(test_SAX2());
50710    if (!strcmp(module, "c14n")) return(test_c14n());
50711    if (!strcmp(module, "catalog")) return(test_catalog());
50712    if (!strcmp(module, "chvalid")) return(test_chvalid());
50713    if (!strcmp(module, "debugXML")) return(test_debugXML());
50714    if (!strcmp(module, "dict")) return(test_dict());
50715    if (!strcmp(module, "encoding")) return(test_encoding());
50716    if (!strcmp(module, "entities")) return(test_entities());
50717    if (!strcmp(module, "hash")) return(test_hash());
50718    if (!strcmp(module, "list")) return(test_list());
50719    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
50720    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
50721    if (!strcmp(module, "parser")) return(test_parser());
50722    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
50723    if (!strcmp(module, "pattern")) return(test_pattern());
50724    if (!strcmp(module, "relaxng")) return(test_relaxng());
50725    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
50726    if (!strcmp(module, "schematron")) return(test_schematron());
50727    if (!strcmp(module, "tree")) return(test_tree());
50728    if (!strcmp(module, "uri")) return(test_uri());
50729    if (!strcmp(module, "valid")) return(test_valid());
50730    if (!strcmp(module, "xinclude")) return(test_xinclude());
50731    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
50732    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
50733    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
50734    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
50735    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
50736    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
50737    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
50738    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
50739    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
50740    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
50741    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
50742    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
50743    if (!strcmp(module, "xpath")) return(test_xpath());
50744    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
50745    if (!strcmp(module, "xpointer")) return(test_xpointer());
50746    return(0);
50747}
50748